Author: thomas.diesler(a)jboss.com
Date: 2006-12-05 19:29:48 -0500 (Tue, 05 Dec 2006)
New Revision: 1559
Added:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonBinding.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonBindingProvider.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonClient.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonContextServlet.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonMessageContext.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonSOAP11Binding.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonSOAP12Binding.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/MessageContextPropertyHelper.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/AddressingBuilderImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/AddressingClientUtil.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/AddressingConstantsImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/AddressingPropertiesImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/AddressingTypeImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/AttributeElementExtensibleImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/AttributeExtensibleImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/AttributedQNameImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/AttributedURIImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/ElementExtensibleImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/EndpointReferenceImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/MetadataImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/ReferenceParametersImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/RelationshipImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/jaxrpc/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/jaxws/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/metadata/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/soap/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/EventSourceEndpoint.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/EventSourceEndpointImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/EventingConstants.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/EventingEndpointBase.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/EventingService.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/SubscriptionManagerEndpoint.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/SubscriptionManagerEndpointImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/deployment/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/metadata/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/policy/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/BinarySecurityTokenValidator.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/Constants.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/DecodingOperation.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/DecryptionOperation.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/EncodingOperation.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/EncryptionOperation.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/FailedAuthenticationException.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/FailedCheckException.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/InvalidSecurityHeaderException.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/InvalidSecurityTokenException.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/KeyResolver.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/Operation.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/OperationDescription.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/QNameTarget.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/ReceiveUsernameOperation.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/RequireEncryptionOperation.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/RequireOperation.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/RequireSignatureOperation.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/RequireTargetableOperation.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/RequireTimestampOperation.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/STRTransform.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/SecurityAdaptor.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/SecurityAdaptorFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/SecurityDecoder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/SecurityEncoder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/SecurityStore.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/SecurityTokenUnavailableException.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/SendUsernameOperation.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/SignatureOperation.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/SignatureVerificationOperation.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/SimplePrincipal.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/Target.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/TimestampOperation.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/TimestampVerificationOperation.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/TokenOperation.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/UnsupportedAlgorithmException.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/UnsupportedSecurityTokenException.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/Util.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/WSSecurityDispatcher.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/WSSecurityException.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/WsuIdResolver.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/WsuIdTarget.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/jaxrpc/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/jaxws/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/CreateAttachmentVisitor.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/DisableMTOMHandler.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/RestoreXOPElementVisitor.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/XOPContext.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxrpc/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxws/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/ExtensibleMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/FaultMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/MetaDataExtension.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/OperationMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/ParameterMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/TypeMappingMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/TypesMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/UnifiedMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/WrappedParameter.java
Removed:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ClientEndpointMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/EndpointMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ExtensibleMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/FaultMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/HandlerMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/HandlerMetaDataJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/HandlerMetaDataJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/MetaDataExtension.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/OperationMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ParameterMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ServerEndpointMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ServiceMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/TypeMappingMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/TypesMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/UnifiedMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/WrappedParameter.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wspolicy/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/xop/
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/binding/EndpointInvocation.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/binding/UnboundHeader.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/deployment/ServiceEndpointDeployer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/jaxrpc/WSAddressingClientHandler.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/jaxrpc/WSAddressingServerHandler.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/jaxws/WSAddressingClientHandler.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/jaxws/WSAddressingServerHandler.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/metadata/AddressingOpMetaExt.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/soap/SOAPAddressingBuilderImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/soap/SOAPAddressingPropertiesImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/deployment/EventingEndpoint.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/deployment/EventingEndpointDI.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/DeliveryType.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/EndpointReference.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/FilterType.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/MetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/ReferenceParameters.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/RenewRequest.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/RenewResponse.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/StatusRequest.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/StatusResponse.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/SubscribeRequest.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/SubscribeResponse.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/SubscriptionEndRequest.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/UnsubscribeRequest.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/metadata/EventingEpMetaExt.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/DispatchJob.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/DispatcherDelegate.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/DispatcherFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/EventDispatcher.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/EventSource.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/EventingBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/Filter.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/Subscription.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/SubscriptionError.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/SubscriptionManager.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/SubscriptionManagerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/SubscriptionManagerMBean.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/SubscriptionTicket.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/policy/Policy.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/policy/PolicyAlternative.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/policy/PolicyAssertion.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/policy/PolicyFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/BinarySecurityToken.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/DirectReference.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/EncryptedKey.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/KeyIdentifier.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/Reference.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/ReferenceList.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/SecurityElement.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/SecurityHeader.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/SecurityProcess.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/SecurityTokenReference.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/Signature.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/Timestamp.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/Token.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/UsernameToken.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/X509IssuerSerial.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/X509Token.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/jaxrpc/WSSecurityHandler.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/jaxrpc/WSSecurityHandlerInbound.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/jaxrpc/WSSecurityHandlerOutbound.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/jaxws/WSSecurityHandler.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/jaxws/WSSecurityHandlerInbound.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/jaxws/WSSecurityHandlerOutbound.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxrpc/JBossXBContentAdapter.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxrpc/XOPMarshallerImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxrpc/XOPScanner.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxrpc/XOPUnmarshallerImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxws/AttachmentMarshallerImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxws/AttachmentUnmarshallerImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxws/ReflectiveXOPScanner.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/SecurityAdaptorFactoryImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/AbstractEJBDeployer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossContextServlet.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossServiceEndpointServlet.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointGeneratorEJB.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointLifecycleDeployer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefMetaDataAdaptor.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/tomcat/TomcatContextServlet.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/CallImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/CallProxy.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/HandlerRegistryImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/ParameterWrapping.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SOAP11BindingJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SOAP12BindingJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SOAPBindingJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SOAPFaultHelperJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SerializationContextJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/ServiceImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/ServiceObjectFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/StubExt.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64Deserializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64Serializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPArrayDeserializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPArraySerializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/HandlerChainBaseImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/HandlerDelegateJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/MessageContextJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/ServerHandlerChain.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/DynamicWrapperGenerator.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/JAXBDeserializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/JAXBSerializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/WrapperGenerator.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/client/ClientImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/client/ClientProxy.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/client/DispatchImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/BindingExt.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/BindingImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/BindingProviderImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/HTTPBindingJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/MessageBinding.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/PayloadBinding.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/SOAP11BindingJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/SOAP12BindingJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/SOAPBindingJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/SOAPFaultHelperJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/handler/HandlerChainExecutor.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/handler/HandlerDelegateJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/handler/HandlerResolverImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/handler/MessageContextJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/handler/PortInfoImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/handler/SOAPMessageContextJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/spi/ServiceDelegateImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jbossxb/JBossXBMarshallerImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jbossxb/JBossXBSupport.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jbossxb/JBossXBUnmarshallerImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jbossxb/SchemaBindingBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/acessor/JAXBAccessor.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/acessor/ReflectiveMethodAccessor.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientEndpointMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB21.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/WSCommonConfig.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSCommonConfigJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSEndpointConfigJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSCommonConfigJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSEndpointConfigJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSHandlerChainsConfigJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedHandlerMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr109/WebservicesFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr181/HandlerChainFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr181/HandlerChainMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr181/HandlerChainsMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/AbstractServiceEndpointInvoker.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/AbstractServiceEndpointServlet.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/HandlerDelegate.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/ServiceEndpoint.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/ServiceEndpointInfo.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/ServiceEndpointInvokerJSE.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/ServiceEndpointManager.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/ServiceEndpointManagerMBean.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/WSDLFilePublisher.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/WSDLRequestHandler.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/EndpointInfo.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/MessageContextAssociation.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/MessageFactoryImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/SOAPBodyImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/SOAPConnectionImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/SOAPContentElement.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/SOAPMessageDispatcher.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/SOAPMessageImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL11.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/SourceWrapperGenerator.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/jaxws/JAXBWSDLGenerator.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/jaxws/WSDLGenerator.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/metadata/ReflectiveMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/metadata/ToolsAnnotationMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/metadata/ToolsEndpointMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/metadata/ToolsUnifiedMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/utils/ThreadLocalAssociation.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/soap/attachment/GenericAttachmentTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDL11TestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1179/TestEndpointImpl.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/dynamichandler/DynamicHandlerTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wseventing/SysmonTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wseventing/SysmonUtil.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/SimpleEncryptTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/SimpleSignTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/StorePassEncryptTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/DIIClientTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingSupport.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/NotificationTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/SubscriptionManagerTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/MicrosoftInteropTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/RoundTripTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/SunInteropTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/XOPTypeDefTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/MTOMServiceBase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webparam/JSR181WebParamTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webresult/JSR181WebResultTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/handler/SOAPMessageTrace.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/wsaddressing/AddressingStatefulTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/EndpointReferenceTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/xop/MimeDeclarationTestCase.java
Log:
partial commit
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/binding/EndpointInvocation.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/binding/EndpointInvocation.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/binding/EndpointInvocation.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -40,9 +40,9 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
import org.jboss.ws.jaxrpc.ParameterWrapping;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.ParameterMetaData;
-import org.jboss.ws.metadata.WrappedParameter;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.jboss.ws.metadata.umdm.WrappedParameter;
import org.jboss.ws.soap.SOAPContentElement;
import org.jboss.ws.utils.HolderUtils;
import org.jboss.ws.utils.JavaUtils;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/binding/UnboundHeader.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/binding/UnboundHeader.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/binding/UnboundHeader.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -26,8 +26,8 @@
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.ParameterMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
/**
* Represents an unbound SOAPHeaderElement
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonBinding.java (from
rev 1557, branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/CommonBinding.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/CommonBinding.java 2006-12-05
23:29:55 UTC (rev 1557)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonBinding.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core;
+
+// $Id$
+
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.ws.binding.BindingException;
+import org.jboss.ws.binding.EndpointInvocation;
+import org.jboss.ws.binding.UnboundHeader;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+
+/**
+ * The base interface for protocol bindings.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 04-Jul-2006
+ */
+public interface CommonBinding
+{
+ /** On the client side, generate the Object from IN parameters. */
+ Object bindRequestMessage(OperationMetaData opMetaData, EndpointInvocation epInv,
Map<QName, UnboundHeader> unboundHeaders) throws BindingException;
+
+ /** On the server side, extract the IN parameters from the Object and populate an
Invocation object */
+ EndpointInvocation unbindRequestMessage(OperationMetaData opMetaData, Object
reqMessage) throws BindingException;
+
+ /** On the server side, generate the Object from OUT parameters in the Invocation
object. */
+ Object bindResponseMessage(OperationMetaData opMetaData, EndpointInvocation epInv)
throws BindingException;
+
+ /** On the client side, extract the OUT parameters from the Object and return them to
the client. */
+ void unbindResponseMessage(OperationMetaData opMetaData, Object resMessage,
EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders) throws
BindingException;
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonBindingProvider.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/CommonBindingProvider.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/CommonBindingProvider.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonBindingProvider.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core;
+
+// $Id$
+
+import org.jboss.ws.WSException;
+import org.jboss.ws.jaxrpc.SOAP11BindingJAXRPC;
+import org.jboss.ws.jaxrpc.SOAP12BindingJAXRPC;
+import org.jboss.ws.jaxws.core.SOAP11BindingJAXWS;
+import org.jboss.ws.jaxws.core.SOAP12BindingJAXWS;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
+
+/**
+ * Provides access to the protocol binding.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 04-Jul-2006
+ */
+public class CommonBindingProvider
+{
+ protected EndpointMetaData epMetaData;
+ protected CommonBinding binding;
+
+ public CommonBindingProvider(EndpointMetaData epMetaData)
+ {
+ this.epMetaData = epMetaData;
+ initBinding(epMetaData.getBindingId(), epMetaData.getType());
+ }
+
+ public CommonBindingProvider(String bindingId, Type type)
+ {
+ initBinding(bindingId, type);
+ }
+
+ protected void initBinding(String bindingId, Type type)
+ {
+ if (CommonSOAPBinding.SOAP11HTTP_BINDING.equals(bindingId))
+ {
+ binding = (type == Type.JAXWS ? new SOAP11BindingJAXWS() : new
SOAP11BindingJAXRPC());
+ }
+ else if (CommonSOAPBinding.SOAP12HTTP_BINDING.equals(bindingId))
+ {
+ binding = (type == Type.JAXWS ? new SOAP12BindingJAXWS() : new
SOAP12BindingJAXRPC());
+ }
+ else
+ {
+ throw new WSException("Unsupported binding: " + bindingId);
+ }
+ }
+
+ public CommonBinding getCommonBinding()
+ {
+ return binding;
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonClient.java (from
rev 1557, branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/CommonClient.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/CommonClient.java 2006-12-05
23:29:55 UTC (rev 1557)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonClient.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,387 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core;
+
+// $Id:CommonClient.java 660 2006-08-01 16:29:43Z thomas.diesler(a)jboss.com $
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.ParameterMode;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.JAXWSAConstants;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.Constants;
+import org.jboss.ws.WSException;
+import org.jboss.ws.binding.EndpointInvocation;
+import org.jboss.ws.binding.UnboundHeader;
+import org.jboss.ws.extras.addressing.AddressingConstantsImpl;
+import org.jboss.ws.jaxrpc.ParameterWrapping;
+import org.jboss.ws.jaxrpc.Style;
+import org.jboss.ws.jaxrpc.handler.HandlerChainBaseImpl;
+import org.jboss.ws.metadata.umdm.ClientEndpointMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
+import org.jboss.ws.soap.EndpointInfo;
+import org.jboss.ws.soap.MessageContextAssociation;
+import org.jboss.ws.soap.SOAPBodyImpl;
+import org.jboss.ws.soap.SOAPConnectionImpl;
+import org.jboss.ws.utils.HolderUtils;
+
+/**
+ * Provides support for the dynamic invocation of a service endpoint.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public abstract class CommonClient
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(CommonClient.class);
+
+ // The endpoint together with the operationName uniquely identify the call operation
+ protected EndpointMetaData epMetaData;
+ // The current operation name
+ protected QName operationName;
+ // Output parameters
+ protected EndpointInvocation epInv;
+ // The binding provider
+ protected CommonBindingProvider bindingProvider;
+
+ /** Create a call that needs to be configured manually
+ */
+ protected CommonClient(ServiceMetaData serviceMetaData)
+ {
+ // If the WSDLService has only one endpoint, use it
+ if (serviceMetaData != null && serviceMetaData.getEndpoints().size() == 1)
+ {
+ this.epMetaData = serviceMetaData.getEndpoints().get(0);
+ }
+ }
+
+ /** Create a call for a known WSDL endpoint.
+ */
+ protected CommonClient(EndpointMetaData epMetaData)
+ {
+ this.epMetaData = epMetaData;
+ }
+
+ /** Create a call for a known WSDL endpoint.
+ */
+ protected CommonClient(ServiceMetaData serviceMetaData, QName portName, QName opName)
+ {
+ if (serviceMetaData != null)
+ {
+ EndpointMetaData epMetaData = null;
+ if (serviceMetaData.getEndpoints().size() > 0)
+ {
+ epMetaData = serviceMetaData.getEndpoint(portName);
+ if (epMetaData == null)
+ throw new WSException("Cannot find endpoint for name: " +
portName);
+ }
+
+ if (epMetaData != null)
+ {
+ this.epMetaData = epMetaData;
+ }
+ }
+
+ if (opName != null)
+ {
+ setOperationName(opName);
+ }
+ }
+
+ /** Gets the address of a target service endpoint.
+ */
+ public abstract String getTargetEndpointAddress();
+
+ /** Sets the address of the target service endpoint.
+ */
+ public abstract void setTargetEndpointAddress(String address);
+
+ /** Gets the name of the operation to be invoked using this Call instance.
+ */
+ public QName getOperationName()
+ {
+ return this.operationName;
+ }
+
+ /** Sets the name of the operation to be invoked using this Call instance.
+ */
+ public void setOperationName(QName operationName)
+ {
+ this.operationName = operationName;
+ }
+
+ /** Get the OperationMetaData for the given operation name
+ * If it does not exist, it will be created
+ */
+ public OperationMetaData getOperationMetaData()
+ {
+ if (operationName == null)
+ throw new WSException("Operation name not set");
+
+ return getOperationMetaData(operationName);
+ }
+
+ // Get the OperationMetaData for the given operation name
+ // If it does not exist, it will be created
+ public OperationMetaData getOperationMetaData(QName opName)
+ {
+ if (opName == null)
+ throw new IllegalArgumentException("Cannot get OperationMetaData for
null");
+
+ EndpointMetaData epMetaData = getEndpointMetaData();
+ OperationMetaData opMetaData = epMetaData.getOperation(opName);
+ if (opMetaData == null &&
epMetaData.getServiceMetaData().getWsdlDefinitions() == null)
+ {
+ opMetaData = new OperationMetaData(epMetaData, opName, opName.getLocalPart());
+ epMetaData.addOperation(opMetaData);
+ }
+
+ if (opMetaData == null)
+ throw new WSException("Cannot obtain operation meta data for: " +
opName);
+
+ return opMetaData;
+ }
+
+ // Get the EndpointMetaData for all OperationMetaData
+ public EndpointMetaData getEndpointMetaData()
+ {
+ if (epMetaData == null)
+ {
+ UnifiedMetaData wsMetaData = new UnifiedMetaData();
+ wsMetaData.setClassLoader(Thread.currentThread().getContextClassLoader());
+
+ ServiceMetaData serviceMetaData = new ServiceMetaData(wsMetaData, new
QName(Constants.NS_JBOSSWS_URI, "AnonymousService"));
+ wsMetaData.addService(serviceMetaData);
+
+ epMetaData = new ClientEndpointMetaData(serviceMetaData, new
QName(Constants.NS_JBOSSWS_URI, "AnonymousPort"), new
QName(Constants.NS_JBOSSWS_URI, "Anonymous"), Type.JAXRPC);
+ epMetaData.setStyle(Style.RPC);
+
+ serviceMetaData.addEndpoint(epMetaData);
+ }
+ return epMetaData;
+ }
+
+ protected abstract boolean callRequestHandlerChain(QName portName, HandlerType type);
+
+ protected abstract boolean callResponseHandlerChain(QName portName, HandlerType
type);
+
+ protected abstract void setInboundContextProperties();
+
+ protected abstract void setOutboundContextProperties();
+
+ /** Call invokation goes as follows:
+ *
+ * 1) synchronize the operation name with the operation meta data
+ * 2) synchronize the input parameters with the operation meta data
+ * 3) generate the payload using a BindingProvider
+ * 4) get the Invoker from Remoting, based on the target endpoint address
+ * 5) do the invocation through the Remoting framework
+ * 6) unwrap the result using the BindingProvider
+ * 7) return the result
+ */
+ protected Object invoke(QName opName, Object[] inputParams, Map<QName,
UnboundHeader> unboundHeaders, Map<String, Object> resContext, boolean
forceOneway) throws Exception
+ {
+ if (opName.equals(operationName) == false)
+ setOperationName(opName);
+
+ OperationMetaData opMetaData = getOperationMetaData();
+ boolean oneway = forceOneway || opMetaData.isOneWay();
+
+ // Associate a message context with the current thread
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ msgContext.setOperationMetaData(opMetaData);
+
+ // copy properties to the message context
+ for (String key : getRequestContext().keySet())
+ {
+ Object value = getRequestContext().get(key);
+ msgContext.setProperty(key, value);
+ }
+
+ try
+ {
+ // Get the binding from the provider
+ CommonBinding binding =
(CommonBinding)getCommonBindingProvider().getCommonBinding();
+
+ // Create the invocation and sync the input parameters
+ epInv = new EndpointInvocation(opMetaData);
+ epInv.initInputParams(inputParams);
+
+ // Bind the request message
+ SOAPMessage reqMessage = (SOAPMessage)binding.bindRequestMessage(opMetaData,
epInv, unboundHeaders);
+
+ setOutboundContextProperties();
+
+ // Call the request handlers
+ QName portName = epMetaData.getQName();
+ boolean handlerPass = callRequestHandlerChain(portName, HandlerType.PRE);
+ handlerPass = handlerPass && callRequestHandlerChain(portName,
HandlerType.ENDPOINT);
+ handlerPass = handlerPass && callRequestHandlerChain(portName,
HandlerType.POST);
+
+ if (handlerPass)
+ {
+ String targetAddress = getTargetEndpointAddress();
+
+ // Fall back to wsa:To
+ AddressingProperties addrProps =
(AddressingProperties)msgContext.getProperty(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
+ if (targetAddress == null && addrProps != null &&
addrProps.getTo() != null)
+ {
+ AddressingConstantsImpl ADDR = new AddressingConstantsImpl();
+ String wsaTo = addrProps.getTo().getURI().toString();
+ if (wsaTo.equals(ADDR.getAnonymousURI()) == false)
+ {
+ try
+ {
+ URL wsaToURL = new URL(wsaTo);
+ log.debug("Sending request to addressing destination: " +
wsaToURL);
+ targetAddress = wsaToURL.toExternalForm();
+ }
+ catch (MalformedURLException ex)
+ {
+ log.debug("Not a valid URL: " + wsaTo);
+ }
+ }
+ }
+
+ // The endpoint address must be known beyond this point
+ if (targetAddress == null)
+ throw new WSException("Target endpoint address not set");
+
+ EndpointInfo epInfo = new EndpointInfo(epMetaData, targetAddress,
getRequestContext());
+
+ SOAPMessage resMessage;
+ if (oneway)
+ {
+ resMessage = new SOAPConnectionImpl().callOneWay(reqMessage, epInfo);
+ }
+ else
+ {
+ resMessage = new SOAPConnectionImpl().call(reqMessage, epInfo);
+ }
+
+ // Associate current message with message context
+ msgContext.setSOAPMessage(resMessage);
+ }
+
+ setInboundContextProperties();
+
+ // Get the return object
+ Object retObj = null;
+ if (oneway == false)
+ {
+ // Call the response handlers
+ handlerPass = callResponseHandlerChain(portName, HandlerType.POST);
+
+ // unbind the return values
+ if (handlerPass)
+ {
+ // BP-1.0 R1027
+ HandlerChainBaseImpl.checkMustUnderstand(msgContext, new String[]{});
+
+ // unbind the return values
+ SOAPMessage resMessage = msgContext.getSOAPMessage();
+ binding.unbindResponseMessage(opMetaData, resMessage, epInv,
unboundHeaders);
+
+ retObj = syncOutputParams(inputParams, epInv);
+ }
+
+ handlerPass = handlerPass && callResponseHandlerChain(portName,
HandlerType.ENDPOINT);
+ handlerPass = handlerPass && callResponseHandlerChain(portName,
HandlerType.PRE);
+
+ // Check if protocol handlers modified the payload
+ if (((SOAPBodyImpl)reqMessage.getSOAPBody()).isModifiedFromSource())
+ {
+ log.debug("Handler modified body payload, unbind message
again");
+ SOAPMessage resMessage = msgContext.getSOAPMessage();
+ binding.unbindResponseMessage(opMetaData, resMessage, epInv,
unboundHeaders);
+ }
+
+ retObj = syncOutputParams(inputParams, epInv);
+ }
+
+ return retObj;
+ }
+ finally
+ {
+ resContext.putAll(msgContext.getProperties());
+ }
+ }
+
+ protected CommonBindingProvider getCommonBindingProvider()
+ {
+ if (bindingProvider == null)
+ {
+ bindingProvider = new CommonBindingProvider(getEndpointMetaData());
+ }
+ return bindingProvider;
+ }
+
+ protected abstract Map<String, Object> getRequestContext();
+
+ /** Synchronize the operation paramters with the call output parameters.
+ */
+ private Object syncOutputParams(Object[] inParams, EndpointInvocation epInv) throws
SOAPException
+ {
+ Object retValue = null;
+
+ // Assign the return value, if we have a return param
+ OperationMetaData opMetaData = getOperationMetaData();
+ ParameterMetaData retMetaData = opMetaData.getReturnParameter();
+ if (retMetaData != null)
+ {
+ retValue = epInv.getReturnValue();
+ if (opMetaData.isDocumentWrapped() && retMetaData.isMessageType() ==
false)
+ retValue = ParameterWrapping.unwrapResponseParameters(retMetaData, retValue,
inParams);
+ }
+
+ // Set the holder values for INOUT parameters
+ for (ParameterMetaData paramMetaData : opMetaData.getParameters())
+ {
+ ParameterMode paramMode = paramMetaData.getMode();
+
+ if (paramMode == ParameterMode.INOUT || paramMode == ParameterMode.OUT)
+ {
+ QName xmlName = paramMetaData.getXmlName();
+ Object value = epInv.getResponseParamValue(xmlName);
+ int index = paramMetaData.getIndex();
+ log.debug("holder [" + index + "] " + xmlName);
+ HolderUtils.setHolderValue(inParams[index], value);
+ }
+ }
+
+ return retValue;
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonContextServlet.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/CommonContextServlet.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/CommonContextServlet.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonContextServlet.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,85 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core;
+
+// $Id$
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.server.ServiceEndpointManager;
+
+/**
+ * The servlet that that is associated with context /jbossws
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 21-Mar-2005
+ */
+public abstract class CommonContextServlet extends HttpServlet
+{
+ // provide logging
+ protected final Logger log = Logger.getLogger(CommonContextServlet.class);
+
+ protected ServiceEndpointManager epManager;
+
+ public void init(ServletConfig config) throws ServletException
+ {
+ super.init(config);
+ initServiceEndpointManager();
+ }
+
+ protected abstract void initServiceEndpointManager();
+
+ /** Process GET requests.
+ */
+ public void doGet(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException
+ {
+ PrintWriter writer = res.getWriter();
+ res.setContentType("text/html");
+
+ writer.print("<html>");
+ setupHTMLResponseHeader(writer);
+
+ writer.print("<body>");
+ writer.print(epManager.showServiceEndpointTable());
+ writer.print("</body>");
+ writer.print("</html>");
+ writer.close();
+ }
+
+ private void setupHTMLResponseHeader(PrintWriter writer)
+ {
+ Package wsPackage = Package.getPackage("org.jboss.ws");
+ writer.println("<head>");
+ writer.println("<meta http-equiv='Content-Type content='text/html;
charset=iso-8859-1'>");
+ writer.println("<title>JBossWS /
"+wsPackage.getImplementationVersion()+"</title>");
+ writer.println("<link rel='stylesheet'
href='./styles.css'>");
+ writer.println("</head>");
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonMessageContext.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/CommonMessageContext.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/CommonMessageContext.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonMessageContext.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,156 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core;
+
+// $Id$
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.ws.binding.SerializationContext;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.xb.binding.NamespaceRegistry;
+
+/**
+ * The common JAXRPC/JAXWS MessageContext
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 1-Sep-2006
+ */
+public abstract class CommonMessageContext
+{
+ // expandToDOM in the SOAPContentElement should not happen during normal operation
+ // This property should be set the message context when it is ok to do so.
+ public static String ALLOW_EXPAND_TO_DOM = "org.jboss.ws.allow.expand.dom";
+
+ // The operation for this message ctx
+ private EndpointMetaData epMetaData;
+ // The operation for this message ctx
+ private OperationMetaData opMetaData;
+ // The SOAPMessage in this message context
+ private SOAPMessage soapMessage;
+ // The map of the properties
+ protected Map<String, Object> props = new HashMap<String, Object>();
+
+ public EndpointMetaData getEndpointMetaData()
+ {
+ if (epMetaData == null && opMetaData != null)
+ epMetaData = opMetaData.getEndpointMetaData();
+
+ return epMetaData;
+ }
+
+ public void setEndpointMetaData(EndpointMetaData epMetaData)
+ {
+ this.epMetaData = epMetaData;
+ }
+
+ public OperationMetaData getOperationMetaData()
+ {
+ return opMetaData;
+ }
+
+ public void setOperationMetaData(OperationMetaData opMetaData)
+ {
+ this.opMetaData = opMetaData;
+ }
+
+ public SOAPMessage getSOAPMessage()
+ {
+ return soapMessage;
+ }
+
+ public void setSOAPMessage(SOAPMessage soapMessage)
+ {
+ this.soapMessage = soapMessage;
+ }
+
+ public abstract SerializationContext getSerializationContext();
+
+ /** Gets the namespace registry for this message context */
+ public NamespaceRegistry getNamespaceRegistry()
+ {
+ return getSerializationContext().getNamespaceRegistry();
+ }
+
+ public Map<String, Object> getProperties()
+ {
+ return props;
+ }
+
+ public void setProperties(Map<String, Object> props)
+ {
+ this.props = props;
+ }
+
+ /**
+ * Returns true if the MessageContext contains a property with the specified name.
+ */
+ public boolean containsProperty(String name)
+ {
+ return props.containsKey(name);
+ }
+
+ /**
+ * Gets the value of a specific property from the MessageContext
+ */
+ public Object getProperty(String name)
+ {
+ Object value = props.get(name);
+
+ if (value instanceof MessageContextPropertyHelper)
+ {
+ return ((MessageContextPropertyHelper)value).get();
+ }
+
+ return value;
+ }
+
+ /**
+ * Returns an Iterator view of the names of the properties in this MessageContext
+ */
+ public Iterator getPropertyNames()
+ {
+ return props.keySet().iterator();
+ }
+
+ /**
+ * Removes a property (name-value pair) from the MessageContext
+ */
+ public void removeProperty(String name)
+ {
+ props.remove(name);
+ }
+
+ /**
+ * Sets the name and value of a property associated with the MessageContext.
+ * If the MessageContext contains a value of the same property, the old value is
replaced.
+ */
+ public void setProperty(String name, Object value)
+ {
+ props.put(name, value);
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonSOAP11Binding.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/CommonSOAP11Binding.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/CommonSOAP11Binding.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonSOAP11Binding.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core;
+
+// $Id$
+
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.ws.Constants;
+import org.jboss.ws.jaxrpc.Use;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.soap.MessageFactoryImpl;
+
+/**
+ * The SOAP11Binding
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 04-Jul-2006
+ */
+public abstract class CommonSOAP11Binding extends CommonSOAPBinding
+{
+ public CommonSOAP11Binding()
+ {
+ }
+
+ /** Create the SOAP-1.1 message */
+ protected SOAPMessage createMessage(OperationMetaData opMetaData) throws
SOAPException
+ {
+ MessageFactoryImpl factory = new MessageFactoryImpl();
+ factory.setEnvelopeURI(Constants.NS_SOAP11_ENV);
+ SOAPMessage soapMessage = factory.createMessage();
+
+ Use encStyle = opMetaData.getEndpointMetaData().getEncodingStyle();
+ if (Use.ENCODED.equals(encStyle))
+ {
+ SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
+ soapEnvelope.addNamespaceDeclaration(Constants.PREFIX_SOAP11_ENC,
Constants.URI_SOAP11_ENC);
+ }
+
+ return soapMessage;
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonSOAP12Binding.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/CommonSOAP12Binding.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/CommonSOAP12Binding.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonSOAP12Binding.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core;
+
+// $Id$
+
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.ws.Constants;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.soap.MessageFactoryImpl;
+
+/**
+ * The SOAP11Binding
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 04-Jul-2006
+ */
+public abstract class CommonSOAP12Binding extends CommonSOAPBinding
+{
+
+ public CommonSOAP12Binding()
+ {
+ }
+
+ /** Create the SOAP-1.1 message */
+ protected SOAPMessage createMessage(OperationMetaData opMetaData) throws
SOAPException
+ {
+ MessageFactoryImpl factory = new MessageFactoryImpl();
+ factory.setEnvelopeURI(Constants.NS_SOAP12_ENV);
+ return factory.createMessage();
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/CommonSOAPBinding.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/CommonSOAPBinding.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,908 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core;
+
+// $Id$
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import javax.activation.DataHandler;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.ParameterMode;
+import javax.xml.soap.AttachmentPart;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.Name;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPBodyElement;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFactory;
+import javax.xml.soap.SOAPHeader;
+import javax.xml.soap.SOAPMessage;
+
+import org.apache.xerces.xs.XSElementDeclaration;
+import org.apache.xerces.xs.XSTypeDefinition;
+import org.jboss.logging.Logger;
+import org.jboss.ws.Constants;
+import org.jboss.ws.WSException;
+import org.jboss.ws.binding.BindingException;
+import org.jboss.ws.binding.EndpointInvocation;
+import org.jboss.ws.binding.UnboundHeader;
+import org.jboss.ws.extras.xop.XOPContext;
+import org.jboss.ws.jaxrpc.ParameterWrapping;
+import org.jboss.ws.jaxrpc.StubExt;
+import org.jboss.ws.jaxrpc.Style;
+import org.jboss.ws.jaxrpc.Use;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.jboss.ws.metadata.umdm.TypesMetaData;
+import org.jboss.ws.soap.MessageContextAssociation;
+import org.jboss.ws.soap.MessageFactoryImpl;
+import org.jboss.ws.soap.NameImpl;
+import org.jboss.ws.soap.SOAPBodyElementDoc;
+import org.jboss.ws.soap.SOAPBodyElementRpc;
+import org.jboss.ws.soap.SOAPContentElement;
+import org.jboss.ws.soap.SOAPElementImpl;
+import org.jboss.ws.soap.SOAPFactoryImpl;
+import org.jboss.ws.soap.SOAPFaultImpl;
+import org.jboss.ws.soap.SOAPHeaderElementImpl;
+import org.jboss.ws.soap.SOAPMessageImpl;
+import org.jboss.ws.soap.attachment.AttachmentPartImpl;
+import org.jboss.ws.soap.attachment.CIDGenerator;
+import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.utils.JavaUtils;
+import org.jboss.ws.utils.MimeUtils;
+import org.jboss.xb.binding.NamespaceRegistry;
+import org.w3c.dom.Element;
+
+/**
+ * The SOAPBinding interface is an abstraction for the SOAP binding.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 04-Jul-2006
+ */
+public abstract class CommonSOAPBinding implements CommonBinding
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(CommonSOAPBinding.class);
+
+ private boolean mtomEnabled;
+
+ /** A constant representing the identity of the SOAP 1.2 over HTTP binding. */
+ public static final String SOAP12HTTP_BINDING =
"http://www.w3.org/2003/05/soap/bindings/HTTP/";
+
+ /** A constant representing the identity of the SOAP 1.1 over HTTP binding. */
+ public static final String SOAP11HTTP_BINDING =
"http://schemas.xmlsoap.org/wsdl/soap/http";
+ private static final Name SOAP_ARRAY_NAME = new NameImpl("Array",
Constants.PREFIX_SOAP11_ENC, Constants.URI_SOAP11_ENC);
+
+ public CommonSOAPBinding()
+ {
+ }
+
+ public MessageFactory getMessageFactory()
+ {
+ return new MessageFactoryImpl();
+ }
+
+ public SOAPFactory getSOAPFactory()
+ {
+ return new SOAPFactoryImpl();
+ }
+
+ public boolean isMTOMEnabled()
+ {
+ return mtomEnabled;
+ }
+
+ public void setMTOMEnabled(boolean flag)
+ {
+ this.mtomEnabled = flag;
+ }
+
+ /** Create the SOAP-1.1 message */
+ protected abstract SOAPMessage createMessage(OperationMetaData opMetaData) throws
SOAPException;
+
+ /** On the client side, generate the payload from IN parameters. */
+ public Object bindRequestMessage(OperationMetaData opMetaData, EndpointInvocation
epInv, Map<QName, UnboundHeader> unboundHeaders) throws BindingException
+ {
+ log.debug("bindRequestMessage: " + opMetaData.getQName());
+
+ try
+ {
+ CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
+ if (msgContext == null)
+ throw new WSException("MessageContext not available");
+
+ // Disable MTOM for rpc/encoded
+ if (opMetaData.isRPCEncoded())
+ msgContext.setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.FALSE);
+
+ // Associate current message with message context
+ SOAPMessageImpl reqMessage = (SOAPMessageImpl)createMessage(opMetaData);
+ msgContext.setSOAPMessage(reqMessage);
+
+ SOAPEnvelope soapEnvelope = reqMessage.getSOAPPart().getEnvelope();
+ SOAPBody soapBody = soapEnvelope.getBody();
+ SOAPHeader soapHeader = soapEnvelope.getHeader();
+
+ // Get the namespace registry
+ NamespaceRegistry namespaceRegistry = msgContext.getNamespaceRegistry();
+
+ Style style = opMetaData.getStyle();
+ if (style == Style.RPC)
+ {
+ QName opQName = opMetaData.getQName();
+ Name opName = new NameImpl(namespaceRegistry.registerQName(opQName));
+
+ log.debug("Create RPC body element: " + opName);
+ SOAPBodyElement soapBodyElement = new SOAPBodyElementRpc(opName);
+
+
+ soapBodyElement =
(SOAPBodyElement)soapBody.addChildElement(soapBodyElement);
+
+ for (ParameterMetaData paramMetaData : opMetaData.getInputParameters())
+ {
+ QName xmlName = paramMetaData.getXmlName();
+ Object value = epInv.getRequestParamValue(xmlName);
+
+ if (paramMetaData.isSwA())
+ {
+ CIDGenerator cidGenerator = reqMessage.getCidGenerator();
+ AttachmentPart part = createAttachmentPart(paramMetaData, value,
cidGenerator);
+ reqMessage.addAttachmentPart(part);
+ }
+ else
+ {
+ SOAPElement soapElement = paramMetaData.isInHeader() ?
(SOAPElement)soapHeader : soapBodyElement;
+ addParameterToMessage(paramMetaData, value, soapElement);
+ }
+ }
+ }
+ else if (style == Style.DOCUMENT)
+ {
+ for (ParameterMetaData paramMetaData : opMetaData.getInputParameters())
+ {
+ QName xmlName = paramMetaData.getXmlName();
+ Object value = epInv.getRequestParamValue(xmlName);
+
+ if (paramMetaData.isSwA())
+ {
+ CIDGenerator cidGenerator = reqMessage.getCidGenerator();
+ AttachmentPart part = createAttachmentPart(paramMetaData, value,
cidGenerator);
+ reqMessage.addAttachmentPart(part);
+ }
+ else
+ {
+ SOAPElement soapElement = paramMetaData.isInHeader() ?
(SOAPElement)soapHeader : soapBody;
+ addParameterToMessage(paramMetaData, value, soapElement);
+ }
+ }
+ }
+ else
+ {
+ throw new WSException("Unsupported message style: " + style);
+ }
+
+ // Add unbound headers
+ if (unboundHeaders != null)
+ {
+ Iterator it = unboundHeaders.values().iterator();
+ while (it.hasNext())
+ {
+ UnboundHeader unboundHeader = (UnboundHeader)it.next();
+ if (unboundHeader.getMode() != ParameterMode.OUT)
+ {
+ QName xmlName = unboundHeader.getXmlName();
+ Object value = unboundHeader.getHeaderValue();
+
+ xmlName = namespaceRegistry.registerQName(xmlName);
+ Name soapName = new NameImpl(xmlName.getLocalPart(),
xmlName.getPrefix(), xmlName.getNamespaceURI());
+
+ log.debug("Add unboundHeader element: " + soapName);
+ SOAPContentElement contentElement = new
SOAPHeaderElementImpl(soapName);
+
contentElement.setParamMetaData(unboundHeader.toParameterMetaData(opMetaData));
+ soapHeader.addChildElement(contentElement);
+ contentElement.setObjectValue(value);
+ }
+ }
+ }
+
+ // Set the SOAPAction
+ setSOAPActionHeader(opMetaData, reqMessage);
+
+ return reqMessage;
+ }
+ catch (Exception e)
+ {
+ handleException(e);
+ return null;
+ }
+ }
+
+ /** Override to set the SOAPAction header */
+ public abstract void setSOAPActionHeader(OperationMetaData opMetaData, SOAPMessage
reqMessage);
+
+ /** On the server side, extract the IN parameters from the payload and populate an
Invocation object */
+ public EndpointInvocation unbindRequestMessage(OperationMetaData opMetaData, Object
payload) throws BindingException
+ {
+ log.debug("unbindRequestMessage: " + opMetaData.getQName());
+
+ try
+ {
+ // Read the SOAPEnvelope from the reqMessage
+ SOAPMessage reqMessage = (SOAPMessage)payload;
+ SOAPEnvelope soapEnvelope = reqMessage.getSOAPPart().getEnvelope();
+ SOAPHeader soapHeader = soapEnvelope.getHeader();
+ SOAPBody soapBody = soapEnvelope.getBody();
+
+ // Verify the SOAP version
+ verifySOAPVersion(opMetaData, soapEnvelope);
+
+ // Construct the endpoint invocation object
+ EndpointInvocation epInv = new EndpointInvocation(opMetaData);
+
+ CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
+ if (msgContext == null)
+ throw new WSException("MessageContext not available");
+
+ // Disable MTOM for rpc/encoded
+ if (opMetaData.isRPCEncoded())
+ msgContext.setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.FALSE);
+
+ // Get the namespace registry
+ NamespaceRegistry namespaceRegistry = msgContext.getNamespaceRegistry();
+
+ if (opMetaData.isMessageEndpoint() == false)
+ {
+ Style style = opMetaData.getStyle();
+ if (style == Style.RPC)
+ {
+ SOAPBodyElement soapBodyElement =
(SOAPBodyElement)soapBody.getChildElements().next();
+ Name elName = soapBodyElement.getElementName();
+
+ QName elQName = new QName(elName.getURI(), elName.getLocalName(),
elName.getPrefix());
+ elQName = namespaceRegistry.registerQName(elQName);
+
+ for (ParameterMetaData paramMetaData : opMetaData.getParameters())
+ {
+ QName xmlName = paramMetaData.getXmlName();
+ if (paramMetaData.getMode() == ParameterMode.OUT)
+ {
+ epInv.setRequestParamValue(xmlName, null);
+ }
+ else
+ {
+ if (paramMetaData.isSwA())
+ {
+ Object value = getAttachmentFromMessage(paramMetaData,
reqMessage);
+ epInv.setRequestParamValue(xmlName, value);
+ }
+ else
+ {
+ if (paramMetaData.isInHeader() == false)
+ {
+ Object value = getParameterFromMessage(paramMetaData,
soapBodyElement, false);
+ epInv.setRequestParamValue(xmlName, value);
+ }
+ else
+ {
+ Object value = getParameterFromMessage(paramMetaData,
soapHeader, false);
+ epInv.setRequestParamValue(xmlName, value);
+ }
+ }
+ }
+ }
+ }
+
+ // Document style
+ else
+ {
+ for (ParameterMetaData paramMetaData : opMetaData.getParameters())
+ {
+ QName xmlName = paramMetaData.getXmlName();
+ if (paramMetaData.isSwA())
+ {
+ Object value = getAttachmentFromMessage(paramMetaData, reqMessage);
+ epInv.setRequestParamValue(xmlName, value);
+ }
+ else
+ {
+ if (paramMetaData.isInHeader())
+ {
+ if (paramMetaData.getMode() == ParameterMode.IN)
+ {
+ Object value = getParameterFromMessage(paramMetaData,
soapHeader, false);
+ epInv.setRequestParamValue(xmlName, value);
+ }
+ else
+ {
+ Object value = getParameterFromMessage(paramMetaData,
soapHeader, true);
+ epInv.setRequestParamValue(xmlName, value);
+ }
+ }
+ else
+ {
+ Object value = getParameterFromMessage(paramMetaData, soapBody,
false);
+ epInv.setRequestParamValue(xmlName, value);
+ }
+ }
+ }
+ }
+ }
+
+ // Generic message endpoint
+ else
+ {
+ for (ParameterMetaData paramMetaData : opMetaData.getParameters())
+ {
+ QName xmlName = paramMetaData.getXmlName();
+ Object value = soapBody.getChildElements().next();
+ epInv.setRequestParamValue(xmlName, value);
+ }
+ }
+
+ return epInv;
+ }
+ catch (Exception e)
+ {
+ handleException(e);
+ return null;
+ }
+ }
+
+ /** On the server side, generate the payload from OUT parameters. */
+ public Object bindResponseMessage(OperationMetaData opMetaData, EndpointInvocation
epInv) throws BindingException
+ {
+ log.debug("bindResponseMessage: " + opMetaData.getQName());
+
+ try
+ {
+ CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
+ if (msgContext == null)
+ throw new WSException("MessageContext not available");
+
+ // Disable MTOM for rpc/encoded
+ if (opMetaData.isRPCEncoded())
+ msgContext.setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.FALSE);
+
+ // Associate current message with message context
+ SOAPMessageImpl resMessage = (SOAPMessageImpl)createMessage(opMetaData);
+ msgContext.setSOAPMessage(resMessage);
+
+ // R2714 For one-way operations, an INSTANCE MUST NOT return a HTTP response
that contains a SOAP envelope.
+ // Specifically, the HTTP response entity-body must be empty.
+ if (opMetaData.isOneWay())
+ {
+ resMessage.getSOAPPart().setContent(null);
+ return resMessage;
+ }
+
+ SOAPEnvelope soapEnvelope = resMessage.getSOAPPart().getEnvelope();
+ SOAPHeader soapHeader = soapEnvelope.getHeader();
+ SOAPBody soapBody = soapEnvelope.getBody();
+
+ // Get the namespace registry
+ NamespaceRegistry namespaceRegistry = msgContext.getNamespaceRegistry();
+
+ Style style = opMetaData.getStyle();
+ if (style == Style.RPC)
+ {
+ QName opQName = opMetaData.getResponseName();
+
+ Name opName = new NameImpl(namespaceRegistry.registerQName(opQName));
+ SOAPBodyElement soapBodyElement = new SOAPBodyElementRpc(opName);
+
+ soapBodyElement =
(SOAPBodyElement)soapBody.addChildElement(soapBodyElement);
+
+ // Add the return to the message
+ ParameterMetaData retMetaData = opMetaData.getReturnParameter();
+ if (retMetaData != null)
+ {
+ Object value = epInv.getReturnValue();
+ if (retMetaData.isSwA())
+ {
+ CIDGenerator cidGenerator = resMessage.getCidGenerator();
+ AttachmentPart part = createAttachmentPart(retMetaData, value,
cidGenerator);
+ resMessage.addAttachmentPart(part);
+ epInv.setReturnValue(part);
+ }
+ else
+ {
+ SOAPContentElement soapElement = addParameterToMessage(retMetaData,
value, soapBodyElement);
+ epInv.setReturnValue(soapElement);
+ soapElement.setObjectValue(value);
+ }
+ }
+
+ // Add the out parameters to the message
+ for (ParameterMetaData paramMetaData : opMetaData.getOutputParameters())
+ {
+ QName xmlName = paramMetaData.getXmlName();
+ Object value = epInv.getResponseParamValue(xmlName);
+ if (paramMetaData.isSwA())
+ {
+ CIDGenerator cidGenerator = resMessage.getCidGenerator();
+ AttachmentPart part = createAttachmentPart(retMetaData, value,
cidGenerator);
+ resMessage.addAttachmentPart(part);
+ }
+ else
+ {
+ if (paramMetaData.isInHeader())
+ {
+ addParameterToMessage(paramMetaData, value, soapHeader);
+ }
+ else
+ {
+ addParameterToMessage(paramMetaData, value, soapBodyElement);
+ }
+ }
+ }
+ }
+ else if (style == Style.DOCUMENT)
+ {
+ ParameterMetaData retMetaData = opMetaData.getReturnParameter();
+ if (retMetaData != null)
+ {
+ Object value = epInv.getReturnValue();
+ if (opMetaData.isDocumentWrapped())
+ value = ParameterWrapping.wrapResponseParameters(retMetaData, value,
epInv.getOutParameters());
+
+ if (retMetaData.isSwA())
+ {
+ CIDGenerator cidGenerator = resMessage.getCidGenerator();
+ AttachmentPart part = createAttachmentPart(retMetaData, value,
cidGenerator);
+ resMessage.addAttachmentPart(part);
+ epInv.setReturnValue(part);
+ }
+ else
+ {
+ SOAPContentElement soapElement = addParameterToMessage(retMetaData,
value, soapBody);
+ epInv.setReturnValue(soapElement);
+ }
+ }
+
+ // Add the out header parameters to the message
+ for (ParameterMetaData paramMetaData : opMetaData.getOutputParameters())
+ {
+ QName xmlName = paramMetaData.getXmlName();
+ if (paramMetaData.isInHeader())
+ {
+ Object value = epInv.getResponseParamValue(xmlName);
+ addParameterToMessage(paramMetaData, value, soapHeader);
+ }
+ }
+ }
+ else
+ {
+ throw new WSException("Unsupported message style: " + style);
+ }
+
+ return resMessage;
+ }
+ catch (Exception e)
+ {
+ handleException(e);
+ return null;
+ }
+ }
+
+ /** On the client side, extract the OUT parameters from the payload and return them to
the client. */
+ public void unbindResponseMessage(OperationMetaData opMetaData, Object payload,
EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders)
+ throws BindingException
+ {
+ log.debug("unbindResponseMessage: " + opMetaData.getQName());
+
+ try
+ {
+ // R2714 For one-way operations, an INSTANCE MUST NOT return a HTTP response
that contains a SOAP envelope.
+ // Specifically, the HTTP response entity-body must be empty.
+ if (opMetaData.isOneWay() == true)
+ {
+ return;
+ }
+
+ // WS-Addressing might redirect the response, which results in an empty
envelope
+ SOAPMessage resMessage = (SOAPMessage)payload;
+ SOAPEnvelope soapEnvelope = resMessage.getSOAPPart().getEnvelope();
+ if (soapEnvelope == null)
+ {
+ return;
+ }
+
+ // Verify the SOAP version
+ verifySOAPVersion(opMetaData, soapEnvelope);
+
+ // Get the SOAP message context that is associated with the current thread
+ CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
+ if (msgContext == null)
+ throw new WSException("MessageContext not available");
+
+ // Disable MTOM for rpc/encoded
+ if (opMetaData.isRPCEncoded())
+ msgContext.setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.FALSE);
+
+ SOAPHeader soapHeader = soapEnvelope.getHeader();
+ SOAPBody soapBody = soapEnvelope.getBody();
+ Iterator bodyChildren = soapBody.getChildElements();
+
+ SOAPBodyElement soapBodyElement = null;
+ if (bodyChildren.hasNext() != false)
+ soapBodyElement = (SOAPBodyElement)bodyChildren.next();
+
+ // Translate the SOAPFault to an exception and throw it
+ if (soapBodyElement instanceof SOAPFaultImpl)
+ throwFaultException((SOAPFaultImpl)soapBodyElement);
+
+ // Extract unbound OUT headers
+ if (unboundHeaders != null)
+ {
+ Map<QName, UnboundHeader> outHeaders = new HashMap<QName,
UnboundHeader>();
+ Iterator itHeaderElements = soapHeader.getChildElements();
+ while (itHeaderElements.hasNext())
+ {
+ SOAPContentElement soapHeaderElement =
(SOAPHeaderElementImpl)itHeaderElements.next();
+ Name elName = soapHeaderElement.getElementName();
+ QName xmlName = new QName(elName.getURI(), elName.getLocalName());
+
+ UnboundHeader unboundHeader = (UnboundHeader)unboundHeaders.get(xmlName);
+ if (unboundHeader != null)
+ {
+
soapHeaderElement.setParamMetaData(unboundHeader.toParameterMetaData(opMetaData));
+
+ // Do the unmarshalling
+ Object value = soapHeaderElement.getObjectValue();
+ unboundHeader.setHeaderValue(value);
+ outHeaders.put(xmlName, unboundHeader);
+ }
+ }
+ unboundHeaders.clear();
+ unboundHeaders.putAll(outHeaders);
+ }
+
+ Style style = opMetaData.getStyle();
+ if (style == Style.RPC)
+ {
+ if (soapBodyElement == null)
+ throw new WSException("Cannot unbind response message with empty soap
body");
+
+ ParameterMetaData retMetaData = opMetaData.getReturnParameter();
+ if (retMetaData != null)
+ {
+ if (retMetaData.isSwA())
+ {
+ Object value = getAttachmentFromMessage(retMetaData, resMessage);
+ epInv.setReturnValue(value);
+ }
+ else
+ {
+ Object value = getParameterFromMessage(retMetaData, soapBodyElement,
false);
+ epInv.setReturnValue(value);
+ }
+ }
+
+ for (ParameterMetaData paramMetaData : opMetaData.getOutputParameters())
+ {
+ QName xmlName = paramMetaData.getXmlName();
+ if (paramMetaData.isSwA())
+ {
+ Object value = getAttachmentFromMessage(paramMetaData, resMessage);
+ epInv.setResponseParamValue(xmlName, value);
+ }
+ else
+ {
+ SOAPElement soapElement = paramMetaData.isInHeader() ? soapHeader :
(SOAPElement)soapBodyElement;
+ Object value = getParameterFromMessage(paramMetaData, soapElement,
false);
+ epInv.setResponseParamValue(xmlName, value);
+ }
+ }
+ }
+ else if (style == Style.DOCUMENT)
+ {
+ ParameterMetaData retMetaData = opMetaData.getReturnParameter();
+
+ // WS-Eventing has no message part for UnsubscribeResponseMsg
+ if (retMetaData != null)
+ {
+ if (retMetaData.isSwA())
+ {
+ Object value = getAttachmentFromMessage(retMetaData, resMessage);
+ epInv.setReturnValue(value);
+ }
+ else
+ {
+ Object value = getParameterFromMessage(retMetaData, soapBody, false);
+ epInv.setReturnValue(value);
+ }
+
+ for (ParameterMetaData paramMetaData : opMetaData.getOutputParameters())
+ {
+ QName xmlName = paramMetaData.getXmlName();
+ if (paramMetaData.isInHeader())
+ {
+ Object value = getParameterFromMessage(paramMetaData, soapHeader,
false);
+ epInv.setResponseParamValue(xmlName, value);
+ }
+ }
+ }
+ }
+ else
+ {
+ throw new WSException("Unsupported message style: " + style);
+ }
+ }
+ catch (Exception e)
+ {
+ handleException(e);
+ }
+ }
+
+ public abstract SOAPMessage exceptionToFaultMessage(Exception ex);
+
+ private void verifySOAPVersion(OperationMetaData opMetaData, SOAPEnvelope
soapEnvelope)
+ {
+ String envNS = soapEnvelope.getNamespaceURI();
+ String bindingId = opMetaData.getEndpointMetaData().getBindingId();
+ if (CommonSOAPBinding.SOAP11HTTP_BINDING.equals(bindingId) &&
Constants.NS_SOAP11_ENV.equals(envNS) == false)
+ log.warn("Expected SOAP-1.1 envelope, but got: " + envNS);
+
+ if (CommonSOAPBinding.SOAP12HTTP_BINDING.equals(bindingId) &&
Constants.NS_SOAP12_ENV.equals(envNS) == false)
+ log.warn("Expected SOAP-1.2 envelope, but got: " + envNS);
+ }
+
+ private AttachmentPart createAttachmentPart(ParameterMetaData paramMetaData, Object
value, CIDGenerator cidGenerator) throws SOAPException, BindingException
+ {
+ String partName = paramMetaData.getXmlName().getLocalPart();
+ Set mimeTypes = paramMetaData.getMimeTypes();
+
+ AttachmentPart part = new AttachmentPartImpl();
+ if (value instanceof DataHandler)
+ {
+ DataHandler handler = (DataHandler)value;
+ String mimeType = MimeUtils.getBaseMimeType(handler.getContentType());
+
+ if (mimeTypes != null && !MimeUtils.isMemberOf(mimeType, mimeTypes))
+ throw new BindingException("Mime type " + mimeType + " not
allowed for parameter " + partName + " allowed types are " + mimeTypes);
+
+ part.setDataHandler((DataHandler)value);
+ }
+ else
+ {
+ String mimeType = null;
+ if (mimeTypes != null && mimeTypes.size() > 0)
+ {
+ mimeType = (String)mimeTypes.iterator().next();
+ }
+ else
+ {
+ mimeType = MimeUtils.resolveMimeType(value);
+ }
+
+ if (mimeType == null)
+ throw new BindingException("Could not determine mime type for attachment
parameter: " + partName);
+
+ part.setContent(value, mimeType);
+ }
+
+ if (paramMetaData.isSwA())
+ {
+ String swaCID = '<' + partName + "=" +
cidGenerator.generateFromCount() + '>';
+ part.setContentId(swaCID);
+ }
+ if (paramMetaData.isXOP())
+ {
+ String xopCID = '<' + cidGenerator.generateFromName(partName) +
'>';
+ part.setContentId(xopCID);
+ }
+
+ return part;
+ }
+
+ private Object getAttachmentFromMessage(ParameterMetaData paramMetaData, SOAPMessage
message) throws SOAPException, BindingException
+ {
+ QName xmlName = paramMetaData.getXmlName();
+
+ AttachmentPart part =
((SOAPMessageImpl)message).getAttachmentByPartName(xmlName.getLocalPart());
+ if (part == null)
+ throw new BindingException("Could not locate attachment for parameter:
" + paramMetaData.getXmlName());
+
+ return part;
+ }
+
+ /** Marshall the given parameter and add it to the SOAPMessage */
+ private SOAPContentElement addParameterToMessage(ParameterMetaData paramMetaData,
Object value, SOAPElement soapElement) throws SOAPException, BindingException
+ {
+ QName xmlName = paramMetaData.getXmlName();
+ Class javaType = paramMetaData.getJavaType();
+
+ if (value != null && paramMetaData.isXOP() == false)
+ {
+ Class valueType = value.getClass();
+ if (JavaUtils.isAssignableFrom(javaType, valueType) == false)
+ throw new BindingException("javaType " + javaType.getName() +
" is not assignable from: " + valueType.getName());
+ }
+
+ // Make sure we have a prefix on qualified names
+ if (xmlName.getNamespaceURI().length() > 0)
+ {
+ CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
+ NamespaceRegistry namespaceRegistry = msgContext.getNamespaceRegistry();
+ xmlName = namespaceRegistry.registerQName(xmlName);
+ }
+
+ Name soapName = new NameImpl(xmlName.getLocalPart(), xmlName.getPrefix(),
xmlName.getNamespaceURI());
+ if (paramMetaData.isSOAPArrayParam())
+ soapName = new NameImpl("Array", Constants.PREFIX_SOAP11_ENC,
Constants.URI_SOAP11_ENC);
+
+ SOAPContentElement contentElement;
+ if (soapElement instanceof SOAPHeader)
+ {
+ contentElement = new SOAPHeaderElementImpl(soapName);
+ soapElement.addChildElement(contentElement);
+ }
+ else
+ {
+ Style style = paramMetaData.getOperationMetaData().getStyle();
+ if (style == Style.DOCUMENT)
+ {
+ contentElement = new SOAPBodyElementDoc(soapName);
+ soapElement.addChildElement(contentElement);
+ }
+ else
+ {
+ contentElement = new SOAPContentElement(soapName);
+ soapElement.addChildElement(contentElement);
+ }
+ }
+
+ contentElement.setParamMetaData(paramMetaData);
+
+ if (paramMetaData.isSOAPArrayParam())
+ {
+ log.trace("Add parameter as SOAP encoded Array");
+ contentElement.addNamespaceDeclaration(Constants.PREFIX_SOAP11_ENC,
Constants.URI_SOAP11_ENC);
+ }
+
+ // When a potential xop parameter is detected and MTOM is enabled
+ // we flag the SOAP message as a XOP package
+ if (paramMetaData.isXOP() && XOPContext.isMTOMEnabled())
+ {
+ log.trace("Add parameter as XOP");
+ CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
+ SOAPMessageImpl soapMessage = (SOAPMessageImpl)msgContext.getSOAPMessage();
+ soapMessage.setXOPMessage(true);
+ }
+
+ contentElement.setObjectValue(value);
+
+ return contentElement;
+ }
+
+ /** Unmarshall a message element and add it to the parameter list */
+ private Object getParameterFromMessage(ParameterMetaData paramMetaData, SOAPElement
soapElement, boolean optional) throws BindingException
+ {
+ Name xmlName = new NameImpl(paramMetaData.getXmlName());
+
+ SOAPContentElement soapContentElement = null;
+ Iterator childElements = soapElement.getChildElements();
+ while (childElements.hasNext())
+ {
+ SOAPElementImpl childElement = (SOAPElementImpl)childElements.next();
+
+ // If this message was manipulated by a handler the child may not be a content
element
+ if (!(childElement instanceof SOAPContentElement))
+ childElement = (SOAPContentElement)soapElement.replaceChild(new
SOAPContentElement(childElement), childElement);
+
+ // The parameters are expected to be lazy
+ SOAPContentElement aux = (SOAPContentElement)childElement;
+ Name elName = aux.getElementName();
+
+ if (xmlName.equals(elName))
+ {
+ soapContentElement = aux;
+ soapContentElement.setParamMetaData(paramMetaData);
+ break;
+ }
+
+ if (SOAP_ARRAY_NAME.equals(elName))
+ {
+ CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
+ msgContext.setProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM,
Boolean.TRUE);
+ try
+ {
+ QName compXMLName = paramMetaData.getXmlName();
+ Element compElement = DOMUtils.getFirstChildElement(aux);
+ if (compElement.getNodeName().equals(compXMLName.getLocalPart()))
+ {
+ soapContentElement = aux;
+ soapContentElement.setParamMetaData(paramMetaData);
+ break;
+ }
+ }
+ finally
+ {
+ msgContext.removeProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
+ }
+ }
+ }
+
+ // If matching by name fails, try to match by xmlType
+ // This maybe necessary when wsa:Action dispatches to the operation
+ if (soapContentElement == null)
+ {
+ childElements = soapElement.getChildElements();
+ OperationMetaData opMetaData = paramMetaData.getOperationMetaData();
+ TypesMetaData typesMetaData =
opMetaData.getEndpointMetaData().getServiceMetaData().getTypesMetaData();
+ if (childElements.hasNext() && opMetaData.getStyle() == Style.DOCUMENT)
+ {
+ SOAPElementImpl childElement = (SOAPElementImpl)childElements.next();
+
+ // The parameters are expected to be lazy
+ SOAPContentElement aux = (SOAPContentElement)childElement;
+ Name elName = aux.getElementName();
+ QName elType = null;
+
+ XSElementDeclaration xsdElement =
typesMetaData.getSchemaModel().getElementDeclaration(elName.getLocalName(),
elName.getURI());
+ if (xsdElement != null && xsdElement.getTypeDefinition() != null)
+ {
+ XSTypeDefinition xsdType = xsdElement.getTypeDefinition();
+ elType = new QName(xsdType.getNamespace(), xsdType.getName());
+ }
+
+ if (paramMetaData.getXmlType().equals(elType))
+ {
+ soapContentElement = aux;
+ soapContentElement.setParamMetaData(paramMetaData);
+ }
+ }
+ }
+
+ if (soapContentElement == null && optional == false)
+ throw new WSException("Cannot find child element: " + xmlName);
+
+ // When a potential XOP parameter is detected and
+ // the incomming request is actuall XOP encoded we flag
+ // the SOAP message a XOP packaged.
+ if (paramMetaData.isXOP() && XOPContext.isXOPEncodedRequest())
+ {
+ SOAPMessageImpl soapMessage =
(SOAPMessageImpl)MessageContextAssociation.peekMessageContext().getSOAPMessage();
+ soapMessage.setXOPMessage(true);
+ }
+ return soapContentElement;
+ }
+
+ abstract protected void throwFaultException(SOAPFaultImpl fault) throws Exception;
+
+ private void handleException(Exception ex) throws BindingException
+ {
+ if (ex instanceof RuntimeException)
+ throw (RuntimeException)ex;
+
+ if (ex instanceof BindingException)
+ throw (BindingException)ex;
+
+ throw new BindingException(ex);
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/MessageContextPropertyHelper.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/MessageContextPropertyHelper.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/MessageContextPropertyHelper.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/MessageContextPropertyHelper.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core;
+
+/**
+ * Interface to be implemented by property helpers to assist the retrieval
+ * of objects added to the property context.
+ *
+ * If an instance of MessageContextPropertyHelper is added to the
+ * CommonMessageContext a call to get for the same property will return
+ * the result of callig get on the helper instead of returning the helper
+ * itself.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since Oct 22, 2006
+ */
+public interface MessageContextPropertyHelper
+{
+
+ public Object get();
+
+}
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/deployment/ServiceEndpointDeployer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/deployment/ServiceEndpointDeployer.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/deployment/ServiceEndpointDeployer.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -28,14 +28,14 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.ServerEndpointMetaData;
-import org.jboss.ws.metadata.ServiceMetaData;
-import org.jboss.ws.metadata.UnifiedMetaData;
import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCDeployment;
import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCServerMetaDataBuilder;
import org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilderEJB3;
import org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilderJSE;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
import org.jboss.ws.server.ServiceEndpointInfo;
import org.jboss.ws.server.ServiceEndpointManager;
import org.jboss.ws.server.WSDLFilePublisher;
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/AddressingBuilderImpl.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/AddressingBuilderImpl.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/AddressingBuilderImpl.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/AddressingBuilderImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,85 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.addressing;
+
+//$Id$
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingConstants;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.AttributedQName;
+import javax.xml.ws.addressing.AttributedURI;
+import javax.xml.ws.addressing.EndpointReference;
+import javax.xml.ws.addressing.Relationship;
+
+/**
+ * Factory for <code>AddressingElements</code>.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Nov-2005
+ */
+public class AddressingBuilderImpl extends AddressingBuilder
+{
+ public AttributedURI newURI(URI uri)
+ {
+ return new AttributedURIImpl(uri);
+ }
+
+ public AttributedURI newURI(String uri) throws URISyntaxException
+ {
+ return newURI(new URI(uri));
+ }
+
+ public AttributedQName newQName(QName name)
+ {
+ return new AttributedQNameImpl(name);
+ }
+
+ public Relationship newRelationship(URI uri)
+ {
+ return new RelationshipImpl(uri);
+ }
+
+ public EndpointReference newEndpointReference(URI uri)
+ {
+ return new EndpointReferenceImpl(uri);
+ }
+
+ public AddressingProperties newAddressingProperties()
+ {
+ return new AddressingPropertiesImpl();
+ }
+
+ public AddressingConstants newAddressingConstants()
+ {
+ return new AddressingConstantsImpl();
+ }
+
+ public String getNamespaceURI()
+ {
+ return new AddressingTypeImpl().getNamespaceURI();
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/AddressingClientUtil.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/AddressingClientUtil.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/AddressingClientUtil.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/AddressingClientUtil.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,121 @@
+package org.jboss.ws.extras.addressing;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import javax.xml.rpc.Stub;
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingConstants;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.AttributedURI;
+
+import org.jboss.ws.utils.UUIDGenerator;
+
+/**
+ * @author Heiko Braun, <heiko(a)openj.net>
+ * @since 04-Mar-2006
+ */
+public class AddressingClientUtil
+{
+ private static AddressingBuilder BUILDER;
+ private static AddressingConstants CONSTANTS;
+ static
+ {
+ BUILDER = AddressingBuilder.getAddressingBuilder();
+ CONSTANTS = BUILDER.newAddressingConstants();
+ }
+
+ /* creates outbound addressing properties */
+ public static AddressingProperties createRequestProperties()
+ {
+ AddressingProperties addrProps = BUILDER.newAddressingProperties();
+ return addrProps;
+ }
+
+ /**
+ * create default outbound addressing properties.
+ */
+ public static AddressingProperties createDefaultProps(String wsaAction, String wsaTo)
+ {
+ try
+ {
+ AddressingProperties addrProps = createRequestProperties();
+ addrProps.setAction(BUILDER.newURI(wsaAction));
+ addrProps.setTo(BUILDER.newURI(wsaTo));
+ return addrProps;
+ }
+ catch (URISyntaxException e)
+ {
+ throw new IllegalArgumentException(e.getMessage());
+ }
+ }
+
+ /**
+ * create anonymous request properties.
+ * wsa:ReplyTo is set to anonymous and a messageID is supplied.
+ */
+ public static AddressingProperties createAnonymousProps(String wsaAction, String
wsaTo)
+ {
+ try
+ {
+ AddressingProperties addrProps = createDefaultProps(wsaAction, wsaTo);
+ addrProps.setMessageID(BUILDER.newURI(generateMessageID()));
+ addrProps.setReplyTo(BUILDER.newEndpointReference(new
URI(CONSTANTS.getAnonymousURI())));
+ return addrProps;
+ }
+ catch (URISyntaxException e)
+ {
+ throw new IllegalArgumentException(e.getMessage());
+ }
+ }
+
+ /**
+ * one-way properties cary a wsa:ReplyTo of none
+ * upon which no response is expected.
+ */
+ public static AddressingProperties createOneWayProps(String wsaAction, String wsaTo)
+ {
+ try
+ {
+ AddressingProperties addrProps = createDefaultProps(wsaAction, wsaTo);
+ addrProps.setMessageID(BUILDER.newURI(generateMessageID()));
+ addrProps.setReplyTo(BUILDER.newEndpointReference(new
URI(CONSTANTS.getNoneURI())));
+ return addrProps;
+ }
+ catch (URISyntaxException e)
+ {
+ throw new IllegalArgumentException(e.getMessage());
+ }
+ }
+
+ /**
+ * customize a stubs endpooint url
+ */
+ public static void setTargetAddress(Stub stub, String url)
+ {
+ stub._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, url);
+ }
+
+ /**
+ * generate a UUID based message id.
+ */
+ public static URI generateMessageID() throws URISyntaxException
+ {
+ URI messageId = new URI("urn:uuid:" +
UUIDGenerator.generateRandomUUIDString());
+ return messageId;
+ }
+
+ public static AttributedURI createMessageID()
+ {
+ AttributedURI msgId = null;
+ try
+ {
+ msgId = BUILDER.newURI(generateMessageID());
+ }
+ catch (URISyntaxException e)
+ {
+ //
+ }
+ return msgId;
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/AddressingConstantsImpl.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/AddressingConstantsImpl.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/AddressingConstantsImpl.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/AddressingConstantsImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,207 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.addressing;
+
+//$Id$
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.addressing.AddressingConstants;
+
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.Constants;
+
+/**
+ * Encapsulation for version-specific WS-Addressing constants.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Nov-2005
+ */
+public class AddressingConstantsImpl implements AddressingConstants
+{
+ static final String URI_ADDRESSING =
"http://www.w3.org/2005/08/addressing";
+ static final String PREFIX_ADDRESSING = "wsa";
+
+ public String getNamespaceURI()
+ {
+ return URI_ADDRESSING;
+ }
+
+ public String getNamespacePrefix()
+ {
+ return PREFIX_ADDRESSING;
+ }
+
+ public String getWSDLNamespaceURI()
+ {
+ return Constants.NS_WSDL11;
+ }
+
+ public String getWSDLNamespacePrefix()
+ {
+ return Constants.PREFIX_WSDL;
+ }
+
+ public QName getWSDLExtensibilityQName()
+ {
+ return null;
+ }
+
+ public QName getWSDLActionQName()
+ {
+ return new QName(URI_ADDRESSING, "Action", "wsa");
+ }
+
+ public String getAnonymousURI()
+ {
+ return "http://www.w3.org/2005/08/addressing/anonymous";
+ }
+
+ public String getNoneURI()
+ {
+ return "http://www.w3.org/2005/08/addressing/none";
+ }
+
+ public QName getFromQName()
+ {
+ return new QName(URI_ADDRESSING, "From", PREFIX_ADDRESSING);
+ }
+
+ public QName getToQName()
+ {
+ return new QName(URI_ADDRESSING, "To", PREFIX_ADDRESSING);
+ }
+
+ public QName getReplyToQName()
+ {
+ return new QName(URI_ADDRESSING, "ReplyTo", PREFIX_ADDRESSING);
+ }
+
+ public QName getFaultToQName()
+ {
+ return new QName(URI_ADDRESSING, "FaultTo", PREFIX_ADDRESSING);
+ }
+
+ public QName getActionQName()
+ {
+ return new QName(URI_ADDRESSING, "Action", PREFIX_ADDRESSING);
+ }
+
+ public QName getMessageIDQName()
+ {
+ return new QName(URI_ADDRESSING, "MessageID", PREFIX_ADDRESSING);
+ }
+
+ public QName getRelationshipReplyQName()
+ {
+ return new QName(URI_ADDRESSING, "Reply", PREFIX_ADDRESSING);
+ }
+
+ public QName getRelatesToQName()
+ {
+ return new QName(URI_ADDRESSING, "RelatesTo", PREFIX_ADDRESSING);
+ }
+
+ public String getRelationshipTypeName()
+ {
+ return "RelationshipType";
+ }
+
+ public QName getMetadataQName()
+ {
+ return new QName(URI_ADDRESSING, "Metadata", PREFIX_ADDRESSING);
+ }
+
+ public QName getAddressQName()
+ {
+ return new QName(URI_ADDRESSING, "Address", PREFIX_ADDRESSING);
+ }
+
+ public QName getReferenceParametersQName()
+ {
+ return new QName(URI_ADDRESSING, "ReferenceParameters",
PREFIX_ADDRESSING);
+ }
+
+ public String getPackageName()
+ {
+ return getClass().getPackage().getName();
+ }
+
+ public String getIsReferenceParameterName()
+ {
+ throw new NotImplementedException();
+ }
+
+ public QName getInvalidMapQName()
+ {
+ return new QName(URI_ADDRESSING, "InvalidMessageInformationHeader",
PREFIX_ADDRESSING);
+ }
+
+ public QName getMapRequiredQName()
+ {
+ return new QName(URI_ADDRESSING, "MessageInformationHeaderRequired",
PREFIX_ADDRESSING);
+ }
+
+ public QName getDestinationUnreachableQName()
+ {
+ return new QName(URI_ADDRESSING, "DestinationUnreachable",
PREFIX_ADDRESSING);
+ }
+
+ public QName getActioNotSupportedQName()
+ {
+ return new QName(URI_ADDRESSING, "ActionNotSupported",
PREFIX_ADDRESSING);
+ }
+
+ public QName getEndpointUnavailableQName()
+ {
+ return new QName(URI_ADDRESSING, "EndpointUnavailable",
PREFIX_ADDRESSING);
+ }
+
+ public String getDefaultFaultAction()
+ {
+ return "http://www.w3.org/2005/08/addressing/fault";
+ }
+
+ public String getActionNotSupportedText()
+ {
+ return "Action not supported";
+ }
+
+ public String getDestinationUnreachableText()
+ {
+ return "Destination unreachable";
+ }
+
+ public String getEndpointUnavailableText()
+ {
+ return "Endpoint unavailable";
+ }
+
+ public String getInvalidMapText()
+ {
+ return "Invalid Map";
+ }
+
+ public String getMapRequiredText()
+ {
+ return "Map Required";
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/AddressingPropertiesImpl.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/AddressingPropertiesImpl.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/AddressingPropertiesImpl.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/AddressingPropertiesImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,277 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extras.addressing;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPElement;
+import javax.xml.ws.addressing.*;
+
+import org.jboss.ws.soap.NameImpl;
+
+// $Id$
+
+/**
+ * Each instance is associated with a particular WS-Addressing schema whose
+ * namespace URI is returned by its <code>getAddressingVersion</code>
method.
+ *
+ * The namespace of each key in the underlying map must match this URI and the
+ * local names of all the keys must be exactly the names of the Message Addressing
Properties
+ * defined in that version of the WS-Addressing specification.
+ *
+ * Each value in the underlying type must be an instance of
<code>AddressingType</code> whose
+ * WS-Addressing version (determined by its
<code>getAddressingVersion</code>) method must
+ * match the WS-Addressing version associated with the
<code>AddressingProperties</code>.
+ *
+ * TODO: verify that AddressingPropertiesImpl can extend ElementExtensibleImpl.
+ * See
http://jira.jboss.com/jira/browse/JBWS-728
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Nov-2005
+ */
+public class AddressingPropertiesImpl extends ElementExtensibleImpl implements
AddressingProperties
+{
+ private static AddressingConstants ADDR = new AddressingConstantsImpl();
+
+ // A REQUIRED absolute URI representing the address of the intended receiver of this
message.
+ private AttributedURI to;
+ // A REQUIRED absolute URI that uniquely identifies the semantics implied by this
message.
+ private AttributedURI action;
+ // An OPTIONAL absolute URI that uniquely identifies the message.
+ private AttributedURI messageId;
+ // An OPTIONAL pair of values that indicate how this message relates to another
message.
+ private Relationship[] relatesTo;
+ // An OPTIONAL endpoint reference for the intended receiver for replies to this
message.
+ private EndpointReference replyTo;
+ // An OPTIONAL endpoint reference for the intended receiver for faults related to this
message.
+ private EndpointReference faultTo;
+ // An OPTIONAL reference to the endpoint from which the message originated.
+ private EndpointReference from;
+ // Corresponds to the value of the [reference parameters] property of the endpoint
reference to which the message is addressed.
+ private ReferenceParameters refParams = new ReferenceParametersImpl();
+
+ private Map<QName, AddressingType> addrTypes = new HashMap<QName,
AddressingType>();
+
+ public AttributedURI getTo()
+ {
+ return to;
+ }
+
+ public void setTo(AttributedURI to)
+ {
+ this.to = to;
+ }
+
+ public AttributedURI getAction()
+ {
+ return action;
+ }
+
+ public void setAction(AttributedURI action)
+ {
+ this.action = action;
+ }
+
+ public AttributedURI getMessageID()
+ {
+ return messageId;
+ }
+
+ public void setMessageID(AttributedURI iri)
+ {
+ this.messageId = iri;
+ }
+
+ public Relationship[] getRelatesTo()
+ {
+ return relatesTo;
+ }
+
+ public void setRelatesTo(Relationship[] relatesTo)
+ {
+ this.relatesTo = relatesTo;
+ }
+
+ public EndpointReference getReplyTo()
+ {
+ return replyTo;
+ }
+
+ public void setReplyTo(EndpointReference replyTo)
+ {
+ this.replyTo = replyTo;
+ }
+
+ public EndpointReference getFaultTo()
+ {
+ return faultTo;
+ }
+
+ public void setFaultTo(EndpointReference faultTo)
+ {
+ this.faultTo = faultTo;
+ }
+
+ public EndpointReference getFrom()
+ {
+ return from;
+ }
+
+ public void setFrom(EndpointReference from)
+ {
+ this.from = from;
+ }
+
+ public ReferenceParameters getReferenceParameters()
+ {
+ return refParams;
+ }
+
+ /**
+ * Initializes the properties as a destination using the given
+ * <code>EndpointReference</code>. The <bold>To</bold>
property is initialized
+ * using the <bold>Address</bold> property of the
<code>EndpointReference</code>
+ * and the <bold>ReferenceParameters</bold> property is initialized using
the
+ * <bold>ReferenceParameters</bold> property of the
<code>EndpointReference</code>.
+ *
+ * @param epr The <code>EndpointReference</code> representing the
destination.
+ */
+ public void initializeAsDestination(EndpointReference epr)
+ {
+ if (epr == null)
+ throw new IllegalArgumentException("Invalid null endpoint
reference");
+
+ this.to = epr.getAddress();
+
+ ReferenceParameters srcParams = epr.getReferenceParameters();
+ for (Object obj : srcParams.getElements())
+ {
+ SOAPElement soapElement = (SOAPElement)obj;
+ soapElement.setAttributeNS(getNamespaceURI(),
"wsa:IsReferenceParameter", "true");
+ addElement(soapElement);
+ }
+ }
+
+ /**
+ * Initialize this <code>AddressingProperties</code> as a reply to the
+ * given message. As described in the WS-Addressing Core specification.
+ * The <bold>ReplyTo</bold> property is using the
<bold>Address</bold>
+ * property of the source <code>AddressingProperties</code> and the
+ * <bold>ReferenceParameters</bold> property is initialized using the
+ * <bold>ReferenceParameters</bold> property of the source message.
+ *
+ * @param props The source <code>AddressingProperties</code>
+ * @param isFault <code>true</code> if the reply is a Fault message.
+ */
+ public void initializeAsReply(AddressingProperties props, boolean isFault)
+ {
+ EndpointReference epr = (isFault ? props.getFaultTo() : null);
+ if (epr == null)
+ {
+ epr = props.getReplyTo();
+ }
+ this.to = (epr != null ? epr.getAddress() : new
AttributedURIImpl(ADDR.getAnonymousURI()));
+
+ if (epr != null)
+ {
+ ReferenceParameters srcParams = epr.getReferenceParameters();
+ for (Object obj : srcParams.getElements())
+ {
+ SOAPElement soapElement = (SOAPElement)obj;
+ soapElement.setAttributeNS(getNamespaceURI(),
"wsa:IsReferenceParameter", "true");
+ addElement(soapElement);
+ }
+ }
+ if (props.getMessageID() != null)
+ {
+ AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+ Relationship rel = builder.newRelationship(props.getMessageID().getURI());
+ this.relatesTo = new Relationship[] { rel };
+ }
+ }
+
+ // Map interface ****************************************************************
+
+ public int size()
+ {
+ return addrTypes.size();
+ }
+
+ public boolean isEmpty()
+ {
+ return addrTypes.isEmpty();
+ }
+
+ public boolean containsKey(Object arg0)
+ {
+ return addrTypes.containsKey(arg0);
+ }
+
+ public boolean containsValue(Object arg0)
+ {
+ return addrTypes.containsValue(arg0);
+ }
+
+ public AddressingType get(Object arg0)
+ {
+ return addrTypes.get(arg0);
+ }
+
+ public AddressingType put(QName arg0, AddressingType arg1)
+ {
+ return addrTypes.put(arg0, arg1);
+ }
+
+ public AddressingType remove(Object arg0)
+ {
+ return addrTypes.remove(arg0);
+ }
+
+ public void putAll(Map<? extends QName, ? extends AddressingType> arg0)
+ {
+ addrTypes.putAll(arg0);
+ }
+
+ public void clear()
+ {
+ addrTypes.clear();
+ }
+
+ public Set<QName> keySet()
+ {
+ return addrTypes.keySet();
+ }
+
+ public Collection<AddressingType> values()
+ {
+ return addrTypes.values();
+ }
+
+ public Set<Entry<QName, AddressingType>> entrySet()
+ {
+ return addrTypes.entrySet();
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/AddressingTypeImpl.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/AddressingTypeImpl.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/AddressingTypeImpl.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/AddressingTypeImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,40 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.addressing;
+
+//$Id$
+
+import javax.xml.ws.addressing.AddressingType;
+
+/**
+ * Implemented by wrappers for types defined by <b>WS-Addressing</b>.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Nov-2005
+ */
+public class AddressingTypeImpl implements AddressingType
+{
+ public String getNamespaceURI()
+ {
+ return AddressingConstantsImpl.URI_ADDRESSING;
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/AttributeElementExtensibleImpl.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/AttributeElementExtensibleImpl.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/AttributeElementExtensibleImpl.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/AttributeElementExtensibleImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,76 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.addressing;
+
+//$Id$
+
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.addressing.AddressingException;
+import javax.xml.ws.addressing.AddressingType;
+import javax.xml.ws.addressing.AttributeExtensible;
+import javax.xml.ws.addressing.ElementExtensible;
+
+/**
+ * Used to represent Addressing classes that support collections of arbitrary XML
Elements.
+ * Used to represent Addressing classes that support extensibility attributes.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Nov-2005
+ */
+public class AttributeElementExtensibleImpl implements AttributeExtensible,
ElementExtensible, AddressingType
+{
+ private AttributeExtensible attrExt = new AttributeExtensibleImpl();
+ private ElementExtensible elmtExt = new ElementExtensibleImpl();
+
+ public Map<QName, String> getAttributes()
+ {
+ return attrExt.getAttributes();
+ }
+
+ public void addAttribute(QName name, String value) throws AddressingException
+ {
+ attrExt.addAttribute(name, value);
+ }
+
+ public List<Object> getElements()
+ {
+ return elmtExt.getElements();
+ }
+
+ public void addElement(Object element)
+ {
+ elmtExt.addElement(element);
+ }
+
+ public boolean removeElement(Object element)
+ {
+ return elmtExt.removeElement(element);
+ }
+
+ public String getNamespaceURI()
+ {
+ return new AddressingTypeImpl().getNamespaceURI();
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/AttributeExtensibleImpl.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/AttributeExtensibleImpl.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/AttributeExtensibleImpl.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/AttributeExtensibleImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,52 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.addressing;
+
+//$Id$
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.addressing.AddressingException;
+import javax.xml.ws.addressing.AttributeExtensible;
+
+/**
+ * Used to represent Addressing classes that support extensibility attributes.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Nov-2005
+ */
+public class AttributeExtensibleImpl extends AddressingTypeImpl implements
AttributeExtensible
+{
+ private Map<QName, String> extMap = new HashMap<QName, String>();
+
+ public Map<QName, String> getAttributes()
+ {
+ return extMap;
+ }
+
+ public void addAttribute(QName name, String value) throws AddressingException
+ {
+ extMap.put(name, value);
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/AttributedQNameImpl.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/AttributedQNameImpl.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/AttributedQNameImpl.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/AttributedQNameImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,49 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.addressing;
+
+//$Id$
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.addressing.AttributedQName;
+
+/**
+ * Abstraction of <code>AttributedQNameType</code> defined in the normative
+ * WS-Addressing core schema.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Nov-2005
+ */
+public class AttributedQNameImpl extends AttributeExtensibleImpl implements
AttributedQName
+{
+ private QName qname;
+
+ public AttributedQNameImpl(QName qname)
+ {
+ this.qname = qname;
+ }
+
+ public QName getQName()
+ {
+ return qname;
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/AttributedURIImpl.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/AttributedURIImpl.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/AttributedURIImpl.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/AttributedURIImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,62 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.addressing;
+
+//$Id$
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import javax.xml.ws.addressing.AttributedURI;
+
+/**
+ * Abstraction <code>AttributedURIType</code> defined in the normative
WS-Addressing core schema.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Nov-2005
+ */
+public class AttributedURIImpl extends AttributeExtensibleImpl implements AttributedURI
+{
+ private URI uri;
+
+ public AttributedURIImpl(URI uri)
+ {
+ this.uri = uri;
+ }
+
+ public AttributedURIImpl(String uri)
+ {
+ try
+ {
+ this.uri = new URI(uri);
+ }
+ catch (URISyntaxException ex)
+ {
+ throw new IllegalArgumentException(ex.toString());
+ }
+ }
+
+ public URI getURI()
+ {
+ return uri;
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/ElementExtensibleImpl.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/ElementExtensibleImpl.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/ElementExtensibleImpl.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/ElementExtensibleImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,58 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.addressing;
+
+//$Id$
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.ws.addressing.ElementExtensible;
+
+/**
+ * Implemented by classes exposing a <code>List</code> of
+ * <code>SOAPElements</code>. Used to represent addressing classes that
+ * support collections of arbitrary XML Elements.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Nov-2005
+ */
+public class ElementExtensibleImpl extends AddressingTypeImpl implements
ElementExtensible
+{
+ private List<Object> elements = new ArrayList<Object>();
+
+ public List<Object> getElements()
+ {
+ return elements;
+ }
+
+ public void addElement(Object element)
+ {
+ elements.add(element);
+ }
+
+ public boolean removeElement(Object element)
+ {
+ return elements.remove(element);
+ }
+
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/EndpointReferenceImpl.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/EndpointReferenceImpl.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/EndpointReferenceImpl.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/EndpointReferenceImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,300 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extras.addressing;
+
+//$Id$
+
+import java.io.IOException;
+import java.io.StringWriter;
+import java.net.URI;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.addressing.AddressingConstants;
+import javax.xml.ws.addressing.AddressingException;
+import javax.xml.ws.addressing.AttributedURI;
+import javax.xml.ws.addressing.EndpointReference;
+import javax.xml.ws.addressing.Metadata;
+import javax.xml.ws.addressing.ReferenceParameters;
+import javax.xml.ws.addressing.soap.SOAPAddressingBuilder;
+
+import org.jboss.ws.WSException;
+import org.jboss.ws.extras.addressing.soap.SOAPAddressingBuilderImpl;
+import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.utils.DOMWriter;
+import org.w3c.dom.Element;
+
+/**
+ * Abstraction of EndpointReference.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Nov-2005
+ */
+public class EndpointReferenceImpl extends AttributeElementExtensibleImpl implements
EndpointReference
+{
+ private static AddressingConstants ADDR = new AddressingConstantsImpl();
+
+ // The REQUIRED root element name
+ private QName rootQName = new QName(ADDR.getNamespaceURI(),
"EndpointReference", ADDR.getNamespacePrefix());
+ // This REQUIRED element (whose content is of type xs:anyURI) specifies the [address]
property of the endpoint reference.
+ private AttributedURIImpl address = new AttributedURIImpl(ADDR.getAnonymousURI());
+ // This OPTIONAL element may contain elements from any namespace. Such elements form
the [reference parameters] of the reference.
+ private ReferenceParametersImpl refParams = new ReferenceParametersImpl();
+ // This OPTIONAL element may contain elements from any namespace.
+ private MetadataImpl metadata = new MetadataImpl();
+
+ public EndpointReferenceImpl(URI uri)
+ {
+ this.address = new AttributedURIImpl(uri);
+ }
+
+ public EndpointReferenceImpl(Element elRoot)
+ {
+ initFromElement(elRoot);
+ }
+
+ public QName getRootQName()
+ {
+ return rootQName;
+ }
+
+ public void setRootQName(QName rootElementName)
+ {
+ this.rootQName = rootElementName;
+ }
+
+ public AttributedURI getAddress()
+ {
+ return address;
+ }
+
+ public ReferenceParameters getReferenceParameters()
+ {
+ return refParams;
+ }
+
+ public Metadata getMetadata()
+ {
+ return metadata;
+ }
+
+ private void initFromElement(Element elRoot)
+ {
+ if (elRoot == null)
+ throw new IllegalArgumentException("Cannot initialize from null
element");
+
+ try
+ {
+ Map<QName, String> attributes = DOMUtils.getAttributes(elRoot);
+ for (QName attqname : attributes.keySet())
+ {
+ String value = attributes.get(attqname);
+ addAttribute(attqname, value);
+ }
+
+ Iterator it = DOMUtils.getChildElements(elRoot);
+ while (it.hasNext())
+ {
+ Element el = (Element)it.next();
+ QName qname = DOMUtils.getElementQName(el);
+
+ // Parse Address
+ if (qname.equals(ADDR.getAddressQName()))
+ {
+ address = new AttributedURIImpl(DOMUtils.getTextContent(el));
+
+ attributes = DOMUtils.getAttributes(el);
+ for (QName attqname : attributes.keySet())
+ {
+ String value = attributes.get(attqname);
+ address.addAttribute(attqname, value);
+ }
+ }
+ // Parse ReferenceParameters
+ else if (qname.equals(ADDR.getReferenceParametersQName()))
+ {
+ attributes = DOMUtils.getAttributes(el);
+ for (QName attqname : attributes.keySet())
+ {
+ String value = attributes.get(attqname);
+ refParams.addAttribute(attqname, value);
+ }
+ Iterator itel = DOMUtils.getChildElements(el);
+ while (itel.hasNext())
+ {
+ Element child = (Element)itel.next();
+ refParams.addElement(child);
+ }
+ }
+ // Parse Metadata
+ else if (qname.equals(ADDR.getMetadataQName()))
+ {
+ attributes = DOMUtils.getAttributes(el);
+ for (QName attqname : attributes.keySet())
+ {
+ String value = attributes.get(attqname);
+ metadata.addAttribute(attqname, value);
+ }
+ Iterator itel = DOMUtils.getChildElements(el);
+ while (itel.hasNext())
+ {
+ Element child = (Element)itel.next();
+ metadata.addElement(child);
+ }
+ }
+ else
+ {
+ addElement(el);
+ }
+ }
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new AddressingException("Cannot init EPR from element", ex);
+ }
+ }
+
+ public Element toElement()
+ {
+ String xmlString = toXMLString(false);
+ try
+ {
+ return DOMUtils.parse(xmlString);
+ }
+ catch (IOException ex)
+ {
+ throw new WSException("Cannot parse: " + xmlString, ex);
+ }
+ }
+
+ public String toXMLString(boolean pretty)
+ {
+ if (pretty)
+ {
+ Element epRef = toElement();
+ return DOMWriter.printNode(epRef, true);
+ }
+
+ SOAPAddressingBuilder builder = new SOAPAddressingBuilderImpl();
+ AddressingConstants ADDR = builder.newAddressingConstants();
+
+ String rootname = getPrefixedName(rootQName);
+ StringBuilder xmlBuffer = new StringBuilder("<" + rootname);
+ appendAttributes(xmlBuffer, getAttributes());
+ xmlBuffer.append(">");
+
+ // insert xmlns:wsa
+ String wsaURI = ADDR.getNamespaceURI();
+ String wsaPrefix = ADDR.getNamespacePrefix();
+ String wsaDeclaration = " xmlns:" + wsaPrefix + "='" +
wsaURI + "'";
+ if (xmlBuffer.indexOf(wsaDeclaration) < 0)
+ {
+ xmlBuffer.insert(rootname.length() + 1, wsaDeclaration);
+ }
+
+ // append address
+ xmlBuffer.append("<" + getPrefixedName(ADDR.getAddressQName()));
+ appendAttributes(xmlBuffer, address.getAttributes());
+ xmlBuffer.append(">");
+ xmlBuffer.append(address.getURI() + "</" +
getPrefixedName(ADDR.getAddressQName()) + ">");
+
+ // append parameters
+ if (refParams.getElements().size() > 0 || refParams.getAttributes().size() >
0)
+ {
+ xmlBuffer.append("<" +
getPrefixedName(ADDR.getReferenceParametersQName()));
+ appendAttributes(xmlBuffer, refParams.getAttributes());
+ xmlBuffer.append(">");
+ appendElements(xmlBuffer, refParams.getElements());
+ xmlBuffer.append("</" +
getPrefixedName(ADDR.getReferenceParametersQName()) + ">");
+ }
+
+ // append metadata
+ if (metadata.getElements().size() > 0 || metadata.getAttributes().size() >
0)
+ {
+ xmlBuffer.append("<" + getPrefixedName(ADDR.getMetadataQName()));
+ appendAttributes(xmlBuffer, metadata.getAttributes());
+ xmlBuffer.append(">");
+ appendElements(xmlBuffer, metadata.getElements());
+ xmlBuffer.append("</" + getPrefixedName(ADDR.getMetadataQName()) +
">");
+ }
+
+ // append custom elements
+ appendElements(xmlBuffer, getElements());
+
+ xmlBuffer.append("</" + rootname + ">");
+
+ String xmlString = xmlBuffer.toString();
+ return xmlString;
+ }
+
+ private void appendAttributes(StringBuilder xmlBuffer, Map<QName, String>
attributes)
+ {
+ for (QName qname : attributes.keySet())
+ {
+ String qualname = getPrefixedName(qname);
+ String value = attributes.get(qname);
+ xmlBuffer.append(" " + qualname + "='" + value +
"'");
+ }
+ }
+
+ private void appendElements(StringBuilder xmlBuffer, List<Object> elements)
+ {
+ for (Object obj : elements)
+ {
+ if (obj instanceof Element)
+ {
+ StringWriter strwr = new StringWriter();
+ DOMWriter domWriter = new DOMWriter(strwr).setCompleteNamespaces(false);
+ domWriter.print((Element)obj);
+ String xmlFragment = strwr.toString();
+ xmlBuffer.append(xmlFragment);
+ }
+ else if (obj instanceof String)
+ {
+ xmlBuffer.append(obj);
+ }
+ else
+ {
+ throw new AddressingException("Unsupported element: " +
obj.getClass().getName());
+ }
+ }
+ }
+
+ private String getPrefixedName(QName qname)
+ {
+ String prefix = qname.getPrefix();
+ String localPart = qname.getLocalPart();
+ String qualname = (prefix != null && prefix.length() > 0 ? prefix +
":" + localPart : localPart);
+ return qualname;
+ }
+
+ public String toString()
+ {
+ return toXMLString(true);
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/MetadataImpl.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/MetadataImpl.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/MetadataImpl.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/MetadataImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,36 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.addressing;
+
+//$Id$
+
+import javax.xml.ws.addressing.Metadata;
+
+/**
+ * Abstraction of Metadata bucket in an <code>EndpointReference</code>.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Nov-2005
+ */
+public class MetadataImpl extends AttributeElementExtensibleImpl implements Metadata
+{
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/ReferenceParametersImpl.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/ReferenceParametersImpl.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/ReferenceParametersImpl.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/ReferenceParametersImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extras.addressing;
+
+import javax.xml.ws.addressing.ReferenceParameters;
+
+// $Id$
+
+/**
+ * Abstraction of ReferenceParameters bucket in an
+ * <code>EndpointReference</code>.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Nov-2005
+ */
+public class ReferenceParametersImpl extends AttributeElementExtensibleImpl implements
ReferenceParameters
+{
+ public ReferenceParametersImpl()
+ {
+ super();
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/RelationshipImpl.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/RelationshipImpl.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/RelationshipImpl.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/RelationshipImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extras.addressing;
+
+import java.net.URI;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.addressing.Relationship;
+
+// $Id$
+
+/**
+ * Abstraction of the RelatesToType defined by WS-Addressing. Includes an ID
+ * property that references the MessageID of the related message and a Type
+ * property corresponding to the RelationshipType attribute of the
+ * RelatesToType. Implementing classes must supply a single argument constructor
+ * with parameter type <code>java.net.URI</code>, which is used to
initialize
+ * the <b>ID</b> property.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Nov-2005
+ */
+public class RelationshipImpl extends AttributeExtensibleImpl implements Relationship
+{
+ private URI uri;
+ private QName type;
+
+ public RelationshipImpl(URI uri)
+ {
+ this.uri = uri;
+ }
+
+ public URI getID()
+ {
+ return uri;
+ }
+
+ public QName getType()
+ {
+ return type;
+ }
+
+ public void setType(QName type)
+ {
+ this.type = type;
+ }
+
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/jaxrpc (from
rev 1557, branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/jaxrpc)
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/jaxrpc/WSAddressingClientHandler.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/jaxrpc/WSAddressingClientHandler.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/jaxrpc/WSAddressingClientHandler.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.addressing.jaxrpc;
+package org.jboss.ws.extras.addressing.jaxrpc;
import javax.xml.namespace.QName;
import javax.xml.rpc.handler.GenericHandler;
@@ -35,7 +35,7 @@
import javax.xml.ws.addressing.soap.SOAPAddressingProperties;
import org.jboss.logging.Logger;
-import org.jboss.ws.addressing.soap.SOAPAddressingPropertiesImpl;
+import org.jboss.ws.extras.addressing.soap.SOAPAddressingPropertiesImpl;
/**
* A client side handler that reads/writes the addressing properties
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/jaxrpc/WSAddressingServerHandler.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/jaxrpc/WSAddressingServerHandler.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/jaxrpc/WSAddressingServerHandler.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.addressing.jaxrpc;
+package org.jboss.ws.extras.addressing.jaxrpc;
import java.net.URISyntaxException;
@@ -35,10 +35,10 @@
import javax.xml.ws.addressing.soap.SOAPAddressingProperties;
import org.jboss.logging.Logger;
-import org.jboss.ws.addressing.AddressingConstantsImpl;
-import org.jboss.ws.addressing.metadata.AddressingOpMetaExt;
+import org.jboss.ws.extras.addressing.AddressingConstantsImpl;
+import org.jboss.ws.extras.addressing.metadata.AddressingOpMetaExt;
import org.jboss.ws.jaxrpc.handler.SOAPMessageContextJAXRPC;
-import org.jboss.ws.metadata.OperationMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
/**
* A server side handler that reads/writes the addressing properties
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/jaxws (from
rev 1557, branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/jaxws)
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/jaxws/WSAddressingClientHandler.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/jaxws/WSAddressingClientHandler.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/jaxws/WSAddressingClientHandler.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.addressing.jaxws;
+package org.jboss.ws.extras.addressing.jaxws;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
@@ -32,7 +32,7 @@
import javax.xml.ws.handler.soap.SOAPMessageContext;
import org.jboss.logging.Logger;
-import org.jboss.ws.addressing.soap.SOAPAddressingPropertiesImpl;
+import org.jboss.ws.extras.addressing.soap.SOAPAddressingPropertiesImpl;
import org.jboss.ws.jaxws.handler.GenericSOAPHandler;
/**
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/jaxws/WSAddressingServerHandler.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/jaxws/WSAddressingServerHandler.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/jaxws/WSAddressingServerHandler.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.addressing.jaxws;
+package org.jboss.ws.extras.addressing.jaxws;
import java.net.URISyntaxException;
import java.util.HashSet;
@@ -36,11 +36,11 @@
import javax.xml.ws.handler.soap.SOAPMessageContext;
import org.jboss.logging.Logger;
-import org.jboss.ws.addressing.AddressingConstantsImpl;
-import org.jboss.ws.addressing.metadata.AddressingOpMetaExt;
-import org.jboss.ws.common.CommonMessageContext;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.extras.addressing.AddressingConstantsImpl;
+import org.jboss.ws.extras.addressing.metadata.AddressingOpMetaExt;
import org.jboss.ws.jaxws.handler.GenericSOAPHandler;
-import org.jboss.ws.metadata.OperationMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
/**
* A server side handler that reads/writes the addressing properties
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/metadata
(from rev 1557, branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/metadata)
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/metadata/AddressingOpMetaExt.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/metadata/AddressingOpMetaExt.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/metadata/AddressingOpMetaExt.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,11 +19,11 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.addressing.metadata;
+package org.jboss.ws.extras.addressing.metadata;
// $Id$
-import org.jboss.ws.metadata.MetaDataExtension;
+import org.jboss.ws.metadata.umdm.MetaDataExtension;
/**
* Addressing meta data extensions:
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/soap (from
rev 1557, branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/soap)
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/soap/SOAPAddressingBuilderImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/soap/SOAPAddressingBuilderImpl.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/soap/SOAPAddressingBuilderImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.addressing.soap;
+package org.jboss.ws.extras.addressing.soap;
//$Id$
@@ -35,12 +35,12 @@
import javax.xml.ws.addressing.Relationship;
import javax.xml.ws.addressing.soap.SOAPAddressingBuilder;
-import org.jboss.ws.addressing.AddressingConstantsImpl;
-import org.jboss.ws.addressing.AddressingTypeImpl;
-import org.jboss.ws.addressing.AttributedQNameImpl;
-import org.jboss.ws.addressing.AttributedURIImpl;
-import org.jboss.ws.addressing.EndpointReferenceImpl;
-import org.jboss.ws.addressing.RelationshipImpl;
+import org.jboss.ws.extras.addressing.AddressingConstantsImpl;
+import org.jboss.ws.extras.addressing.AddressingTypeImpl;
+import org.jboss.ws.extras.addressing.AttributedQNameImpl;
+import org.jboss.ws.extras.addressing.AttributedURIImpl;
+import org.jboss.ws.extras.addressing.EndpointReferenceImpl;
+import org.jboss.ws.extras.addressing.RelationshipImpl;
/**
* Factory for <code>AddressingElements</code>.
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/soap/SOAPAddressingPropertiesImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/addressing/soap/SOAPAddressingPropertiesImpl.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/soap/SOAPAddressingPropertiesImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.addressing.soap;
+package org.jboss.ws.extras.addressing.soap;
//$Id$
@@ -47,9 +47,9 @@
import org.jboss.util.NotImplementedException;
import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.addressing.AddressingConstantsImpl;
-import org.jboss.ws.addressing.AddressingPropertiesImpl;
-import org.jboss.ws.addressing.EndpointReferenceImpl;
+import org.jboss.ws.extras.addressing.AddressingConstantsImpl;
+import org.jboss.ws.extras.addressing.AddressingPropertiesImpl;
+import org.jboss.ws.extras.addressing.EndpointReferenceImpl;
import org.jboss.ws.soap.NameImpl;
import org.jboss.ws.soap.SOAPElementImpl;
import org.jboss.ws.soap.SOAPFactoryImpl;
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/EventSourceEndpoint.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/EventSourceEndpoint.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/EventSourceEndpoint.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/EventSourceEndpoint.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extras.eventing;
+
+// $Id$
+
+import org.jboss.ws.extras.eventing.element.SubscribeRequest;
+import org.jboss.ws.extras.eventing.element.SubscribeResponse;
+import org.jboss.ws.extras.eventing.element.SubscriptionEndRequest;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+/**
+ * Event source endpoint interface.
+ *
+ * @author Heiko Braun, <heiko(a)openj.net>
+ * @since 24-Nov-2005
+ */
+public interface EventSourceEndpoint extends Remote
+{
+
+ SubscribeResponse subscribe(SubscribeRequest subscribeRequest) throws
RemoteException;
+
+ SubscriptionEndRequest subscriptionEnd() throws RemoteException;
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/EventSourceEndpointImpl.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/EventSourceEndpointImpl.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/EventSourceEndpointImpl.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/EventSourceEndpointImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,108 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extras.eventing;
+
+// $Id$
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.extras.eventing.element.EndpointReference;
+import org.jboss.ws.extras.eventing.element.SubscribeRequest;
+import org.jboss.ws.extras.eventing.element.SubscribeResponse;
+import org.jboss.ws.extras.eventing.element.SubscriptionEndRequest;
+import org.jboss.ws.extras.eventing.mgmt.Filter;
+import org.jboss.ws.extras.eventing.mgmt.SubscriptionError;
+import org.jboss.ws.extras.eventing.mgmt.SubscriptionManagerMBean;
+import org.jboss.ws.extras.eventing.mgmt.SubscriptionTicket;
+
+import javax.xml.rpc.soap.SOAPFaultException;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.AttributedURI;
+import java.rmi.RemoteException;
+
+/**
+ * Event source endpoint implementation.<br>
+ * Delegates to {@link org.jboss.ws.extras.eventing.mgmt.SubscriptionManager}
+ *
+ * @author Heiko Braun, <heiko(a)openj.net>
+ * @since 25-Nov-2005
+ */
+public class EventSourceEndpointImpl extends EventingEndpointBase
+ implements EventSourceEndpoint
+{
+ private static Logger log = Logger.getLogger(EventSourceEndpointImpl.class);
+
+ public SubscribeResponse subscribe(SubscribeRequest request) throws RemoteException
+ {
+ try
+ {
+ // retrieve addressing headers
+ AddressingProperties inProps = getAddrProperties();
+ AttributedURI eventSourceURI = inProps.getTo();
+ log.debug("Subscribe request for event source: " +
eventSourceURI.getURI());
+
+ assertSubscriberEndpoints(request);
+ EndpointReference notifyTo = request.getDelivery().getNotifyTo();
+ EndpointReference endTo = request.getEndTo();
+
+ // adapt filter elements
+ Filter filter = null;
+ if (request.getFilter() != null)
+ {
+ filter = new Filter(request.getFilter().getDialect(),
request.getFilter().get_value());
+ }
+
+ // invoke subscription manager
+ SubscriptionManagerMBean subscriptionManager = getSubscriptionManager();
+ SubscriptionTicket ticket =
subscriptionManager.subscribe(eventSourceURI.getURI(), notifyTo, endTo,
request.getExpires(), filter);
+
+ // create the response element
+ SubscribeResponse res = new SubscribeResponse();
+ res.setExpires(ticket.getExpires());
+ res.setSubscriptionManager(ticket.getSubscriptionManager());
+
+ return res;
+
+ }
+ catch (SubscriptionError e)
+ {
+ throw new SOAPFaultException(buildFaultQName(e.getSubcode()), e.getReason(),
null, null);
+ }
+ }
+
+ public SubscriptionEndRequest subscriptionEnd() throws RemoteException
+ {
+ return new SubscriptionEndRequest();
+ }
+
+ /**
+ * Ensure that the subscriber endpoint information is supplied in request.
+ * Namely NotifyTo and EndTo need to be set.
+ * @param request
+ */
+ private void assertSubscriberEndpoints(SubscribeRequest request) {
+ if(null == request.getDelivery().getNotifyTo() || null == request.getEndTo() )
+ throw new SOAPFaultException(
buildFaultQName(EventingConstants.CODE_INVALID_MESSAGE) ,
+ "Subcriber endpoint information missing from request",
+ null, null
+ );
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/EventingConstants.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/EventingConstants.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/EventingConstants.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/EventingConstants.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,163 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extras.eventing;
+
+// $Id$
+
+import org.jboss.ws.WSException;
+
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingConstants;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+/**
+ * @author Heiko Braun, <heiko(a)openj.net>
+ * @since 19-Dec-2005
+ */
+public class EventingConstants
+{
+ private static AddressingBuilder WSA_BUILDER =
AddressingBuilder.getAddressingBuilder();
+ private static AddressingConstants WSA_CONSTANTS =
WSA_BUILDER.newAddressingConstants();
+
+ // common namespaces
+
+ public final static String NS_EVENTING =
"http://schemas.xmlsoap.org/ws/2004/08/eventing";
+ public final static String PREFIX_EVENTING = "wse";
+ public final static String NS_ADDRESSING = WSA_CONSTANTS.getNamespaceURI();
+
+ // request /response action from specification
+
+ public final static String SUBSCRIBE_ACTION =
"http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe";
+ public final static String SUBSCRIBE_RESPONSE_ACTION =
"http://schemas.xmlsoap.org/ws/2004/08/eventing/SubscribeResponse";
+ public final static String UNSUBSCRIBE_ACTION =
"http://schemas.xmlsoap.org/ws/2004/08/eventing/Unsubscribe";
+ public final static String UNSUBSCRIBE_RESPONSE_ACTION =
"http://schemas.xmlsoap.org/ws/2004/08/eventing/UnsubscribeResponse";
+ public final static String GET_STATUS_ACTION =
"http://schemas.xmlsoap.org/ws/2004/08/eventing/GetStatus";
+ public final static String GET_STATUS_RESPONSE_ACTION =
"http://schemas.xmlsoap.org/ws/2004/08/eventing/GetStatusResponse";
+ public final static String RENEW_ACTION =
"http://schemas.xmlsoap.org/ws/2004/08/eventing/Renew";
+ public final static String RENEW_RESPONSE_ACTION =
"http://schemas.xmlsoap.org/ws/2004/08/eventing/RenewResponse";
+ public final static String SUBSCRIPTION_END_ACTION =
"http://schemas.xmlsoap.org/ws/2004/08/eventing/SubscriptionEnd";
+
+ public final static String WSA_FAULT_ACTION =
"http://schemas.xmlsoap.org/ws/2004/08/addressing/fault";
+ public final static String WSA_ANONYMOUS_URI = WSA_CONSTANTS.getAnonymousURI();
+
+ // failures
+
+ public final static String DELIVERY_FAILURE =
"http://schemas.xmlsoap.org/ws/2004/08/eventing/DeliveryFailure";
+ public final static String SOURCE_SHUTTING_DOWN =
"http://schemas.xmlsoap.org/ws/2004/08/eventing/SourceShuttingDown";
+ public final static String SOURCE_CANCELING =
"http://schemas.xmlsoap.org/ws/2004/08/eventing/SourceCanceling";
+
+ public final static String CODE_UNABLE_TO_PROCESS =
"EventSourceUnableToProcess";
+ public final static String CODE_FILTER_NOT_SUPPORTED =
"FilteringNotSupported";
+ public final static String CODE_REQUESTED_FILTER_UNAVAILABLE =
"FilteringRequestedUnavailable";
+ public final static String CODE_INVALID_EXPIRATION_TIME =
"InvalidExpirationTime";
+ public final static String CODE_UNABLE_TO_RENEW = "UnableToRenew";
+ public final static String CODE_INVALID_MESSAGE = "InvalidMessage";
+
+ // default config
+
+ public final static String DISPATCHER_JNDI_NAME = "EventDispatcher";
+ public final static long MAX_LEASE_TIME = 1000 * 60 * 10L;
+ public final static long DEFAULT_LEASE = 1000 * 60 * 5L;
+
+ private static URI DELIVERY_PUSH_URI = null;
+ private static URI DIALECT_XPATH_URI = null;
+
+ private static URI SUBSCRIBE_ACTION_URI = null;
+
+ public final static URI buildURI(String uri)
+ {
+ try
+ {
+ return new URI(uri);
+ }
+ catch (URISyntaxException e)
+ {
+ throw new IllegalArgumentException(e.getMessage());
+ }
+ }
+
+ public static final URI getDefaultFilterDialect()
+ {
+ try
+ {
+ return new
URI("http://www.w3.org/TR/1999/REC-xpath-19991116");
+ }
+ catch (URISyntaxException e)
+ {
+ throw new WSException(e.getMessage());
+ }
+ }
+
+ public static final URI getDeliveryPush()
+ {
+ if (null == DELIVERY_PUSH_URI)
+ {
+ try
+ {
+ DELIVERY_PUSH_URI = new
URI("http://schemas.xmlsoap.org/ws/2004/08/eventing/DeliveryModes/Pu...;
+ }
+ catch (URISyntaxException e)
+ {
+ //
+ }
+ }
+ return DELIVERY_PUSH_URI;
+ }
+
+ public static URI getDialectXPath()
+ {
+ if (null == DIALECT_XPATH_URI)
+ {
+ try
+ {
+ DIALECT_XPATH_URI = new
URI("http://www.w3.org/TR/1999/REC-xpath-19991116");
+ }
+ catch (URISyntaxException e)
+ {
+ //
+ }
+ }
+
+ return DIALECT_XPATH_URI;
+ }
+
+ public static URI getSubscribeAction()
+ {
+ if (null == SUBSCRIBE_ACTION_URI)
+ {
+ try
+ {
+ SUBSCRIBE_ACTION_URI = new URI(SUBSCRIBE_ACTION);
+ }
+ catch (URISyntaxException e)
+ {
+ //
+ }
+ }
+
+ return SUBSCRIBE_ACTION_URI;
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/EventingEndpointBase.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/EventingEndpointBase.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/EventingEndpointBase.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/EventingEndpointBase.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,99 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extras.eventing;
+
+
+// $Id$
+
+import java.net.URI;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.soap.SOAPFaultException;
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.JAXWSAConstants;
+
+import org.jboss.ws.Constants;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.extras.eventing.mgmt.SubscriptionManagerFactory;
+import org.jboss.ws.extras.eventing.mgmt.SubscriptionManagerMBean;
+import org.jboss.ws.soap.MessageContextAssociation;
+
+/**
+ * @author Heiko Braun, <heiko(a)openj.net>
+ * @since 13-Jan-2006
+ */
+public abstract class EventingEndpointBase
+{
+
+ private AddressingBuilder addrBuilder;
+
+ /**
+ * Retrieve the addressing properties associated with the request
+ * and verify them.
+ */
+ protected static AddressingProperties getAddrProperties()
+ {
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ AddressingProperties inProps =
(AddressingProperties)msgContext.getProperty(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+ assertAddrProperties(inProps);
+ return inProps;
+ }
+
+ protected void setReplyAction(URI replyAction)
+ {
+
+ }
+
+ /**
+ * Access local subscription manager service.
+ */
+ protected SubscriptionManagerMBean getSubscriptionManager()
+ {
+ SubscriptionManagerFactory factory = SubscriptionManagerFactory.getInstance();
+ SubscriptionManagerMBean subscriptionManager = factory.getSubscriptionManager();
+ return subscriptionManager;
+ }
+
+ protected AddressingBuilder getAddrBuilder()
+ {
+ if (null == addrBuilder)
+ addrBuilder = AddressingBuilder.getAddressingBuilder();
+ return addrBuilder;
+ }
+
+ /**
+ * Ensure that all required inbound properties are supplied in request.
+ * @param inProps
+ * @throws javax.xml.rpc.soap.SOAPFaultException
+ */
+ protected static void assertAddrProperties(AddressingProperties inProps) throws
SOAPFaultException
+ {
+ if (null == inProps)
+ throw new SOAPFaultException(Constants.SOAP11_FAULT_CODE_CLIENT,
"Addressing headers missing from request", "wse:InvalidMessage",
null);
+ }
+
+ public QName buildFaultQName(String elementName)
+ {
+ return new QName(EventingConstants.NS_EVENTING, elementName,
EventingConstants.PREFIX_EVENTING);
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/EventingService.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/EventingService.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/EventingService.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/EventingService.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extras.eventing;
+
+// $Id$
+
+import javax.xml.rpc.Service;
+
+/**
+ * @author Heiko Braun, <heiko(a)openj.net>
+ * @since 24-Nov-2005
+ */
+public interface EventingService extends Service
+{
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/SubscriptionManagerEndpoint.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/SubscriptionManagerEndpoint.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/SubscriptionManagerEndpoint.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/SubscriptionManagerEndpoint.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extras.eventing;
+
+// $Id$
+
+import org.jboss.ws.extras.eventing.element.*;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+/**
+ * Subscription manager endpoint interface.
+ *
+ * @author Heiko Braun, <heiko(a)openj.net>
+ * @since 16-Dec-2005
+ */
+public interface SubscriptionManagerEndpoint extends Remote
+{
+
+ StatusResponse getStatus(StatusRequest request) throws RemoteException;
+
+ RenewResponse renew(RenewRequest request) throws RemoteException;
+
+ void unsubscribe(UnsubscribeRequest request) throws RemoteException;
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/SubscriptionManagerEndpointImpl.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/SubscriptionManagerEndpointImpl.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/SubscriptionManagerEndpointImpl.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/SubscriptionManagerEndpointImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,194 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extras.eventing;
+
+// $Id$
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.rmi.RemoteException;
+import java.util.Date;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.soap.SOAPFaultException;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.JAXWSAConstants;
+import javax.xml.ws.addressing.ReferenceParameters;
+
+import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.Constants;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.extras.eventing.element.RenewRequest;
+import org.jboss.ws.extras.eventing.element.RenewResponse;
+import org.jboss.ws.extras.eventing.element.StatusRequest;
+import org.jboss.ws.extras.eventing.element.StatusResponse;
+import org.jboss.ws.extras.eventing.element.UnsubscribeRequest;
+import org.jboss.ws.extras.eventing.mgmt.SubscriptionError;
+import org.jboss.ws.soap.MessageContextAssociation;
+import org.w3c.dom.Element;
+
+/**
+ * SubscriptionManager endpoint implementation.<br>
+ * Delegates to {@link org.jboss.ws.extras.eventing.mgmt.SubscriptionManager}
+ *
+ * @author Heiko Braun, <heiko(a)openj.net>
+ * @since 16-Dec-2005
+ */
+public class SubscriptionManagerEndpointImpl extends EventingEndpointBase
+ implements SubscriptionManagerEndpoint
+{
+
+ public static final QName IDQN = new
QName("http://schemas.xmlsoap.org/ws/2004/08/eventing", "Identifier",
"ns1");
+
+ /**
+ * Get the status of a subscription.
+ *
+ * @param request
+ * @return response including the lease time.
+ * @throws RemoteException
+ */
+ public StatusResponse getStatus(StatusRequest request) throws RemoteException
+ {
+ URI identifier = retrieveSubscriptionId();
+
+ try
+ {
+ Date leaseTime = getSubscriptionManager().getStatus(identifier);
+ StatusResponse response = new StatusResponse();
+ response.setExpires(leaseTime);
+
+ return response;
+ }
+ catch (SubscriptionError e)
+ {
+ throw new SOAPFaultException(buildFaultQName(e.getSubcode()), e.getReason(),
null, null);
+ }
+ }
+
+ /**
+ * Update the expiration for a subscription.
+ *
+ * @param request
+ * @return response inclduing the new lease time.
+ * @throws RemoteException
+ */
+ public RenewResponse renew(RenewRequest request) throws RemoteException
+ {
+
setReplyAction(EventingConstants.buildURI(EventingConstants.RENEW_RESPONSE_ACTION));
+ URI identifier = retrieveSubscriptionId();
+
+ try
+ {
+ Date newLeaseTime = getSubscriptionManager().renew(identifier,
request.getExpires());
+ RenewResponse response = new RenewResponse();
+ response.setExpires(newLeaseTime);
+
+ return response;
+ }
+ catch (SubscriptionError e)
+ {
+ throw new SOAPFaultException(buildFaultQName(e.getSubcode()), e.getReason(),
null, null);
+ }
+
+ }
+
+ /**
+ * Explicitly delete a subscription.
+ *
+ * @param request
+ * @throws RemoteException
+ */
+ public void unsubscribe(UnsubscribeRequest request) throws RemoteException
+ {
+
setReplyAction(EventingConstants.buildURI(EventingConstants.UNSUBSCRIBE_RESPONSE_ACTION));
+ URI identifier = retrieveSubscriptionId();
+
+ try
+ {
+ getSubscriptionManager().unsubscribe(identifier);
+ }
+ catch (SubscriptionError e)
+ {
+ throw new SOAPFaultException(buildFaultQName(e.getSubcode()), e.getReason(),
null, null);
+ }
+
+ }
+
+ private URI retrieveSubscriptionId()
+ {
+ URI subscriptionId = null;
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ AddressingProperties addrProps =
(AddressingProperties)msgContext.getProperty(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+
+ if (null == addrProps)
+ {
+ throw new SOAPFaultException(
+ Constants.SOAP11_FAULT_CODE_CLIENT,
+ "The message is not valid and cannot be processed:" +
+ "Cannot obtain addressing properties.",
+ null, null
+ );
+ }
+
+ ReferenceParameters refParams = addrProps.getReferenceParameters();
+ if (refParams != null)
+ {
+ for (Object obj : refParams.getElements())
+ {
+ if (obj instanceof Element)
+ {
+ Element el = (Element)obj;
+ QName qname = DOMUtils.getElementQName(el);
+ if (qname.equals(IDQN))
+ {
+ try
+ {
+ subscriptionId = new URI(DOMUtils.getTextContent(el));
+ break;
+ }
+ catch (URISyntaxException e)
+ {
+ throw new SOAPFaultException(
+ Constants.SOAP11_FAULT_CODE_CLIENT,
+ "The message is not valid and cannot be processed:"
+
+ "Invalid subscription id.",
+ null, null
+ );
+ }
+ }
+ }
+ }
+ }
+
+ if (null == subscriptionId)
+ {
+ throw new SOAPFaultException(
+ buildFaultQName(EventingConstants.CODE_INVALID_MESSAGE),
+ "The message is not valid and cannot be processed."
+ + "Cannot obtain subscription id.",
+ null, null
+ );
+ }
+
+ return subscriptionId;
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/deployment
(from rev 1557, branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/deployment)
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/deployment/EventingEndpoint.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/deployment/EventingEndpoint.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/deployment/EventingEndpoint.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -1,11 +1,11 @@
-package org.jboss.ws.eventing.deployment;
+package org.jboss.ws.extras.eventing.deployment;
import org.jboss.ws.WSException;
-import org.jboss.ws.eventing.EventingConstants;
-import org.jboss.ws.eventing.metadata.EventingEpMetaExt;
-import org.jboss.ws.eventing.mgmt.SubscriptionManagerFactory;
-import org.jboss.ws.eventing.mgmt.SubscriptionManagerMBean;
-import org.jboss.ws.metadata.ServerEndpointMetaData;
+import org.jboss.ws.extras.eventing.EventingConstants;
+import org.jboss.ws.extras.eventing.metadata.EventingEpMetaExt;
+import org.jboss.ws.extras.eventing.mgmt.SubscriptionManagerFactory;
+import org.jboss.ws.extras.eventing.mgmt.SubscriptionManagerMBean;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
import org.jboss.ws.server.ServiceEndpoint;
import org.jboss.ws.server.ServiceEndpointInfo;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/deployment/EventingEndpointDI.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/deployment/EventingEndpointDI.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/deployment/EventingEndpointDI.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -1,4 +1,4 @@
-package org.jboss.ws.eventing.deployment;
+package org.jboss.ws.extras.eventing.deployment;
import org.jboss.ws.utils.DOMUtils;
import org.w3c.dom.Element;
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element (from
rev 1557, branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/element)
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/DeliveryType.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/element/DeliveryType.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/DeliveryType.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.element;
+package org.jboss.ws.extras.eventing.element;
// $Id$
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/EndpointReference.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/element/EndpointReference.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/EndpointReference.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,14 +19,14 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.element;
+package org.jboss.ws.extras.eventing.element;
// $Id$
import org.w3c.dom.Element;
-import org.jboss.ws.addressing.EndpointReferenceImpl;
import org.jboss.ws.soap.SOAPFactoryImpl;
-import org.jboss.ws.eventing.EventingConstants;
+import org.jboss.ws.extras.addressing.EndpointReferenceImpl;
+import org.jboss.ws.extras.eventing.EventingConstants;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPFactory;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/FilterType.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/element/FilterType.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/FilterType.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.element;
+package org.jboss.ws.extras.eventing.element;
// $Id$
@@ -36,7 +36,7 @@
* <br>
* For further information see
<
code>http://www.w3.org/TR/xpath#predicates</code>.
*
- * @see org.jboss.ws.eventing.mgmt.Filter
+ * @see org.jboss.ws.extras.eventing.mgmt.Filter
*
* @author Heiko Braun, <heiko(a)openj.net>
* @since 24-Nov-2005
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/MetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/element/MetaData.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/MetaData.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.element;
+package org.jboss.ws.extras.eventing.element;
// $Id$
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/ReferenceParameters.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/element/ReferenceParameters.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/ReferenceParameters.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.element;
+package org.jboss.ws.extras.eventing.element;
// $Id$
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/RenewRequest.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/element/RenewRequest.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/RenewRequest.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.element;
+package org.jboss.ws.extras.eventing.element;
// $Id$
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/RenewResponse.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/element/RenewResponse.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/RenewResponse.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.element;
+package org.jboss.ws.extras.eventing.element;
// $Id$
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/StatusRequest.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/element/StatusRequest.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/StatusRequest.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.element;
+package org.jboss.ws.extras.eventing.element;
import javax.xml.soap.SOAPElement;
// $Id$
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/StatusResponse.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/element/StatusResponse.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/StatusResponse.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.element;
+package org.jboss.ws.extras.eventing.element;
// $Id$
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/SubscribeRequest.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/element/SubscribeRequest.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/SubscribeRequest.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.element;
+package org.jboss.ws.extras.eventing.element;
// $Id$
@@ -49,7 +49,7 @@
this.endTo = endTo;
}
- public org.jboss.ws.eventing.element.DeliveryType getDelivery()
+ public org.jboss.ws.extras.eventing.element.DeliveryType getDelivery()
{
return delivery;
}
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/SubscribeResponse.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/element/SubscribeResponse.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/SubscribeResponse.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.element;
+package org.jboss.ws.extras.eventing.element;
// $Id$
@@ -31,7 +31,7 @@
*/
public class SubscribeResponse
{
- private org.jboss.ws.eventing.element.EndpointReference subscriptionManager;
+ private org.jboss.ws.extras.eventing.element.EndpointReference subscriptionManager;
private Date expires;
public EndpointReference getSubscriptionManager()
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/SubscriptionEndRequest.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/element/SubscriptionEndRequest.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/SubscriptionEndRequest.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,11 +19,11 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.element;
+package org.jboss.ws.extras.eventing.element;
// $Id$
-import org.jboss.ws.addressing.EndpointReferenceImpl;
+import org.jboss.ws.extras.addressing.EndpointReferenceImpl;
import java.net.URI;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/UnsubscribeRequest.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/element/UnsubscribeRequest.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/UnsubscribeRequest.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.element;
+package org.jboss.ws.extras.eventing.element;
// $Id$
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/metadata (from
rev 1557, branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/metadata)
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/metadata/EventingEpMetaExt.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/metadata/EventingEpMetaExt.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/metadata/EventingEpMetaExt.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -1,9 +1,9 @@
-package org.jboss.ws.eventing.metadata;
+package org.jboss.ws.extras.eventing.metadata;
import java.net.URI;
import java.net.URISyntaxException;
-import org.jboss.ws.metadata.MetaDataExtension;
+import org.jboss.ws.metadata.umdm.MetaDataExtension;
/**
* Eventing specific endpoint meta data extensions.
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt (from rev
1557, branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/mgmt)
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/DispatchJob.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/mgmt/DispatchJob.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/DispatchJob.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.mgmt;
+package org.jboss.ws.extras.eventing.mgmt;
// $Id$
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/DispatcherDelegate.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/mgmt/DispatcherDelegate.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/DispatcherDelegate.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -1,4 +1,4 @@
-package org.jboss.ws.eventing.mgmt;
+package org.jboss.ws.extras.eventing.mgmt;
import java.net.URI;
import java.util.Properties;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/DispatcherFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/mgmt/DispatcherFactory.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/DispatcherFactory.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -1,4 +1,4 @@
-package org.jboss.ws.eventing.mgmt;
+package org.jboss.ws.extras.eventing.mgmt;
import javax.naming.Context;
import javax.naming.Name;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/EventDispatcher.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/mgmt/EventDispatcher.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/EventDispatcher.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.mgmt;
+package org.jboss.ws.extras.eventing.mgmt;
// $Id$
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/EventSource.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/mgmt/EventSource.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/EventSource.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.mgmt;
+package org.jboss.ws.extras.eventing.mgmt;
// $Id$
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/EventingBuilder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/mgmt/EventingBuilder.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/EventingBuilder.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -1,8 +1,8 @@
-package org.jboss.ws.eventing.mgmt;
+package org.jboss.ws.extras.eventing.mgmt;
import org.jboss.ws.WSException;
-import org.jboss.ws.eventing.EventingConstants;
-import org.jboss.ws.eventing.deployment.EventingEndpointDI;
+import org.jboss.ws.extras.eventing.EventingConstants;
+import org.jboss.ws.extras.eventing.deployment.EventingEndpointDI;
import java.net.URI;
import java.net.URISyntaxException;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/Filter.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/mgmt/Filter.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/Filter.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.mgmt;
+package org.jboss.ws.extras.eventing.mgmt;
// $Id$
@@ -28,7 +28,7 @@
/**
* A local filter representation.
*
- * @see org.jboss.ws.eventing.element.FilterType
+ * @see org.jboss.ws.extras.eventing.element.FilterType
*
* @author Heiko Braun, <heiko(a)openj.net>
* @since 08-Dec-2005
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/Subscription.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/mgmt/Subscription.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/Subscription.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.mgmt;
+package org.jboss.ws.extras.eventing.mgmt;
// $Id$
@@ -27,8 +27,8 @@
import org.apache.xpath.objects.XObject;
import org.jboss.logging.Logger;
import org.jboss.ws.utils.DOMWriter;
-import org.jboss.ws.eventing.EventingConstants;
-import org.jboss.ws.eventing.element.EndpointReference;
+import org.jboss.ws.extras.eventing.EventingConstants;
+import org.jboss.ws.extras.eventing.element.EndpointReference;
import org.jboss.ws.soap.SOAPConnectionImpl;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/SubscriptionError.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/mgmt/SubscriptionError.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/SubscriptionError.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -1,4 +1,4 @@
-package org.jboss.ws.eventing.mgmt;
+package org.jboss.ws.extras.eventing.mgmt;
/**
* @author Heiko Braun, <heiko(a)openj.net>
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/SubscriptionManager.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/mgmt/SubscriptionManager.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/SubscriptionManager.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.mgmt;
+package org.jboss.ws.extras.eventing.mgmt;
// $Id$
@@ -45,10 +45,10 @@
import org.jboss.logging.Logger;
import org.jboss.util.naming.Util;
import org.jboss.ws.WSException;
-import org.jboss.ws.eventing.EventingConstants;
-import org.jboss.ws.eventing.deployment.EventingEndpointDI;
-import org.jboss.ws.eventing.element.EndpointReference;
-import org.jboss.ws.eventing.element.ReferenceParameters;
+import org.jboss.ws.extras.eventing.EventingConstants;
+import org.jboss.ws.extras.eventing.deployment.EventingEndpointDI;
+import org.jboss.ws.extras.eventing.element.EndpointReference;
+import org.jboss.ws.extras.eventing.element.ReferenceParameters;
import org.jboss.ws.utils.UUIDGenerator;
import org.jboss.ws.utils.ObjectNameFactory;
import org.w3c.dom.Element;
@@ -71,9 +71,9 @@
* <p>
* Currently only event push is supported.
*
- * @see org.jboss.ws.eventing.EventSourceEndpoint
- * @see org.jboss.ws.eventing.SubscriptionManagerEndpoint
- * @see org.jboss.ws.eventing.element.FilterType
+ * @see org.jboss.ws.extras.eventing.EventSourceEndpoint
+ * @see org.jboss.ws.extras.eventing.SubscriptionManagerEndpoint
+ * @see org.jboss.ws.extras.eventing.element.FilterType
*
* @author Heiko Braun, <heiko(a)openj.net>
* @since 02-Dec-2005
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/SubscriptionManagerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/mgmt/SubscriptionManagerFactory.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/SubscriptionManagerFactory.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -1,4 +1,4 @@
-package org.jboss.ws.eventing.mgmt;
+package org.jboss.ws.extras.eventing.mgmt;
import org.jboss.kernel.spi.registry.KernelRegistry;
import org.jboss.kernel.spi.registry.KernelRegistryEntry;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/SubscriptionManagerMBean.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/mgmt/SubscriptionManagerMBean.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/SubscriptionManagerMBean.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,15 +19,15 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.mgmt;
+package org.jboss.ws.extras.eventing.mgmt;
// $Id$
import java.net.URI;
import java.util.Date;
-import org.jboss.ws.eventing.deployment.EventingEndpointDI;
-import org.jboss.ws.eventing.element.EndpointReference;
+import org.jboss.ws.extras.eventing.deployment.EventingEndpointDI;
+import org.jboss.ws.extras.eventing.element.EndpointReference;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/SubscriptionTicket.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/eventing/mgmt/SubscriptionTicket.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/SubscriptionTicket.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,11 +19,11 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.mgmt;
+package org.jboss.ws.extras.eventing.mgmt;
// $Id$
-import org.jboss.ws.eventing.element.EndpointReference;
+import org.jboss.ws.extras.eventing.element.EndpointReference;
import java.net.URI;
import java.util.Date;
@@ -51,7 +51,7 @@
return identifier;
}
- public org.jboss.ws.eventing.element.EndpointReference getSubscriptionManager()
+ public org.jboss.ws.extras.eventing.element.EndpointReference
getSubscriptionManager()
{
return subscriptionManager;
}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/policy (from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wspolicy)
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/policy/Policy.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/wspolicy/Policy.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/policy/Policy.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wspolicy;
+package org.jboss.ws.extras.policy;
// $Id$
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/policy/PolicyAlternative.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wspolicy/PolicyAlternative.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/policy/PolicyAlternative.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wspolicy;
+package org.jboss.ws.extras.policy;
//$Id$
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/policy/PolicyAssertion.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wspolicy/PolicyAssertion.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/policy/PolicyAssertion.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wspolicy;
+package org.jboss.ws.extras.policy;
//$Id$
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/policy/PolicyFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wspolicy/PolicyFactory.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/policy/PolicyFactory.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wspolicy;
+package org.jboss.ws.extras.policy;
// $Id$
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/BinarySecurityTokenValidator.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/BinarySecurityTokenValidator.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/BinarySecurityTokenValidator.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/BinarySecurityTokenValidator.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,48 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.security;
+
+import org.jboss.ws.extras.security.element.BinarySecurityToken;
+import org.jboss.ws.extras.security.element.X509Token;
+
+
+/**
+ * <code>BinarySecurityTokenValidator</code> is responsible for validating
BSTs
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class BinarySecurityTokenValidator
+{
+ private SecurityStore store;
+
+ public BinarySecurityTokenValidator(SecurityStore store)
+ {
+ this.store = store;
+ }
+
+ public void validateToken(BinarySecurityToken token) throws WSSecurityException
+ {
+ if (token instanceof X509Token)
+ store.validateCertificate(((X509Token)token).getCert());
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/Constants.java
(from rev 1557, branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/Constants.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/Constants.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/Constants.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,70 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.security;
+
+import org.apache.xml.security.utils.EncryptionConstants;
+
+
+/**
+ * @author Jason T. Greene
+ * @version $Id$
+ */
+public class Constants
+{
+ public static final String WSS_SOAP_NS =
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0";
+
+ public static final String JBOSS_WSSE_NS =
"http://www.jboss.com/jbossws/ws-security";
+
+ public static final String JBOSS_WSSE_PREFIX = "jboss-wsse";
+
+ public static final String WSSE_PREFIX = "wsse";
+
+ public static final String WSSE_NS =
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
+
+ public static final String WSU_PREFIX = "wsu";
+
+ public static final String WSU_NS =
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
+
+ public static final String XML_SIGNATURE_NS =
org.apache.xml.security.utils.Constants.SignatureSpecNS;
+
+ public static final String XML_ENCRYPTION_NS = EncryptionConstants.EncryptionSpecNS;
+
+ public static final String XML_ENCRYPTION_PREFIX = "xenc";
+
+ public static final String ID = "Id";
+
+ public static final String WSU_ID = WSU_PREFIX + ":" + ID;
+
+ public static final String BASE64_ENCODING_TYPE = WSS_SOAP_NS +
"#Base64Binary";
+
+ public static final String WSSE_HEADER = WSSE_PREFIX + ":Security";
+
+ public static final String XMLNS_NS = "http://www.w3.org/2000/xmlns/";
+
+ public static final String XENC_DATAREFERENCE = "DataReference";
+
+ public static final String XENC_REFERENCELIST = "ReferenceList";
+
+ public static final String XENC_ELEMENT_TYPE = EncryptionConstants.TYPE_ELEMENT;
+
+ public static final String XENC_CONTENT_TYPE = EncryptionConstants.TYPE_CONTENT;
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/DecodingOperation.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/DecodingOperation.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/DecodingOperation.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/DecodingOperation.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,40 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.security;
+
+import java.util.Collection;
+
+import org.jboss.ws.extras.security.element.SecurityProcess;
+import org.w3c.dom.Document;
+
+/**
+ * <code>DecodingOperation</code> represents an operation that is applied to
a
+ * WS-Security encoded message to both convert and verify the contents of the
+ * message.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public interface DecodingOperation extends Operation
+{
+ public Collection<String> process(Document message, SecurityProcess process)
throws WSSecurityException;
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/DecryptionOperation.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/DecryptionOperation.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/DecryptionOperation.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/DecryptionOperation.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,145 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.security;
+
+import java.util.Collection;
+import java.util.HashSet;
+
+import javax.crypto.SecretKey;
+
+import org.apache.xml.security.encryption.XMLCipher;
+import org.apache.xml.security.encryption.XMLEncryptionException;
+import org.jboss.ws.extras.security.element.EncryptedKey;
+import org.jboss.ws.extras.security.element.ReferenceList;
+import org.jboss.ws.extras.security.element.SecurityHeader;
+import org.jboss.ws.extras.security.element.SecurityProcess;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+public class DecryptionOperation implements DecodingOperation
+{
+
+ private SecurityHeader header;
+
+ private SecurityStore store;
+
+ public DecryptionOperation(SecurityHeader header, SecurityStore store) throws
WSSecurityException
+ {
+ this.header = header;
+ this.store = store;
+ }
+
+ private boolean isContent(Element element)
+ {
+ return Constants.XENC_CONTENT_TYPE.equals(element.getAttribute("Type"));
+ }
+
+ private String getEncryptionAlgorithm(Element element) throws WSSecurityException
+ {
+ element = Util.findElement(element, "EncryptionMethod",
Constants.XML_ENCRYPTION_NS);
+ if (element == null)
+ throw new InvalidSecurityHeaderException("Encrypted element corrupted, no
encryption method");
+
+ String alg = element.getAttribute("Algorithm");
+ if (alg == null || alg.length() == 0)
+ throw new InvalidSecurityHeaderException("Encrypted element corrupted, no
algorithm specified");
+
+ return alg;
+ }
+
+ private String decryptElement(Element element, SecretKey key) throws
WSSecurityException
+ {
+ Element previous;
+ boolean parent;
+ boolean isContent;
+
+ // We find the decrypted element by traversing to the element before the
+ // encrypted data. If there is no sibling before the encrypted data, then
+ // we traverse to the parent.
+ // "Now take a step back . . . and then a step forward . . . and then a
+ // step back . . . and then we're cha-chaing." -Chris Knight
+ parent = isContent = isContent(element);
+ if (parent)
+ {
+ previous = (Element) element.getParentNode();
+ }
+ else
+ {
+ previous = Util.getPreviousSiblingElement(element);
+ if (previous == null)
+ {
+ parent = true;
+ previous = (Element) element.getParentNode();
+ }
+ }
+
+ String alg = getEncryptionAlgorithm(element);
+ try
+ {
+ XMLCipher cipher = XMLCipher.getInstance(alg);
+ cipher.init(XMLCipher.DECRYPT_MODE, key);
+ cipher.doFinal(element.getOwnerDocument(), element);
+ }
+ catch (XMLEncryptionException e)
+ {
+ throw new FailedCheckException("Decryption was invalid.");
+ }
+ catch (Exception e)
+ {
+ throw new WSSecurityException("Could not decrypt element: " +
e.getMessage(), e);
+ }
+
+ if (isContent)
+ return Util.getWsuId(previous);
+
+ Element decrypted = (parent) ? Util.getFirstChildElement(previous) :
Util.getNextSiblingElement(previous);
+ if (decrypted == null)
+ return null;
+
+ return Util.getWsuId(decrypted);
+ }
+
+ private boolean isEncryptedData(Element element)
+ {
+ return "EncryptedData".equals(element.getLocalName()) &&
Constants.XML_ENCRYPTION_NS.equals(element.getNamespaceURI());
+ }
+
+ public Collection<String> process(Document message, SecurityProcess process)
throws WSSecurityException
+ {
+ Collection<String> ids = new HashSet<String>();
+ EncryptedKey key = (EncryptedKey) process;
+ ReferenceList list = key.getReferenceList();
+ for (String uri : list.getAllReferences())
+ {
+ Element element = Util.findElementByWsuId(message.getDocumentElement(), uri);
+ if (element == null)
+ throw new WSSecurityException("A reference list refered to an element
that was not found: " + uri);
+
+ if (!isEncryptedData(element))
+ throw new WSSecurityException("Malformed reference list, a non encrypted
data element was referenced: " + uri);
+
+ ids.add(decryptElement(element, key.getSecretKey()));
+ }
+
+ return ids;
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/EncodingOperation.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/EncodingOperation.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/EncodingOperation.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/EncodingOperation.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,39 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.security;
+
+import java.util.List;
+
+import org.w3c.dom.Document;
+
+/**
+ * <code>EncodingOperation</code> represents an encoding operation that is
+ * applied to a standard SOAP message, transforming it into a WS-Security
+ * encoded message.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public interface EncodingOperation extends Operation
+{
+ public void process(Document message, List<Target> targets, String alias, String
credential, String algorithm) throws WSSecurityException;
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/EncryptionOperation.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/EncryptionOperation.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/EncryptionOperation.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/EncryptionOperation.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,172 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.security;
+
+import java.security.NoSuchAlgorithmException;
+import java.security.cert.X509Certificate;
+import java.util.HashMap;
+import java.util.List;
+
+import javax.crypto.KeyGenerator;
+import javax.crypto.SecretKey;
+import javax.xml.namespace.QName;
+
+import org.apache.xml.security.encryption.EncryptedData;
+import org.apache.xml.security.encryption.XMLCipher;
+import org.apache.xml.security.exceptions.XMLSecurityException;
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.extras.security.element.EncryptedKey;
+import org.jboss.ws.extras.security.element.ReferenceList;
+import org.jboss.ws.extras.security.element.SecurityHeader;
+import org.jboss.ws.extras.security.element.X509Token;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+public class EncryptionOperation implements EncodingOperation
+{
+ private SecurityHeader header;
+
+ private SecurityStore store;
+
+ private static class Algorithm
+ {
+ Algorithm(String jceName, String xmlName, int size)
+ {
+ this.jceName = jceName;
+ this.xmlName = xmlName;
+ this.size = size;
+ }
+
+ public String jceName;
+ public String xmlName;
+ public int size;
+ }
+
+ private static HashMap<String, Algorithm> algorithms;
+
+ private static final String DEFAULT_ALGORITHM = "aes-128";
+
+ static
+ {
+ algorithms = new HashMap<String, Algorithm>(4);
+ algorithms.put("aes-128", new Algorithm("AES",
XMLCipher.AES_128, 128));
+ algorithms.put("aes-192", new Algorithm("AES",
XMLCipher.AES_192, 192));
+ algorithms.put("aes-256", new Algorithm("AES",
XMLCipher.AES_256, 256));
+ algorithms.put("tripledes", new Algorithm("TripleDes",
XMLCipher.TRIPLEDES, 168));
+ }
+
+ public EncryptionOperation(SecurityHeader header, SecurityStore store) throws
WSSecurityException
+ {
+ this.header = header;
+ this.store = store;
+ }
+
+ private void processTarget(XMLCipher cipher, Document message, Target target,
ReferenceList list, SecretKey key) throws WSSecurityException
+ {
+ if (!(target instanceof QNameTarget))
+ throw new NotImplementedException();
+
+ QName name = ((QNameTarget)target).getName();
+
+ Element element = Util.findElement(message.getDocumentElement(), name);
+ if (element == null)
+ throw new RuntimeException("Could not find element");
+
+ // Ensure that the element has an id, so that encryption verification can be
performed
+ Util.assignWsuId(element);
+
+ try
+ {
+ cipher.init(XMLCipher.ENCRYPT_MODE, key);
+ EncryptedData encrypted = cipher.getEncryptedData();
+ String id = Util.generateId("encrypted");
+ encrypted.setId(id);
+ list.add(id);
+ cipher.doFinal(message, element, target.isContent());
+ }
+ catch (Exception e)
+ {
+ throw new WSSecurityException("Error encrypting target: " + name, e);
+ }
+ }
+
+ public SecretKey getSecretKey(String algorithm) throws WSSecurityException
+ {
+ Algorithm alg = algorithms.get(algorithm);
+
+ try
+ {
+ KeyGenerator kgen = KeyGenerator.getInstance(alg.jceName);
+ kgen.init(alg.size);
+ return kgen.generateKey();
+ }
+ catch (NoSuchAlgorithmException e)
+ {
+ throw new WSSecurityException(e.getMessage());
+ }
+ }
+
+ public void process(Document message, List<Target> targets, String alias, String
credential, String algorithm) throws WSSecurityException
+ {
+ if (! algorithms.containsKey(algorithm))
+ algorithm = DEFAULT_ALGORITHM;
+
+ SecretKey secretKey = getSecretKey(algorithm);
+ XMLCipher cipher;
+ try
+ {
+ cipher = XMLCipher.getInstance(algorithms.get(algorithm).xmlName);
+ cipher.init(XMLCipher.ENCRYPT_MODE, secretKey);
+ }
+ catch (XMLSecurityException e)
+ {
+ throw new WSSecurityException("Error initializing xml cipher" +
e.getMessage(), e);
+ }
+
+ ReferenceList list = new ReferenceList();
+
+ if (targets == null || targets.size() == 0)
+ {
+ // By default we encrypt the content of the body element
+ String namespace = message.getDocumentElement().getNamespaceURI();
+ processTarget(cipher, message, new QNameTarget(new QName(namespace,
"Body"), true), list, secretKey);
+ }
+ else
+ {
+ for (Target target : targets)
+ processTarget(cipher, message, target, list, secretKey);
+ }
+
+ X509Certificate cert = store.getCertificate(alias);
+ X509Token token = (X509Token) header.getSharedToken(cert);
+
+ // Can we reuse an existing token?
+ if (token == null)
+ {
+ token = new X509Token(cert, message);
+ header.addToken(token);
+ }
+
+ EncryptedKey eKey = new EncryptedKey(message, secretKey, token, list);
+ header.addSecurityProcess(eKey);
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/FailedAuthenticationException.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/FailedAuthenticationException.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/FailedAuthenticationException.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/FailedAuthenticationException.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,64 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.security;
+
+import javax.xml.namespace.QName;
+
+
+/**
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class FailedAuthenticationException extends WSSecurityException
+{
+ public static final QName faultCode = new QName(Constants.WSSE_NS,
"FailedAuthentication", Constants.WSSE_PREFIX);
+
+ public static final String faultString = "The security token could not be
authenticated or authorized.";
+
+ public FailedAuthenticationException()
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public FailedAuthenticationException(Throwable cause)
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public FailedAuthenticationException(String message)
+ {
+ super(message);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+
+ public FailedAuthenticationException(String message, Throwable cause)
+ {
+ super(message, cause);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/FailedCheckException.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/FailedCheckException.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/FailedCheckException.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/FailedCheckException.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,64 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.security;
+
+import javax.xml.namespace.QName;
+
+
+/**
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class FailedCheckException extends WSSecurityException
+{
+ public static final QName faultCode = new QName(Constants.WSSE_NS,
"FailedCheck", Constants.WSSE_PREFIX);
+
+ public static final String faultString = "The signature or decryption was
invlaid.";
+
+ public FailedCheckException()
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public FailedCheckException(Throwable cause)
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public FailedCheckException(String message)
+ {
+ super(message);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+
+ public FailedCheckException(String message, Throwable cause)
+ {
+ super(message, cause);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/InvalidSecurityHeaderException.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/InvalidSecurityHeaderException.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/InvalidSecurityHeaderException.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/InvalidSecurityHeaderException.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,64 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.security;
+
+import javax.xml.namespace.QName;
+
+
+/**
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class InvalidSecurityHeaderException extends WSSecurityException
+{
+ public static final QName faultCode = new QName(Constants.WSSE_NS,
"InvalidSecurity", Constants.WSSE_PREFIX);
+
+ public static final String faultString = "An error was dicovered processing the
<wsse:Security> header.";
+
+ public InvalidSecurityHeaderException()
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public InvalidSecurityHeaderException(Throwable cause)
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public InvalidSecurityHeaderException(String message)
+ {
+ super(message);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+
+ public InvalidSecurityHeaderException(String message, Throwable cause)
+ {
+ super(message, cause);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/InvalidSecurityTokenException.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/InvalidSecurityTokenException.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/InvalidSecurityTokenException.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/InvalidSecurityTokenException.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,64 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.security;
+
+import javax.xml.namespace.QName;
+
+
+/**
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class InvalidSecurityTokenException extends WSSecurityException
+{
+ public static final QName faultCode = new QName(Constants.WSSE_NS,
"InvlalidSecurityToken", Constants.WSSE_PREFIX);
+
+ public static final String faultString = "An invlaid security token was
provided.";
+
+ public InvalidSecurityTokenException()
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public InvalidSecurityTokenException(Throwable cause)
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public InvalidSecurityTokenException(String message)
+ {
+ super(message);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+
+ public InvalidSecurityTokenException(String message, Throwable cause)
+ {
+ super(message, cause);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/KeyResolver.java (from
rev 1557, branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/KeyResolver.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/KeyResolver.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/KeyResolver.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,166 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.security;
+
+import java.security.PrivateKey;
+import java.security.PublicKey;
+import java.security.cert.X509Certificate;
+import java.util.HashMap;
+
+import org.apache.xml.security.keys.KeyInfo;
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.extras.security.element.BinarySecurityToken;
+import org.jboss.ws.extras.security.element.DirectReference;
+import org.jboss.ws.extras.security.element.KeyIdentifier;
+import org.jboss.ws.extras.security.element.Reference;
+import org.jboss.ws.extras.security.element.SecurityTokenReference;
+import org.jboss.ws.extras.security.element.X509IssuerSerial;
+import org.jboss.ws.extras.security.element.X509Token;
+import org.w3c.dom.Element;
+
+
+/**
+ * <code>KeyResolver</code> is responsible for locating security tokens
+ * within a WS-Security message.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class KeyResolver
+{
+ private HashMap<String, BinarySecurityToken> tokenCache = new HashMap<String,
BinarySecurityToken>();
+
+ private SecurityStore store;
+
+ public KeyResolver(SecurityStore store)
+ {
+ this.store = store;
+ }
+
+ private SecurityTokenReference extractSecurityTokenReference(KeyInfo info) throws
WSSecurityException
+ {
+ Element child = Util.getFirstChildElement(info.getElement());
+ if (child == null)
+ throw new WSSecurityException("Empty KeyInfo");
+
+ if (! child.getLocalName().equals("SecurityTokenReference"))
+ throw new WSSecurityException("KeyInfo did not contain expected
SecurityTokenReference, instead got: " + child.getLocalName());
+
+ return new SecurityTokenReference(child);
+ }
+
+ public void cacheToken(BinarySecurityToken token)
+ {
+ tokenCache.put(token.getId(), token);
+ }
+
+ public BinarySecurityToken resolve(SecurityTokenReference reference) throws
WSSecurityException
+ {
+ Reference ref = reference.getReference();
+ if (ref instanceof DirectReference)
+ {
+ DirectReference direct = (DirectReference) ref;
+ return resolveDirectReference(direct);
+ }
+ else if (ref instanceof KeyIdentifier)
+ {
+ KeyIdentifier identifier = (KeyIdentifier) ref;
+ return resolveKeyIdentifier(identifier);
+ }
+ else if (ref instanceof X509IssuerSerial)
+ {
+ X509IssuerSerial issuerSerial = (X509IssuerSerial) ref;
+ return resolveX509IssuerSerial(issuerSerial);
+ }
+
+ throw new NotImplementedException("Currently only DirectReference is
supported!");
+ }
+
+ private BinarySecurityToken resolveDirectReference(DirectReference direct) throws
WSSecurityException
+ {
+ String id = direct.getUri().substring(1);
+
+ BinarySecurityToken token = tokenCache.get(id);
+ if (token == null)
+ throw new SecurityTokenUnavailableException("Could not resolve token id:
" + id);
+
+ return token;
+ }
+
+ private BinarySecurityToken resolveKeyIdentifier(KeyIdentifier identifier) throws
WSSecurityException
+ {
+ // Support only SKI at the moment
+ X509Certificate cert =
store.getCertificateBySubjectKeyIdentifier(identifier.getIdentifier());
+ if (cert == null)
+ throw new SecurityTokenUnavailableException("Could not locate certificate
by key identifier");
+ return new X509Token(cert, identifier.getDocument());
+ }
+
+ private BinarySecurityToken resolveX509IssuerSerial(X509IssuerSerial issuerSerial)
throws WSSecurityException
+ {
+ X509Certificate cert = store.getCertificateByIssuerSerial(issuerSerial.getIssuer(),
issuerSerial.getSerial());
+ if (cert == null)
+ throw new SecurityTokenUnavailableException("Could not locate certificate by
issuer and serial number");
+
+ return new X509Token(cert, issuerSerial.getDocument());
+ }
+
+ public X509Certificate resolveCertificate(SecurityTokenReference reference) throws
WSSecurityException
+ {
+ BinarySecurityToken token = resolve(reference);
+
+ if (! (token instanceof X509Token))
+ throw new WSSecurityException("Expected X509Token, cache contained: "
+ token.getClass().getName());
+
+ return ((X509Token)token).getCert();
+ }
+
+ public PublicKey resolvePublicKey(SecurityTokenReference reference) throws
WSSecurityException
+ {
+ return resolveCertificate(reference).getPublicKey();
+ }
+
+ public PrivateKey resolvePrivateKey(SecurityTokenReference reference) throws
WSSecurityException
+ {
+ return store.getPrivateKey(resolveCertificate(reference));
+ }
+
+ public BinarySecurityToken resolve(KeyInfo info) throws WSSecurityException
+ {
+ return resolve(extractSecurityTokenReference(info));
+ }
+
+ public X509Certificate resolveCertificate(KeyInfo info) throws WSSecurityException
+ {
+ return resolveCertificate(extractSecurityTokenReference(info));
+ }
+
+ public PublicKey resolvePublicKey(KeyInfo info) throws WSSecurityException
+ {
+ return resolvePublicKey(extractSecurityTokenReference(info));
+ }
+
+ public PrivateKey resolvePrivateKey(KeyInfo info) throws WSSecurityException
+ {
+ return resolvePrivateKey(extractSecurityTokenReference(info));
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/Operation.java
(from rev 1557, branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/Operation.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/Operation.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/Operation.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,33 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.security;
+
+/**
+ * Marker interface for all WS-Security operations
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public interface Operation
+{
+
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/OperationDescription.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/OperationDescription.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/OperationDescription.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/OperationDescription.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,105 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.security;
+
+import java.util.List;
+
+
+/**
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class OperationDescription<T extends Operation>
+{
+ private Class<? extends T> operation;
+
+ private List<Target> targets;
+
+ private String certificateAlias;
+
+ private String credential;
+
+ private String algorithm;
+
+ public OperationDescription(Class<? extends T> operation, List<Target>
targets, String certicateAlias, String credential, String algorithm)
+ {
+ this.operation = operation;
+ this.targets = targets;
+ this.certificateAlias = certicateAlias;
+ this.credential = credential;
+ this.algorithm = algorithm;
+ }
+
+ public Class<? extends T> getOperation()
+ {
+ return operation;
+ }
+
+ public void setOperation(Class<? extends T> operation)
+ {
+ this.operation = operation;
+ }
+
+ public List<Target> getTargets()
+ {
+ return targets;
+ }
+
+ public void setTargets(List<Target> targets)
+ {
+ this.targets = targets;
+ }
+
+
+ public String getCertificateAlias()
+ {
+ return certificateAlias;
+ }
+
+
+ public void setCertificateAlias(String certificateAlias)
+ {
+ this.certificateAlias = certificateAlias;
+ }
+
+
+ public String getCredential()
+ {
+ return credential;
+ }
+
+ public void setCredential(String credential)
+ {
+ this.credential = credential;
+ }
+
+ public String getAlgorithm()
+ {
+ return algorithm;
+ }
+
+ public void setAlgorithm(String algorithm)
+ {
+ this.algorithm = algorithm;
+ }
+
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/QNameTarget.java (from
rev 1557, branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/QNameTarget.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/QNameTarget.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/QNameTarget.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,59 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.security;
+
+import javax.xml.namespace.QName;
+
+
+
+/**
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class QNameTarget extends Target
+{
+ private QName name;
+
+ private boolean content;
+
+ public QNameTarget(QName name)
+ {
+ this.name = name;
+ this.content = false;
+ }
+
+ public QNameTarget(QName name, boolean content)
+ {
+ this(name);
+ this.content = content;
+ }
+
+ public QName getName()
+ {
+ return name;
+ }
+
+ public boolean isContent()
+ {
+ return content;
+ }
+}
\ No newline at end of file
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/ReceiveUsernameOperation.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/ReceiveUsernameOperation.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/ReceiveUsernameOperation.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/ReceiveUsernameOperation.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extras.security;
+
+import org.jboss.ws.extras.security.element.SecurityHeader;
+import org.jboss.ws.extras.security.element.Token;
+import org.jboss.ws.extras.security.element.UsernameToken;
+import org.w3c.dom.Document;
+
+public class ReceiveUsernameOperation implements TokenOperation
+{
+ private SecurityHeader header;
+
+ private SecurityStore store;
+
+ public ReceiveUsernameOperation(SecurityHeader header, SecurityStore store)
+ {
+ this.header = header;
+ this.store = store;
+ }
+
+ public void process(Document message, Token token) throws WSSecurityException
+ {
+ UsernameToken user = (UsernameToken)token;
+
+ SecurityAdaptorFactory factory = SecurityAdaptorFactory.getInstance();
+ SecurityAdaptor securityAdaptor = factory.getSecurityAdaptor();
+ securityAdaptor.setPrincipal(new SimplePrincipal(user.getUsername()));
+ securityAdaptor.setCredential(user.getPassword());
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/RequireEncryptionOperation.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/RequireEncryptionOperation.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/RequireEncryptionOperation.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/RequireEncryptionOperation.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,33 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.security;
+
+import org.jboss.ws.extras.security.element.SecurityHeader;
+
+
+public class RequireEncryptionOperation extends RequireTargetableOperation
+{
+ public RequireEncryptionOperation(SecurityHeader header, SecurityStore store) throws
WSSecurityException
+ {
+ super(header, store);
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/RequireOperation.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/RequireOperation.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/RequireOperation.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/RequireOperation.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,38 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.security;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.w3c.dom.Document;
+
+/**
+ * Marker interface for all requirement based WS-Security operations.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public interface RequireOperation extends Operation
+{
+ public void process(Document message, List<Target> targets, String alias, String
credential, Collection<String> processedIds) throws WSSecurityException;
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/RequireSignatureOperation.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/RequireSignatureOperation.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/RequireSignatureOperation.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/RequireSignatureOperation.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,33 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.security;
+
+import org.jboss.ws.extras.security.element.SecurityHeader;
+
+
+public class RequireSignatureOperation extends RequireTargetableOperation
+{
+ public RequireSignatureOperation(SecurityHeader header, SecurityStore store) throws
WSSecurityException
+ {
+ super(header, store);
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/RequireTargetableOperation.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/RequireTargetableOperation.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/RequireTargetableOperation.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/RequireTargetableOperation.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,90 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.security;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.ws.extras.security.element.SecurityHeader;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+public class RequireTargetableOperation implements RequireOperation
+{
+ public RequireTargetableOperation(SecurityHeader header, SecurityStore store) throws
WSSecurityException
+ {
+ }
+
+ private Collection<String> resolveTarget(Document message, Target target) throws
WSSecurityException
+ {
+ if (target instanceof QNameTarget)
+ return resolveQNameTarget(message, (QNameTarget) target);
+ else if (target instanceof WsuIdTarget)
+ {
+ Collection<String> result = new ArrayList<String>(1);
+ result.add(((WsuIdTarget)target).getId());
+ return result;
+ }
+
+ throw new WSSecurityException("Unknown target");
+ }
+
+ private Collection<String> resolveQNameTarget(Document message, QNameTarget
target) throws WSSecurityException
+ {
+ QName name = target.getName();
+
+ Element element = Util.findElement(message.getDocumentElement(), name);
+ if (element == null)
+ throw new FailedCheckException("Required QName was not present: " +
name);
+
+ String id = Util.getWsuId(element);
+
+ if (id == null)
+ throw new FailedCheckException("Required element did not contain a
wsu:id.");
+
+ Collection<String> result = new ArrayList<String>(1);
+ result.add(id);
+
+ return result;
+ }
+
+ public void process(Document message, List<Target> targets, String alias, String
credential, Collection<String> processedIds) throws WSSecurityException
+ {
+ if (targets == null || targets.size() == 0)
+ {
+ // By default we require just the body element
+ String namespace = message.getDocumentElement().getNamespaceURI();
+ targets = new ArrayList<Target>(1);
+ targets.add(new QNameTarget(new QName(namespace, "Body"), true));
+ }
+
+ for (Target target : targets)
+ {
+ Collection<String> ids = resolveTarget(message, target);
+ if (! processedIds.containsAll(ids))
+ throw new FailedCheckException("Required elements for encryption and or
signing are not all present.");
+ }
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/RequireTimestampOperation.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/RequireTimestampOperation.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/RequireTimestampOperation.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/RequireTimestampOperation.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,60 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.security;
+
+import java.util.Calendar;
+import java.util.Collection;
+import java.util.List;
+
+import org.jboss.ws.extras.security.element.SecurityHeader;
+import org.jboss.ws.extras.security.element.Timestamp;
+import org.w3c.dom.Document;
+
+
+public class RequireTimestampOperation implements RequireOperation
+{
+ private SecurityHeader header;
+
+ public RequireTimestampOperation(SecurityHeader header, SecurityStore store) throws
WSSecurityException
+ {
+ this.header = header;
+ }
+
+ public void process(Document message, List<Target> targets, String maxAge,
String credential, Collection<String> processedIds) throws WSSecurityException
+ {
+ Timestamp stamp = header.getTimestamp();
+ if (stamp == null)
+ throw new FailedCheckException("Required timestamp not present.");
+
+ // If there is no maxAge specified then we are done
+ if (maxAge == null)
+ return;
+
+ int max = Integer.parseInt(maxAge);
+
+ Calendar expired = (Calendar)stamp.getCreated().clone();
+ expired.add(Calendar.SECOND, max);
+
+ if (! Calendar.getInstance().before(expired))
+ throw new FailedCheckException("Timestamp of message is too old.");
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/STRTransform.java (from
rev 1557, branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/STRTransform.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/STRTransform.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/STRTransform.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,173 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.security;
+
+import java.io.IOException;
+
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.apache.xml.security.c14n.CanonicalizationException;
+import org.apache.xml.security.c14n.Canonicalizer;
+import org.apache.xml.security.c14n.InvalidCanonicalizerException;
+import org.apache.xml.security.signature.XMLSignatureInput;
+import org.apache.xml.security.transforms.Transform;
+import org.apache.xml.security.transforms.TransformSpi;
+import org.apache.xml.security.transforms.TransformationException;
+import org.apache.xml.security.utils.XMLUtils;
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.WSException;
+import org.jboss.ws.extras.security.element.BinarySecurityToken;
+import org.jboss.ws.extras.security.element.SecurityTokenReference;
+import org.jboss.ws.utils.ThreadLocalAssociation;
+import org.w3c.dom.Element;
+import org.xml.sax.SAXException;
+
+
+/**
+ * <code>STRTransform</code> implements the STR-Transform specified in the
+ * WS-Security specification. This class dynamically registers itself with
+ * XML Security on its first load (using a static initializer).
+ *
+ * You must call the static yet thread safe setSecurityStore() before use of
+ * this class.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class STRTransform extends TransformSpi
+{
+ public static final String STR_URI =
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#STR-Transform";
+
+ static
+ {
+ try
+ {
+ Transform.register(STR_URI, STRTransform.class.getName());
+ }
+ catch (Exception e)
+ {
+ // Eat
+ }
+ }
+
+ private String canonicalize(Element element, Element method) throws
TransformationException, InvalidCanonicalizerException, CanonicalizationException
+ {
+ if (method == null || !
method.getLocalName().equals("CanonicalizationMethod"))
+ throw new TransformationException("CanonicalizationMethod
expected!");
+
+ String algorithm = method.getAttribute("Algorithm");
+ if (algorithm == null || algorithm.length() == 0)
+ throw new TransformationException("CanonicalizationMethod missing
algorithm!");
+
+ Canonicalizer canon = Canonicalizer.getInstance(algorithm);
+
+ return new String(canon.canonicalizeSubtree(element, "#default"));
+ }
+
+ @Override
+ protected String engineGetURI()
+ {
+ return STR_URI;
+ }
+
+
+ @Override
+ protected XMLSignatureInput enginePerformTransform(XMLSignatureInput input) throws
IOException, CanonicalizationException,
+ InvalidCanonicalizerException, TransformationException,
ParserConfigurationException, SAXException
+ {
+
+ SecurityStore store = ThreadLocalAssociation.localStrTransformAssoc().get();
+
+ if (store == null)
+ throw new WSException("SecurityStore Thread Local not initialized before
call!");
+
+ try
+ {
+ if (! input.isElement())
+ throw new NotImplementedException("Only element input is
supported");
+
+ // Resolve the BinarySecurityToken associated with this SecurityTokenReference
+ Element element = (Element)input.getSubNode();
+ SecurityTokenReference ref = new SecurityTokenReference(element);
+ KeyResolver resolver = new KeyResolver(store);
+ BinarySecurityToken token = resolver.resolve(ref);
+
+ // Get the specially formated dom element for this element
+ element = token.getSTRTransformElement();
+
+ // Obtain the canonicalizer specified in the transformation parameters
+ Element parameters =
XMLUtils.selectNode(this._transformObject.getElement().getFirstChild(),
Constants.WSSE_NS,
+ "TransformationParameters", 0);
+ if (parameters == null)
+ throw new TransformationException("wsse:TransformationParameters
expected!");
+
+ Element method = Util.getFirstChildElement(parameters);
+ String transformed = canonicalize(element, method);
+
+ // Now WS-Security says we must augment the transformed output to ensure that
there is
+ // a default namespace
+ int startTag = transformed.indexOf('<');
+ int endTag = transformed.indexOf('>', startTag + 1);
+ String within = transformed.substring(startTag + 1, endTag);
+ if (! within.contains("xmlns="))
+ {
+ int insPos = within.indexOf(" ") + startTag + 1;
+ transformed = new StringBuilder(transformed).insert(insPos, "
xmlns=\"\"").toString();
+ }
+
+ return new XMLSignatureInput(transformed.getBytes());
+ }
+ catch (WSSecurityException e)
+ {
+ throw new TransformationException(e.getMessage(), e);
+ }
+ finally
+ {
+ ThreadLocalAssociation.localStrTransformAssoc().set(null);
+ }
+ }
+
+ public static void setSecurityStore(SecurityStore store)
+ {
+ ThreadLocalAssociation.localStrTransformAssoc().set(store);
+ }
+
+ public boolean wantsOctetStream()
+ {
+ return false;
+ }
+
+ public boolean wantsNodeSet()
+ {
+ return false;
+ }
+
+ public boolean returnsOctetStream()
+ {
+ return false;
+ }
+
+ public boolean returnsNodeSet()
+ {
+ return false;
+ }
+}
\ No newline at end of file
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/SecurityAdaptor.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/SecurityAdaptor.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/SecurityAdaptor.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/SecurityAdaptor.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,38 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.security;
+
+// $Id$
+
+import java.security.Principal;
+
+/**
+ * A container idependent security adaptor
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-May-2005
+ */
+public interface SecurityAdaptor
+{
+ void setPrincipal(Principal pricipal);
+ void setCredential(Object credential);
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/SecurityAdaptorFactory.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/SecurityAdaptorFactory.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/SecurityAdaptorFactory.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/SecurityAdaptorFactory.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extras.security;
+
+//$Id$
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+
+/**
+ * A container idependent security adaptor factory
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-May-2005
+ */
+public class SecurityAdaptorFactory
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(SecurityAdaptorFactory.class);
+
+ public static final String DEFAULT_FACTORY =
"org.jboss.ws.integration.SecurityAdaptorFactoryImpl";
+
+ private static SecurityAdaptorFactory delegate;
+
+ public static SecurityAdaptorFactory getInstance()
+ {
+ if (delegate == null)
+ {
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+ try
+ {
+ Class factoryClass = ctxLoader.loadClass(DEFAULT_FACTORY);
+ delegate = (SecurityAdaptorFactory)factoryClass.newInstance();
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception e)
+ {
+ throw new WSException("Cannot load: " + DEFAULT_FACTORY, e);
+ }
+ }
+ return delegate;
+ }
+
+ public SecurityAdaptor getSecurityAdaptor()
+ {
+ return delegate.getSecurityAdaptor();
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/SecurityDecoder.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/SecurityDecoder.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/SecurityDecoder.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/SecurityDecoder.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,194 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.security;
+
+import java.lang.reflect.Constructor;
+import java.util.Calendar;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+
+import org.jboss.ws.extras.security.element.EncryptedKey;
+import org.jboss.ws.extras.security.element.SecurityHeader;
+import org.jboss.ws.extras.security.element.SecurityProcess;
+import org.jboss.ws.extras.security.element.Signature;
+import org.jboss.ws.extras.security.element.Timestamp;
+import org.jboss.ws.extras.security.element.Token;
+import org.jboss.ws.extras.security.element.UsernameToken;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class SecurityDecoder
+{
+ private Element headerElement;
+
+ private Calendar now = null;
+
+ private SecurityHeader header;
+
+ private Document message;
+
+ private SecurityStore store;
+
+ private HashSet<String> signedIds = new HashSet<String>();
+
+ private HashSet<String> encryptedIds = new HashSet<String>();
+
+ public SecurityDecoder(SecurityStore store)
+ {
+ org.apache.xml.security.Init.init();
+ this.store = store;
+ }
+
+ /**
+ * A special constructor that allows you to use a different value when validating the
message.
+ * DO NOT USE THIS UNLESS YOU REALLY KNOW WHAT YOU ARE DOING!.
+ *
+ * @param SecurityStore the security store that contains key and trust information
+ * @param now The timestamp to use as the current time when validating a message
expiration
+ */
+ public SecurityDecoder(SecurityStore store, Calendar now)
+ {
+ this(store);
+ this.now = now;
+ }
+
+ private Element getHeader(Document message) throws WSSecurityException
+ {
+ Element header = Util.findElement(message.getDocumentElement(),
"Security", Constants.WSSE_NS);
+ if (header == null)
+ throw new WSSecurityException("Expected security header was not
found");
+
+ return header;
+ }
+
+ private void detachHeader()
+ {
+ headerElement.getParentNode().removeChild(headerElement);
+ }
+
+
+ private void decode() throws WSSecurityException
+ {
+ // Validate a timestamp if it is present
+ Timestamp timestamp = header.getTimestamp();
+
+ if (timestamp != null)
+ {
+ TimestampVerificationOperation operation =
+ (now == null) ? new TimestampVerificationOperation() : new
TimestampVerificationOperation(now);
+ operation.process(message, timestamp);
+ }
+
+ for (Token token : header.getTokens())
+ {
+ if (token instanceof UsernameToken)
+ new ReceiveUsernameOperation(header, store).process(message, token);
+ }
+
+ signedIds.clear();
+ encryptedIds.clear();
+
+ SignatureVerificationOperation signatureVerifier = new
SignatureVerificationOperation(header, store);
+ DecryptionOperation decrypter = new DecryptionOperation(header, store);
+
+ for (SecurityProcess process : header.getSecurityProcesses())
+ {
+ // If this list gets much larger it should probably be a hash lookup
+ if (process instanceof Signature)
+ {
+ Collection<String> ids = signatureVerifier.process(message, process);
+ if (ids != null)
+ signedIds.addAll(ids);
+ }
+ else if (process instanceof EncryptedKey)
+ {
+ Collection<String> ids = decrypter.process(message, process);
+ if (ids != null)
+ encryptedIds.addAll(ids);
+ }
+ }
+ }
+
+ public void verify(List<OperationDescription<RequireOperation>>
requireOperations) throws WSSecurityException
+ {
+ if (requireOperations == null)
+ return;
+
+ for (OperationDescription<RequireOperation> o : requireOperations)
+ {
+ Class<? extends RequireOperation> operation = o.getOperation();
+ RequireOperation op;
+ Collection<String> processedIds = null;
+
+ if (operation.equals(RequireSignatureOperation.class))
+ {
+ op = new RequireSignatureOperation(header, store);
+ processedIds = signedIds;
+ }
+ else if (operation.equals(RequireEncryptionOperation.class))
+ {
+ op = new RequireEncryptionOperation(header, store);
+ processedIds = encryptedIds;
+ }
+ else
+ {
+ try
+ {
+ Constructor<? extends RequireOperation> c =
operation.getConstructor(SecurityHeader.class, SecurityStore.class);
+ op = c.newInstance(header, store);
+ }
+ catch (Exception e)
+ {
+ throw new WSSecurityException("Error constructing operation: " +
operation);
+ }
+ }
+
+ op.process(message, o.getTargets(), o.getCertificateAlias(), o.getCredential(),
processedIds);
+ }
+ }
+
+ public void decode(Document message) throws WSSecurityException
+ {
+ decode(message, getHeader(message));
+ }
+
+ public void decode(Document message, Element headerElement) throws
WSSecurityException
+ {
+ this.headerElement = headerElement;
+ this.header = new SecurityHeader(this.headerElement, store);
+ this.message = message;
+
+ decode();
+ }
+
+ public void complete()
+ {
+ // On completion we must remove the header so that no one else can process this
+ // message (required by the specification)
+ detachHeader();
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/SecurityEncoder.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/SecurityEncoder.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/SecurityEncoder.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/SecurityEncoder.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,86 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.security;
+
+import java.lang.reflect.Constructor;
+import java.util.List;
+
+import org.jboss.ws.extras.security.element.SecurityHeader;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+
+/**
+ * <code>SecurityEncoder</code> is responsible for transforming a SOAP
message
+ * into a WS-Security encoded message.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class SecurityEncoder
+{
+ private List<OperationDescription<EncodingOperation>> operations;
+
+ private SecurityStore store;
+
+ public SecurityEncoder(List<OperationDescription<EncodingOperation>>
operations, SecurityStore store)
+ {
+ org.apache.xml.security.Init.init();
+ this.operations = operations;
+ this.store = store;
+ }
+
+ private void attachHeader(SecurityHeader header, Document message)
+ {
+ Element soapHeader = Util.findOrCreateSoapHeader(message.getDocumentElement());
+ try
+ {
+ Element wsse = header.getElement();
+ wsse.setAttributeNS(soapHeader.getNamespaceURI(), soapHeader.getPrefix() +
":mustUnderstand", "1");
+ soapHeader.insertBefore(wsse, soapHeader.getFirstChild());
+ }
+ catch (Exception e) {}
+
+ }
+
+ public void encode(Document message) throws WSSecurityException
+ {
+ SecurityHeader header = new SecurityHeader(message);
+ for (OperationDescription<EncodingOperation> o : operations)
+ {
+ EncodingOperation operation;
+
+ try
+ {
+ Constructor<? extends EncodingOperation> constructor =
o.getOperation().getConstructor(SecurityHeader.class, SecurityStore.class);
+ operation = constructor.newInstance(header, store);
+ }
+ catch (Exception e)
+ {
+ throw new WSSecurityException("Error constructing operation: " +
o.getOperation());
+ }
+
+ operation.process(message, o.getTargets(), o.getCertificateAlias(),
o.getCredential(), o.getAlgorithm());
+ }
+ attachHeader(header, message);
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/SecurityStore.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/SecurityStore.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/SecurityStore.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/SecurityStore.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,488 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extras.security;
+
+// $Id$
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.security.InvalidAlgorithmParameterException;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.PrivateKey;
+import java.security.cert.CertPath;
+import java.security.cert.CertPathValidator;
+import java.security.cert.CertPathValidatorException;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateFactory;
+import java.security.cert.PKIXParameters;
+import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import org.jboss.logging.Logger;
+
+/**
+ * <code>SecurityStore</code> holds and loads the keystore and truststore
required for encyption and signing.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @author <a href="mailto:jason.greene@jboss.com">Magesh Kumar
B</a>
+ * @version $Revision$
+ */
+public class SecurityStore
+{
+ private static Logger log = Logger.getLogger(SecurityStore.class);
+
+ private KeyStore keyStore;
+
+ private String keyStorePassword;
+
+ private KeyStore trustStore;
+
+ private String trustStorePassword;
+
+ public SecurityStore() throws WSSecurityException
+ {
+ this(null, null, null, null, null, null);
+ }
+
+ public SecurityStore(URL keyStoreURL, String keyStoreType, String keyStorePassword)
throws WSSecurityException
+ {
+ loadKeyStore(keyStoreURL, keyStoreType, keyStorePassword);
+ loadTrustStore(keyStoreURL, keyStoreType, keyStorePassword);
+ }
+
+ public SecurityStore(URL keyStoreURL, String keyStoreType, String keyStorePassword,
URL trustStoreURL, String trustStoreType, String trustStorePassword)
+ throws WSSecurityException
+ {
+ loadKeyStore(keyStoreURL, keyStoreType, keyStorePassword);
+ loadTrustStore(trustStoreURL, trustStoreType, trustStorePassword);
+ }
+
+ private void loadKeyStore(URL keyStoreURL, String keyStoreType, String
keyStorePassword) throws WSSecurityException
+ {
+ if (keyStorePassword == null)
+ keyStorePassword =
System.getProperty("org.jboss.ws.wsse.keyStorePassword");
+
+ keyStore = loadStore("org.jboss.ws.wsse.keyStore", "Keystore",
keyStoreURL, keyStoreType, keyStorePassword);
+ this.keyStorePassword = keyStorePassword;
+ }
+
+ private void loadTrustStore(URL trustStoreURL, String trustStoreType, String
trustStorePassword) throws WSSecurityException
+ {
+ if (trustStorePassword == null)
+ trustStorePassword =
System.getProperty("org.jboss.ws.wsse.trustStorePassword");
+
+ trustStore = loadStore("org.jboss.ws.wsse.trustStore",
"Truststore", trustStoreURL, trustStoreType, trustStorePassword);
+ this.trustStorePassword = trustStorePassword;
+ }
+
+ private KeyStore loadStore(String property, String type, URL storeURL, String
storeType, String storePassword) throws WSSecurityException
+ {
+ if (storeURL == null)
+ {
+ String defaultStore = System.getProperty(property);
+ if (defaultStore == null)
+ {
+ return null;
+ }
+
+ File storeFile = new File(defaultStore);
+ try
+ {
+ storeURL = storeFile.toURL();
+ }
+ catch (MalformedURLException e)
+ {
+ throw new WSSecurityException("Problems loading " + type + ":
" + e.getMessage(), e);
+ }
+ }
+
+ if (storeType == null)
+ storeType = System.getProperty(property + "Type");
+ if (storeType == null)
+ storeType = "jks";
+
+ KeyStore keyStore = null;
+ try
+ {
+ log.debug("loadStore: " + storeURL);
+ InputStream stream = storeURL.openStream();
+ if (stream == null)
+ throw new WSSecurityException("Cannot load store from: " +
storeURL);
+
+ keyStore = KeyStore.getInstance(storeType);
+ if (keyStore == null)
+ throw new WSSecurityException("Cannot get keystore for type: " +
storeType);
+
+ String decryptedPassword = decryptPassword(storePassword);
+ if (decryptedPassword == null)
+ throw new WSSecurityException("Cannot decrypt store password");
+
+ keyStore.load(stream, decryptedPassword.toCharArray());
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (WSSecurityException ex)
+ {
+ throw ex;
+ }
+ catch (Exception ex)
+ {
+ throw new WSSecurityException("Problems loading " + type + ":
" + ex.getMessage(), ex);
+ }
+
+ return keyStore;
+ }
+
+ /**
+ * This method examines the password for the presence of a encryption algorithm, if
found
+ * decrypts and returns the password, else returns the password as is.
+ */
+ private String decryptPassword(String password) throws WSSecurityException
+ {
+ log.trace("decrypt password: " + password);
+
+ if (password == null)
+ throw new WSSecurityException("Invalid null password for security
store");
+
+ if (password.charAt(0) == '{')
+ {
+ StringTokenizer tokenizer = new StringTokenizer(password, "{}");
+ String keyStorePasswordCmdType = tokenizer.nextToken();
+ String keyStorePasswordCmd = tokenizer.nextToken();
+ if (keyStorePasswordCmdType.equals("EXT"))
+ {
+ password = execPasswordCmd(keyStorePasswordCmd);
+ }
+ else if (keyStorePasswordCmdType.equals("CLASS"))
+ {
+ password = invokePasswordClass(keyStorePasswordCmd);
+ }
+ else
+ {
+ throw new WSSecurityException("Unknown keyStorePasswordCmdType: " +
keyStorePasswordCmdType);
+ }
+ }
+ if (password == null)
+ throw new WSSecurityException("Cannot decrypt password, result is
null");
+
+ log.trace("decrypted password: " + password);
+ return password;
+ }
+
+ private String execPasswordCmd(String keyStorePasswordCmd) throws WSSecurityException
+ {
+ log.debug("Executing command: " + keyStorePasswordCmd);
+ try
+ {
+ Runtime rt = Runtime.getRuntime();
+ Process p = rt.exec(keyStorePasswordCmd);
+ InputStream stdin = p.getInputStream();
+ BufferedReader reader = new BufferedReader(new InputStreamReader(stdin));
+ String password = reader.readLine();
+ stdin.close();
+ int exitCode = p.waitFor();
+ log.debug("Command exited with: " + exitCode);
+ return password;
+ }
+ catch (Exception e)
+ {
+ throw new WSSecurityException("Problems executing password command: "
+ keyStorePasswordCmd, e);
+ }
+ }
+
+ private String invokePasswordClass(String keyStorePasswordCmd) throws
WSSecurityException
+ {
+ String password = null;
+ String classname = keyStorePasswordCmd;
+ String ctorArg = null;
+ int colon = keyStorePasswordCmd.indexOf(':');
+ if (colon > 0)
+ {
+ classname = keyStorePasswordCmd.substring(0, colon);
+ ctorArg = keyStorePasswordCmd.substring(colon + 1);
+ }
+ log.debug("Loading class: " + classname + ", ctorArg=" +
ctorArg);
+ try
+ {
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ Class c = loader.loadClass(classname);
+ Object instance = null;
+ if (ctorArg != null)
+ {
+ Class[] sig = { String.class };
+ Constructor ctor = c.getConstructor(sig);
+ Object[] args = { ctorArg };
+ instance = ctor.newInstance(args);
+ }
+ else
+ {
+ instance = c.newInstance();
+ }
+ try
+ {
+ log.debug("Checking for toCharArray");
+ Class[] sig = {};
+ Method toCharArray = c.getMethod("toCharArray", sig);
+ Object[] args = {};
+ log.debug("Invoking toCharArray");
+ password = new String((char[])toCharArray.invoke(instance, args));
+ }
+ catch (NoSuchMethodException e)
+ {
+ log.debug("No toCharArray found, invoking toString");
+ password = instance.toString();
+ }
+ }
+ catch (Exception e)
+ {
+ throw new WSSecurityException("Problems loading or invoking Password class
: " + classname, e);
+ }
+ return password;
+ }
+
+ public static byte[] getSubjectKeyIdentifier(X509Certificate cert)
+ {
+ // Maybee we should make one ourselves if it isn't there?
+ byte[] encoded = cert.getExtensionValue("2.5.29.14");
+ if (encoded == null)
+ return null;
+
+ // We need to skip 4 bytes [(OCTET STRING) (LENGTH)[(OCTET STRING) (LENGTH) (Actual
data)]]
+ int trunc = encoded.length - 4;
+
+ byte[] identifier = new byte[trunc];
+ System.arraycopy(encoded, 4, identifier, 0, trunc);
+
+ return identifier;
+ }
+
+ public X509Certificate getCertificate(String alias) throws WSSecurityException
+ {
+ if (keyStore == null)
+ {
+ throw new WSSecurityException("KeyStore not set.");
+ }
+
+ X509Certificate cert;
+ try
+ {
+ cert = (X509Certificate)keyStore.getCertificate(alias);
+ }
+ catch (Exception e)
+ {
+ throw new WSSecurityException("Problems retrieving cert: " +
e.getMessage(), e);
+ }
+
+ if (cert == null)
+ throw new WSSecurityException("Certificate (" + alias + ") not in
keystore");
+
+ return cert;
+ }
+
+ public X509Certificate getCertificateBySubjectKeyIdentifier(byte[] identifier) throws
WSSecurityException
+ {
+ if (identifier == null)
+ return null;
+
+ if (keyStore == null)
+ {
+ throw new WSSecurityException("KeyStore not set.");
+ }
+
+ try
+ {
+ Enumeration i = keyStore.aliases();
+
+ while (i.hasMoreElements())
+ {
+ String alias = (String)i.nextElement();
+ Certificate cert = keyStore.getCertificate(alias);
+ if (!(cert instanceof X509Certificate))
+ continue;
+
+ byte[] subjectKeyIdentifier =
getSubjectKeyIdentifier((X509Certificate)cert);
+ if (subjectKeyIdentifier == null)
+ continue;
+
+ if (Arrays.equals(identifier, subjectKeyIdentifier))
+ return (X509Certificate)cert;
+ }
+ }
+ catch (KeyStoreException e)
+ {
+ throw new WSSecurityException("Problems retrieving cert: " +
e.getMessage(), e);
+ }
+
+ return null;
+ }
+
+ public X509Certificate getCertificateByIssuerSerial(String issuer, String serial)
throws WSSecurityException
+ {
+ if (keyStore == null)
+ {
+ throw new WSSecurityException("KeyStore not set.");
+ }
+
+ try
+ {
+ Enumeration i = keyStore.aliases();
+
+ while (i.hasMoreElements())
+ {
+ String alias = (String)i.nextElement();
+ Certificate cert = keyStore.getCertificate(alias);
+ if (!(cert instanceof X509Certificate))
+ continue;
+
+ X509Certificate x509 = (X509Certificate)cert;
+ if (issuer.equals(x509.getIssuerDN().toString()) &&
serial.equals(x509.getSerialNumber().toString()))
+ return x509;
+ }
+ }
+ catch (KeyStoreException e)
+ {
+ throw new WSSecurityException("Problems retrieving cert: " +
e.getMessage(), e);
+ }
+
+ return null;
+ }
+
+ public PrivateKey getPrivateKey(String alias) throws WSSecurityException
+ {
+ if (keyStore == null)
+ {
+ throw new WSSecurityException("KeyStore not set.");
+ }
+
+ PrivateKey key;
+ try
+ {
+ key = (PrivateKey)keyStore.getKey(alias,
decryptPassword(keyStorePassword).toCharArray());
+ }
+ catch (Exception e)
+ {
+ throw new WSSecurityException("Problems retrieving private key: " +
e.getMessage(), e);
+ }
+
+ if (key == null)
+ throw new WSSecurityException("Private key (" + alias + ") not in
keystore");
+
+ return key;
+ }
+
+ public PrivateKey getPrivateKey(X509Certificate cert) throws WSSecurityException
+ {
+ if (keyStore == null)
+ {
+ throw new WSSecurityException("KeyStore not set.");
+ }
+
+ try
+ {
+ String alias = keyStore.getCertificateAlias(cert);
+ return getPrivateKey(alias);
+ }
+ catch (Exception e)
+ {
+ throw new WSSecurityException("Problems retrieving private key: " +
e.getMessage(), e);
+ }
+ }
+
+ public void validateCertificate(X509Certificate cert) throws WSSecurityException
+ {
+ try
+ {
+ cert.checkValidity();
+ }
+ catch (Exception e)
+ {
+ log.debug("Certificate is invalid", e);
+ throw new FailedAuthenticationException();
+ }
+
+ if (keyStore == null)
+ {
+ throw new WSSecurityException("TrustStore not set.");
+ }
+
+ // Check for the exact entry in the truststore first, then fallback to a CA check
+ try
+ {
+ if (trustStore.getCertificateAlias(cert) != null)
+ {
+ return;
+ }
+ }
+ catch (KeyStoreException e)
+ {
+ throw new WSSecurityException("Problems searching truststore", e);
+ }
+
+ List list = new ArrayList(1);
+ list.add(cert);
+
+ CertPath cp;
+ CertPathValidator cpv;
+ PKIXParameters parameters;
+
+ try
+ {
+ cp = CertificateFactory.getInstance("X.509").generateCertPath(list);
+ cpv = CertPathValidator.getInstance("PKIX");
+ parameters = new PKIXParameters(trustStore);
+
+ // We currently don't support CRLs
+ parameters.setRevocationEnabled(false);
+ }
+ catch (Exception e)
+ {
+ throw new WSSecurityException("Problems setting up certificate
validation", e);
+ }
+
+ try
+ {
+ cpv.validate(cp, parameters);
+ }
+ catch (CertPathValidatorException cpve)
+ {
+ log.debug("Certificate is invalid:", cpve);
+ throw new FailedAuthenticationException();
+ }
+ catch (InvalidAlgorithmParameterException e)
+ {
+ throw new WSSecurityException("Problems setting up certificate
validation", e);
+ }
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/SecurityTokenUnavailableException.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/SecurityTokenUnavailableException.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/SecurityTokenUnavailableException.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/SecurityTokenUnavailableException.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,64 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.security;
+
+import javax.xml.namespace.QName;
+
+
+/**
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class SecurityTokenUnavailableException extends WSSecurityException
+{
+ public static final QName faultCode = new QName(Constants.WSSE_NS,
"SecurityTokenUnavailable", Constants.WSSE_PREFIX);
+
+ public static final String faultString = "Referenced security token could not be
retrieved.";
+
+ public SecurityTokenUnavailableException()
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public SecurityTokenUnavailableException(Throwable cause)
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public SecurityTokenUnavailableException(String message)
+ {
+ super(message);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+
+ public SecurityTokenUnavailableException(String message, Throwable cause)
+ {
+ super(message, cause);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/SendUsernameOperation.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/SendUsernameOperation.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/SendUsernameOperation.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/SendUsernameOperation.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,46 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.security;
+
+import java.util.List;
+
+import org.jboss.ws.extras.security.element.SecurityHeader;
+import org.jboss.ws.extras.security.element.UsernameToken;
+import org.w3c.dom.Document;
+
+public class SendUsernameOperation implements EncodingOperation
+{
+ private SecurityHeader header;
+
+ private SecurityStore store;
+
+ public SendUsernameOperation(SecurityHeader header, SecurityStore store)
+ {
+ this.header = header;
+ this.store = store;
+ }
+
+ public void process(Document message, List<Target> targets, String alias, String
credential, String algorithm) throws WSSecurityException
+ {
+ header.addToken(new UsernameToken(alias, credential, message));
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/SignatureOperation.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/SignatureOperation.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/SignatureOperation.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/SignatureOperation.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,178 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.security;
+
+import java.security.PrivateKey;
+import java.security.cert.X509Certificate;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.xml.security.c14n.Canonicalizer;
+import org.apache.xml.security.exceptions.XMLSecurityException;
+import org.apache.xml.security.signature.XMLSignature;
+import org.apache.xml.security.signature.XMLSignatureException;
+import org.apache.xml.security.transforms.TransformationException;
+import org.apache.xml.security.transforms.Transforms;
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.extras.security.element.DirectReference;
+import org.jboss.ws.extras.security.element.SecurityHeader;
+import org.jboss.ws.extras.security.element.SecurityTokenReference;
+import org.jboss.ws.extras.security.element.Signature;
+import org.jboss.ws.extras.security.element.X509Token;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+
+public class SignatureOperation implements EncodingOperation
+{
+ private SecurityHeader header;
+
+ private SecurityStore store;
+
+ public SignatureOperation(SecurityHeader header, SecurityStore store) throws
WSSecurityException
+ {
+ this.header = header;
+ this.store = store;
+ }
+
+ private void processTarget(XMLSignature sig, Document message, Target target)
+ {
+ if (target instanceof QNameTarget)
+ processQNameTarget(sig, message, (QNameTarget) target);
+ else if (target instanceof WsuIdTarget)
+ processWsuIdTarget(sig, message, (WsuIdTarget) target);
+ else
+ throw new NotImplementedException();
+ }
+
+ private void processQNameTarget(XMLSignature sig, Document message, QNameTarget
target)
+ {
+ QName name = target.getName();
+
+ Transforms transforms = new Transforms(message);
+ try
+ {
+ transforms.addTransform(Transforms.TRANSFORM_C14N_EXCL_OMIT_COMMENTS);
+ }
+ catch (TransformationException e)
+ {
+ throw new RuntimeException(e);
+ }
+
+ Element element = Util.findElement(message.getDocumentElement(), name);
+ if (element == null)
+ throw new RuntimeException("Could not find element");
+
+ String id = Util.assignWsuId(element);
+
+ try
+ {
+ sig.addDocument("#" + id, transforms);
+ }
+ catch (XMLSignatureException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private void processWsuIdTarget(XMLSignature sig, Document message, WsuIdTarget
target)
+ {
+ String id = target.getId();
+
+ Transforms transforms = new Transforms(message);
+ try
+ {
+ transforms.addTransform(Transforms.TRANSFORM_C14N_EXCL_OMIT_COMMENTS);
+ }
+ catch (TransformationException e)
+ {
+ throw new RuntimeException(e);
+ }
+
+ try
+ {
+ sig.addDocument("#" + id, transforms);
+ }
+ catch (XMLSignatureException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public void process(Document message, List<Target> targets, String alias, String
credential, String algorithm) throws WSSecurityException
+ {
+ Element envelope = message.getDocumentElement();
+ XMLSignature sig;
+ try
+ {
+ sig = new XMLSignature(message, null, XMLSignature.ALGO_ID_SIGNATURE_RSA,
Canonicalizer.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);
+ }
+ catch (XMLSecurityException e)
+ {
+ throw new WSSecurityException("Error building signature", e);
+ }
+
+ // For now we pass our resolver the root document because the signature element
isn't attached
+ // to the evelope yet (no wsse header). Perhaps we should do this differently
+ sig.addResourceResolver(new WsuIdResolver(message, header.getElement()));
+ PrivateKey key = store.getPrivateKey(alias);
+
+ if (targets == null || targets.size() == 0)
+ {
+ // By default we sign the body element, and a timestamp if it is available
+ String namespace = envelope.getNamespaceURI();
+ processTarget(sig, message, new QNameTarget(new QName(namespace,
"Body")));
+ if (header.getTimestamp() != null)
+ processTarget(sig, message, new WsuIdTarget("timestamp"));
+ }
+ else
+ {
+ for (Target target : targets)
+ processTarget(sig, message, target);
+ }
+
+ try
+ {
+ sig.sign(key);
+ }
+ catch (XMLSignatureException e)
+ {
+ throw new WSSecurityException("Error signing message: " +
e.getMessage(), e);
+ }
+
+ X509Certificate cert = store.getCertificate(alias);
+ X509Token token = (X509Token) header.getSharedToken(cert);
+
+ // Can we reuse an existing token?
+ if (token == null)
+ {
+ token = new X509Token(cert, message);
+ header.addToken(token);
+ }
+
+ SecurityTokenReference reference = new SecurityTokenReference(new
DirectReference(message, token));
+ sig.getKeyInfo().addUnknownElement(reference.getElement());
+
+ header.addSecurityProcess(new Signature(sig));
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/SignatureVerificationOperation.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/SignatureVerificationOperation.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/SignatureVerificationOperation.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/SignatureVerificationOperation.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,89 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.security;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.apache.xml.security.exceptions.XMLSecurityException;
+import org.apache.xml.security.signature.SignedInfo;
+import org.apache.xml.security.signature.XMLSignature;
+import org.apache.xml.security.signature.XMLSignatureException;
+import org.jboss.ws.extras.security.element.SecurityHeader;
+import org.jboss.ws.extras.security.element.SecurityProcess;
+import org.jboss.ws.extras.security.element.Signature;
+import org.w3c.dom.Document;
+
+public class SignatureVerificationOperation implements DecodingOperation
+{
+ private SecurityHeader header;
+
+ private SecurityStore store;
+
+ public SignatureVerificationOperation(SecurityHeader header, SecurityStore store)
throws WSSecurityException
+ {
+ this.header = header;
+ this.store = store;
+ }
+
+ public Collection<String> process(Document message, SecurityProcess process)
throws WSSecurityException
+ {
+ Signature signature = (Signature) process;
+ XMLSignature xmlSig = signature.getSignature();
+
+ xmlSig.addResourceResolver(new WsuIdResolver(message));
+ STRTransform.setSecurityStore(store);
+
+ try
+ {
+ if (! xmlSig.checkSignatureValue(signature.getPublicKey()))
+ throw new FailedCheckException("Signature is invalid.");
+ }
+ catch (XMLSignatureException e)
+ {
+ throw new WSSecurityException("An unexpected error occured while verifying
signature", e);
+ }
+ finally
+ {
+ STRTransform.setSecurityStore(null);
+ }
+
+ SignedInfo info = xmlSig.getSignedInfo();
+ int length = info.getLength();
+ Collection<String> processed = new ArrayList<String>(length);
+ try
+ {
+ for (int i = 0; i < length; i++)
+ {
+ String uri = info.item(i).getURI();
+ if (uri != null && uri.length() > 1 &&
uri.charAt(0)=='#')
+ processed.add(uri.substring(1));
+ }
+ }
+ catch (XMLSecurityException e)
+ {
+ throw new WSSecurityException("Could not extract references", e);
+ }
+
+ return processed;
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/SimplePrincipal.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/SimplePrincipal.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/SimplePrincipal.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/SimplePrincipal.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extras.security;
+
+import java.io.Serializable;
+import java.security.Principal;
+
+/** A simple String based implementation of Principal.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class SimplePrincipal implements Principal, Serializable
+{
+ private static final long serialVersionUID = 136345402844480211L;
+
+ private String name;
+
+ public SimplePrincipal(String name)
+ {
+ this.name = name;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public boolean equals(Object obj)
+ {
+ if (!(obj instanceof Principal))
+ return false;
+
+ return toString().equals(((Principal)obj).getName());
+ }
+
+ public int hashCode()
+ {
+ return (name == null ? 0 : name.hashCode());
+ }
+
+ public String toString()
+ {
+ return "" + name;
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/Target.java
(from rev 1557, branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/Target.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/Target.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/Target.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,33 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.security;
+
+
+/**
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+abstract public class Target
+{
+ // Applies only to encryption
+ abstract public boolean isContent();
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/TimestampOperation.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/TimestampOperation.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/TimestampOperation.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/TimestampOperation.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,58 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.security;
+
+import java.util.List;
+
+import org.jboss.ws.extras.security.element.SecurityHeader;
+import org.jboss.ws.extras.security.element.Timestamp;
+import org.w3c.dom.Document;
+
+public class TimestampOperation implements EncodingOperation
+{
+ private SecurityHeader header;
+
+ private SecurityStore store;
+
+ public TimestampOperation(SecurityHeader header, SecurityStore store)
+ {
+ this.header = header;
+ this.store = store;
+ }
+
+ public void process(Document message, List<Target> targets, String alias, String
credential, String algorithm) throws WSSecurityException
+ {
+ Integer ttl = null;
+
+ try
+ {
+ // Time to live is stuffed in the credential field
+ ttl = Integer.valueOf(credential);
+ }
+ catch (NumberFormatException e)
+ {
+ // Eat
+ }
+
+ header.setTimestamp(new Timestamp(ttl, message));
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/TimestampVerificationOperation.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/TimestampVerificationOperation.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/TimestampVerificationOperation.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/TimestampVerificationOperation.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,61 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.security;
+
+import java.util.Calendar;
+
+import org.jboss.ws.extras.security.element.Timestamp;
+import org.w3c.dom.Document;
+
+
+public class TimestampVerificationOperation
+{
+ private Calendar now = null;
+
+ public TimestampVerificationOperation()
+ {
+ }
+
+ /**
+ * A special constructor that allows you to use a different value when validating the
message.
+ * DO NOT USE THIS UNLESS YOU REALLY KNOW WHAT YOU ARE DOING!.
+ *
+ * @param now The timestamp to use as the current time when validating a message
expiration
+ */
+ public TimestampVerificationOperation(Calendar now)
+ {
+ this.now = now;
+ }
+
+ public void process(Document message, Timestamp timestamp) throws WSSecurityException
+ {
+ Calendar expired = timestamp.getExpires();
+ Calendar created = timestamp.getCreated();
+ Calendar now = (this.now == null) ? Calendar.getInstance() : this.now;
+
+ if (created.after(now))
+ throw new WSSecurityException("Invalid timestamp, message claimed to be
created after now");
+
+ if (expired != null && ! now.before(expired))
+ throw new FailedCheckException("Expired message.");
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/TokenOperation.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/TokenOperation.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/TokenOperation.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/TokenOperation.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,38 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.security;
+
+import org.jboss.ws.extras.security.element.Token;
+import org.w3c.dom.Document;
+
+/**
+ * <code>DecodingOperation</code> represents an operation that is applied to
a
+ * WS-Security encoded message to both convert and verify the contents of the
+ * message.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public interface TokenOperation
+{
+ public void process(Document message, Token token) throws WSSecurityException;
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/UnsupportedAlgorithmException.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/UnsupportedAlgorithmException.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/UnsupportedAlgorithmException.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/UnsupportedAlgorithmException.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,65 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.security;
+
+import javax.xml.namespace.QName;
+
+
+/**
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+
+public class UnsupportedAlgorithmException extends WSSecurityException
+{
+ public static final QName faultCode = new QName("UnsupportedAlgorithm",
Constants.WSSE_PREFIX, Constants.WSSE_NS);
+
+ public static final String faultString = "An unsupported signature or encryption
algorithm was used.";
+
+ public UnsupportedAlgorithmException()
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public UnsupportedAlgorithmException(Throwable cause)
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public UnsupportedAlgorithmException(String message)
+ {
+ super(message);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+
+ public UnsupportedAlgorithmException(String message, Throwable cause)
+ {
+ super(message, cause);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/UnsupportedSecurityTokenException.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/UnsupportedSecurityTokenException.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/UnsupportedSecurityTokenException.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/UnsupportedSecurityTokenException.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,64 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.security;
+
+import javax.xml.namespace.QName;
+
+
+/**
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class UnsupportedSecurityTokenException extends WSSecurityException
+{
+ public static final QName faultCode = new QName("UnsupportedSecurityToken",
Constants.WSSE_PREFIX, Constants.WSSE_NS);
+
+ public static final String faultString = "An unsupported token was
provided.";
+
+ public UnsupportedSecurityTokenException()
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public UnsupportedSecurityTokenException(Throwable cause)
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public UnsupportedSecurityTokenException(String message)
+ {
+ super(message);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+
+ public UnsupportedSecurityTokenException(String message, Throwable cause)
+ {
+ super(message, cause);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/Util.java (from
rev 1557, branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/Util.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/Util.java 2006-12-05 23:29:55
UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/Util.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,217 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.security;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * @author Jason T. Greene
+ * @version $Id$
+ */
+public class Util
+{
+ public static int count = 0;
+
+ public static String assignWsuId(Element element)
+ {
+ String id = element.getAttributeNS(Constants.WSU_NS, Constants.ID);
+
+ if (id == null || id.length() < 1)
+ {
+ id = generateId();
+ element.setAttributeNS(Constants.WSU_NS, Constants.WSU_ID, id);
+ addNamespace(element, Constants.WSU_PREFIX, Constants.WSU_NS);
+ }
+
+ return id;
+ }
+
+ public static Element getFirstChildElement(Node node)
+ {
+ Node child = node.getFirstChild();
+ while (child != null && child.getNodeType() != Node.ELEMENT_NODE)
+ child = child.getNextSibling();
+
+ return (Element)child;
+ }
+
+ public static Element getNextSiblingElement(Element element)
+ {
+ Node sibling = element.getNextSibling();
+ while (sibling != null && sibling.getNodeType() != Node.ELEMENT_NODE)
+ sibling = sibling.getNextSibling();
+
+ return (Element)sibling;
+ }
+
+ public static Element getPreviousSiblingElement(Element element)
+ {
+ Node sibling = element.getPreviousSibling();
+ while (sibling != null && sibling.getNodeType() != Node.ELEMENT_NODE)
+ sibling = sibling.getPreviousSibling();
+
+ return (Element)sibling;
+ }
+
+ public static Element findElement(Element root, String localName, String namespace)
+ {
+ return findElement(root, new QName(namespace, localName));
+ }
+
+ public static Element findElement(Element root, QName name)
+ {
+ // Here lies your standard recusive DFS.....
+ if (matchNode(root, name))
+ return root;
+
+ // Search children
+ for (Node child = root.getFirstChild(); child != null; child =
child.getNextSibling())
+ {
+ if (child.getNodeType() != Node.ELEMENT_NODE)
+ continue;
+
+ Node possibleMatch = findElement((Element)child, name);
+ if (possibleMatch != null)
+ return (Element)possibleMatch;
+ }
+
+ return null;
+ }
+
+ public static List<Node> findAllElements(Element root, QName name, boolean
local)
+ {
+ List<Node> list = new ArrayList<Node>();
+ if (matchNode(root, name, local))
+ list.add(root);
+
+ for (Node child = root.getFirstChild(); child != null; child =
child.getNextSibling())
+ {
+ if (child.getNodeType() != Node.ELEMENT_NODE)
+ continue;
+
+ list.addAll(findAllElements((Element) child, name, local));
+ }
+
+ return list;
+ }
+
+ public static Element findElementByWsuId(Element root, String id)
+ {
+ // Here lies another standard recusive DFS.....
+ if (id.equals(getWsuId(root)))
+ return root;
+
+ // Search children
+ for (Node child = root.getFirstChild(); child != null; child =
child.getNextSibling())
+ {
+ if (child.getNodeType() != Node.ELEMENT_NODE)
+ continue;
+
+ Node possibleMatch = findElementByWsuId((Element)child, id);
+ if (possibleMatch != null)
+ return (Element)possibleMatch;
+ }
+
+ return null;
+ }
+
+ public static Element findOrCreateSoapHeader(Element envelope)
+ {
+ String prefix = envelope.getPrefix();
+ String uri = envelope.getNamespaceURI();
+ QName name = new QName(uri, "Header");
+ Element header = findElement(envelope, name);
+ if (header == null)
+ {
+ header = envelope.getOwnerDocument().createElementNS(uri, prefix +
":Header");
+ envelope.insertBefore(header, envelope.getFirstChild());
+ }
+
+ return header;
+ }
+
+ public static String getWsuId(Element element)
+ {
+ if (element.hasAttributeNS(Constants.WSU_NS, Constants.ID))
+ return element.getAttributeNS(Constants.WSU_NS, Constants.ID);
+
+ if (element.hasAttribute(Constants.ID))
+ {
+ String ns = element.getNamespaceURI();
+ if (Constants.XML_SIGNATURE_NS.equals(ns) ||
Constants.XML_ENCRYPTION_NS.equals(ns))
+ return element.getAttribute(Constants.ID);
+ }
+
+ return null;
+ }
+
+ public static boolean equalStrings(String string1, String string2)
+ {
+ if (string1 == null && string2 == null)
+ return true;
+
+ return string1 != null && string1.equals(string2);
+ }
+
+ public static boolean matchNode(Node node, QName name)
+ {
+ return matchNode(node, name, false);
+ }
+
+ public static boolean matchNode(Node node, QName name, boolean local)
+ {
+ return equalStrings(node.getLocalName(), name.getLocalPart())
+ && (local || equalStrings(node.getNamespaceURI(),
name.getNamespaceURI()));
+ }
+
+ public static String generateId()
+ {
+ return generateId("element");
+ }
+
+ public static void addNamespace(Element element, String prefix, String uri)
+ {
+ element.setAttributeNS(Constants.XMLNS_NS, "xmlns:" + prefix, uri);
+ }
+
+ public static String generateId(String prefix)
+ {
+ StringBuilder id = new StringBuilder();
+ long time = System.currentTimeMillis();
+
+ // reasonably gaurantee uniqueness
+ synchronized (Util.class)
+ {
+ count++;
+ }
+
+
id.append(prefix).append("-").append(count).append("-").append(time).append("-").append(id.hashCode());
+
+ return id.toString();
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/WSSecurityDispatcher.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/WSSecurityDispatcher.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/WSSecurityDispatcher.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/WSSecurityDispatcher.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,303 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extras.security;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.Stub;
+import javax.xml.rpc.soap.SOAPFaultException;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPHeader;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.utils.DOMWriter;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.jaxrpc.StubExt;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.wsse.Config;
+import org.jboss.ws.metadata.wsse.Encrypt;
+import org.jboss.ws.metadata.wsse.Operation;
+import org.jboss.ws.metadata.wsse.Port;
+import org.jboss.ws.metadata.wsse.RequireEncryption;
+import org.jboss.ws.metadata.wsse.RequireSignature;
+import org.jboss.ws.metadata.wsse.RequireTimestamp;
+import org.jboss.ws.metadata.wsse.Requires;
+import org.jboss.ws.metadata.wsse.Sign;
+import org.jboss.ws.metadata.wsse.Timestamp;
+import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
+import org.jboss.ws.soap.SOAPMessageImpl;
+import org.w3c.dom.Element;
+
+public class WSSecurityDispatcher
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(WSSecurityDispatcher.class);
+
+ private static List<Target>
convertTargets(List<org.jboss.ws.metadata.wsse.Target> targets)
+ {
+ if (targets == null)
+ return null;
+
+ ArrayList<Target> newList = new ArrayList<Target>(targets.size());
+
+ for (org.jboss.ws.metadata.wsse.Target target : targets)
+ {
+ if ("qname".equals(target.getType()))
+ {
+ QNameTarget qnameTarget = new QNameTarget(QName.valueOf(target.getValue()),
target.isContentOnly());
+ newList.add(qnameTarget);
+ }
+ else if ("wsuid".equals(target.getType()))
+ {
+ newList.add(new WsuIdTarget(target.getValue()));
+ }
+ }
+
+ return newList;
+ }
+
+ private static Config getConfig(WSSecurityConfiguration config, String portName,
String operationName)
+ {
+ Port port = config.getPorts().get(portName);
+ if (port == null)
+ return config.getDefaultConfig();
+
+ Operation operation = port.getOperations().get(operationName);
+ if (operation == null)
+ {
+ Config portConfig = port.getDefaultConfig();
+ return (portConfig == null) ? config.getDefaultConfig() : portConfig;
+
+ }
+
+ return operation.getConfig();
+ }
+
+ private static SOAPFaultException convertToFault(WSSecurityException e)
+ {
+ return new SOAPFaultException(e.getFaultCode(), e.getFaultString(), null, null);
+ }
+
+ public static void handleInbound(CommonMessageContext ctx) throws SOAPException,
SOAPFaultException
+ {
+ WSSecurityConfiguration config = getSecurityConfig(ctx);
+ SOAPMessageImpl soapMessage = (SOAPMessageImpl)ctx.getSOAPMessage();
+
+ SOAPHeader soapHeader = soapMessage.getSOAPHeader();
+ QName secQName = new QName(Constants.WSSE_NS, "Security");
+ Element secHeaderElement = Util.findElement(soapHeader, secQName);
+
+ if (secHeaderElement == null)
+ {
+ // This is ok, we always allow faults to be received because WS-Security does
not encrypt faults
+ if (soapMessage.getSOAPBody().getFault() != null)
+ return;
+
+ OperationMetaData opMetaData = ctx.getOperationMetaData();
+ if (opMetaData == null)
+ {
+ // Get the operation meta data from the soap message
+ // for the server side inbound message.
+ EndpointMetaData epMetaData = ctx.getEndpointMetaData();
+ opMetaData = soapMessage.getOperationMetaData(epMetaData);
+ }
+
+ String operation = opMetaData.getQName().toString();
+ String port = opMetaData.getEndpointMetaData().getQName().getLocalPart();
+
+ if (hasRequirements(config, operation, port))
+ throw convertToFault(new InvalidSecurityHeaderException("This service
requires <wsse:Security>, which is missing."));
+
+ return;
+ }
+
+ try
+ {
+ SecurityStore securityStore = new SecurityStore(config.getKeyStoreURL(),
config.getKeyStoreType(), config.getKeyStorePassword(), config.getTrustStoreURL(),
+ config.getTrustStoreType(), config.getTrustStorePassword());
+ SecurityDecoder decoder = new SecurityDecoder(securityStore);
+
+ decoder.decode(soapMessage.getSOAPPart(), secHeaderElement);
+ log.debug("Decoded Message:\n" +
DOMWriter.printNode(soapMessage.getSOAPPart(), true));
+
+ OperationMetaData opMetaData = ctx.getOperationMetaData();
+ if (opMetaData == null)
+ {
+ // Get the operation meta data from the soap message
+ // for the server side inbound message.
+ EndpointMetaData epMetaData = ctx.getEndpointMetaData();
+ opMetaData = soapMessage.getOperationMetaData(epMetaData);
+ }
+
+ String operation = opMetaData.getQName().toString();
+ String port = opMetaData.getEndpointMetaData().getQName().getLocalPart();
+
+ List<OperationDescription<RequireOperation>> operations =
buildRequireOperations(config, operation, port);
+
+ decoder.verify(operations);
+ log.debug("Verification is successful");
+
+ decoder.complete();
+ }
+ catch (WSSecurityException e)
+ {
+ if (e.isInternalError())
+ log.error("Internal error occured handling inbound message:", e);
+ else log.debug("Returning error to sender: " + e.getMessage());
+
+ throw convertToFault(e);
+ }
+ }
+
+ private static WSSecurityConfiguration getSecurityConfig(CommonMessageContext ctx)
+ {
+ WSSecurityConfiguration config =
ctx.getEndpointMetaData().getServiceMetaData().getSecurityConfiguration();
+ if (config == null)
+ throw new WSException("Cannot obtatin security configuration from message
context");
+
+ return config;
+ }
+
+ private static boolean hasRequirements(WSSecurityConfiguration config, String
operation, String port)
+ {
+ Config operationConfig = getConfig(config, port, operation);
+ return (operationConfig != null && operationConfig.getRequires() != null);
+ }
+
+ private static List<OperationDescription<RequireOperation>>
buildRequireOperations(WSSecurityConfiguration config, String operation, String port)
+ {
+ Config operationConfig = getConfig(config, port, operation);
+ if (operationConfig == null)
+ return null;
+
+ Requires requires = operationConfig.getRequires();
+ if (requires == null)
+ return null;
+
+ ArrayList<OperationDescription<RequireOperation>> operations = new
ArrayList<OperationDescription<RequireOperation>>();
+ RequireTimestamp requireTimestamp = requires.getRequireTimestamp();
+ if (requireTimestamp != null)
+ operations.add(new
OperationDescription<RequireOperation>(RequireTimestampOperation.class, null,
requireTimestamp.getMaxAge(), null, null));
+
+ RequireSignature requireSignature = requires.getRequireSignature();
+ if (requireSignature != null)
+ {
+ List<Target> targets = convertTargets(requireSignature.getTargets());
+ operations.add(new
OperationDescription<RequireOperation>(RequireSignatureOperation.class, targets,
null, null, null));
+ }
+
+ RequireEncryption requireEncryption = requires.getRequireEncryption();
+ if (requireEncryption != null)
+ {
+ List<Target> targets = convertTargets(requireEncryption.getTargets());
+ operations.add(new
OperationDescription<RequireOperation>(RequireEncryptionOperation.class, targets,
null, null, null));
+ }
+
+ return operations;
+ }
+
+ public static void handleOutbound(CommonMessageContext ctx) throws SOAPException,
SOAPFaultException
+ {
+ WSSecurityConfiguration config = getSecurityConfig(ctx);
+ SOAPMessageImpl soapMessage = (SOAPMessageImpl)ctx.getSOAPMessage();
+
+ OperationMetaData opMetaData = ctx.getOperationMetaData();
+ String operation = opMetaData.getQName().toString();
+ String port = opMetaData.getEndpointMetaData().getQName().getLocalPart();
+
+ Config operationConfig = getConfig(config, port, operation);
+
+ log.debug("WS-Security config:" + operationConfig);
+ // Nothing to process
+ if (operationConfig == null)
+ return;
+
+ ArrayList<OperationDescription<EncodingOperation>> operations = new
ArrayList<OperationDescription<EncodingOperation>>();
+ Timestamp timestamp = operationConfig.getTimestamp();
+ if (timestamp != null)
+ {
+ operations.add(new
OperationDescription<EncodingOperation>(TimestampOperation.class, null, null,
timestamp.getTtl(), null));
+ }
+
+ if (operationConfig.getUsername() != null)
+ {
+ Object user = ctx.getProperty(Stub.USERNAME_PROPERTY);
+ Object pass = ctx.getProperty(Stub.PASSWORD_PROPERTY);
+
+ if (user != null && pass != null)
+ {
+ operations.add(new
OperationDescription<EncodingOperation>(SendUsernameOperation.class, null,
user.toString(), pass.toString(), null));
+ ctx.setProperty(StubExt.PROPERTY_AUTH_TYPE,
StubExt.PROPERTY_AUTH_TYPE_WSSE);
+ }
+ }
+
+ Sign sign = operationConfig.getSign();
+ if (sign != null)
+ {
+ List<Target> targets = convertTargets(sign.getTargets());
+ if (sign.isIncludeTimestamp())
+ {
+ if (timestamp == null)
+ operations.add(new
OperationDescription<EncodingOperation>(TimestampOperation.class, null, null, null,
null));
+
+ if (targets != null && targets.size() > 0)
+ targets.add(new WsuIdTarget("timestamp"));
+ }
+
+ operations.add(new
OperationDescription<EncodingOperation>(SignatureOperation.class, targets,
sign.getAlias(), null, null));
+ }
+
+ Encrypt encrypt = operationConfig.getEncrypt();
+ if (encrypt != null)
+ {
+ List<Target> targets = convertTargets(encrypt.getTargets());
+ operations.add(new
OperationDescription<EncodingOperation>(EncryptionOperation.class, targets,
encrypt.getAlias(), null, encrypt.getAlgorithm()));
+ }
+
+ if (operations.size() == 0)
+ return;
+
+ log.debug("Encoding Message:\n" +
DOMWriter.printNode(soapMessage.getSOAPPart(), true));
+
+ try
+ {
+ SecurityStore securityStore = new SecurityStore(config.getKeyStoreURL(),
config.getKeyStoreType(), config.getKeyStorePassword(), config.getTrustStoreURL(),
+ config.getTrustStoreType(), config.getTrustStorePassword());
+ SecurityEncoder encoder = new SecurityEncoder(operations, securityStore);
+ encoder.encode(soapMessage.getSOAPPart());
+ }
+ catch (WSSecurityException e)
+ {
+ if (e.isInternalError())
+ log.error("Internal error occured handling outbound message:", e);
+ else log.debug("Returning error to sender: " + e.getMessage());
+
+ throw convertToFault(e);
+ }
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/WSSecurityException.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/WSSecurityException.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/WSSecurityException.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/WSSecurityException.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,74 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.security;
+
+import javax.xml.namespace.QName;
+
+/**
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class WSSecurityException extends Exception
+{
+ private boolean internal = false;
+
+ private QName faultCode = new QName(Constants.JBOSS_WSSE_NS,
"InternalError", Constants.JBOSS_WSSE_PREFIX);
+
+ private String faultString = "An internal WS-Security error occurred. See log for
details";
+
+ public WSSecurityException(String message)
+ {
+ super(message);
+ this.internal = true;
+ }
+
+ public WSSecurityException(String message, Throwable cause)
+ {
+ super(message, cause);
+ this.internal = true;
+ }
+
+ protected void setFaultCode(QName faultCode)
+ {
+ this.faultCode = faultCode;
+ }
+
+ protected void setFaultString(String faultMessage)
+ {
+ this.faultString = faultMessage;
+ }
+
+ public boolean isInternalError()
+ {
+ return internal;
+ }
+
+ public QName getFaultCode()
+ {
+ return faultCode;
+ }
+
+ public String getFaultString()
+ {
+ return faultString;
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/WsuIdResolver.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/WsuIdResolver.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/WsuIdResolver.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/WsuIdResolver.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,89 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.security;
+
+import org.apache.xml.security.signature.XMLSignatureInput;
+import org.apache.xml.security.utils.resolver.ResourceResolverException;
+import org.apache.xml.security.utils.resolver.ResourceResolverSpi;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+
+/**
+ * @author Jason T. Greene
+ * @version $Id$
+ */
+public class WsuIdResolver extends ResourceResolverSpi
+{
+ Document doc;
+ Element header;
+
+ public WsuIdResolver(Document doc)
+ {
+ this.doc = doc;
+ }
+
+ public WsuIdResolver(Document doc, Element header)
+ {
+ this.doc = doc;
+ this.header = header;
+ }
+
+ /**
+ * @see
org.apache.xml.security.utils.resolver.ResourceResolverSpi#engineCanResolve(org.w3c.dom.Attr,
java.lang.String)
+ */
+ public boolean engineCanResolve(Attr uri, String baseURI)
+ {
+ if (uri == null)
+ return false;
+
+ String nodeValue = uri.getNodeValue();
+ return nodeValue != null && nodeValue.startsWith("#");
+ }
+
+ /**
+ * @see
org.apache.xml.security.utils.resolver.ResourceResolverSpi#engineResolve(org.w3c.dom.Attr,
java.lang.String)
+ */
+ public XMLSignatureInput engineResolve(Attr uri, String BaseURI) throws
ResourceResolverException
+ {
+ //Document doc = uri.getOwnerDocument();
+ String id = uri.getValue().substring(1);
+
+ Element element = doc.getDocumentElement();
+ element = Util.findElementByWsuId(element, id);
+
+ // If its not in the document, try the header
+ if (element == null && header != null)
+ element = Util.findElementByWsuId(header, id);
+
+ if (element == null)
+ throw new ResourceResolverException(id, uri, BaseURI);
+
+ XMLSignatureInput input = new XMLSignatureInput(element);
+ input.setMIMEType("text/xml");
+
+ input.setSourceURI(BaseURI + uri);
+
+ return input;
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/WsuIdTarget.java (from
rev 1557, branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/WsuIdTarget.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/WsuIdTarget.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/WsuIdTarget.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,56 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.security;
+
+
+/**
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class WsuIdTarget extends Target
+{
+ private String id;
+
+ private boolean content;
+
+ public WsuIdTarget(String url)
+ {
+ this.id = url;
+ this.content = false;
+ }
+
+ public WsuIdTarget(String url, boolean content)
+ {
+ this(url);
+ this.content = content;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public boolean isContent()
+ {
+ return content;
+ }
+}
\ No newline at end of file
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element (from
rev 1557, branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/element)
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/BinarySecurityToken.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/element/BinarySecurityToken.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/BinarySecurityToken.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,11 +19,11 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.element;
+package org.jboss.ws.extras.security.element;
-import org.jboss.ws.wsse.Constants;
-import org.jboss.ws.wsse.Util;
-import org.jboss.ws.wsse.WSSecurityException;
+import org.jboss.ws.extras.security.Constants;
+import org.jboss.ws.extras.security.Util;
+import org.jboss.ws.extras.security.WSSecurityException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/DirectReference.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/element/DirectReference.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/DirectReference.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,10 +19,10 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.element;
+package org.jboss.ws.extras.security.element;
-import org.jboss.ws.wsse.Constants;
-import org.jboss.ws.wsse.WSSecurityException;
+import org.jboss.ws.extras.security.Constants;
+import org.jboss.ws.extras.security.WSSecurityException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -32,8 +32,8 @@
* retrievable via a URL. This is typically used for refering to a
* <code>BinarySecurityToken</code> that is within the same message.
*
- * @see org.jboss.ws.wsse.element.SecurityTokenReference
- * @see org.jboss.ws.wsse.element.BinarySecurityToken
+ * @see org.jboss.ws.extras.security.element.SecurityTokenReference
+ * @see org.jboss.ws.extras.security.element.BinarySecurityToken
*
* @author Jason T. Greene
* @version $Id$
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/EncryptedKey.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/element/EncryptedKey.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/EncryptedKey.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.element;
+package org.jboss.ws.extras.security.element;
import java.security.PrivateKey;
@@ -28,11 +28,11 @@
import org.apache.xml.security.encryption.XMLCipher;
import org.apache.xml.security.exceptions.XMLSecurityException;
import org.apache.xml.security.keys.KeyInfo;
-import org.jboss.ws.wsse.Constants;
-import org.jboss.ws.wsse.InvalidSecurityHeaderException;
-import org.jboss.ws.wsse.KeyResolver;
-import org.jboss.ws.wsse.Util;
-import org.jboss.ws.wsse.WSSecurityException;
+import org.jboss.ws.extras.security.Constants;
+import org.jboss.ws.extras.security.InvalidSecurityHeaderException;
+import org.jboss.ws.extras.security.KeyResolver;
+import org.jboss.ws.extras.security.Util;
+import org.jboss.ws.extras.security.WSSecurityException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/KeyIdentifier.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/element/KeyIdentifier.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/KeyIdentifier.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,15 +19,15 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.element;
+package org.jboss.ws.extras.security.element;
import java.security.cert.X509Certificate;
import org.apache.xml.security.exceptions.Base64DecodingException;
import org.apache.xml.security.utils.Base64;
import org.apache.xml.security.utils.XMLUtils;
-import org.jboss.ws.wsse.Constants;
-import org.jboss.ws.wsse.WSSecurityException;
+import org.jboss.ws.extras.security.Constants;
+import org.jboss.ws.extras.security.WSSecurityException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -38,8 +38,8 @@
* X.509v3 Subject Key Identifier, which is the only currently
* supported key identifier by this class.
*
- * @see org.jboss.ws.wsse.element.SecurityTokenReference
- * @see org.jboss.ws.wsse.element.BinarySecurityToken
+ * @see org.jboss.ws.extras.security.element.SecurityTokenReference
+ * @see org.jboss.ws.extras.security.element.BinarySecurityToken
*
* @author Jason T. Greene
* @version $Id$
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/Reference.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/element/Reference.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/Reference.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,9 +19,9 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.element;
+package org.jboss.ws.extras.security.element;
-import org.jboss.ws.wsse.WSSecurityException;
+import org.jboss.ws.extras.security.WSSecurityException;
import org.w3c.dom.Element;
abstract public class Reference implements SecurityElement
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/ReferenceList.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/element/ReferenceList.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/ReferenceList.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,15 +19,15 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.element;
+package org.jboss.ws.extras.security.element;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedList;
import org.apache.xml.security.encryption.Reference;
-import org.jboss.ws.wsse.Constants;
-import org.jboss.ws.wsse.Util;
+import org.jboss.ws.extras.security.Constants;
+import org.jboss.ws.extras.security.Util;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/SecurityElement.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/element/SecurityElement.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/SecurityElement.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,9 +19,9 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.element;
+package org.jboss.ws.extras.security.element;
-import org.jboss.ws.wsse.WSSecurityException;
+import org.jboss.ws.extras.security.WSSecurityException;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/SecurityHeader.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/element/SecurityHeader.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/SecurityHeader.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,18 +19,18 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.element;
+package org.jboss.ws.extras.security.element;
import java.util.HashMap;
import java.util.LinkedList;
-import org.jboss.ws.wsse.BinarySecurityTokenValidator;
-import org.jboss.ws.wsse.Constants;
-import org.jboss.ws.wsse.KeyResolver;
-import org.jboss.ws.wsse.SecurityStore;
-import org.jboss.ws.wsse.UnsupportedSecurityTokenException;
-import org.jboss.ws.wsse.Util;
-import org.jboss.ws.wsse.WSSecurityException;
+import org.jboss.ws.extras.security.BinarySecurityTokenValidator;
+import org.jboss.ws.extras.security.Constants;
+import org.jboss.ws.extras.security.KeyResolver;
+import org.jboss.ws.extras.security.SecurityStore;
+import org.jboss.ws.extras.security.UnsupportedSecurityTokenException;
+import org.jboss.ws.extras.security.Util;
+import org.jboss.ws.extras.security.WSSecurityException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/SecurityProcess.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/element/SecurityProcess.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/SecurityProcess.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.element;
+package org.jboss.ws.extras.security.element;
/**
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/SecurityTokenReference.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/element/SecurityTokenReference.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/SecurityTokenReference.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,11 +19,11 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.element;
+package org.jboss.ws.extras.security.element;
-import org.jboss.ws.wsse.Constants;
-import org.jboss.ws.wsse.Util;
-import org.jboss.ws.wsse.WSSecurityException;
+import org.jboss.ws.extras.security.Constants;
+import org.jboss.ws.extras.security.Util;
+import org.jboss.ws.extras.security.WSSecurityException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/Signature.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/element/Signature.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/Signature.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,14 +19,14 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.element;
+package org.jboss.ws.extras.security.element;
import java.security.PublicKey;
import org.apache.xml.security.exceptions.XMLSecurityException;
import org.apache.xml.security.signature.XMLSignature;
-import org.jboss.ws.wsse.KeyResolver;
-import org.jboss.ws.wsse.WSSecurityException;
+import org.jboss.ws.extras.security.KeyResolver;
+import org.jboss.ws.extras.security.WSSecurityException;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/Timestamp.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/element/Timestamp.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/Timestamp.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,16 +19,16 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.element;
+package org.jboss.ws.extras.security.element;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.TimeZone;
import org.apache.xml.security.utils.XMLUtils;
-import org.jboss.ws.wsse.Constants;
-import org.jboss.ws.wsse.Util;
-import org.jboss.ws.wsse.WSSecurityException;
+import org.jboss.ws.extras.security.Constants;
+import org.jboss.ws.extras.security.Util;
+import org.jboss.ws.extras.security.WSSecurityException;
import org.jboss.xb.binding.SimpleTypeBindings;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/Token.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/element/Token.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/Token.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.element;
+package org.jboss.ws.extras.security.element;
/**
* <code>Token</code> represnts an authenticated identifier contained in a
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/UsernameToken.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/element/UsernameToken.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/UsernameToken.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,12 +19,12 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.element;
+package org.jboss.ws.extras.security.element;
import org.apache.xml.security.utils.XMLUtils;
-import org.jboss.ws.wsse.Constants;
-import org.jboss.ws.wsse.Util;
-import org.jboss.ws.wsse.WSSecurityException;
+import org.jboss.ws.extras.security.Constants;
+import org.jboss.ws.extras.security.Util;
+import org.jboss.ws.extras.security.WSSecurityException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/X509IssuerSerial.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/element/X509IssuerSerial.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/X509IssuerSerial.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,15 +19,15 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.element;
+package org.jboss.ws.extras.security.element;
import java.security.cert.X509Certificate;
import org.apache.xml.security.utils.XMLUtils;
-import org.jboss.ws.wsse.Constants;
-import org.jboss.ws.wsse.InvalidSecurityHeaderException;
-import org.jboss.ws.wsse.Util;
-import org.jboss.ws.wsse.WSSecurityException;
+import org.jboss.ws.extras.security.Constants;
+import org.jboss.ws.extras.security.InvalidSecurityHeaderException;
+import org.jboss.ws.extras.security.Util;
+import org.jboss.ws.extras.security.WSSecurityException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -36,8 +36,8 @@
* <code>SecurityTokenReference</code> that referes to a token that
* using the Issuer's DN, and certificate serial number.
*
- * @see org.jboss.ws.wsse.element.SecurityTokenReference
- * @see org.jboss.ws.wsse.element.BinarySecurityToken
+ * @see org.jboss.ws.extras.security.element.SecurityTokenReference
+ * @see org.jboss.ws.extras.security.element.BinarySecurityToken
*
* @author Jason T. Greene
* @version $Id$
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/X509Token.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/element/X509Token.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/element/X509Token.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.element;
+package org.jboss.ws.extras.security.element;
import java.io.ByteArrayInputStream;
import java.security.cert.CertificateEncodingException;
@@ -28,8 +28,8 @@
import org.apache.xml.security.utils.XMLUtils;
import org.jboss.util.Base64;
-import org.jboss.ws.wsse.Constants;
-import org.jboss.ws.wsse.WSSecurityException;
+import org.jboss.ws.extras.security.Constants;
+import org.jboss.ws.extras.security.WSSecurityException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/jaxrpc (from
rev 1557, branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/jaxrpc)
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/jaxrpc/WSSecurityHandler.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/jaxrpc/WSSecurityHandler.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/jaxrpc/WSSecurityHandler.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.jaxrpc;
+package org.jboss.ws.extras.security.jaxrpc;
// $Id$
@@ -29,10 +29,10 @@
import javax.xml.soap.SOAPException;
import org.jboss.logging.Logger;
+import org.jboss.ws.extras.security.WSSecurityDispatcher;
import org.jboss.ws.jaxrpc.handler.SOAPMessageContextJAXRPC;
-import org.jboss.ws.metadata.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
-import org.jboss.ws.wsse.WSSecurityDispatcher;
/**
* An abstract JAXRPC handler that delegates to the WSSecurityDispatcher
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/jaxrpc/WSSecurityHandlerInbound.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/jaxrpc/WSSecurityHandlerInbound.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/jaxrpc/WSSecurityHandlerInbound.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.jaxrpc;
+package org.jboss.ws.extras.security.jaxrpc;
// $Id$
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/jaxrpc/WSSecurityHandlerOutbound.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/jaxrpc/WSSecurityHandlerOutbound.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/jaxrpc/WSSecurityHandlerOutbound.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.jaxrpc;
+package org.jboss.ws.extras.security.jaxrpc;
// $Id$
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/jaxws (from rev
1557, branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/jaxws)
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/jaxws/WSSecurityHandler.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/jaxws/WSSecurityHandler.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/jaxws/WSSecurityHandler.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.jaxws;
+package org.jboss.ws.extras.security.jaxws;
// $Id$
@@ -27,11 +27,11 @@
import javax.xml.ws.handler.MessageContext;
import org.jboss.logging.Logger;
-import org.jboss.ws.common.CommonMessageContext;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.extras.security.WSSecurityDispatcher;
import org.jboss.ws.jaxws.handler.GenericSOAPHandler;
-import org.jboss.ws.metadata.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
-import org.jboss.ws.wsse.WSSecurityDispatcher;
/**
* An abstract JAXWS handler that delegates to the WSSecurityDispatcher
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/jaxws/WSSecurityHandlerInbound.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/jaxws/WSSecurityHandlerInbound.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/jaxws/WSSecurityHandlerInbound.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.jaxws;
+package org.jboss.ws.extras.security.jaxws;
import javax.xml.ws.handler.MessageContext;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/jaxws/WSSecurityHandlerOutbound.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/wsse/jaxws/WSSecurityHandlerOutbound.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/jaxws/WSSecurityHandlerOutbound.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.jaxws;
+package org.jboss.ws.extras.security.jaxws;
import javax.xml.ws.handler.MessageContext;
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/CreateAttachmentVisitor.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/xop/CreateAttachmentVisitor.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/xop/CreateAttachmentVisitor.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/CreateAttachmentVisitor.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,89 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.xop;
+
+import org.jboss.ws.soap.SAAJVisitor;
+import org.jboss.ws.soap.SOAPElementImpl;
+import org.jboss.ws.soap.SOAPContentElement;
+
+import java.util.Iterator;
+import java.io.Writer;
+import java.io.IOException;
+
+/**
+ * @author Heiko Braun <heiko.braun(a)jboss.com>
+ * @version $Id: CreateAttachmentVisitor.java 1408 2006-11-07 13:42:25Z
heiko.braun(a)jboss.com $
+ * @since Nov 7, 2006
+ */
+public class CreateAttachmentVisitor implements SAAJVisitor {
+ public void visitXOPElements(SOAPElementImpl root)
+ {
+ boolean isSCE = (root instanceof SOAPContentElement);
+
+ // don't expand SOAPContentElements
+ if(isSCE)
+ {
+ root.accept(this);
+ }
+ else
+ {
+ Iterator it = root.getChildElements();
+ while(it.hasNext())
+ {
+ final Object o = it.next();
+ if(o instanceof SOAPElementImpl)
+ visitXOPElements((SOAPElementImpl)o);
+ }
+ }
+ }
+
+ public void visitSOAPElement(SOAPElementImpl soapElement) {
+ // nada
+ }
+
+ public void visitSOAPContentElement(SOAPContentElement scElement) {
+ // Calling writeElement will enforce marshalling of this object
+ // Any attachment will be created while doing this.
+ try
+ {
+ scElement.writeElement( new NoopWriter() );
+ }
+ catch (IOException e)
+ {
+ //
+ }
+ }
+
+ class NoopWriter extends Writer {
+ public void write(char cbuf[], int off, int len) throws IOException {
+
+ }
+
+ public void flush() throws IOException {
+
+ }
+
+ public void close() throws IOException {
+
+ }
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/DisableMTOMHandler.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/xop/DisableMTOMHandler.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/xop/DisableMTOMHandler.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/DisableMTOMHandler.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,59 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.xop;
+
+import org.jboss.ws.jaxrpc.StubExt;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.handler.GenericHandler;
+import javax.xml.rpc.handler.MessageContext;
+
+/**
+ * @author Heiko Braun <heiko.braun(a)jboss.com>
+ * @version $Id$
+ * @since Oct 2, 2006
+ */
+public class DisableMTOMHandler extends GenericHandler {
+ public QName[] getHeaders() {
+ return new QName[0];
+ }
+
+ public boolean handleRequest(MessageContext msgContext) {
+ disableMTOM(msgContext);
+ return true;
+ }
+
+ public boolean handleResponse(MessageContext msgContext) {
+ disableMTOM(msgContext);
+ return true;
+ }
+
+ public boolean handleFault(MessageContext msgContext) {
+ disableMTOM(msgContext);
+ return true;
+ }
+
+ public void disableMTOM(MessageContext msgContext)
+ {
+ msgContext.setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.FALSE);
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/RestoreXOPElementVisitor.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/xop/RestoreXOPElementVisitor.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/xop/RestoreXOPElementVisitor.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/RestoreXOPElementVisitor.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,75 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.xop;
+
+import org.jboss.ws.soap.SAAJVisitor;
+import org.jboss.ws.soap.SOAPContentElement;
+import org.jboss.ws.soap.SOAPElementImpl;
+
+import java.util.Iterator;
+
+/**
+ * Visit soap object model and restore XOP contents.
+ * This visitor is invoked when:
+ * <ul>
+ * <li>Client side request handler chain has been executed
+ * <li>Server side response or fault handler chain been executed
+ * </ul>
+ *
+ * It basically takes care that when jaxrpc handlers have been in place,
+ * the XOP contents are being restored upon request and response.
+ *
+ * @author Heiko Braun <heiko.braun(a)jboss.com>
+ * @version $Id$
+ * @since Sep 26, 2006
+ */
+public class RestoreXOPElementVisitor implements SAAJVisitor {
+
+ public void visitXOPElements(SOAPElementImpl root)
+ {
+ boolean isSCE = (root instanceof SOAPContentElement);
+
+ // don't expand SOAPContentElements
+ if(isSCE)
+ {
+ root.accept(this);
+ }
+ else
+ {
+ Iterator it = root.getChildElements();
+ while(it.hasNext())
+ {
+ final Object o = it.next();
+ if(o instanceof SOAPElementImpl)
+ visitXOPElements((SOAPElementImpl)o);
+ }
+ }
+ }
+
+ public void visitSOAPElement(SOAPElementImpl soapElement) {
+ // nada
+ }
+
+ public void visitSOAPContentElement(SOAPContentElement scElement) {
+ scElement.handleMTOMTransitions();
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/XOPContext.java
(from rev 1557, branches/tdiesler/trunk/src/main/java/org/jboss/ws/xop/XOPContext.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/xop/XOPContext.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/XOPContext.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,405 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extras.xop;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.Constants;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.extras.xop.jaxrpc.XOPMarshallerImpl;
+import org.jboss.ws.jaxrpc.StubExt;
+import org.jboss.ws.soap.MessageContextAssociation;
+import org.jboss.ws.soap.NameImpl;
+import org.jboss.ws.soap.SOAPElementImpl;
+import org.jboss.ws.soap.SOAPMessageImpl;
+import org.jboss.ws.soap.attachment.MimeConstants;
+import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.utils.JavaUtils;
+import org.jboss.ws.utils.MimeUtils;
+import org.jboss.xb.binding.SimpleTypeBindings;
+import org.jboss.xb.binding.sunday.xop.XOPMarshaller;
+import org.jboss.xb.binding.sunday.xop.XOPObject;
+
+import javax.activation.DataHandler;
+import javax.xml.namespace.QName;
+import javax.xml.soap.*;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.util.Iterator;
+
+/**
+ * XOP context associated with a message context.
+ * Acts as a facade to the current soap message and supports the various XOP
transitions.<p>
+ * A good starting point to understand how MTOM in JBossWS works is to take a
+ * look at the SOAPContentElement implementation.
+ *
+ * @see org.jboss.ws.soap.SOAPContentElement#handleMTOMTransitions()
+ * @see org.jboss.ws.extras.xop.jaxrpc.XOPUnmarshallerImpl
+ * @see XOPMarshallerImpl
+ *
+ * @author Heiko Braun <heiko.braun(a)jboss.com>
+ * @since May 10, 2006
+ * @version $Id$
+ */
+public class XOPContext {
+
+ private static final Logger log = Logger.getLogger(XOPContext.class);
+
+ private static final String NS_XOP_JBOSSWS = "http://org.jboss.ws/xop";
+
+ /**
+ * Check if the current soap message flagged as a XOP package.
+ * This may differ from the wire format when jaxrpc handlers are in place.
+ */
+ public static boolean isXOPMessage() {
+ boolean isXOP = false;
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ if(msgContext!=null) {
+ SOAPMessageImpl soapMessage = (SOAPMessageImpl)msgContext.getSOAPMessage();
+ isXOP = (soapMessage != null && soapMessage.isXOPMessage());
+ }
+ return isXOP;
+ }
+
+ /**
+ * Check if the wire format is actually a xop encoded multipart message
+ */
+ public static boolean isXOPEncodedRequest()
+ {
+ boolean isMultippartXOP = false;
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ if(msgContext!=null) {
+ SOAPMessageImpl soapMessage = (SOAPMessageImpl)msgContext.getSOAPMessage();
+ String[] contentType =
soapMessage.getMimeHeaders().getHeader("content-type");
+ if(contentType!=null)
+ {
+ for(String value : contentType)
+ {
+ if(value.indexOf(MimeConstants.TYPE_APPLICATION_XOP_XML) != -1)
+ {
+ isMultippartXOP = true;
+ break;
+ }
+ }
+ }
+ }
+
+ return isMultippartXOP;
+ }
+
+ /**
+ * Check if MTOM is disabled through a message context property.
+ * (<code>org.jboss.ws.mtom.enabled</code>)<br>
+ * Defaults to TRUE if the property is not set.
+ */
+ public static boolean isMTOMEnabled()
+ {
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ Boolean mtomEnabled =
(Boolean)msgContext.getProperty(StubExt.PROPERTY_MTOM_ENABLED);
+ return Boolean.TRUE.equals(mtomEnabled) || mtomEnabled == null;
+ }
+
+ public static void setMTOMEnabled(boolean b)
+ {
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ msgContext.setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.valueOf(b));
+ }
+
+ /**
+ * Replace all <code>xop:Include</code> elements with it's base64
representation.
+ * This happens when the associated SOAPContentElement transitions to state
dom-valid.<br>
+ * All attachement parts will be removed.
+ */
+ public static void inlineXOPData(SOAPElement xopElement)
+ {
+ String ns = xopElement.getNamespaceURI()!=null ? xopElement.getNamespaceURI():
"";
+ String localName = xopElement.getLocalName();
+
+ // rpc/lit
+ if(ns.equals(Constants.NS_XOP) && localName.equals("Include"))
+ {
+ replaceXOPInclude(xopElement.getParentElement(), xopElement);
+ }
+ else
+ {
+ // doc/lit
+ Iterator it = DOMUtils.getChildElements(xopElement);
+ while(it.hasNext())
+ {
+ SOAPElement childElement = (SOAPElement)it.next();
+ String childNS = childElement.getNamespaceURI()!=null ?
childElement.getNamespaceURI(): "";
+ String childName = childElement.getLocalName();
+ if(childNS.equals(Constants.NS_XOP) &&
childName.equals("Include"))
+ {
+ replaceXOPInclude(xopElement, childElement);
+ }
+ else
+ {
+ inlineXOPData(childElement);
+ }
+ }
+ }
+ }
+
+ /**
+ * When handlers jump in, the SOAPMessage flag that indicates
+ * a xop encoded message (derived from wire format) becomes stale.
+ *
+ * @param isXOPMessage
+ */
+ private static void setXOPMessage(boolean isXOPMessage)
+ {
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ SOAPMessageImpl soapMsg = (SOAPMessageImpl)msgContext.getSOAPMessage();
+ soapMsg.setXOPMessage(isXOPMessage);
+ }
+
+ /**
+ * The XOP attachments need to be created before the actual message is written
+ * to an output stream. This is necessary because it changes the overall message
content-type.
+ * If we would do this lazily (i.e. upon remoting callback) the previous content-type
+ * would already have been written.
+ *
+ * @see org.jboss.ws.soap.SOAPConnectionImpl#callInternal(javax.xml.soap.SOAPMessage,
Object, boolean)
+ * @see org.jboss.ws.binding.soap.SOAPMessageMarshaller#write(Object,
java.io.OutputStream)
+ */
+ public static void eagerlyCreateAttachments()
+ {
+ if(!isXOPMessage())
+ return;
+
+ try
+ {
+ CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
+ SOAPMessage soapMessage = msgContext != null ? msgContext.getSOAPMessage() :
null;
+ SOAPBody body = soapMessage!=null ? soapMessage.getSOAPBody() : null;
+
+ if(body!=null)
+ {
+ CreateAttachmentVisitor visitor = new CreateAttachmentVisitor();
+ visitor.visitXOPElements((SOAPElementImpl)body);
+ }
+ }
+ catch (SOAPException e)
+ {
+ throw new WSException("Failed to eagerly create XOP attachments", e);
+ }
+ }
+
+ /**
+ * Visit the soap object model elements and restore xop data.
+ */
+ public static void visitAndRestoreXOPData()
+ {
+ try
+ {
+ if(!isXOPMessage() && isMTOMEnabled())
+ {
+ CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
+ SOAPBody body = msgContext.getSOAPMessage().getSOAPBody();
+ RestoreXOPElementVisitor visitor = new RestoreXOPElementVisitor();
+ visitor.visitXOPElements((SOAPElementImpl)body);
+ }
+ }
+ catch (SOAPException e)
+ {
+ throw new WSException("Failed to restore XOP data", e);
+ }
+ }
+
+ /**
+ * Restore previously inlined XOP elements.
+ * All base64 representations will be replaced by
<code>xop:Include</code>
+ * elements and the attachment parts will be recreated. <br>
+ * This happens when a SOAPContentElement is written to an output stream.
+ */
+ public static void restoreXOPDataDOM(SOAPElement xopElement)
+ {
+ String contentType = xopElement.getAttributeNS(NS_XOP_JBOSSWS,
"content-type");
+ if(contentType != null && contentType.length()>0)
+ {
+ replaceBase64Representation(xopElement, contentType);
+ xopElement.removeAttribute(new NameImpl(new QName(NS_XOP_JBOSSWS,
"content-type")));
+ }
+ else
+ {
+ Iterator it = DOMUtils.getChildElements(xopElement);
+ while(it.hasNext())
+ {
+ SOAPElement childElement = (SOAPElement)it.next();
+ restoreXOPDataDOM(childElement);
+ }
+ }
+ }
+
+ private static void replaceBase64Representation(SOAPElement xopElement, String
contentType) {
+
+ SOAPElement parentElement = xopElement.getParentElement();
+ log.debug("Replace base64 representation on element [xmlName=" +
parentElement.getLocalName()+"]");
+
+ String base64 = xopElement.getValue();
+ byte[] data = SimpleTypeBindings.unmarshalBase64(base64);
+
+ MimeUtils.ByteArrayConverter converter =
MimeUtils.getConverterForContentType(contentType);
+ Object converted = converter.readFrom(new ByteArrayInputStream(data));
+
+ XOPObject xopObject = new XOPObject(converted);
+ xopObject.setContentType(contentType);
+
+ XOPMarshaller xopMarshaller = new XOPMarshallerImpl();
+ String cid = xopMarshaller.addMtomAttachment(xopObject,
xopElement.getNamespaceURI(), xopElement.getLocalName());
+
+ // remove base64 node with the xop:Include element
+ org.w3c.dom.Node child = (org.w3c.dom.Node)xopElement.getFirstChild();
+ xopElement.removeChild(child);
+
+ try
+ {
+ SOAPElement xopInclude =
xopElement.addChildElement(Constants.NAME_XOP_INCLUDE);
+ xopInclude.setAttribute("href", cid);
+ log.debug("Restored xop:Include element on
[xmlName="+xopElement.getLocalName()+"]");
+
+ XOPContext.setXOPMessage(true);
+ }
+ catch (SOAPException e)
+ {
+ throw new WSException("Failed to create XOP include element", e);
+ }
+
+ }
+
+ private static void replaceXOPInclude(SOAPElement parent, SOAPElement
xopIncludeElement)
+ {
+
+ log.debug("Replace xop:Include on element [xmlName=" +
parent.getLocalName() +"]");
+
+ String cid = xopIncludeElement.getAttribute("href");
+ byte[] data;
+ String contentType;
+
+ try
+ {
+ AttachmentPart part = XOPContext.getAttachmentByCID(cid);
+ DataHandler dh = part.getDataHandler();
+ contentType = dh.getContentType();
+
+ // TODO: can't we create base64 directly from stream?
+ ByteArrayOutputStream bout = new ByteArrayOutputStream();
+ dh.writeTo(bout);
+ data = bout.toByteArray();
+
+ }
+ catch (Exception e)
+ {
+ throw new WSException("Failed to inline XOP data", e);
+ }
+
+ // create base64 contents
+ String base64 = SimpleTypeBindings.marshalBase64(data);
+ parent.removeChild(xopIncludeElement);
+ parent.setValue(base64);
+ parent.setAttributeNS(NS_XOP_JBOSSWS, "content-type", contentType);
+
+ log.debug("Created base64 representation for content-type " +
contentType);
+
+ // cleanup the attachment part
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ SOAPMessageImpl soapMessage = (SOAPMessageImpl)msgContext.getSOAPMessage();
+
+ if(cid.startsWith("cid:")) cid = cid.substring(4);
+ cid = '<'+cid+'>';
+
+ AttachmentPart removedPart = soapMessage.removeAttachmentByContentId(cid);
+ if(null == removedPart)
+ throw new WSException("Unable to remove attachment part " + cid);
+
+ log.debug("Removed attachment part " + cid);
+
+ // leave soap object model in a valid state
+ setXOPMessage(false);
+
+ }
+
+ /**
+ * Access an XOP attachment part by content id (CID).
+ */
+ public static AttachmentPart getAttachmentByCID(String cid) throws SOAPException
+ {
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ SOAPMessageImpl soapMessage = (SOAPMessageImpl)msgContext.getSOAPMessage();
+
+ // RFC2392 requires the 'cid:' part to be stripped from the cid
+ if(cid.startsWith("cid:")) cid = cid.substring(4);
+ cid = '<'+cid+'>';
+
+ AttachmentPart part = soapMessage.getAttachmentByContentId(cid);
+ if (part == null)
+ throw new WSException("Cannot find attachment part for: " + cid);
+
+ return part;
+ }
+
+ /**
+ * Create a <code>DataHandler</code> for an object.
+ * The handlers content type is based on the java type.
+ */
+ public static DataHandler createDataHandler(XOPObject xopObject)
+ {
+ DataHandler dataHandler;
+ Object o = xopObject.getContent();
+
+ if(o instanceof DataHandler)
+ {
+ dataHandler = (DataHandler)o;
+ }
+ else if(xopObject.getContentType() != null)
+ {
+ dataHandler = new DataHandler(o, xopObject.getContentType());
+ }
+ else
+ {
+ dataHandler = new DataHandler(o, getContentTypeForClazz(o.getClass()));
+ }
+
+ return dataHandler;
+ }
+
+ public static String getContentTypeForClazz(Class clazz)
+ {
+ if(JavaUtils.isAssignableFrom(java.awt.Image.class, clazz))
+ {
+ return "image/jpeg";
+ }
+ else if (JavaUtils.isAssignableFrom(javax.xml.transform.Source.class, clazz))
+ {
+ return "application/xml";
+ }
+ else if (JavaUtils.isAssignableFrom(java.lang.String.class, clazz))
+ {
+ return "text/plain";
+ }
+ else
+ {
+ return "application/octet-stream";
+ }
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxrpc (from rev
1557, branches/tdiesler/trunk/src/main/java/org/jboss/ws/xop/jaxrpc)
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxrpc/JBossXBContentAdapter.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/xop/jaxrpc/JBossXBContentAdapter.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxrpc/JBossXBContentAdapter.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,12 +19,12 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.xop.jaxrpc;
+package org.jboss.ws.extras.xop.jaxrpc;
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-import org.jboss.ws.xop.XOPContext;
+import org.jboss.ws.extras.xop.XOPContext;
import org.jboss.ws.soap.attachment.ContentHandlerRegistry;
import org.jboss.ws.soap.attachment.SwapableMemoryDataSource;
import org.jboss.ws.utils.IOUtils;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxrpc/XOPMarshallerImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/xop/jaxrpc/XOPMarshallerImpl.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxrpc/XOPMarshallerImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,16 +19,16 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.xop.jaxrpc;
+package org.jboss.ws.extras.xop.jaxrpc;
import org.jboss.logging.Logger;
import org.jboss.util.NotImplementedException;
-import org.jboss.ws.common.CommonMessageContext;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.extras.xop.XOPContext;
import org.jboss.ws.soap.MessageContextAssociation;
import org.jboss.ws.soap.SOAPMessageImpl;
import org.jboss.ws.soap.attachment.ContentHandlerRegistry;
import org.jboss.ws.soap.attachment.MimeConstants;
-import org.jboss.ws.xop.XOPContext;
import org.jboss.xb.binding.sunday.xop.XOPMarshaller;
import org.jboss.xb.binding.sunday.xop.XOPObject;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxrpc/XOPScanner.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/xop/jaxrpc/XOPScanner.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxrpc/XOPScanner.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.xop.jaxrpc;
+package org.jboss.ws.extras.xop.jaxrpc;
import org.apache.xerces.xs.*;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxrpc/XOPUnmarshallerImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/xop/jaxrpc/XOPUnmarshallerImpl.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxrpc/XOPUnmarshallerImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,12 +19,12 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.xop.jaxrpc;
+package org.jboss.ws.extras.xop.jaxrpc;
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-import org.jboss.ws.xop.XOPContext;
+import org.jboss.ws.extras.xop.XOPContext;
import org.jboss.ws.soap.attachment.ContentHandlerRegistry;
import org.jboss.xb.binding.sunday.xop.XOPObject;
import org.jboss.xb.binding.sunday.xop.XOPUnmarshaller;
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxws (from rev
1557, branches/tdiesler/trunk/src/main/java/org/jboss/ws/xop/jaxws)
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxws/AttachmentMarshallerImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/xop/jaxws/AttachmentMarshallerImpl.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxws/AttachmentMarshallerImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -1,7 +1,7 @@
-package org.jboss.ws.xop.jaxws;
+package org.jboss.ws.extras.xop.jaxws;
-import org.jboss.ws.xop.jaxrpc.XOPMarshallerImpl;
-import org.jboss.ws.xop.XOPContext;
+import org.jboss.ws.extras.xop.XOPContext;
+import org.jboss.ws.extras.xop.jaxrpc.XOPMarshallerImpl;
import org.jboss.ws.WSException;
import org.jboss.xb.binding.sunday.xop.XOPObject;
import org.jboss.xb.binding.sunday.xop.XOPMarshaller;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxws/AttachmentUnmarshallerImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/xop/jaxws/AttachmentUnmarshallerImpl.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxws/AttachmentUnmarshallerImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -1,7 +1,7 @@
-package org.jboss.ws.xop.jaxws;
+package org.jboss.ws.extras.xop.jaxws;
-import org.jboss.ws.xop.XOPContext;
-import org.jboss.ws.xop.jaxrpc.XOPUnmarshallerImpl;
+import org.jboss.ws.extras.xop.XOPContext;
+import org.jboss.ws.extras.xop.jaxrpc.XOPUnmarshallerImpl;
import org.jboss.xb.binding.sunday.xop.XOPUnmarshaller;
import org.jboss.xb.binding.sunday.xop.XOPObject;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxws/ReflectiveXOPScanner.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/xop/jaxws/ReflectiveXOPScanner.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxws/ReflectiveXOPScanner.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.xop.jaxws;
+package org.jboss.ws.extras.xop.jaxws;
import javax.xml.bind.annotation.XmlMimeType;
import java.lang.reflect.Field;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/SecurityAdaptorFactoryImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/SecurityAdaptorFactoryImpl.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/SecurityAdaptorFactoryImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -26,8 +26,8 @@
import java.security.Principal;
import org.jboss.security.SecurityAssociation;
-import org.jboss.ws.wsse.SecurityAdaptor;
-import org.jboss.ws.wsse.SecurityAdaptorFactory;
+import org.jboss.ws.extras.security.SecurityAdaptor;
+import org.jboss.ws.extras.security.SecurityAdaptorFactory;
/**
* A Jboss specific SecurityAdaptorFactory
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/AbstractEJBDeployer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/AbstractEJBDeployer.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/AbstractEJBDeployer.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -28,7 +28,7 @@
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.spi.deployer.DeploymentUnit;
import org.jboss.ws.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.metadata.UnifiedMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
/**
* An abstract deployer for EJB Endpoints
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossContextServlet.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossContextServlet.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossContextServlet.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -24,7 +24,7 @@
// $Id$
import org.jboss.logging.Logger;
-import org.jboss.ws.common.CommonContextServlet;
+import org.jboss.ws.core.CommonContextServlet;
import org.jboss.ws.server.ServiceEndpointManagerFactory;
/**
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossServiceEndpointServlet.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossServiceEndpointServlet.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossServiceEndpointServlet.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -29,10 +29,10 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-import org.jboss.ws.metadata.HandlerMetaData;
-import org.jboss.ws.metadata.ServerEndpointMetaData;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
import org.jboss.ws.metadata.config.WSCommonConfig;
+import org.jboss.ws.metadata.umdm.HandlerMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.server.ServiceEndpoint;
import org.jboss.ws.server.AbstractServiceEndpointServlet;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointGeneratorEJB.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointGeneratorEJB.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointGeneratorEJB.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -34,10 +34,10 @@
import org.jboss.deployers.spi.deployer.DeploymentUnit;
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.ServerEndpointMetaData;
-import org.jboss.ws.metadata.ServiceMetaData;
-import org.jboss.ws.metadata.UnifiedMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
import org.jboss.ws.server.ServerConfig;
import org.jboss.ws.server.ServerConfigFactory;
import org.jboss.ws.utils.DOMUtils;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointLifecycleDeployer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointLifecycleDeployer.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointLifecycleDeployer.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -33,7 +33,7 @@
import org.jboss.metadata.WebMetaData;
import org.jboss.ws.deployment.ServiceEndpointDeployer;
import org.jboss.ws.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.metadata.UnifiedMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
import org.jboss.ws.server.KernelLocator;
/**
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefMetaDataAdaptor.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefMetaDataAdaptor.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefMetaDataAdaptor.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -33,10 +33,10 @@
import org.jboss.webservice.metadata.serviceref.InitParamMetaData;
import org.jboss.webservice.metadata.serviceref.PortComponentRefMetaData;
import org.jboss.webservice.metadata.serviceref.ServiceRefMetaData;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerInitParam;
import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
import org.jboss.ws.metadata.j2ee.UnifiedPortComponentRefMetaData;
import org.jboss.ws.metadata.j2ee.UnifiedServiceRefMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerInitParam;
/**
* Build container independent service ref meta data
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/tomcat/TomcatContextServlet.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/tomcat/TomcatContextServlet.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/tomcat/TomcatContextServlet.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -37,7 +37,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-import org.jboss.ws.common.CommonContextServlet;
+import org.jboss.ws.core.CommonContextServlet;
import org.jboss.ws.server.ServiceEndpointManager;
import org.jboss.ws.server.ServiceEndpointManagerFactory;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/CallImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/CallImpl.java 2006-12-06
00:28:12 UTC (rev 1558)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/CallImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -47,21 +47,21 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.binding.UnboundHeader;
-import org.jboss.ws.common.CommonClient;
+import org.jboss.ws.core.CommonClient;
+import org.jboss.ws.extras.xop.XOPContext;
import org.jboss.ws.jaxrpc.handler.HandlerChainBaseImpl;
import org.jboss.ws.jaxrpc.handler.SOAPMessageContextJAXRPC;
import org.jboss.ws.jbossxb.JBossXBDeserializerFactory;
import org.jboss.ws.jbossxb.JBossXBSerializerFactory;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.ParameterMetaData;
-import org.jboss.ws.metadata.ServiceMetaData;
-import org.jboss.ws.metadata.TypesMetaData;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.umdm.TypesMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
import org.jboss.ws.soap.MessageContextAssociation;
import org.jboss.ws.utils.JavaUtils;
-import org.jboss.ws.xop.XOPContext;
/** Provides support for the dynamic invocation of a service endpoint.
* The javax.xml.rpc.Service interface acts as a factory for the creation of Call
instances.
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/CallProxy.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/CallProxy.java 2006-12-06
00:28:12 UTC (rev 1558)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/CallProxy.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -39,8 +39,8 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.OperationMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.utils.JavaUtils;
/**
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/HandlerRegistryImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/HandlerRegistryImpl.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/HandlerRegistryImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -36,10 +36,10 @@
import org.jboss.logging.Logger;
import org.jboss.ws.jaxrpc.handler.ClientHandlerChain;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.HandlerMetaDataJAXRPC;
-import org.jboss.ws.metadata.ServiceMetaData;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaDataJAXRPC;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
/**
* Provides support for the programmatic configuration of
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/ParameterWrapping.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/ParameterWrapping.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/ParameterWrapping.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -43,13 +43,13 @@
import org.jboss.ws.WSException;
import org.jboss.ws.jbossxb.JBossXBDeserializerFactory;
import org.jboss.ws.jbossxb.JBossXBSerializerFactory;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.ParameterMetaData;
-import org.jboss.ws.metadata.ServiceMetaData;
-import org.jboss.ws.metadata.TypeMappingMetaData;
-import org.jboss.ws.metadata.TypesMetaData;
-import org.jboss.ws.metadata.WrappedParameter;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.umdm.TypeMappingMetaData;
+import org.jboss.ws.metadata.umdm.TypesMetaData;
+import org.jboss.ws.metadata.umdm.WrappedParameter;
import org.jboss.ws.utils.HolderUtils;
import org.jboss.ws.utils.JavaUtils;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SOAP11BindingJAXRPC.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SOAP11BindingJAXRPC.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SOAP11BindingJAXRPC.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -25,8 +25,8 @@
import javax.xml.soap.SOAPMessage;
-import org.jboss.ws.common.CommonSOAP11Binding;
-import org.jboss.ws.metadata.OperationMetaData;
+import org.jboss.ws.core.CommonSOAP11Binding;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.soap.SOAPFaultImpl;
/**
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SOAP12BindingJAXRPC.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SOAP12BindingJAXRPC.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SOAP12BindingJAXRPC.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -25,8 +25,8 @@
import javax.xml.soap.SOAPMessage;
-import org.jboss.ws.common.CommonSOAP12Binding;
-import org.jboss.ws.metadata.OperationMetaData;
+import org.jboss.ws.core.CommonSOAP12Binding;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.soap.SOAPFaultImpl;
/**
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SOAPBindingJAXRPC.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SOAPBindingJAXRPC.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SOAPBindingJAXRPC.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -28,8 +28,8 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.logging.Logger;
-import org.jboss.ws.common.CommonMessageContext;
-import org.jboss.ws.metadata.OperationMetaData;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.soap.MessageContextAssociation;
/**
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SOAPFaultHelperJAXRPC.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SOAPFaultHelperJAXRPC.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SOAPFaultHelperJAXRPC.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -51,11 +51,11 @@
import org.jboss.ws.binding.DeserializerSupport;
import org.jboss.ws.binding.SerializationContext;
import org.jboss.ws.binding.SerializerSupport;
-import org.jboss.ws.common.CommonMessageContext;
+import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.jaxrpc.encoding.DeserializerFactoryBase;
import org.jboss.ws.jaxrpc.encoding.SerializerFactoryBase;
-import org.jboss.ws.metadata.FaultMetaData;
-import org.jboss.ws.metadata.OperationMetaData;
+import org.jboss.ws.metadata.umdm.FaultMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.soap.MessageContextAssociation;
import org.jboss.ws.soap.MessageFactoryImpl;
import org.jboss.ws.soap.NameImpl;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SerializationContextJAXRPC.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SerializationContextJAXRPC.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SerializationContextJAXRPC.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -31,12 +31,12 @@
import org.jboss.ws.WSException;
import org.jboss.ws.binding.SerializationContext;
import org.jboss.ws.jaxrpc.handler.SOAPMessageContextJAXRPC;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.ServiceMetaData;
-import org.jboss.ws.metadata.TypesMetaData;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.jaxrpcmapping.JavaXmlTypeMapping;
import org.jboss.ws.metadata.jaxrpcmapping.PackageMapping;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.umdm.TypesMetaData;
import org.jboss.ws.soap.MessageContextAssociation;
import org.jboss.ws.utils.JavaUtils;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/ServiceImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/ServiceImpl.java 2006-12-06
00:28:12 UTC (rev 1558)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/ServiceImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -39,13 +39,13 @@
import javax.xml.rpc.handler.HandlerChain;
import javax.xml.rpc.handler.HandlerRegistry;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.ServiceMetaData;
-import org.jboss.ws.metadata.UnifiedMetaData;
import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCClientMetaDataBuilder;
import org.jboss.ws.metadata.j2ee.UnifiedServiceRefMetaData;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
/**
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/ServiceObjectFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/ServiceObjectFactory.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/ServiceObjectFactory.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -58,15 +58,15 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.HandlerMetaData;
-import org.jboss.ws.metadata.HandlerMetaDataJAXRPC;
-import org.jboss.ws.metadata.ServiceMetaData;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerInitParam;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
import org.jboss.ws.metadata.j2ee.UnifiedPortComponentRefMetaData;
import org.jboss.ws.metadata.j2ee.UnifiedServiceRefMetaData;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaDataJAXRPC;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerInitParam;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
import org.jboss.ws.server.ServiceEndpoint;
import org.jboss.ws.server.ServiceEndpointManager;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/StubExt.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/StubExt.java 2006-12-06
00:28:12 UTC (rev 1558)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/StubExt.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -26,7 +26,7 @@
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
-import org.jboss.ws.metadata.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
// $Id$
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64Deserializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64Deserializer.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64Deserializer.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -29,8 +29,8 @@
import org.jboss.ws.binding.BindingException;
import org.jboss.ws.binding.DeserializerSupport;
import org.jboss.ws.binding.SerializationContext;
-import org.jboss.ws.xop.XOPContext;
-import org.jboss.ws.xop.jaxrpc.XOPUnmarshallerImpl;
+import org.jboss.ws.extras.xop.XOPContext;
+import org.jboss.ws.extras.xop.jaxrpc.XOPUnmarshallerImpl;
import org.jboss.ws.utils.DOMUtils;
import org.jboss.ws.WSException;
import org.jboss.xb.binding.SimpleTypeBindings;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64Serializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64Serializer.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64Serializer.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -29,9 +29,9 @@
import org.jboss.ws.binding.BindingException;
import org.jboss.ws.binding.SerializationContext;
import org.jboss.ws.binding.SerializerSupport;
+import org.jboss.ws.extras.xop.XOPContext;
+import org.jboss.ws.extras.xop.jaxrpc.XOPMarshallerImpl;
import org.jboss.ws.utils.JavaUtils;
-import org.jboss.ws.xop.XOPContext;
-import org.jboss.ws.xop.jaxrpc.XOPMarshallerImpl;
import org.jboss.xb.binding.NamespaceRegistry;
import org.jboss.xb.binding.SimpleTypeBindings;
import org.jboss.xb.binding.sunday.xop.XOPMarshaller;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPArrayDeserializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPArrayDeserializer.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPArrayDeserializer.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -39,7 +39,7 @@
import org.jboss.ws.binding.DeserializerSupport;
import org.jboss.ws.binding.SerializationContext;
import org.jboss.ws.jaxrpc.TypeMappingImpl;
-import org.jboss.ws.metadata.ParameterMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
import org.jboss.ws.utils.JavaUtils;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPArraySerializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPArraySerializer.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPArraySerializer.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -32,7 +32,7 @@
import org.jboss.ws.binding.SerializationContext;
import org.jboss.ws.binding.SerializerSupport;
import org.jboss.ws.jaxrpc.TypeMappingImpl;
-import org.jboss.ws.metadata.ParameterMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
import org.jboss.ws.utils.JavaUtils;
import org.w3c.dom.NamedNodeMap;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/HandlerChainBaseImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/HandlerChainBaseImpl.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/HandlerChainBaseImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -48,11 +48,11 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
-import org.jboss.ws.common.CommonMessageContext;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.ParameterMetaData;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.soap.SOAPElementImpl;
import org.jboss.ws.soap.SOAPElementWriter;
import org.jboss.ws.soap.SOAPEnvelopeImpl;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/HandlerDelegateJAXRPC.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/HandlerDelegateJAXRPC.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/HandlerDelegateJAXRPC.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -34,15 +34,15 @@
import javax.xml.rpc.handler.HandlerInfo;
import org.jboss.logging.Logger;
-import org.jboss.ws.metadata.HandlerMetaData;
-import org.jboss.ws.metadata.HandlerMetaDataJAXRPC;
-import org.jboss.ws.metadata.ServerEndpointMetaData;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerInitParam;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+import org.jboss.ws.extras.xop.XOPContext;
+import org.jboss.ws.metadata.umdm.HandlerMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaDataJAXRPC;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerInitParam;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.server.HandlerDelegate;
import org.jboss.ws.server.ServiceEndpointInfo;
import org.jboss.ws.soap.MessageContextAssociation;
-import org.jboss.ws.xop.XOPContext;
/** Delegates to JAXRPC handlers
*
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/MessageContextJAXRPC.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/MessageContextJAXRPC.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/MessageContextJAXRPC.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -27,10 +27,10 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.ws.binding.SerializationContext;
-import org.jboss.ws.common.CommonMessageContext;
+import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.jaxrpc.SerializationContextJAXRPC;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.ServiceMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
import org.jboss.xb.binding.NamespaceRegistry;
/**
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/ServerHandlerChain.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/ServerHandlerChain.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/ServerHandlerChain.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -28,7 +28,7 @@
import javax.xml.rpc.handler.MessageContext;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
/**
* Represents a list of handlers. All elements in the
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/DynamicWrapperGenerator.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/DynamicWrapperGenerator.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/DynamicWrapperGenerator.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -44,12 +44,12 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-import org.jboss.ws.metadata.FaultMetaData;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.ParameterMetaData;
-import org.jboss.ws.metadata.TypeMappingMetaData;
-import org.jboss.ws.metadata.TypesMetaData;
-import org.jboss.ws.metadata.WrappedParameter;
+import org.jboss.ws.metadata.umdm.FaultMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.jboss.ws.metadata.umdm.TypeMappingMetaData;
+import org.jboss.ws.metadata.umdm.TypesMetaData;
+import org.jboss.ws.metadata.umdm.WrappedParameter;
import org.jboss.ws.utils.JavaUtils;
import org.jboss.ws.utils.JavassistUtils;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/JAXBDeserializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/JAXBDeserializer.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/JAXBDeserializer.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -36,8 +36,8 @@
import org.jboss.ws.binding.BindingException;
import org.jboss.ws.binding.ComplexTypeDeserializer;
import org.jboss.ws.binding.SerializationContext;
+import org.jboss.ws.extras.xop.jaxws.AttachmentUnmarshallerImpl;
import org.jboss.ws.jaxrpc.TypeMappingImpl;
-import org.jboss.ws.xop.jaxws.AttachmentUnmarshallerImpl;
/**
* A Deserializer that can handle complex types by delegating to JAXB.
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/JAXBSerializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/JAXBSerializer.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/JAXBSerializer.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -35,8 +35,8 @@
import org.jboss.ws.binding.BindingException;
import org.jboss.ws.binding.ComplexTypeSerializer;
import org.jboss.ws.binding.SerializationContext;
+import org.jboss.ws.extras.xop.jaxws.AttachmentMarshallerImpl;
import org.jboss.ws.jaxrpc.TypeMappingImpl;
-import org.jboss.ws.xop.jaxws.AttachmentMarshallerImpl;
import org.w3c.dom.NamedNodeMap;
/**
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/WrapperGenerator.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/WrapperGenerator.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/WrapperGenerator.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -28,8 +28,8 @@
import java.util.SortedMap;
import java.util.TreeMap;
-import org.jboss.ws.metadata.FaultMetaData;
-import org.jboss.ws.metadata.ParameterMetaData;
+import org.jboss.ws.metadata.umdm.FaultMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
/**
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/client/ClientImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/client/ClientImpl.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/client/ClientImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -40,18 +40,18 @@
import javax.xml.ws.soap.SOAPFaultException;
import org.jboss.logging.Logger;
-import org.jboss.ws.common.CommonBindingProvider;
-import org.jboss.ws.common.CommonClient;
-import org.jboss.ws.common.CommonMessageContext;
+import org.jboss.ws.core.CommonBindingProvider;
+import org.jboss.ws.core.CommonClient;
+import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.jaxws.core.BindingExt;
import org.jboss.ws.jaxws.core.BindingProviderImpl;
import org.jboss.ws.jaxws.handler.HandlerChainExecutor;
import org.jboss.ws.jaxws.handler.MessageContextJAXWS;
import org.jboss.ws.jaxws.handler.PortInfoImpl;
import org.jboss.ws.jaxws.handler.SOAPMessageContextJAXWS;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.soap.MessageContextAssociation;
/**
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/client/ClientProxy.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/client/ClientProxy.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/client/ClientProxy.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -40,8 +40,8 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
import org.jboss.ws.Constants;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.OperationMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.utils.JavaUtils;
/**
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/client/DispatchImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/client/DispatchImpl.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/client/DispatchImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -52,7 +52,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.jaxws.core.BindingProviderImpl;
-import org.jboss.ws.metadata.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.soap.SOAPBodyImpl;
import org.jboss.ws.soap.SOAPConnectionImpl;
import org.jboss.ws.utils.DOMWriter;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/BindingExt.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/BindingExt.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/BindingExt.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -26,7 +26,7 @@
import javax.xml.ws.Binding;
import javax.xml.ws.handler.Handler;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
// $Id$
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/BindingImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/BindingImpl.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/BindingImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -30,7 +30,7 @@
import javax.xml.ws.handler.Handler;
import org.jboss.logging.Logger;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
/**
* The Binding interface is the base interface for JAXWS protocol bindings.
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/BindingProviderImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/BindingProviderImpl.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/BindingProviderImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -33,9 +33,9 @@
import javax.xml.ws.http.HTTPBinding;
import javax.xml.ws.soap.SOAPBinding;
-import org.jboss.ws.common.CommonBindingProvider;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.EndpointMetaData.Type;
+import org.jboss.ws.core.CommonBindingProvider;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
/**
* The BindingProvider interface provides access to the protocol binding and associated
context objects
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/HTTPBindingJAXWS.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/HTTPBindingJAXWS.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/HTTPBindingJAXWS.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -34,9 +34,9 @@
import org.jboss.ws.binding.BindingException;
import org.jboss.ws.binding.EndpointInvocation;
import org.jboss.ws.binding.UnboundHeader;
-import org.jboss.ws.common.CommonBinding;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+import org.jboss.ws.core.CommonBinding;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
/**
* The HTTPBinding interface is an abstraction for the XML/HTTP binding.
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/MessageBinding.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/MessageBinding.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/MessageBinding.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -36,11 +36,11 @@
import org.jboss.ws.binding.BindingException;
import org.jboss.ws.binding.EndpointInvocation;
import org.jboss.ws.binding.UnboundHeader;
-import org.jboss.ws.common.CommonBinding;
+import org.jboss.ws.core.CommonBinding;
import org.jboss.ws.jaxws.handler.SOAPMessageContextJAXWS;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.ParameterMetaData;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.soap.MessageContextAssociation;
/** A binding for unprocessed SOAP Messages
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/PayloadBinding.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/PayloadBinding.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/PayloadBinding.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -38,11 +38,11 @@
import org.jboss.ws.binding.BindingException;
import org.jboss.ws.binding.EndpointInvocation;
import org.jboss.ws.binding.UnboundHeader;
-import org.jboss.ws.common.CommonBinding;
+import org.jboss.ws.core.CommonBinding;
import org.jboss.ws.jaxws.handler.SOAPMessageContextJAXWS;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.ParameterMetaData;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.soap.MessageContextAssociation;
import org.jboss.ws.soap.MessageFactoryImpl;
import org.jboss.ws.soap.SOAPBodyImpl;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/SOAP11BindingJAXWS.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/SOAP11BindingJAXWS.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/SOAP11BindingJAXWS.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -33,9 +33,9 @@
import javax.xml.ws.soap.SOAPBinding;
import org.jboss.ws.Constants;
-import org.jboss.ws.common.CommonSOAP11Binding;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+import org.jboss.ws.core.CommonSOAP11Binding;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.soap.SOAPFaultImpl;
/**
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/SOAP12BindingJAXWS.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/SOAP12BindingJAXWS.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/SOAP12BindingJAXWS.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -34,9 +34,9 @@
import javax.xml.ws.soap.SOAPBinding;
import org.jboss.ws.Constants;
-import org.jboss.ws.common.CommonSOAP12Binding;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+import org.jboss.ws.core.CommonSOAP12Binding;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.soap.SOAPFaultImpl;
/**
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/SOAPBindingJAXWS.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/SOAPBindingJAXWS.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/SOAPBindingJAXWS.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -32,8 +32,8 @@
import javax.xml.ws.BindingProvider;
import org.jboss.logging.Logger;
-import org.jboss.ws.common.CommonMessageContext;
-import org.jboss.ws.metadata.OperationMetaData;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.soap.MessageContextAssociation;
/**
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/SOAPFaultHelperJAXWS.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/SOAPFaultHelperJAXWS.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/SOAPFaultHelperJAXWS.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -43,12 +43,12 @@
import org.jboss.ws.binding.DeserializerSupport;
import org.jboss.ws.binding.SerializationContext;
import org.jboss.ws.binding.SerializerSupport;
-import org.jboss.ws.common.CommonMessageContext;
+import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.jaxrpc.SOAPFaultHelperJAXRPC;
import org.jboss.ws.jaxrpc.encoding.DeserializerFactoryBase;
import org.jboss.ws.jaxrpc.encoding.SerializerFactoryBase;
-import org.jboss.ws.metadata.FaultMetaData;
-import org.jboss.ws.metadata.OperationMetaData;
+import org.jboss.ws.metadata.umdm.FaultMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.soap.MessageContextAssociation;
import org.jboss.ws.soap.NameImpl;
import org.jboss.ws.soap.SOAPFactoryImpl;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/handler/HandlerChainExecutor.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/handler/HandlerChainExecutor.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/handler/HandlerChainExecutor.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -34,9 +34,9 @@
import javax.xml.ws.handler.MessageContext;
import org.jboss.logging.Logger;
-import org.jboss.ws.common.CommonMessageContext;
+import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.metadata.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.soap.SOAPEnvelopeImpl;
import org.jboss.ws.utils.DOMWriter;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/handler/HandlerDelegateJAXWS.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/handler/HandlerDelegateJAXWS.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/handler/HandlerDelegateJAXWS.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -31,9 +31,9 @@
import javax.xml.ws.handler.PortInfo;
import org.jboss.logging.Logger;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.ServerEndpointMetaData;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.server.HandlerDelegate;
import org.jboss.ws.server.ServiceEndpointInfo;
import org.jboss.ws.soap.MessageContextAssociation;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/handler/HandlerResolverImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/handler/HandlerResolverImpl.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/handler/HandlerResolverImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -40,12 +40,12 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.HandlerMetaData;
-import org.jboss.ws.metadata.HandlerMetaDataJAXWS;
-import org.jboss.ws.metadata.ServiceMetaData;
-import org.jboss.ws.metadata.UnifiedMetaData;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaDataJAXWS;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
/**
* HandlerResolver is an interface implemented by an application to get control over
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/handler/MessageContextJAXWS.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/handler/MessageContextJAXWS.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/handler/MessageContextJAXWS.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -31,10 +31,10 @@
import javax.xml.ws.handler.MessageContext;
import org.jboss.ws.binding.SerializationContext;
-import org.jboss.ws.common.CommonMessageContext;
+import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.jaxws.SerializationContextJAXWS;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.ServiceMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
import org.jboss.xb.binding.NamespaceRegistry;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/handler/PortInfoImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/handler/PortInfoImpl.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/handler/PortInfoImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -24,7 +24,7 @@
import javax.xml.namespace.QName;
import javax.xml.ws.handler.PortInfo;
-import org.jboss.ws.metadata.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
/**
* The PortInfo interface is used by a HandlerResolver to query information about the
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/handler/SOAPMessageContextJAXWS.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/handler/SOAPMessageContextJAXWS.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/handler/SOAPMessageContextJAXWS.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -39,7 +39,7 @@
import javax.xml.ws.WebServiceException;
import javax.xml.ws.handler.soap.SOAPMessageContext;
-import org.jboss.ws.common.CommonMessageContext;
+import org.jboss.ws.core.CommonMessageContext;
/**
* The interface SOAPMessageContext provides access to the SOAP message for either RPC
request or response.
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/spi/ServiceDelegateImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/spi/ServiceDelegateImpl.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/spi/ServiceDelegateImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -48,13 +48,13 @@
import org.jboss.ws.jaxws.client.ClientProxy;
import org.jboss.ws.jaxws.client.DispatchImpl;
import org.jboss.ws.jaxws.handler.HandlerResolverImpl;
-import org.jboss.ws.metadata.ClientEndpointMetaData;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.ServiceMetaData;
-import org.jboss.ws.metadata.EndpointMetaData.Type;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
import org.jboss.ws.metadata.builder.jaxws.JAXWSClientEndpointMetaDataBuilder;
import org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder;
+import org.jboss.ws.metadata.umdm.ClientEndpointMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
/**
* Service delegates are used internally by Service objects to allow pluggability of
JAX-WS implementations.
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jbossxb/JBossXBMarshallerImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jbossxb/JBossXBMarshallerImpl.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jbossxb/JBossXBMarshallerImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -26,11 +26,11 @@
import org.jboss.logging.Logger;
import org.jboss.util.NotImplementedException;
import org.jboss.ws.WSException;
+import org.jboss.ws.extras.xop.jaxrpc.XOPMarshallerImpl;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.jaxrpcmapping.JavaXmlTypeMapping;
import org.jboss.ws.metadata.jaxrpcmapping.VariableMapping;
import org.jboss.ws.utils.JavaUtils;
-import org.jboss.ws.xop.jaxrpc.XOPMarshallerImpl;
import org.jboss.xb.binding.Constants;
import org.jboss.xb.binding.sunday.marshalling.MarshallerImpl;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/jbossxb/JBossXBSupport.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jbossxb/JBossXBSupport.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jbossxb/JBossXBSupport.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -4,11 +4,11 @@
import javax.xml.namespace.QName;
-import org.jboss.ws.common.CommonMessageContext;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.ServiceMetaData;
+import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
import org.jboss.ws.soap.MessageContextAssociation;
import org.jboss.xb.binding.MarshallingContext;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jbossxb/JBossXBUnmarshallerImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jbossxb/JBossXBUnmarshallerImpl.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jbossxb/JBossXBUnmarshallerImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -24,7 +24,7 @@
// $Id$
import org.jboss.ws.WSException;
-import org.jboss.ws.xop.jaxrpc.XOPUnmarshallerImpl;
+import org.jboss.ws.extras.xop.jaxrpc.XOPUnmarshallerImpl;
import org.jboss.xb.binding.JBossXBException;
import org.jboss.xb.binding.UnmarshallerFactory;
import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jbossxb/SchemaBindingBuilder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jbossxb/SchemaBindingBuilder.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jbossxb/SchemaBindingBuilder.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -28,9 +28,9 @@
import org.jboss.util.xml.JBossEntityResolver;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
+import org.jboss.ws.extras.xop.jaxrpc.JBossXBContentAdapter;
import org.jboss.ws.metadata.jaxrpcmapping.*;
import org.jboss.ws.utils.JBossWSEntityResolver;
-import org.jboss.ws.xop.jaxrpc.JBossXBContentAdapter;
import org.jboss.xb.binding.metadata.ClassMetaData;
import org.jboss.xb.binding.metadata.PackageMetaData;
import org.jboss.xb.binding.metadata.PropertyMetaData;
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ClientEndpointMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ClientEndpointMetaData.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ClientEndpointMetaData.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -1,176 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata;
-
-// $Id$
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
-import org.jboss.ws.metadata.config.WSConfigFactory;
-import org.jboss.ws.metadata.config.jaxrpc.WSClientConfigJAXRPC;
-import org.jboss.ws.metadata.config.jaxrpc.WSConfigRootJAXRPC;
-import org.jboss.ws.metadata.config.jaxws.WSClientConfigJAXWS;
-import org.jboss.ws.metadata.config.jaxws.WSConfigRootJAXWS;
-import org.jboss.ws.metadata.config.jaxws.WSHandlerChainsConfigJAXWS;
-import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
-
-/**
- * Client side endpoint meta data.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-May-2005
- */
-public class ClientEndpointMetaData extends EndpointMetaData
-{
- // provide logging
- private static Logger log = Logger.getLogger(ClientEndpointMetaData.class);
-
- public ClientEndpointMetaData(ServiceMetaData service, QName qname, QName
interfaceQName, Type type)
- {
- super(service, qname, interfaceQName, type);
- }
-
- public void setConfigName(String configName)
- {
- super.setConfigName(configName);
- endpointConfig = null;
- }
-
- public void setConfigFile(String configFile)
- {
- super.setConfigFile(configFile);
- endpointConfig = null;
- }
-
- @Override
- public Object getEndpointConfig()
- {
- if (endpointConfig == null)
- {
- String configName = getConfigName();
- if (configName == null)
- {
- configName = "Standard Client";
- setConfigName(configName);
- }
-
- String configFile = getConfigFile();
- if (configFile == null)
- {
- if (getType() == Type.JAXRPC)
- {
- configFile = "META-INF/standard-jaxrpc-client-config.xml";
- }
- else
- {
- configFile = "META-INF/standard-jaxws-client-config.xml";
- }
- setConfigFile(configFile);
- }
-
- log.debug("getClientConfig: [name=" + configName + ",url=" +
configFile + "]");
-
- URL configURL = null;
- try
- {
- configURL = new URL(configFile);
- }
- catch (MalformedURLException ex)
- {
- // ignore
- }
-
- // Try to get the URL as resource
- if (configURL == null)
- {
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
- configURL = cl.getResource(configFile);
- if (configURL == null)
- throw new WSException("Cannot get resource: " + configFile);
- }
-
- // Get the config root
- Object wsConfig;
- try
- {
- WSConfigFactory factory = WSConfigFactory.newInstance();
- wsConfig = factory.parseWithObjectModelFactory(configURL);
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WSException("Cannot parse client config", ex);
- }
-
- // Get the client config
- if (wsConfig instanceof WSConfigRootJAXRPC)
- {
- endpointConfig =
((WSConfigRootJAXRPC)wsConfig).getClientConfigByName(configName);
- if (endpointConfig == null)
- throw new WSException("Cannot obtain client config: " +
configName);
- }
- else
- {
- endpointConfig =
((WSConfigRootJAXWS)wsConfig).getClientConfigByName(configName);
- if (endpointConfig == null)
- throw new WSException("Cannot obtain client config: " +
configName);
- }
- }
-
- return endpointConfig;
- }
-
- public String toString()
- {
- StringBuilder buffer = new StringBuilder("\nClientEndpointMetaData:");
- buffer.append("\n type=" + getType());
- buffer.append("\n qname=" + getQName());
- buffer.append("\n address=" + getEndpointAddress());
- buffer.append("\n binding=" + getBindingId());
- buffer.append("\n seiName=" + getServiceEndpointInterfaceName());
- buffer.append("\n configFile=" + getConfigFile());
- buffer.append("\n configName=" + getConfigName());
- buffer.append("\n authMethod=" + getAuthMethod());
- buffer.append("\n properties=" + getProperties());
-
- for (OperationMetaData opMetaData : getOperations())
- {
- buffer.append("\n" + opMetaData);
- }
- for (HandlerMetaData hdlMetaData : getHandlerMetaData(HandlerType.ALL))
- {
- buffer.append("\n" + hdlMetaData);
- }
- return buffer.toString();
- }
-}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/EndpointMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/EndpointMetaData.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/EndpointMetaData.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -1,580 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata;
-
-// $Id$
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.jws.soap.SOAPBinding.ParameterStyle;
-import javax.xml.namespace.QName;
-import javax.xml.rpc.ParameterMode;
-import javax.xml.ws.Service.Mode;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.jboss.ws.WSException;
-import org.jboss.ws.common.CommonSOAPBinding;
-import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.jaxrpc.TypeMappingImpl;
-import org.jboss.ws.jaxrpc.Use;
-import org.jboss.ws.jaxrpc.encoding.SOAPArrayDeserializerFactory;
-import org.jboss.ws.jaxrpc.encoding.SOAPArraySerializerFactory;
-import org.jboss.ws.jaxws.JAXBDeserializerFactory;
-import org.jboss.ws.jaxws.JAXBSerializerFactory;
-import org.jboss.ws.jbossxb.JBossXBDeserializerFactory;
-import org.jboss.ws.jbossxb.JBossXBSerializerFactory;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
-import org.jboss.ws.metadata.config.WSCommonConfig;
-import org.jboss.ws.utils.JavaUtils;
-
-/**
- * A Service component describes a set of endpoints.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-May-2005
- */
-public abstract class EndpointMetaData extends ExtensibleMetaData
-{
- // provide logging
- private static Logger log = Logger.getLogger(EndpointMetaData.class);
-
- public enum Type
- {
- JAXRPC, JAXWS
- }
-
- // The parent meta data.
- private ServiceMetaData serviceMetaData;
-
- // The REQUIRED endpoint config
- protected WSCommonConfig endpointConfig;
-
- // The REQUIRED name
- private QName portName;
- // The REQUIRED binding id
- private String bindingId;
- // The REQUIRED name of the WSDL interface/portType
- private QName interfaceQName;
- // The REQUIRED config-name
- private String configName;
- // The REQUIRED config-file
- private String configFile;
- // The endpoint address
- private String endpointAddress;
- // The endpoint interface name
- private String seiName;
- // The endpoint interface
- private Class seiClass;
- // The optional authentication method
- private String authMethod;
- // Arbitrary properties given by <call-property>
- private Properties properties;
- // The SOAPBinding style
- private Style style;
- // The SOAPBinding use
- private Use use;
- // The SOAPBinding parameter style
- private ParameterStyle parameterStyle;
- // The JAXWS ServiceMode
- private Mode serviceMode;
- // Whether the endpoint was deployed from annotations
- private Type type;
- // The list of service meta data
- private List<OperationMetaData> operations = new
ArrayList<OperationMetaData>();
- // The optional handlers
- private List<HandlerMetaData> handlers = new
ArrayList<HandlerMetaData>();
- // True if the handlers are initialized
- private boolean handlersInitialized;
- // Maps the java method to the operation meta data
- private Map<Method, OperationMetaData> opMetaDataCache = new HashMap<Method,
OperationMetaData>();
-
- public EndpointMetaData(ServiceMetaData service, QName qname, QName interfaceQName,
Type type)
- {
- this.serviceMetaData = service;
- this.portName = qname;
- this.interfaceQName = interfaceQName;
- this.type = type;
-
- // The default binding
- this.bindingId = CommonSOAPBinding.SOAP11HTTP_BINDING;
- }
-
- public ServiceMetaData getServiceMetaData()
- {
- return serviceMetaData;
- }
-
- public QName getQName()
- {
- return portName;
- }
-
- public QName getInterfaceQName()
- {
- return interfaceQName;
- }
-
- public String getConfigFile()
- {
- return configFile;
- }
-
- public void setConfigFile(String configFile)
- {
- this.configFile = configFile;
- this.endpointConfig = null;
- }
-
- public String getConfigName()
- {
- return configName;
- }
-
- public void setConfigName(String configName)
- {
- this.configName = configName;
- this.endpointConfig = null;
- }
-
- public abstract Object getEndpointConfig();
-
- public String getEndpointAddress()
- {
- return endpointAddress;
- }
-
- public void setEndpointAddress(String endpointAddress)
- {
- this.endpointAddress = endpointAddress;
- }
-
- public String getBindingId()
- {
- return bindingId;
- }
-
- public void setBindingId(String bindingId)
- {
- if (!CommonSOAPBinding.SOAP11HTTP_BINDING.equals(bindingId) &&
!CommonSOAPBinding.SOAP12HTTP_BINDING.equals(bindingId))
- throw new WSException("Unsupported binding: " + bindingId);
- this.bindingId = bindingId;
- }
-
- public String getServiceEndpointInterfaceName()
- {
- return seiName;
- }
-
- public void setServiceEndpointInterfaceName(String seiName)
- {
- this.seiName = seiName;
- this.seiClass = null;
-
- UnifiedMetaData wsMetaData = serviceMetaData.getUnifiedMetaData();
- if (wsMetaData.isEagerInitialized())
- {
- if (UnifiedMetaData.isFinalRelease() == false)
- log.warn("Set SEI name after eager initialization", new
IllegalStateException());
-
- // reinitialize
- initializeInternal();
- }
- }
-
- /** Get the class loader associated with the endpoint meta data */
- public ClassLoader getClassLoader()
- {
- ClassLoader classLoader =
getServiceMetaData().getUnifiedMetaData().getClassLoader();
- return classLoader;
- }
-
- /**
- * Load the service endpoint interface.
- * It should only be cached during eager initialization.
- */
- public Class getServiceEndpointInterface()
- {
- Class tmpClass = seiClass;
- if (tmpClass == null && seiName != null)
- {
- try
- {
- ClassLoader classLoader = getClassLoader();
- tmpClass = classLoader.loadClass(seiName);
- if (serviceMetaData.getUnifiedMetaData().isEagerInitialized())
- {
- log.warn("Loading SEI after eager initialization");
- seiClass = tmpClass;
- }
- }
- catch (ClassNotFoundException ex)
- {
- throw new WSException("Cannot load service endpoint interface: " +
seiName, ex);
- }
- }
- return tmpClass;
- }
-
- public Use getEncodingStyle()
- {
- if (use == null)
- {
- use = Use.getDefaultUse();
- log.debug("Using default encoding style: " + use);
- }
- return use;
- }
-
- public void setEncodingStyle(Use value)
- {
- if (value != null && use != null && !use.equals(value))
- throw new WSException("Mixed encoding styles not supported");
-
- log.trace("setEncodingStyle: " + value);
- this.use = value;
- }
-
- public Style getStyle()
- {
- if (style == null)
- {
- style = Style.getDefaultStyle();
- log.debug("Using default style: " + style);
- }
- return style;
- }
-
- public void setStyle(Style value)
- {
- if (value != null && style != null && !style.equals(value))
- throw new WSException("Mixed styles not supported");
-
- log.trace("setStyle: " + value);
- this.style = value;
- }
-
- public ParameterStyle getParameterStyle()
- {
- if (parameterStyle == null)
- {
- parameterStyle = ParameterStyle.WRAPPED;
- log.debug("Using default parameter style: " + parameterStyle);
- }
- return parameterStyle;
- }
-
- public void setParameterStyle(ParameterStyle value)
- {
- if (value != null && parameterStyle != null &&
!parameterStyle.equals(value))
- throw new WSException("Mixed SOAP parameter styles not supported");
-
- log.debug("setParameterStyle: " + value);
- this.parameterStyle = value;
- }
-
- public Mode getServiceMode()
- {
- return serviceMode;
- }
-
- public void setServiceMode(Mode serviceMode)
- {
- this.serviceMode = serviceMode;
- }
-
- public Type getType()
- {
- return type;
- }
-
- public String getAuthMethod()
- {
- return authMethod;
- }
-
- public void setAuthMethod(String authMethod)
- {
- this.authMethod = authMethod;
- }
-
- public Properties getProperties()
- {
- return properties;
- }
-
- public void setProperties(Properties properties)
- {
- this.properties = properties;
- }
-
- public List<OperationMetaData> getOperations()
- {
- return new ArrayList<OperationMetaData>(operations);
- }
-
- public OperationMetaData getOperation(QName xmlName)
- {
- OperationMetaData opMetaData = null;
- for (OperationMetaData aux : operations)
- {
- QName opQName = aux.getQName();
- String javaName = aux.getJavaName();
- if (opQName.equals(xmlName) &&
!javaName.endsWith(Constants.ASYNC_METHOD_SUFFIX))
- {
- if (opMetaData == null)
- {
- opMetaData = aux;
- }
- else
- {
- throw new WSException("Cannot uniquely indentify operation: " +
xmlName);
- }
- }
- }
-
- if (opMetaData == null && getStyle() == Style.DOCUMENT)
- {
- for (OperationMetaData auxOperation : operations)
- {
- ParameterMetaData paramMetaData = null;
- for (ParameterMetaData auxParam : auxOperation.getParameters())
- {
- ParameterMode mode = auxParam.getMode();
- if (auxParam.isInHeader() == false && mode == ParameterMode.IN)
- {
- paramMetaData = auxParam;
- break;
- }
- }
- if (paramMetaData != null &&
paramMetaData.getXmlName().equals(xmlName))
- {
- if (opMetaData == null)
- {
- opMetaData = auxOperation;
- }
- else
- {
- throw new WSException("Cannot uniquely indentify operation: "
+ xmlName);
- }
- }
- }
- }
-
- return opMetaData;
- }
-
- public OperationMetaData getOperation(Method method)
- {
- if (opMetaDataCache.size() == 0)
- {
- // This can happen when the SEI mapping was not found
- log.warn("Access to empty operation meta data cache,
reinitializing");
- initializeInternal();
- }
-
- OperationMetaData opMetaData = opMetaDataCache.get(method);
- if (opMetaData == null)
- {
- for (OperationMetaData aux : operations)
- {
- boolean doesMatch = aux.getJavaMethod().equals(method);
-
- // fallback for async methods
- if(!doesMatch &&
method.getName().endsWith(Constants.ASYNC_METHOD_SUFFIX))
- {
- String name = method.getName();
- name = name.substring(0, name.length()-5);
- doesMatch = aux.getJavaName().equals(name);
- }
-
- if (doesMatch)
- {
- opMetaDataCache.put(method, aux);
- opMetaData = aux;
- break;
- }
-
- }
- }
- return opMetaData;
- }
-
- public void addOperation(OperationMetaData opMetaData)
- {
- operations.add(opMetaData);
- }
-
- public void clearOperations()
- {
- operations.clear();
- }
-
- public void addHandlers(List<HandlerMetaData> configHandlers)
- {
- handlers.addAll(configHandlers);
- }
-
- public void addHandler(HandlerMetaData handler)
- {
- handlers.add(handler);
- }
-
- public void clearHandlers()
- {
- handlers.clear();
- handlersInitialized = false;
- }
-
- public List<HandlerMetaData> getHandlerMetaData(HandlerType type)
- {
- List<HandlerMetaData> typeHandlers = new ArrayList<HandlerMetaData>();
- for (HandlerMetaData hmd : handlers)
- {
- if (hmd.getHandlerType() == type || type == HandlerType.ALL)
- typeHandlers.add(hmd);
- }
- return typeHandlers;
- }
-
- public boolean isHandlersInitialized()
- {
- return handlersInitialized;
- }
-
- public void setHandlersInitialized(boolean flag)
- {
- this.handlersInitialized = flag;
- }
-
- public void validate()
- {
- for (HandlerMetaData handler : handlers)
- handler.validate();
-
- for (OperationMetaData opMetaData : operations)
- opMetaData.validate();
- }
-
- /**
- * @see UnifiedMetaData#eagerInitialize()
- */
- public void eagerInitialize()
- {
- initializeInternal();
- }
-
- private void initializeInternal()
- {
- // reset sei class
- seiClass = null;
-
- // Initialize handlers
- for (HandlerMetaData handler : handlers)
- handler.eagerInitialize();
-
- eagerInitializeOperations();
- eagerInitializeTypes();
- }
-
- private void eagerInitializeOperations()
- {
- seiClass = getServiceEndpointInterface();
- if (seiClass != null)
- {
- List<Method> unsynchronizedMethods = new ArrayList<Method>();
- unsynchronizedMethods.addAll(Arrays.asList(seiClass.getMethods()));
-
- for (OperationMetaData opMetaData : operations)
- {
- opMetaData.eagerInitialize(unsynchronizedMethods);
- Method method = opMetaData.getJavaMethod();
- if (method != null)
- {
- opMetaDataCache.put(method, opMetaData);
- unsynchronizedMethods.remove(method);
- }
- }
- }
- }
-
- private void eagerInitializeTypes()
- {
- TypeMappingImpl typeMapping = serviceMetaData.getTypeMapping();
- for (TypeMappingMetaData tmMetaData :
serviceMetaData.getTypesMetaData().getTypeMappings())
- {
- String javaTypeName = tmMetaData.getJavaTypeName();
- QName xmlType = tmMetaData.getXmlType();
- if (xmlType != null)
- {
- List<Class> registeredTypes = typeMapping.getJavaTypes(xmlType);
-
- boolean registered = false;
- for (Class current : registeredTypes) {
- if (current.getName().equals(javaTypeName))
- {
- registered = true;
- break;
- }
- }
-
- if (registered == false)
- {
- try
- {
- ClassLoader classLoader = getClassLoader();
- Class javaType = JavaUtils.loadJavaType(javaTypeName, classLoader);
-
- if (JavaUtils.isPrimitive(javaTypeName))
- javaType = JavaUtils.getWrapperType(javaType);
-
- if (getEncodingStyle() == Use.ENCODED && javaType.isArray())
- {
- typeMapping.register(javaType, xmlType, new
SOAPArraySerializerFactory(), new SOAPArrayDeserializerFactory());
- }
- else
- {
- if (getType() == Type.JAXWS)
- {
- typeMapping.register(javaType, xmlType, new
JAXBSerializerFactory(), new JAXBDeserializerFactory());
- }
- else
- {
- typeMapping.register(javaType, xmlType, new
JBossXBSerializerFactory(), new JBossXBDeserializerFactory());
- }
- }
- }
- catch (ClassNotFoundException e)
- {
- log.warn("Cannot load class for type: " + xmlType +
"," + javaTypeName);
- }
- }
- }
- }
- }
-}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ExtensibleMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ExtensibleMetaData.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ExtensibleMetaData.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -1,28 +0,0 @@
-package org.jboss.ws.metadata;
-
-import java.util.Map;
-import java.util.HashMap;
-
-/**
- * Base class for UMD elements that are extensible.
- *
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 21-Mar-2006
- */
-public abstract class ExtensibleMetaData {
-
- private Map<String, MetaDataExtension> extensions = new HashMap<String,
MetaDataExtension>();
-
- public Map<String, MetaDataExtension> getExtensions() {
- return extensions;
- }
-
- public void addExtension(MetaDataExtension ext) {
- getExtensions().put(ext.getExtensionNameSpace(), ext);
- }
-
- public MetaDataExtension getExtension(String namespace) {
- return getExtensions().get(namespace);
- }
-
-}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/FaultMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/FaultMetaData.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/FaultMetaData.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -1,183 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.jaxws.DynamicWrapperGenerator;
-import org.jboss.ws.utils.JavaUtils;
-
-/**
- * A Fault component describes a fault that a given operation supports.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author jason.greene(a)jboss.com
- * @since 12-May-2005
- */
-public class FaultMetaData
-{
- // provide logging
- private final Logger log = Logger.getLogger(FaultMetaData.class);
-
- // The parent operation
- private OperationMetaData opMetaData;
-
- private QName xmlName;
- private QName xmlType;
- private String javaTypeName;
- private String faultBeanName;
- private Class javaType;
- private Class faultBean;
-
- public FaultMetaData(OperationMetaData operation, QName xmlName, QName xmlType, String
javaTypeName)
- {
- this(operation, xmlName, javaTypeName);
- setXmlType(xmlType);
- }
-
- public FaultMetaData(OperationMetaData operation, QName xmlName, String javaTypeName)
- {
- if (xmlName == null)
- throw new IllegalArgumentException("Invalid null xmlName argument");
- if (javaTypeName == null)
- throw new IllegalArgumentException("Invalid null javaTypeName argument,
for: " + xmlName);
-
- this.opMetaData = operation;
- this.xmlName = xmlName;
- this.javaTypeName = javaTypeName;
- }
-
- public OperationMetaData getOperationMetaData()
- {
- return opMetaData;
- }
-
- public QName getXmlName()
- {
- return xmlName;
- }
-
- public QName getXmlType()
- {
- return xmlType;
- }
-
- public void setXmlType(QName xmlType)
- {
- if (xmlType == null)
- throw new IllegalArgumentException("Invalid null xmlType argument, for:
" + xmlName);
-
- this.xmlType = xmlType;
- }
-
- public String getJavaTypeName()
- {
- return javaTypeName;
- }
-
- /** Load the java type.
- * It should only be cached during eager initialization.
- */
- public Class getJavaType()
- {
- Class tmpJavaType = javaType;
- if (tmpJavaType == null && javaTypeName != null)
- {
- try
- {
- ClassLoader loader = opMetaData.getEndpointMetaData().getClassLoader();
- tmpJavaType = JavaUtils.loadJavaType(javaTypeName, loader);
-
- if
(opMetaData.getEndpointMetaData().getServiceMetaData().getUnifiedMetaData().isEagerInitialized())
- {
- log.warn("Loading java type after eager initialization");
- javaType = tmpJavaType;
- }
- }
- catch (ClassNotFoundException ex)
- {
- throw new WSException("Cannot load java type: " + javaTypeName,
ex);
- }
- }
- return tmpJavaType;
- }
-
- public String getFaultBeanName()
- {
- return faultBeanName;
- }
-
- public void setFaultBeanName(String faultBeanName)
- {
- this.faultBeanName = faultBeanName;
- }
-
- public Class getFaultBean()
- {
- Class tmpFaultBean = faultBean;
- if (tmpFaultBean == null && faultBeanName != null)
- {
- try
- {
- ClassLoader loader = opMetaData.getEndpointMetaData().getClassLoader();
- tmpFaultBean = JavaUtils.loadJavaType(faultBeanName, loader);
- }
- catch (ClassNotFoundException ex)
- {
- throw new WSException("Cannot load fault bean: " + faultBeanName,
ex);
- }
- }
- return tmpFaultBean;
- }
-
- public void validate()
- {
- // nothing to do
- }
-
- public void eagerInitialize()
- {
- ClassLoader loader = opMetaData.getEndpointMetaData().getClassLoader();
- new DynamicWrapperGenerator(loader).generate(this);
-
- // Initialize the cache
- javaType = getJavaType();
- if (javaType == null)
- throw new WSException("Cannot load java type: " + javaTypeName);
-
- faultBean = getFaultBean();
- }
-
- public String toString()
- {
- StringBuilder buffer = new StringBuilder("\nFaultMetaData");
- buffer.append("\n xmlName=" + xmlName);
- buffer.append("\n xmlType=" + xmlType);
- buffer.append("\n javaType=" + javaTypeName);
- buffer.append("\n faultBean=" + faultBeanName);
- return buffer.toString();
- }
-}
\ No newline at end of file
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/HandlerMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/HandlerMetaData.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/HandlerMetaData.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -1,204 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata;
-
-// $Id:HandlerMetaData.java 915 2006-09-08 08:40:45Z thomas.diesler(a)jboss.com $
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-
-/**
- * The common metdata data for a handler element
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public abstract class HandlerMetaData implements Serializable
-{
- // provide logging
- private final Logger log = Logger.getLogger(HandlerMetaData.class);
-
- public enum HandlerType
- {
- PRE, ENDPOINT, POST, ALL
- };
-
- private transient EndpointMetaData epMetaData;
-
- // The required <handler-name> element
- private String handlerName;
- // The required <handler-class> element
- private String handlerClassName;
- // The required handler type
- private HandlerType handlerType;
- // The optional <soap-header> elements
- private Set<QName> soapHeaders = new HashSet<QName>();
- // The optional <init-param> elements
- private List<HandlerInitParam> initParams = new
ArrayList<HandlerInitParam>();
- // The cached handler class
- private Class handlerClass;
-
- public HandlerMetaData(EndpointMetaData epMetaData, HandlerType type)
- {
- this.epMetaData = epMetaData;
- this.handlerType = type;
- }
-
- public void setEndpointMetaData(EndpointMetaData epMetaData)
- {
- this.epMetaData = epMetaData;
- }
-
- public EndpointMetaData getEndpointMetaData()
- {
- return epMetaData;
- }
-
- public void setHandlerName(String value)
- {
- this.handlerName = value;
- }
-
- public String getHandlerName()
- {
- return handlerName;
- }
-
- public void setHandlerClassName(String handlerClass)
- {
- this.handlerClassName = handlerClass;
- }
-
- public String getHandlerClassName()
- {
- return handlerClassName;
- }
-
- public Class getHandlerClass()
- {
- if (handlerClassName == null)
- throw new IllegalStateException("Handler class name cannot be null");
-
- Class localClass = handlerClass;
- if (localClass == null)
- {
- try
- {
- ClassLoader loader = epMetaData.getClassLoader();
- localClass = loader.loadClass(handlerClassName);
- }
- catch (ClassNotFoundException ex)
- {
- throw new WSException("Cannot load handler: " + handlerClassName,
ex);
- }
- }
- return localClass;
- }
-
- public HandlerType getHandlerType()
- {
- return handlerType;
- }
-
- public void setSoapHeaders(Set<QName> soapHeaders)
- {
- this.soapHeaders = soapHeaders;
- }
-
- public Set<QName> getSoapHeaders()
- {
- return soapHeaders;
- }
-
- public void seiInitParams(List<HandlerInitParam> initParams)
- {
- this.initParams = initParams;
- }
-
- public List<HandlerInitParam> getInitParams()
- {
- return initParams;
- }
-
- public void validate()
- {
- List<String> securityHandlers = new ArrayList<String>();
-
securityHandlers.add(org.jboss.ws.wsse.jaxrpc.WSSecurityHandlerInbound.class.getName());
-
securityHandlers.add(org.jboss.ws.wsse.jaxrpc.WSSecurityHandlerOutbound.class.getName());
-
securityHandlers.add(org.jboss.ws.wsse.jaxws.WSSecurityHandlerInbound.class.getName());
-
securityHandlers.add(org.jboss.ws.wsse.jaxws.WSSecurityHandlerOutbound.class.getName());
-
- if (securityHandlers.contains(handlerClassName))
- {
- if (epMetaData.getServiceMetaData().getSecurityConfiguration() == null)
- log.warn("WS-Security requires security configuration");
- }
- }
-
- public void eagerInitialize()
- {
- handlerClass = getHandlerClass();
- }
-
- public static class HandlerInitParam implements Serializable
- {
- private static final long serialVersionUID = -8687875291620457318L;
-
- // The required <handler-name> element
- private String paramName;
- // The required <handler-class> element
- private String paramValue;
-
- public String getParamName()
- {
- return paramName;
- }
-
- public void setParamName(String paramName)
- {
- this.paramName = paramName;
- }
-
- public String getParamValue()
- {
- return paramValue;
- }
-
- public void setParamValue(String paramValue)
- {
- this.paramValue = paramValue;
- }
-
- public String toString()
- {
- return "[name=" + paramName + ",value=" + paramValue +
"]";
- }
- }
-}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/HandlerMetaDataJAXRPC.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/HandlerMetaDataJAXRPC.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/HandlerMetaDataJAXRPC.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -1,83 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata;
-
-//$Id:HandlerMetaDataJAXRPC.java 915 2006-09-08 08:40:45Z thomas.diesler(a)jboss.com $
-
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-
-/**
- * The JAXRPC metdata data for a handler element
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class HandlerMetaDataJAXRPC extends HandlerMetaData
-{
- private static final long serialVersionUID = -5232305815202943509L;
-
- // The optional <soap-role> elements
- private Set<String> soapRoles = new HashSet<String>();
- // The optional <port-name> elements
- private Set<String> portNames = new HashSet<String>();
-
- public HandlerMetaDataJAXRPC(EndpointMetaData epMetaData, HandlerType type)
- {
- super(epMetaData, type);
- }
-
- public void setSoapRoles(Set<String> soapRoles)
- {
- this.soapRoles = soapRoles;
- }
-
- public Set<String> getSoapRoles()
- {
- return soapRoles;
- }
-
- public void setPortNames(Set<String> portNames)
- {
- this.portNames = portNames;
- }
-
- public Set<String> getPortNames()
- {
- return portNames;
- }
-
- public String toString()
- {
- StringBuffer buffer = new StringBuffer("\nHandlerMetaDataJAXRPC:");
- buffer.append("\n type=" + getHandlerType());
- buffer.append("\n name=" + getHandlerName());
- buffer.append("\n class=" + getHandlerClassName());
- buffer.append("\n params=" + getInitParams());
- buffer.append("\n headers=" + getSoapHeaders());
- buffer.append("\n roles=" + getSoapRoles());
- buffer.append("\n ports=" + getPortNames());
- return buffer.toString();
- }
-}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/HandlerMetaDataJAXWS.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/HandlerMetaDataJAXWS.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/HandlerMetaDataJAXWS.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -1,93 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata;
-
-//$Id$
-
-import javax.xml.namespace.QName;
-
-/**
- * The JAXWS metdata data for a handler element
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class HandlerMetaDataJAXWS extends HandlerMetaData
-{
- private static final long serialVersionUID = 7631133188974299826L;
-
- // The JAXWS protocol bindings
- private String protocolBindings;
- // The JAXWS service name pattern
- private QName serviceNamePattern;
- // The JAXWS port name pattern
- private QName portNamePattern;
-
- public HandlerMetaDataJAXWS(EndpointMetaData epMetaData, HandlerType type)
- {
- super(epMetaData, type);
- }
-
- public QName getPortNamePattern()
- {
- return portNamePattern;
- }
-
- public void setPortNamePattern(QName portNamePattern)
- {
- this.portNamePattern = portNamePattern;
- }
-
- public String getProtocolBindings()
- {
- return protocolBindings;
- }
-
- public void setProtocolBindings(String protocolBindings)
- {
- this.protocolBindings = protocolBindings;
- }
-
- public QName getServiceNamePattern()
- {
- return serviceNamePattern;
- }
-
- public void setServiceNamePattern(QName serviceNamePattern)
- {
- this.serviceNamePattern = serviceNamePattern;
- }
-
- public String toString()
- {
- StringBuffer buffer = new StringBuffer("\nHandlerMetaDataJAXWS:");
- buffer.append("\n type=" + getHandlerType());
- buffer.append("\n name=" + getHandlerName());
- buffer.append("\n class=" + getHandlerClass());
- buffer.append("\n params=" + getInitParams());
- buffer.append("\n protocols=" + getProtocolBindings());
- buffer.append("\n services=" + getServiceNamePattern());
- buffer.append("\n ports=" + getPortNamePattern());
- return buffer.toString();
- }
-
-}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/MetaDataExtension.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/MetaDataExtension.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/MetaDataExtension.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -1,45 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata;
-
-// $Id$
-
-/**
- * Operation metaData extension.
- *
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 17-Mar-2006
- */
-public abstract class MetaDataExtension
-{
- private String extensionNameSpace;
-
- public MetaDataExtension(String extensionNameSpace)
- {
- this.extensionNameSpace = extensionNameSpace;
- }
-
- public String getExtensionNameSpace()
- {
- return extensionNameSpace;
- }
-}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/OperationMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/OperationMetaData.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/OperationMetaData.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -1,521 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata;
-
-// $Id$
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.jws.soap.SOAPBinding.ParameterStyle;
-import javax.xml.namespace.QName;
-import javax.xml.rpc.ParameterMode;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.jaxrpc.Use;
-import org.jboss.ws.metadata.EndpointMetaData.Type;
-import org.jboss.ws.utils.JavaUtils;
-import org.w3c.dom.Element;
-
-/**
- * An Operation component describes an operation that a given interface supports.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @since 12-May-2004
- */
-public class OperationMetaData extends ExtensibleMetaData
-{
- // provide logging
- private final Logger log = Logger.getLogger(OperationMetaData.class);
-
- // The parent interface
- private EndpointMetaData epMetaData;
-
- private QName qname;
- private QName responseName;
- private String javaName;
- private Method javaMethod;
- private boolean oneWay;
- private String soapAction;
- private List<ParameterMetaData> parameters = new
ArrayList<ParameterMetaData>();
- private List<FaultMetaData> faults = new ArrayList<FaultMetaData>();
- private ParameterMetaData returnParam;
-
- public OperationMetaData(QName qname, String javaName)
- {
- UnifiedMetaData umd = new UnifiedMetaData();
- ServiceMetaData smd = new ServiceMetaData(umd, new
QName("mock-service"));
- ServerEndpointMetaData epmd = new ServerEndpointMetaData(smd, new
QName("mock-endpoint"), new QName("mock-interface"), Type.JAXRPC);
- initOperationMetaData(epmd, qname, javaName);
- }
-
- public OperationMetaData(EndpointMetaData epMetaData, QName qname, String javaName)
- {
- log.trace("new OperationMetaData: [xmlName=" + qname +
",javaName=" + javaName + "]");
- initOperationMetaData(epMetaData, qname, javaName);
- }
-
- private void initOperationMetaData(EndpointMetaData epMetaData, QName qname, String
javaName)
- {
- this.epMetaData = epMetaData;
- this.qname = qname;
- this.javaName = javaName;
-
- if (qname == null)
- throw new IllegalArgumentException("Invalid null qname argument");
- if (javaName == null)
- throw new IllegalArgumentException("Invalid null javaName argument, for:
" + qname);
-
- String nsURI = qname.getNamespaceURI();
- String localPart = qname.getLocalPart();
- this.responseName = new QName(nsURI, localPart + "Response");
- }
-
- public EndpointMetaData getEndpointMetaData()
- {
- return epMetaData;
- }
-
- public QName getQName()
- {
- return qname;
- }
-
- public QName getResponseName()
- {
- return responseName;
- }
-
- public String getSOAPAction()
- {
- return soapAction;
- }
-
- public void setSOAPAction(String soapAction)
- {
- this.soapAction = soapAction;
- }
-
- public Style getStyle()
- {
- return epMetaData.getStyle();
- }
-
- public Use getUse()
- {
- return epMetaData.getEncodingStyle();
- }
-
- public ParameterStyle getParameterStyle()
- {
- return epMetaData.getParameterStyle();
- }
-
- public boolean isRPCLiteral()
- {
- return getStyle() == Style.RPC && getUse() == Use.LITERAL;
- }
-
- public boolean isRPCEncoded()
- {
- return getStyle() == Style.RPC && getUse() == Use.ENCODED;
- }
-
- public boolean isDocumentBare()
- {
- return getStyle() == Style.DOCUMENT && getParameterStyle() ==
ParameterStyle.BARE;
- }
-
- public boolean isDocumentWrapped()
- {
- return getStyle() == Style.DOCUMENT && getParameterStyle() ==
ParameterStyle.WRAPPED;
- }
-
- public String getJavaName()
- {
- return javaName;
- }
-
- public Method getJavaMethod()
- {
- Method tmpMethod = javaMethod;
- Class seiClass = epMetaData.getServiceEndpointInterface();
- if (tmpMethod == null && seiClass != null)
- {
- for (Method method : seiClass.getMethods())
- {
- if (isJavaMethod(method))
- {
- tmpMethod = method;
-
- UnifiedMetaData wsMetaData =
epMetaData.getServiceMetaData().getUnifiedMetaData();
- if (wsMetaData.isEagerInitialized())
- {
- if (UnifiedMetaData.isFinalRelease() == false)
- log.warn("Loading java method after eager initialization",
new IllegalStateException());
-
- javaMethod = method;
- }
-
- break;
- }
- }
-
- if (tmpMethod == null)
- throw new WSException("Cannot find java method: " + javaName);
- }
- return tmpMethod;
- }
-
- public boolean isJavaMethod(Method method)
- {
- boolean isJavaMethod = method.equals(javaMethod);
- if (isJavaMethod == false)
- {
- String methodName = method.getName();
- if (javaName.equals(methodName))
- {
- log.trace("Found java method: " + method);
-
- // compare params by java type name
- if (matchParameters(method, true))
- {
- log.debug("Found best matching java method: " + method);
- isJavaMethod = true;
- }
-
- // compare params by assignability
- if (!isJavaMethod && matchParameters(method, false))
- {
- log.debug("Found possible matching java method: " + method);
- isJavaMethod = true;
- }
- }
- }
-
- if (log.isTraceEnabled())
- log.trace("Synchronized java method:\n" + method + "\nwith:
" + toString());
-
- return isJavaMethod;
- }
-
- private boolean matchParameters(Method method, boolean exact)
- {
- Class[] paramTypes = method.getParameterTypes();
- Set<Integer> matches = new HashSet<Integer>(paramTypes.length);
-
- for (ParameterMetaData param : getParameters())
- {
- if (param.matchParameter(method, matches, exact) == false)
- return false;
- }
-
- // We should have an entry for every parameter index if we match
- if (matches.size() != paramTypes.length)
- return false;
-
- ParameterMetaData returnMetaData = getReturnParameter();
- if (returnMetaData != null)
- {
- return returnMetaData.matchParameter(method, matches, exact);
- }
-
- return true;
- }
-
- /** Return true if this is a generic message style destination that takes a
org.w3c.dom.Element
- */
- public boolean isMessageEndpoint()
- {
- boolean isMessageEndpoint = false;
- if (parameters.size() == 1)
- {
- ParameterMetaData inParam = parameters.get(0);
- if (JavaUtils.isAssignableFrom(Element.class, inParam.getJavaType()))
- {
- isMessageEndpoint = true;
- }
- }
- return isMessageEndpoint;
- }
-
- public boolean isOneWay()
- {
- return oneWay;
- }
-
- public void setOneWay(boolean oneWay)
- {
- this.oneWay = oneWay;
- assertOneWayOperation();
- }
-
- public ParameterMetaData getParameter(QName xmlName)
- {
- ParameterMetaData paramMetaData = null;
- for (int i = 0; paramMetaData == null && i < parameters.size(); i++)
- {
- ParameterMetaData aux = parameters.get(i);
- if (xmlName.equals(aux.getXmlName()))
- paramMetaData = aux;
- }
- return paramMetaData;
- }
-
- /** Get the IN or INOUT parameter list */
- public List<ParameterMetaData> getInputParameters()
- {
- List<ParameterMetaData> retList = new ArrayList<ParameterMetaData>();
- for (ParameterMetaData paramMetaData : parameters)
- {
- ParameterMode mode = paramMetaData.getMode();
- if (mode == ParameterMode.IN || mode == ParameterMode.INOUT)
- retList.add(paramMetaData);
- }
- return retList;
- }
-
- /** Get the OUT or INOUT parameter list */
- public List<ParameterMetaData> getOutputParameters()
- {
- List<ParameterMetaData> retList = new ArrayList<ParameterMetaData>();
- for (ParameterMetaData paramMetaData : parameters)
- {
- ParameterMode mode = paramMetaData.getMode();
- if (mode == ParameterMode.OUT || mode == ParameterMode.INOUT)
- retList.add(paramMetaData);
- }
- return retList;
- }
-
- /** Get the non header parameter list */
- public List<ParameterMetaData> getNonHeaderParameters()
- {
- List<ParameterMetaData> retList = new ArrayList<ParameterMetaData>();
- for (ParameterMetaData paramMetaData : parameters)
- {
- if (paramMetaData.isInHeader() == false)
- retList.add(paramMetaData);
- }
- return retList;
- }
-
- public List<ParameterMetaData> getParameters()
- {
- return new ArrayList<ParameterMetaData>(parameters);
- }
-
- public void addParameter(ParameterMetaData pmd)
- {
- log.trace("addParameter: [xmlName=" + pmd.getXmlName() +
",xmlType=" + pmd.getXmlType() + "]");
- parameters.add(pmd);
- assertOneWayOperation();
- }
-
- public void removeAllParameters()
- {
- parameters.clear();
- }
-
- public ParameterMetaData getReturnParameter()
- {
- return returnParam;
- }
-
- public void setReturnParameter(ParameterMetaData returnParam)
- {
- log.trace("setReturnParameter: " + returnParam);
- returnParam.setMode(ParameterMode.OUT);
- returnParam.setIndex(-1);
- this.returnParam = returnParam;
- assertOneWayOperation();
- }
-
- public List<FaultMetaData> getFaults()
- {
- return new ArrayList<FaultMetaData>(faults);
- }
-
- public FaultMetaData getFault(QName xmlName)
- {
- FaultMetaData faultMetaData = null;
- for (int i = 0; faultMetaData == null && i < faults.size(); i++)
- {
- FaultMetaData aux = faults.get(i);
- if (aux.getXmlName().equals(xmlName))
- faultMetaData = aux;
- }
- return faultMetaData;
- }
-
- public FaultMetaData getFault(Class javaType)
- {
- FaultMetaData faultMetaData = null;
- for (FaultMetaData aux : faults)
- {
- if (aux.getJavaType().equals(javaType))
- {
- faultMetaData = aux;
- break;
- }
- }
- return faultMetaData;
- }
-
- public void addFault(FaultMetaData fault)
- {
- log.trace("addFault: " + fault);
- faults.add(fault);
- assertOneWayOperation();
- }
-
- // A JSR-181 processor is REQUIRED to report an error if an
- // operation marked @Oneway has a return value, declares any checked exceptions or has
any
- // INOUT or OUT parameters.
- private void assertOneWayOperation()
- {
- if (oneWay)
- {
- if (returnParam != null)
- throw new WSException("OneWay operations cannot have a return
parameter");
-
- if (faults.size() > 0)
- throw new WSException("OneWay operations cannot have checked
exceptions");
-
- for (ParameterMetaData paramMetaData : parameters)
- {
- if (paramMetaData.getMode() != ParameterMode.IN)
- throw new WSException("OneWay operations cannot have INOUT or OUT
parameters");
- }
- }
- }
-
- public void assertDocumentBare()
- {
- if (isDocumentBare())
- {
- int in = 0;
- int out = 0;
-
- for (ParameterMetaData paramMetaData : parameters)
- {
- if (paramMetaData.isInHeader())
- continue;
-
- ParameterMode mode = paramMetaData.getMode();
- if (mode != ParameterMode.OUT)
- in++;
- if (mode != ParameterMode.IN)
- out++;
- }
-
- if (returnParam != null && !returnParam.isInHeader())
- out++;
-
- if (in > 1 || out > (oneWay ? 0 : 1))
- throw new WSException("The body of a document/literal bare message
requires at most 1 input and at most 1 output (or 0 if oneway). method: " + javaName
+ " in: "
- + in + " out: " + out);
- }
- }
-
- public void validate()
- {
- for (ParameterMetaData parameter : parameters)
- parameter.validate();
-
- for (FaultMetaData fault : faults)
- fault.validate();
- }
-
- /**
- * @see UnifiedMetaData#eagerInitialize()
- */
- public void eagerInitialize(List<Method> unsynchronizedMethods)
- {
- // reset java method
- javaMethod = null;
-
- for (ParameterMetaData parameter : parameters)
- parameter.eagerInitialize();
-
- if (returnParam != null)
- returnParam.eagerInitialize();
-
- for (FaultMetaData fault : faults)
- fault.eagerInitialize();
-
- // Method initialization
- for (Method method : unsynchronizedMethods)
- {
- if (isJavaMethod(method))
- {
- javaMethod = method;
- break;
- }
- }
-
- // Report unsynchronized java method
- if (javaMethod == null)
- {
- StringBuilder errMsg = new StringBuilder("Cannot synchronize to any of
these methods:");
- for (Method method : unsynchronizedMethods)
- {
- errMsg.append("\n" + method);
- }
- errMsg.append("\n" + toString());
- throw new IllegalStateException(errMsg.toString());
- }
- }
-
- public String toString()
- {
- StringBuilder buffer = new StringBuilder("\nOperationMetaData:");
- buffer.append("\n qname=" + qname);
- buffer.append("\n javaName=" + javaName);
- buffer.append("\n style=" + getStyle() + "/" + getUse());
- if (getStyle() == Style.DOCUMENT)
- {
- buffer.append("/" + getParameterStyle());
- }
- buffer.append("\n oneWay=" + oneWay);
- buffer.append("\n soapAction=" + soapAction);
- for (ParameterMetaData param : parameters)
- {
- buffer.append(param);
- }
- if (returnParam != null)
- {
- buffer.append(returnParam.toString());
- }
- for (FaultMetaData fault : faults)
- {
- buffer.append(fault);
- }
- return buffer.toString();
- }
-}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ParameterMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ParameterMetaData.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ParameterMetaData.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -1,469 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata;
-
-// $Id$
-
-import java.lang.reflect.Method;
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.StringTokenizer;
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.ParameterMode;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.jboss.ws.WSException;
-import org.jboss.ws.jaxrpc.ParameterWrapping;
-import org.jboss.ws.jaxws.DynamicWrapperGenerator;
-import org.jboss.ws.metadata.WrappedParameter.AccessorFactory;
-import org.jboss.ws.metadata.acessor.ReflectiveMethodAccessor;
-import org.jboss.ws.utils.HolderUtils;
-import org.jboss.ws.utils.JavaUtils;
-
-/**
- * A request/response parameter that a given operation supports.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @since 12-May-2005
- */
-public class ParameterMetaData
-{
- // provide logging
- private final Logger log = Logger.getLogger(ParameterMetaData.class);
-
- // The parent operation
- private OperationMetaData opMetaData;
-
- private QName xmlName;
- private String partName;
- private QName xmlType;
- private String javaTypeName;
- private Class javaType;
- private ParameterMode mode;
- private Set<String> mimeTypes;
- private boolean inHeader;
- private boolean isSwA;
- private boolean isXOP;
- private List<WrappedParameter> wrappedParameters;
- private int index;
-
- // SOAP-ENC:Array
- private boolean soapArrayParam;
- private QName soapArrayCompType;
- private AccessorFactoryCreator accessorFactoryCreator =
ReflectiveMethodAccessor.FACTORY_CREATOR;
-
- public static interface AccessorFactoryCreator
- {
- public AccessorFactory create(ParameterMetaData parameter);
- }
-
- private static final List<String> messageTypes = new ArrayList<String>();
- static
- {
- messageTypes.add("javax.xml.soap.SOAPElement");
- messageTypes.add("org.w3c.dom.Element");
- }
-
- public ParameterMetaData(OperationMetaData opMetaData, QName xmlName, QName xmlType,
String javaTypeName)
- {
- this(opMetaData, xmlName, javaTypeName);
- setXmlType(xmlType);
- }
-
- public ParameterMetaData(OperationMetaData opMetaData, QName xmlName, String
javaTypeName)
- {
- if (xmlName == null)
- throw new IllegalArgumentException("Invalid null xmlName argument");
-
- // Remove the prefixes
- if (xmlName.getNamespaceURI().length() > 0)
- xmlName = new QName(xmlName.getNamespaceURI(), xmlName.getLocalPart());
-
- this.xmlName = xmlName;
- this.opMetaData = opMetaData;
- this.mode = ParameterMode.IN;
- this.partName = xmlName.getLocalPart();
- this.javaTypeName = javaTypeName;
- }
-
- private static boolean matchParameter(Method method, int index, Class expectedType,
Set<Integer> matches, boolean exact, boolean holder)
- {
- Class returnType = method.getReturnType();
- Type[] parameters = method.getGenericParameterTypes();
-
- if (index == -1 && matchTypes(returnType, expectedType, exact, false))
- return true;
-
- if (index < parameters.length && matchTypes(parameters[index],
expectedType, exact, holder))
- {
- matches.add(index);
- return true;
- }
-
- return false;
- }
-
- private static boolean matchTypes(Type actualType, Class expectedType, boolean exact,
boolean holder)
- {
- if (holder && HolderUtils.isHolderType(actualType) == false)
- return false;
-
- Type valueType = (holder ? HolderUtils.getValueType(actualType) : actualType);
- Class valueClass = JavaUtils.erasure(valueType);
- boolean matched = (exact ? valueClass.getName().equals(expectedType.getName()) :
JavaUtils.isAssignableFrom(valueClass, expectedType));
-
- return matched;
- }
-
- public OperationMetaData getOperationMetaData()
- {
- return opMetaData;
- }
-
- public QName getXmlName()
- {
- return xmlName;
- }
-
- public QName getXmlType()
- {
- return xmlType;
- }
-
- public void setXmlType(QName xmlType)
- {
- if (xmlType == null)
- throw new IllegalArgumentException("Invalid null xmlType");
-
- // Remove potential prefix
- if (xmlType.getNamespaceURI().length() > 0)
- this.xmlType = new QName(xmlType.getNamespaceURI(), xmlType.getLocalPart());
- else this.xmlType = xmlType;
-
- // Special case to identify attachments
- if (Constants.NS_ATTACHMENT_MIME_TYPE.equals(xmlType.getNamespaceURI()))
- {
- String mimeType = convertXmlTypeToMimeType(xmlType);
- setMimeTypes(mimeType);
- this.isSwA = true;
- }
- else if(Constants.NS_SCHEMA_XSD.equals(xmlType.getNamespaceURI())
- && "base64Binary".equals(xmlType.getLocalPart()))
- {
- setXOP(true);
- }
- }
-
- public String getJavaTypeName()
- {
- return javaTypeName;
- }
-
- public void setJavaTypeName(String typeName)
- {
- // Warn if this is called after eager initialization
- UnifiedMetaData wsMetaData =
opMetaData.getEndpointMetaData().getServiceMetaData().getUnifiedMetaData();
- if (wsMetaData.isEagerInitialized() && UnifiedMetaData.isFinalRelease() ==
false)
- log.warn("Set java type name after eager initialization", new
IllegalStateException());
-
- javaTypeName = typeName;
- javaType = null;
- }
-
- /** Load the java type.
- * It should only be cached during eager initialization.
- */
- public Class getJavaType()
- {
- Class tmpJavaType = javaType;
- if (tmpJavaType == null && javaTypeName != null)
- {
- try
- {
- ClassLoader loader = opMetaData.getEndpointMetaData().getClassLoader();
- tmpJavaType = JavaUtils.loadJavaType(javaTypeName, loader);
-
- UnifiedMetaData wsMetaData =
opMetaData.getEndpointMetaData().getServiceMetaData().getUnifiedMetaData();
- if (wsMetaData.isEagerInitialized())
- {
- // This should not happen, see the warning in setJavaTypeName
- javaType = tmpJavaType;
- }
- }
- catch (ClassNotFoundException ex)
- {
- throw new WSException("Cannot load java type: " + javaTypeName,
ex);
- }
- }
- return tmpJavaType;
- }
-
- public ParameterMode getMode()
- {
- return mode;
- }
-
- public void setMode(String mode)
- {
- if ("IN".equals(mode))
- setMode(ParameterMode.IN);
- else if ("INOUT".equals(mode))
- setMode(ParameterMode.INOUT);
- else if ("OUT".equals(mode))
- setMode(ParameterMode.OUT);
- else throw new IllegalArgumentException("Invalid mode: " + mode);
- }
-
- public void setMode(ParameterMode mode)
- {
- this.mode = mode;
- }
-
- public Set<String> getMimeTypes()
- {
- return mimeTypes;
- }
-
- public void setMimeTypes(String mimeStr)
- {
- mimeTypes = new HashSet<String>();
- StringTokenizer st = new StringTokenizer(mimeStr, ",");
- while (st.hasMoreTokens())
- mimeTypes.add(st.nextToken().trim());
- }
-
- public boolean isInHeader()
- {
- return inHeader;
- }
-
- public void setInHeader(boolean inHeader)
- {
- this.inHeader = inHeader;
- }
-
- public boolean isSwA()
- {
- return isSwA;
- }
-
- public void setSwA(boolean isSwA)
- {
- this.isSwA = isSwA;
- }
-
- public boolean isXOP()
- {
- return isXOP;
- }
-
- public void setXOP(boolean isXOP)
- {
- this.isXOP = isXOP;
- }
-
- public boolean isSOAPArrayParam()
- {
- return soapArrayParam;
- }
-
- public void setSOAPArrayParam(boolean soapArrayParam)
- {
- this.soapArrayParam = soapArrayParam;
- }
-
- public QName getSOAPArrayCompType()
- {
- return soapArrayCompType;
- }
-
- public void setSOAPArrayCompType(QName xmlType)
- {
- this.soapArrayCompType = xmlType;
- }
-
- public boolean isMessageType()
- {
- return messageTypes.contains(javaTypeName);
- }
-
- public static boolean isMessageType(String javaTypeName)
- {
- return messageTypes.contains(javaTypeName);
- }
-
- /** Converts a proprietary JBossWS attachment xml type to the MIME type that it
represents.
- */
- private String convertXmlTypeToMimeType(QName xmlType)
- {
- StringBuilder mimeName = new StringBuilder(xmlType.getLocalPart());
- int pos = mimeName.indexOf("_");
- if (pos == -1)
- throw new IllegalArgumentException("Invalid mime type: " + xmlType);
-
- mimeName.setCharAt(pos, '/');
- return mimeName.toString();
- }
-
- public int getIndex()
- {
- return index;
- }
-
- public void setIndex(int index)
- {
- this.index = index;
- }
-
- public List<WrappedParameter> getWrappedParameters()
- {
- return wrappedParameters;
- }
-
- public void setWrappedParameters(List<WrappedParameter> wrappedParameters)
- {
- this.wrappedParameters = wrappedParameters;
- }
-
- public String getPartName()
- {
- return partName;
- }
-
- public void setPartName(String partName)
- {
- this.partName = partName;
- }
-
- public void validate()
- {
- // nothing to do
- }
-
- /**
- * @see UnifiedMetaData#eagerInitialize()
- */
- public void eagerInitialize()
- {
- // reset java type
- javaType = null;
-
- if (getOperationMetaData().isDocumentWrapped() && isMessageType() ==
false)
- {
- new DynamicWrapperGenerator(getClassLoader()).generate(this);
-
- // Initialize accessors
- AccessorFactory factory = accessorFactoryCreator.create(this);
- for (WrappedParameter wrapped : wrappedParameters)
- wrapped.setAccessor(factory.create(wrapped));
- }
-
- javaType = getJavaType();
- if (javaType == null)
- throw new WSException("Cannot load java type: " + javaTypeName);
- }
-
- private ClassLoader getClassLoader()
- {
- ClassLoader loader =
opMetaData.getEndpointMetaData().getServiceMetaData().getUnifiedMetaData().getClassLoader();
- if (loader == null)
- throw new WSException("ClassLoader not available");
- return loader;
- }
-
- public boolean matchParameter(Method method, Set<Integer> matches, boolean
exact)
- {
- ClassLoader loader =
getOperationMetaData().getEndpointMetaData().getClassLoader();
- List<WrappedParameter> wrappedParameters = getWrappedParameters();
- Class wrapperType = getJavaType();
-
- // Standard type
- if (wrappedParameters == null)
- return matchParameter(method, getIndex(), getJavaType(), matches, exact, mode !=
ParameterMode.IN);
-
- // Wrapped type
- for (WrappedParameter wrapped : wrappedParameters)
- {
- String typeName = wrapped.getType();
-
- try
- {
- Class type = (typeName != null) ? JavaUtils.loadJavaType(typeName, loader) :
ParameterWrapping.getWrappedType(wrapped.getVariable(), wrapperType);
- if (type == null)
- return false;
- if (!matchParameter(method, wrapped.getIndex(), type, matches, exact,
wrapped.isHolder()))
- return false;
- }
- catch (Exception ex)
- {
- log.debug("Invalid wrapper type:" + typeName, ex);
- return false;
- }
- }
-
- return true;
- }
-
- public void setAccessorFactoryCreator(AccessorFactoryCreator accessorFactoryCreator)
- {
- this.accessorFactoryCreator = accessorFactoryCreator;
- }
-
- public String toString()
- {
- boolean isReturn = (opMetaData.getReturnParameter() == this);
- StringBuilder buffer = new StringBuilder("\n" + (isReturn ?
"ReturnMetaData:" : "ParameterMetaData:"));
- buffer.append("\n xmlName=" + getXmlName());
- buffer.append("\n partName=" + getPartName());
- buffer.append("\n xmlType=" + getXmlType());
- buffer.append("\n javaType=" + getJavaTypeName());
- buffer.append("\n mode=" + getMode());
- buffer.append("\n inHeader=" + isInHeader());
- buffer.append("\n index=" + index);
-
- if (soapArrayParam)
- buffer.append("\n soapArrayCompType=" + soapArrayCompType);
-
- if (isSwA())
- {
- buffer.append("\n isSwA=" + isSwA());
- buffer.append("\n mimeTypes=" + getMimeTypes());
- }
-
- if (wrappedParameters != null)
- buffer.append("\n wrappedParameters=" + wrappedParameters);
-
- if (isXOP())
- {
- buffer.append("\n isXOP=" + isXOP());
- buffer.append("\n mimeTypes=" + getMimeTypes());
- }
-
- return buffer.toString();
- }
-}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ServerEndpointMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ServerEndpointMetaData.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ServerEndpointMetaData.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -1,300 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata;
-
-// $Id$
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import javax.management.ObjectName;
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
-import org.jboss.ws.metadata.config.WSCommonConfig;
-import org.jboss.ws.metadata.config.WSConfigFactory;
-import org.jboss.ws.metadata.config.jaxrpc.WSConfigRootJAXRPC;
-import org.jboss.ws.metadata.config.jaxws.WSConfigRootJAXWS;
-import org.jboss.ws.server.ServiceEndpoint;
-
-/**
- * Client side endpoint meta data.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @since 12-May-2005
- */
-public class ServerEndpointMetaData extends EndpointMetaData
-{
- // provide logging
- private static Logger log = Logger.getLogger(ServerEndpointMetaData.class);
-
- public static final String SEPID_DOMAIN = "jboss.ws";
- public static final String SEPID_PROPERTY_CONTEXT = "context";
- public static final String SEPID_PROPERTY_ENDPOINT = "endpoint";
-
- // The REQUIRED link name
- private String linkName;
- // Legacy JSR-109 port component name
- private String portComponentName;
- // The endpoint implementation bean
- private String implName;
- // The unique service endpointID
- private ObjectName sepID;
- // The HTTP context root
- private String contextRoot;
- // The HTTP virtual hosts
- private String[] virtualHosts;
- // The HTTP url parttern
- private String urlPattern;
- // The optional transport guarantee
- private String transportGuarantee;
- // The bean that registers with the ServiceEndpointManager
- private String managedEndpointBean = ServiceEndpoint.class.getName();
-
- public ServerEndpointMetaData(ServiceMetaData service, QName qname, QName
interfaceQName, Type type)
- {
- super(service, qname, interfaceQName, type);
- }
-
- public void setConfigName(String configName)
- {
- super.setConfigName(configName);
- endpointConfig = null;
- }
-
- public void setConfigFile(String configFile)
- {
- super.setConfigFile(configFile);
- endpointConfig = null;
- }
-
- public String getLinkName()
- {
- return linkName;
- }
-
- public void setLinkName(String linkName)
- {
- this.linkName = linkName;
- }
-
- public String getPortComponentName()
- {
- return portComponentName;
- }
-
- public void setPortComponentName(String portComponentName)
- {
- this.portComponentName = portComponentName;
- }
-
- public String getServiceEndpointImplName()
- {
- return implName;
- }
-
- public void setServiceEndpointImplName(String endpointImpl)
- {
- this.implName = endpointImpl;
- }
-
- public ObjectName getServiceEndpointID()
- {
- return sepID;
- }
-
- public void setServiceEndpointID(ObjectName endpointID)
- {
- this.sepID = endpointID;
- }
-
- public String getContextRoot()
- {
- return contextRoot;
- }
-
- public void setContextRoot(String contextRoot)
- {
- if (contextRoot != null && contextRoot.startsWith("/") == false)
- throw new IllegalArgumentException("context root should start with
'/'");
-
- this.contextRoot = contextRoot;
- }
-
- public String[] getVirtualHosts()
- {
- return virtualHosts;
- }
-
- public void setVirtualHosts(String[] virtualHosts)
- {
- this.virtualHosts = virtualHosts;
- }
-
- public String getURLPattern()
- {
- return urlPattern;
- }
-
- public void setURLPattern(String urlPattern)
- {
- if (urlPattern != null && urlPattern.startsWith("/") == false)
- throw new IllegalArgumentException("url pattern should start with
'/'");
-
- this.urlPattern = urlPattern;
- }
-
- public String getTransportGuarantee()
- {
- return transportGuarantee;
- }
-
- public void setTransportGuarantee(String transportGuarantee)
- {
- this.transportGuarantee = transportGuarantee;
- }
-
- public String getManagedEndpointBean()
- {
- return managedEndpointBean;
- }
-
- public void setManagedEndpointBean(String managedEndpointBean)
- {
- this.managedEndpointBean = managedEndpointBean;
- }
-
- @Override
- public WSCommonConfig getEndpointConfig()
- {
- if (endpointConfig == null)
- {
- String configName = getConfigName();
- if (configName == null)
- {
- configName = "Standard Endpoint";
- setConfigName(configName);
- }
-
- String configFile = getConfigFile();
- if (configFile == null)
- {
- if (getType() == Type.JAXRPC)
- {
- configFile = "META-INF/standard-jaxrpc-endpoint-config.xml";
- }
- else
- {
- configFile = "META-INF/standard-jaxws-endpoint-config.xml";
- }
- setConfigFile(configFile);
- }
-
- log.debug("getEndpointConfig: [name=" + configName + ",url="
+ configFile + "]");
-
- URL configURL = null;
- try
- {
- configURL = new URL(configFile);
- }
- catch (MalformedURLException ex)
- {
- // ignore
- }
-
- // Try to get the URL as resource
- if (configURL == null)
- {
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
- configURL = cl.getResource(configFile);
- if (configURL == null)
- throw new WSException("Cannot get resource: " + configFile);
- }
-
- // Get the config root
- Object wsConfig;
- try
- {
- WSConfigFactory factory = WSConfigFactory.newInstance();
- wsConfig = factory.parseWithObjectModelFactory(configURL);
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WSException("Cannot parse client config", ex);
- }
-
- // Get the endpoint config
- if (wsConfig instanceof WSConfigRootJAXRPC)
- {
- endpointConfig =
((WSConfigRootJAXRPC)wsConfig).getEndpointConfigByName(configName);
- if (endpointConfig == null)
- throw new WSException("Cannot obtain endpoint config: " +
configName);
- }
- else
- {
- endpointConfig =
((WSConfigRootJAXWS)wsConfig).getEndpointConfigByName(configName);
- if (endpointConfig == null)
- throw new WSException("Cannot obtain endpoint config: " +
configName);
- }
- }
- return endpointConfig;
- }
-
- public String toString()
- {
- StringBuilder buffer = new StringBuilder("\nServerEndpointMetaData:");
- buffer.append("\n type=" + getType());
- buffer.append("\n qname=" + getQName());
- buffer.append("\n id=" + getServiceEndpointID().getCanonicalName());
- buffer.append("\n address=" + getEndpointAddress());
- buffer.append("\n binding=" + getBindingId());
- buffer.append("\n linkName=" + getLinkName());
- buffer.append("\n implName=" + getServiceEndpointImplName());
- buffer.append("\n seiName=" + getServiceEndpointInterfaceName());
- buffer.append("\n serviceMode=" + getServiceMode());
- buffer.append("\n portComponentName=" + getPortComponentName());
- buffer.append("\n contextRoot=" + getContextRoot());
- buffer.append("\n urlPattern=" + getURLPattern());
- buffer.append("\n configFile=" + getConfigFile());
- buffer.append("\n configName=" + getConfigName());
- buffer.append("\n authMethod=" + getAuthMethod());
- buffer.append("\n transportGuarantee=" + getTransportGuarantee());
- buffer.append("\n properties=" + getProperties());
-
- for (OperationMetaData opMetaData : getOperations())
- {
- buffer.append("\n" + opMetaData);
- }
- for (HandlerMetaData hdlMetaData : getHandlerMetaData(HandlerType.ALL))
- {
- buffer.append("\n" + hdlMetaData);
- }
- return buffer.toString();
- }
-}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ServiceMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ServiceMetaData.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ServiceMetaData.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -1,416 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata;
-
-// $Id$
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.encoding.TypeMappingRegistry;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.jaxrpc.TypeMappingImpl;
-import org.jboss.ws.jaxrpc.TypeMappingRegistryImpl;
-import org.jboss.ws.jaxrpc.Use;
-import org.jboss.ws.jbossxb.SchemaBindingBuilder;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
-import org.jboss.ws.metadata.wsdl.WSDLTypes;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
-import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
-import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
-
-/**
- * A Service component describes a set of endpoints.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-May-2005
- */
-public class ServiceMetaData
-{
- // provide logging
- private static final Logger log = Logger.getLogger(ServiceMetaData.class);
-
- // The parent meta data.
- private UnifiedMetaData wsMetaData;
-
- // The service endpoints
- private Map<QName, EndpointMetaData> endpoints = new LinkedHashMap<QName,
EndpointMetaData>();
-
- private QName serviceName;
- private String wsdName;
- private String wsdlFile;
- private String jaxrpcMappingFile;
- private String wsdlPublishLocation;
-
- // The type mapping that is maintained by this service
- private TypesMetaData types;
- private TypeMappingRegistry tmRegistry = new TypeMappingRegistryImpl();
- private SchemaBinding schemaBinding;
-
- // Arbitrary properties given by <call-property>
- private Properties properties;
-
- // derived cached encoding style
- private Use encStyle;
-
- // The security configuration
- private WSSecurityConfiguration securityConfiguration;
-
- public ServiceMetaData(UnifiedMetaData wsMetaData, QName serviceName)
- {
- this.wsMetaData = wsMetaData;
- this.serviceName = serviceName;
- this.types = new TypesMetaData(this);
- }
-
- public UnifiedMetaData getUnifiedMetaData()
- {
- return wsMetaData;
- }
-
- public void setServiceName(QName serviceName)
- {
- this.serviceName = serviceName;
- }
-
- public QName getServiceName()
- {
- return serviceName;
- }
-
- public String getWebserviceDescriptionName()
- {
- return wsdName;
- }
-
- public void setWebserviceDescriptionName(String wsdName)
- {
- this.wsdName = wsdName;
- }
-
- public String getWsdlFile()
- {
- return wsdlFile;
- }
-
- public void setWsdlFile(String wsdlFile)
- {
- this.wsdlFile = wsdlFile;
- }
-
- public String getWsdlPublishLocation()
- {
- return wsdlPublishLocation;
- }
-
- public void setWsdlPublishLocation(String wsdlPublishLocation)
- {
- this.wsdlPublishLocation = wsdlPublishLocation;
- }
-
- public Properties getProperties()
- {
- return properties;
- }
-
- public void setProperties(Properties properties)
- {
- this.properties = properties;
- }
-
- public TypesMetaData getTypesMetaData()
- {
- return types;
- }
-
- public List<EndpointMetaData> getEndpoints()
- {
- return new ArrayList<EndpointMetaData>(endpoints.values());
- }
-
- public EndpointMetaData getEndpoint(QName portName)
- {
- return endpoints.get(portName);
- }
-
- public EndpointMetaData getEndpointByServiceEndpointInterface(String seiName)
- {
- EndpointMetaData epMetaData = null;
- for (EndpointMetaData epmd : endpoints.values())
- {
- if (seiName.equals(epmd.getServiceEndpointInterfaceName()))
- {
- if (epMetaData != null)
- {
- // The CTS uses Service.getPort(Class) with multiple endpoints
implementing the same SEI
- log.warn("Multiple possible endpoints implementing SEI: " +
seiName);
- }
- epMetaData = epmd;
- }
- }
- return epMetaData;
- }
-
- public void addEndpoint(EndpointMetaData epMetaData)
- {
- QName portName = epMetaData.getQName();
-
- // This happends when we have multiple port components in sharing the same wsdl
port
- // The EndpointMetaData name is the wsdl port, so we cannot have multiple meta data
for the same port.
- if (endpoints.get(portName) != null)
- throw new WSException("EndpointMetaData name must be unique: " +
portName);
-
- endpoints.put(portName, epMetaData);
- }
-
- public String getJaxrpcMappingFile()
- {
- return jaxrpcMappingFile;
- }
-
- public void setJaxrpcMappingFile(String jaxrpcMappingFile)
- {
- this.jaxrpcMappingFile = jaxrpcMappingFile;
- }
-
- public JavaWsdlMapping getJavaWsdlMapping()
- {
- JavaWsdlMapping javaWsdlMapping =
(JavaWsdlMapping)wsMetaData.getMappingDefinition(jaxrpcMappingFile);
- if (javaWsdlMapping == null && jaxrpcMappingFile != null)
- {
- URL mappingLocation = null;
- try
- {
- mappingLocation = new URL(jaxrpcMappingFile);
- }
- catch (MalformedURLException e)
- {
- // ignore
- }
- if (mappingLocation == null)
- {
- mappingLocation =
wsMetaData.getClassLoader().getResource(jaxrpcMappingFile);
- }
-
- if (mappingLocation == null)
- throw new IllegalArgumentException("Cannot find jaxrpc-mapping.xml in
deployment: " + jaxrpcMappingFile);
-
- try
- {
- JavaWsdlMappingFactory mappingFactory =
JavaWsdlMappingFactory.newInstance();
- javaWsdlMapping = mappingFactory.parse(mappingLocation);
- wsMetaData.addMappingDefinition(jaxrpcMappingFile, javaWsdlMapping);
- }
- catch (IOException e)
- {
- throw new WSException("Cannot parse jaxrpc-mapping.xml", e);
- }
- }
- return javaWsdlMapping;
- }
-
- /**
- * Get the wsdl definition that corresponds to the wsdl-file element.
- */
- public WSDLDefinitions getWsdlDefinitions()
- {
- WSDLDefinitions wsdlDefinitions =
(WSDLDefinitions)wsMetaData.getWSDLDefinition(wsdlFile);
- if (wsdlDefinitions == null && wsdlFile != null)
- {
- URL wsdlLocation = getWsdlLocation();
- if (wsdlLocation == null)
- throw new IllegalArgumentException("Cannot find wsdl in deployment:
" + wsdlFile);
-
- WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
- wsdlDefinitions = factory.parse(wsdlLocation);
- wsMetaData.addWSDLDefinition(wsdlFile, wsdlDefinitions);
- }
- return wsdlDefinitions;
- }
-
- public URL getWsdlLocation()
- {
- URL wsdlLocation = null;
- if (wsdlFile != null)
- {
- try
- {
- wsdlLocation = new URL(wsdlFile);
- }
- catch (MalformedURLException e)
- {
- // ignore
- }
- if (wsdlLocation == null)
- {
- wsdlLocation = wsMetaData.getClassLoader().getResource(wsdlFile);
- }
- }
- return wsdlLocation;
- }
-
- public TypeMappingImpl getTypeMapping()
- {
- Use encStyle = getEncodingStyle();
- TypeMappingImpl typeMapping =
(TypeMappingImpl)tmRegistry.getTypeMapping(encStyle.toURI());
- if (typeMapping == null)
- throw new WSException("No type mapping for encoding style: " +
encStyle);
-
- return typeMapping;
- }
-
- public WSSecurityConfiguration getSecurityConfiguration()
- {
- return securityConfiguration;
- }
-
- public void setSecurityConfiguration(WSSecurityConfiguration securityConfiguration)
- {
- this.securityConfiguration = securityConfiguration;
- }
-
- public Use getEncodingStyle()
- {
- if (encStyle == null)
- {
- if (endpoints.size() > 0)
- {
- for (EndpointMetaData epMetaData : endpoints.values())
- {
- if (encStyle == null)
- {
- encStyle = epMetaData.getEncodingStyle();
- }
- else if (encStyle.equals(epMetaData.getEncodingStyle()) == false)
- {
- throw new WSException("Conflicting encoding styles not
supported");
- }
- }
- }
- else
- {
- encStyle = Use.LITERAL;
- }
- }
- return encStyle;
- }
-
- public SchemaBinding getSchemaBinding()
- {
- JavaWsdlMapping wsdlMapping = getJavaWsdlMapping();
- if (schemaBinding == null && getEncodingStyle() == Use.LITERAL &&
wsdlMapping != null)
- {
- JBossXSModel xsModel = types.getSchemaModel();
- SchemaBindingBuilder bindingBuilder = new SchemaBindingBuilder();
- schemaBinding = bindingBuilder.buildSchemaBinding(xsModel, wsdlMapping);
- }
- return schemaBinding;
- }
-
- public void validate()
- {
- // Validate that there is at least one handler configured
- // if we have a security configuration
- if (securityConfiguration != null)
- {
- int handlerCount = 0;
- for (EndpointMetaData epMetaData : endpoints.values())
- {
- handlerCount += epMetaData.getHandlerMetaData(HandlerType.ALL).size();
- }
- if (handlerCount == 0)
- log.warn("WS-Security requires a security handler to be
configured");
- }
-
- // Validate endpoints
- for (EndpointMetaData epMetaData : endpoints.values())
- epMetaData.validate();
- }
-
- /**
- * @see UnifiedMetaData#eagerInitialize()
- */
- public void eagerInitialize()
- {
- // Initialize all wsdl definitions and schema objects
- WSDLDefinitions definitions = getWsdlDefinitions();
- if (definitions != null)
- {
- WSDLTypes types = definitions.getWsdlTypes();
- if (types != null)
- {
- JBossXSModel model = WSDLUtils.getSchemaModel(types);
- if (model != null)
- model.eagerInitialize();
- }
- }
-
- // Initialize jaxrpc-mapping data
- getJavaWsdlMapping();
-
- // Initialize endpoints
- for (EndpointMetaData epMetaData : endpoints.values())
- epMetaData.eagerInitialize();
-
- // Initialize schema binding
- getSchemaBinding();
- }
-
- /** Assert that the given namespace is the WSDL's target namespace */
- public void assertTargetNamespace(String targetNS)
- {
- if (getServiceName().getNamespaceURI().equals(targetNS) == false)
- throw new WSException("Requested namespace is not WSDL target namespace:
" + targetNS);
- }
-
- public String toString()
- {
- StringBuilder buffer = new StringBuilder("\nServiceMetaData:");
- buffer.append("\n qname=" + serviceName);
- buffer.append("\n wsdName=" + wsdName);
- buffer.append("\n wsdlFile=" + wsdlFile);
- buffer.append("\n jaxrpcFile=" + jaxrpcMappingFile);
- buffer.append("\n publishLocation=" + wsdlPublishLocation);
- buffer.append("\n properties=" + properties);
- buffer.append("\n" + types);
- buffer.append("\n");
- for (EndpointMetaData epMetaData : endpoints.values())
- {
- buffer.append(epMetaData);
- }
- return buffer.toString();
- }
-}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/TypeMappingMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/TypeMappingMetaData.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/TypeMappingMetaData.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -1,109 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata;
-
-// $Id$
-
-import java.util.Arrays;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-/**
- * Type mapping meta data
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-May-2005
- */
-public class TypeMappingMetaData
-{
- // The parent meta data.
- private TypesMetaData typesMetaData;
-
- private QName xmlType;
- private String javaTypeName;
- private String qnameScope;
-
- // List of allowed qname scopes
- public static final String QNAME_SCOPE_SIMPLE_TYPE = "simpleType";
- public static final String QNAME_SCOPE_COMPLEX_TYPE = "complexType";
- public static final String QNAME_SCOPE_ELEMENT = "element";
- private static List<String> allowedScopes = Arrays.asList(new String[] {
QNAME_SCOPE_COMPLEX_TYPE, QNAME_SCOPE_SIMPLE_TYPE, QNAME_SCOPE_ELEMENT });
-
- public TypeMappingMetaData(TypesMetaData typesMetaData, QName xmlType, String
javaTypeName)
- {
- if (xmlType == null)
- throw new IllegalArgumentException("Invalid null xmlType");
- if (javaTypeName == null)
- throw new IllegalArgumentException("Invalid null javaTypeName");
-
- this.typesMetaData = typesMetaData;
- this.javaTypeName = javaTypeName;
- this.xmlType = xmlType;
- this.qnameScope = QNAME_SCOPE_COMPLEX_TYPE;
- }
-
- public TypesMetaData getTypesMetaData()
- {
- return typesMetaData;
- }
-
- public String getJavaTypeName()
- {
- return javaTypeName;
- }
-
- public QName getXmlType()
- {
- return xmlType;
- }
-
- public String getQNameScope()
- {
- return qnameScope;
- }
-
- public void setQNameScope(String qnameScope)
- {
- if (allowedScopes.contains(qnameScope) == false)
- throw new IllegalArgumentException("Invalid qname scope: " +
qnameScope);
-
- this.qnameScope = qnameScope;
- }
-
- public int hashCode()
- {
- return toString().hashCode();
- }
-
- public boolean equals(Object obj)
- {
- if (obj instanceof TypeMappingMetaData == false) return false;
- TypeMappingMetaData other = (TypeMappingMetaData)obj;
- return toString().equals(other.toString());
- }
-
- public String toString()
- {
- return "[" + qnameScope + "=" + xmlType +
",javaType=" + javaTypeName + "]";
- }
-}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/TypesMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/TypesMetaData.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/TypesMetaData.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -1,193 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata;
-
-// $Id$
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.xerces.xs.XSSimpleTypeDefinition;
-import org.apache.xerces.xs.XSTypeDefinition;
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
-
-/**
- * Types meta data
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-May-2005
- */
-public class TypesMetaData
-{
- // provide logging
- private static final Logger log = Logger.getLogger(TypesMetaData.class);
-
- // The parent meta data.
- private ServiceMetaData serviceMetaData;
- // The list of type meta data
- private List<TypeMappingMetaData> typeList = new
ArrayList<TypeMappingMetaData>();
-
- private JBossXSModel schemaModel;
-
- public TypesMetaData(ServiceMetaData serviceMetaData)
- {
- this.serviceMetaData = serviceMetaData;
- }
-
- public ServiceMetaData getServiceMetaData()
- {
- return serviceMetaData;
- }
-
- public JBossXSModel getSchemaModel()
- {
- return schemaModel;
- }
-
- public void setSchemaModel(JBossXSModel model)
- {
- this.schemaModel = model;
- }
-
- public void addSchemaModel(JBossXSModel model)
- {
- if (this.schemaModel == null)
- {
- this.schemaModel = model;
- }
- else
- {
- this.schemaModel.merge(model);
- }
- }
-
- public List<TypeMappingMetaData> getTypeMappings()
- {
- return new ArrayList<TypeMappingMetaData>(typeList);
- }
-
- public void addTypeMapping(TypeMappingMetaData tmMetaData)
- {
- if (typeList.contains(tmMetaData) == false)
- {
- log.trace("Add type mapping: " + tmMetaData);
- typeList.add(tmMetaData);
- }
- }
-
- public TypeMappingMetaData getTypeMappingByXMLType(QName xmlType)
- {
- TypeMappingMetaData tmMetaData = null;
- for (TypeMappingMetaData aux : typeList)
- {
- boolean isElementScope =
TypeMappingMetaData.QNAME_SCOPE_ELEMENT.equals(aux.getQNameScope());
- if (aux.getXmlType().equals(xmlType) && isElementScope == false)
- {
- if (tmMetaData != null)
- {
- log.error(tmMetaData + "\n" + aux);
- throw new WSException("Ambiguous type mappping for: " +
xmlType);
- }
- tmMetaData = aux;
- }
- }
-
- if (tmMetaData == null && schemaModel != null)
- {
- // Simple types are not neccessary mapped in jaxrpc-mapping.xml, lazily add the
mapping here
- XSTypeDefinition xsType = schemaModel.getTypeDefinition(xmlType.getLocalPart(),
xmlType.getNamespaceURI());
- if (xsType instanceof XSSimpleTypeDefinition)
- {
- XSSimpleTypeDefinition xsSimpleType = (XSSimpleTypeDefinition)xsType;
- String javaTypeName = null;
-
- // <simpleType name="FooStringListType">
- // <list itemType="string"/>
- // </simpleType>
- if (xsSimpleType.getVariety() == XSSimpleTypeDefinition.VARIETY_LIST)
- {
- XSSimpleTypeDefinition itemType = xsSimpleType.getItemType();
- QName xmlBaseType = new QName(itemType.getNamespace(),
itemType.getName());
- javaTypeName = new LiteralTypeMapping().getJavaTypeName(xmlBaseType);
- if (javaTypeName != null)
- {
- javaTypeName += "[]";
- }
- }
-
- // <simpleType name="FooIType">
- // <restriction base="normalizedString">
- // <pattern value="\d{3}-[A-Z0-9]{5}"/>
- // </restriction>
- // </simpleType>
- XSTypeDefinition xsBaseType = xsType.getBaseType();
- while (javaTypeName == null && xsBaseType != null)
- {
- QName xmlBaseType = new QName(xsBaseType.getNamespace(),
xsBaseType.getName());
- javaTypeName = new LiteralTypeMapping().getJavaTypeName(xmlBaseType);
- xsBaseType = xsBaseType.getBaseType();
- }
-
- if (javaTypeName != null)
- {
- tmMetaData = new TypeMappingMetaData(this, xmlType, javaTypeName);
- tmMetaData.setQNameScope(TypeMappingMetaData.QNAME_SCOPE_SIMPLE_TYPE);
- log.debug("Adding a simpleType without jaxrpc-mapping: " +
tmMetaData);
- addTypeMapping(tmMetaData);
- }
- else
- {
- log.warn("Cannot obtain javaTypeName for xmlType: " + xmlType);
- }
- }
- }
-
- return tmMetaData;
- }
-
- public TypeMappingMetaData getTypeMappingByJavaType(String javaTypeName)
- {
- TypeMappingMetaData tmMetaData = null;
- for (TypeMappingMetaData aux : typeList)
- {
- if (aux.getJavaTypeName().equals(javaTypeName))
- tmMetaData = aux;
- }
- return tmMetaData;
- }
-
- public String toString()
- {
- StringBuilder buffer = new StringBuilder("\nTypesMetaData: ");
- for (TypeMappingMetaData tmd : typeList)
- {
- buffer.append("\n " + tmd);
- }
- buffer.append("\n" + (schemaModel != null ? schemaModel.serialize() :
"<schema/>"));
- return buffer.toString();
- }
-}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/UnifiedMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/UnifiedMetaData.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/UnifiedMetaData.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -1,219 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata;
-
-// $Id$
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.server.ServiceEndpointManager;
-
-/**
- * The top level meta data.
- *
- * <h4>Thread safety</h4>
- * <p>A <code>UnifiedMetaData</code> instance may be shared accross
threads provided that the following conditions are met:
- * <ol>
- * <li>{@link #eagerInitialize() eagerInitialize()} is called from a single thread
on startup</li>
- * <li>Multi-thread access is limited to read-only calls</li>
- * </ol></p>
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @since 12-May-2005
- */
-public class UnifiedMetaData
-{
- // provide logging
- private static Logger log = Logger.getLogger(UnifiedMetaData.class);
-
- // The canonical deployment name
- private String deploymentName;
- // The modules class loader
- private ClassLoader classLoader;
- // The optional security domain
- private String securityDomain;
- // The implementation version
- private static String implementationVersion;
- // True if this is a final release
- private static boolean isFinalRelease;
- // Map<String, WSDLDefinitions> the wsdl-file to the wsdl Document
- // Note the same wsdl can be used in multiple webservice descriptions
- Map<String, WSDLDefinitions> wsdlMap = new HashMap<String,
WSDLDefinitions>();
- // Maps the jaxrpc-mapping-file to {@link JavaWsdlMapping} object
- // Note the same jaxrpc-mapping.xml can be used in multiple webservice descriptions
- Map<String, JavaWsdlMapping> jaxrpcMap = new HashMap<String,
JavaWsdlMapping>();
- // The list of service meta data
- private List<ServiceMetaData> services = new
ArrayList<ServiceMetaData>();
- // Used by eager initialization
- private boolean eagerInitialized;
- // Used by validate
- private boolean validated;
-
- public UnifiedMetaData()
- {
- this.classLoader = Thread.currentThread().getContextClassLoader();
- }
-
- public ClassLoader getClassLoader()
- {
- if (classLoader == null)
- throw new IllegalStateException ("Class loader not available");
-
- return classLoader;
- }
-
- public void setClassLoader(ClassLoader classLoader)
- {
- this.classLoader = classLoader;
- }
-
- public String getDeploymentName()
- {
- return deploymentName;
- }
-
- public void setDeploymentName(String deploymentName)
- {
- this.deploymentName = deploymentName;
- }
-
- public String getSecurityDomain()
- {
- return securityDomain;
- }
-
- public void setSecurityDomain(String domain)
- {
- String prefix = "java:/jaas/";
- if (domain != null && domain.startsWith(prefix))
- domain = domain.substring(prefix.length());
-
- this.securityDomain = domain;
- }
-
- public List<ServiceMetaData> getServices()
- {
- return new ArrayList<ServiceMetaData>(services);
- }
-
- public void addService(ServiceMetaData serviceMetaData)
- {
- services.add(serviceMetaData);
- }
-
- public void addWSDLDefinition(String wsdlFile, WSDLDefinitions wsdlDefinitions)
- {
- wsdlMap.put(wsdlFile, wsdlDefinitions);
- }
-
- public WSDLDefinitions getWSDLDefinition(String wsdlFile)
- {
- return wsdlMap.get(wsdlFile);
- }
-
- public void addMappingDefinition(String jaxrpcFile, JavaWsdlMapping javaWsdlMapping)
- {
- jaxrpcMap.put(jaxrpcFile, javaWsdlMapping);
- }
-
- public JavaWsdlMapping getMappingDefinition(String jaxrpcFile)
- {
- return jaxrpcMap.get(jaxrpcFile);
- }
-
- public void validate()
- {
- if (validated == false)
- {
- for (ServiceMetaData service : services)
- {
- service.validate();
- }
- validated = true;
- }
- }
-
- public boolean isEagerInitialized()
- {
- return eagerInitialized;
- }
-
- /**
- * Eagerly initialize all cache values that are normally lazy-loaded. This
- * allows for concurrent read-only access to a
<code>UnifiedMetaData</code>
- * instance. This method, however, must be called from a single thread.
- */
- public void eagerInitialize()
- {
- if (eagerInitialized == false)
- {
- log.debug("Eagerly initialize the meta data model");
- for (ServiceMetaData service : services)
- {
- service.eagerInitialize();
- }
- eagerInitialized = true;
- }
- }
-
- public static String getImplementationVersion()
- {
- if (implementationVersion == null)
- {
- implementationVersion =
ServiceEndpointManager.class.getPackage().getImplementationVersion();
- if (implementationVersion != null)
- isFinalRelease = new
StringTokenizer(implementationVersion).nextToken().endsWith(".GA");
- }
- return implementationVersion;
- }
-
- public static boolean isFinalRelease()
- {
- getImplementationVersion();
- return isFinalRelease;
- }
-
- public String toString()
- {
- StringBuilder buffer = new StringBuilder("\nUnifiedMetaData: ");
- buffer.append("\n implementation: " + getImplementationVersion());
- buffer.append("\n deploymentName: " + getDeploymentName());
- buffer.append("\n securityDomain: " + getSecurityDomain());
- //buffer.append("\n resourceLoader: " + resourceLoader);
- //buffer.append("\n classLoader: " + classLoader);
- buffer.append("\n");
-
- for (ServiceMetaData serviceMetaData : services)
- {
- buffer.append(serviceMetaData);
- }
- return buffer.toString();
- }
-}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/WrappedParameter.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/WrappedParameter.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/WrappedParameter.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -1,138 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.ws.utils.JavaUtils;
-
-/**
- * WrappedParameter represents a document/literal wrapped parameter.
- *
- * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-public class WrappedParameter
-{
- public static final int RETURN = -1;
- private QName name;
- private String type;
- private String[] typeArguments;
- private String variable;
- private boolean holder = false;
- private int index = -2;
- private Accessor accessor;
-
- public static interface AccessorFactory
- {
- public Accessor create(WrappedParameter parameter);
- }
-
- public static interface Accessor
- {
- public void set(Object bean, Object value);
- public Object get(Object bean);
- }
-
- public WrappedParameter(QName name, String type, String variable, int index)
- {
- this.setName(name);
- this.setType(type);
- this.setVariable(variable);
- this.setIndex(index);
- }
-
- public Accessor accessor()
- {
- return accessor;
- }
-
- public void setName(QName name)
- {
- this.name = name;
- }
-
- public QName getName()
- {
- return name;
- }
-
- public void setType(String type)
- {
- this.type = type;
- }
-
- public String getType()
- {
- return type;
- }
-
- public void setTypeArguments(String[] typeArguments)
- {
- this.typeArguments = typeArguments;
- }
-
- public String[] getTypeArguments()
- {
- return typeArguments;
- }
-
- public void setVariable(String variable)
- {
- this.variable = variable;
- }
-
- public String getVariable()
- {
- return variable;
- }
-
- public void setHolder(boolean holder)
- {
- this.holder = holder;
- }
-
- public boolean isHolder()
- {
- return holder;
- }
-
- public void setIndex(int index)
- {
- this.index = index;
- }
-
- public int getIndex()
- {
- return index;
- }
-
- void setAccessor(Accessor accessor)
- {
- this.accessor = accessor;
- }
-
- public String toString()
- {
- return "[name = " + getName() + ", type = " + getType() +
", typeArgs = " + JavaUtils.printArray(getTypeArguments()) + ", variable =
" + getVariable() + ", index = " + getIndex() + "]";
- }
-}
\ No newline at end of file
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/acessor/JAXBAccessor.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/acessor/JAXBAccessor.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/acessor/JAXBAccessor.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -25,11 +25,11 @@
import javax.xml.namespace.QName;
import org.jboss.ws.WSException;
-import org.jboss.ws.metadata.ParameterMetaData;
-import org.jboss.ws.metadata.WrappedParameter;
-import org.jboss.ws.metadata.ParameterMetaData.AccessorFactoryCreator;
-import org.jboss.ws.metadata.WrappedParameter.Accessor;
-import org.jboss.ws.metadata.WrappedParameter.AccessorFactory;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.jboss.ws.metadata.umdm.WrappedParameter;
+import org.jboss.ws.metadata.umdm.ParameterMetaData.AccessorFactoryCreator;
+import org.jboss.ws.metadata.umdm.WrappedParameter.Accessor;
+import org.jboss.ws.metadata.umdm.WrappedParameter.AccessorFactory;
import com.sun.xml.bind.api.AccessorException;
import com.sun.xml.bind.api.JAXBRIContext;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/acessor/ReflectiveMethodAccessor.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/acessor/ReflectiveMethodAccessor.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/acessor/ReflectiveMethodAccessor.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -25,11 +25,11 @@
import java.lang.reflect.Method;
import org.jboss.ws.WSException;
-import org.jboss.ws.metadata.ParameterMetaData;
-import org.jboss.ws.metadata.WrappedParameter;
-import org.jboss.ws.metadata.ParameterMetaData.AccessorFactoryCreator;
-import org.jboss.ws.metadata.WrappedParameter.Accessor;
-import org.jboss.ws.metadata.WrappedParameter.AccessorFactory;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.jboss.ws.metadata.umdm.WrappedParameter;
+import org.jboss.ws.metadata.umdm.ParameterMetaData.AccessorFactoryCreator;
+import org.jboss.ws.metadata.umdm.WrappedParameter.Accessor;
+import org.jboss.ws.metadata.umdm.WrappedParameter.AccessorFactory;
/**
* A simple JavaBean accessor that uses ordinary reflection.
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -45,12 +45,9 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-import org.jboss.ws.common.CommonSOAPBinding;
+import org.jboss.ws.core.CommonSOAPBinding;
import org.jboss.ws.deployment.UnifiedDeploymentInfo;
import org.jboss.ws.jaxrpc.Use;
-import org.jboss.ws.metadata.ClientEndpointMetaData;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.ServerEndpointMetaData;
import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
import org.jboss.ws.metadata.j2ee.UnifiedEjbPortComponentMetaData;
@@ -58,6 +55,9 @@
import org.jboss.ws.metadata.j2ee.UnifiedWebMetaData;
import org.jboss.ws.metadata.j2ee.UnifiedWebSecurityMetaData;
import
org.jboss.ws.metadata.j2ee.UnifiedWebSecurityMetaData.UnifiedWebResourceCollection;
+import org.jboss.ws.metadata.umdm.ClientEndpointMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
import org.jboss.ws.metadata.wsdl.NCName;
import org.jboss.ws.metadata.wsdl.WSDLBinding;
import org.jboss.ws.metadata.wsdl.WSDLBindingOperation;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -34,18 +34,18 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-import org.jboss.ws.metadata.ClientEndpointMetaData;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.ServiceMetaData;
-import org.jboss.ws.metadata.UnifiedMetaData;
-import org.jboss.ws.metadata.EndpointMetaData.Type;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
import org.jboss.ws.metadata.config.jaxrpc.WSClientConfigJAXRPC;
import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
import org.jboss.ws.metadata.j2ee.UnifiedServiceRefMetaData;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
import org.jboss.ws.metadata.jaxrpcmapping.ServiceEndpointInterfaceMapping;
+import org.jboss.ws.metadata.umdm.ClientEndpointMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.metadata.wsdl.NCName;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -38,26 +38,18 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-import org.jboss.ws.addressing.AddressingPropertiesImpl;
-import org.jboss.ws.addressing.metadata.AddressingOpMetaExt;
-import org.jboss.ws.eventing.EventingConstants;
-import org.jboss.ws.eventing.deployment.EventingEndpoint;
-import org.jboss.ws.eventing.metadata.EventingEpMetaExt;
+import org.jboss.ws.extras.addressing.AddressingPropertiesImpl;
+import org.jboss.ws.extras.addressing.metadata.AddressingOpMetaExt;
+import org.jboss.ws.extras.eventing.EventingConstants;
+import org.jboss.ws.extras.eventing.deployment.EventingEndpoint;
+import org.jboss.ws.extras.eventing.metadata.EventingEpMetaExt;
+import org.jboss.ws.extras.xop.jaxrpc.XOPScanner;
import org.jboss.ws.jaxrpc.LiteralTypeMapping;
import org.jboss.ws.jaxrpc.Style;
import org.jboss.ws.jaxrpc.TypeMappingImpl;
import org.jboss.ws.jaxrpc.TypeMappingRegistryImpl;
import org.jboss.ws.jaxrpc.UnqualifiedFaultException;
import org.jboss.ws.jaxrpc.Use;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.FaultMetaData;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.ParameterMetaData;
-import org.jboss.ws.metadata.ServerEndpointMetaData;
-import org.jboss.ws.metadata.ServiceMetaData;
-import org.jboss.ws.metadata.TypeMappingMetaData;
-import org.jboss.ws.metadata.TypesMetaData;
-import org.jboss.ws.metadata.WrappedParameter;
import org.jboss.ws.metadata.builder.MetaDataBuilder;
import org.jboss.ws.metadata.jaxrpcmapping.ExceptionMapping;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
@@ -68,6 +60,15 @@
import org.jboss.ws.metadata.jaxrpcmapping.VariableMapping;
import org.jboss.ws.metadata.jaxrpcmapping.WsdlMessageMapping;
import org.jboss.ws.metadata.jaxrpcmapping.WsdlReturnValueMapping;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.FaultMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.umdm.TypeMappingMetaData;
+import org.jboss.ws.metadata.umdm.TypesMetaData;
+import org.jboss.ws.metadata.umdm.WrappedParameter;
import org.jboss.ws.metadata.wsdl.NCName;
import org.jboss.ws.metadata.wsdl.WSDLBinding;
import org.jboss.ws.metadata.wsdl.WSDLBindingOperation;
@@ -91,7 +92,6 @@
import org.jboss.ws.metadata.wsdl.WSDLRPCSignatureItem.Direction;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
import org.jboss.ws.utils.JavaUtils;
-import org.jboss.ws.xop.jaxrpc.XOPScanner;
/**
* A meta data builder that is based on webservices.xml.
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -33,12 +33,6 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
import org.jboss.ws.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.ServerEndpointMetaData;
-import org.jboss.ws.metadata.ServiceMetaData;
-import org.jboss.ws.metadata.UnifiedMetaData;
-import org.jboss.ws.metadata.EndpointMetaData.Type;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
import org.jboss.ws.metadata.config.jaxrpc.WSEndpointConfigJAXRPC;
import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
@@ -51,6 +45,12 @@
import org.jboss.ws.metadata.jaxrpcmapping.ServiceEndpointInterfaceMapping;
import org.jboss.ws.metadata.jsr109.PortComponentMetaData;
import org.jboss.ws.metadata.jsr109.WebserviceDescriptionMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
import org.jboss.ws.metadata.wsdl.WSDLService;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientEndpointMetaDataBuilder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientEndpointMetaDataBuilder.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientEndpointMetaDataBuilder.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -27,9 +27,9 @@
import javax.xml.ws.BindingType;
import org.jboss.logging.Logger;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
import org.jboss.ws.metadata.config.jaxws.WSClientConfigJAXWS;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
/**
* A client side meta data builder that is based on JSR-181 annotations
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -32,12 +32,12 @@
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.metadata.ClientEndpointMetaData;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.ServiceMetaData;
-import org.jboss.ws.metadata.UnifiedMetaData;
-import org.jboss.ws.metadata.EndpointMetaData.Type;
+import org.jboss.ws.metadata.umdm.ClientEndpointMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
import org.jboss.ws.metadata.wsdl.NCName;
import org.jboss.ws.metadata.wsdl.WSDLBinding;
import org.jboss.ws.metadata.wsdl.WSDLBindingOperation;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -27,9 +27,9 @@
import org.jboss.ws.annotation.PortComponent;
import org.jboss.ws.deployment.UnifiedDeploymentInfo;
import org.jboss.ws.deployment.UnifiedDeploymentInfo.DeploymentType;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.ServerEndpointMetaData;
-import org.jboss.ws.metadata.UnifiedMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
/**
* Builds ServiceEndpointMetaData for a JAX-WS endpoint.
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB21.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB21.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB21.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -30,10 +30,10 @@
import org.jboss.ws.WSException;
import org.jboss.ws.deployment.JAXWSDeployment;
import org.jboss.ws.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.metadata.ServerEndpointMetaData;
-import org.jboss.ws.metadata.UnifiedMetaData;
import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
/**
* A server side meta data builder that is based on JSR-181 annotations
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -31,9 +31,9 @@
import org.jboss.ws.WSException;
import org.jboss.ws.deployment.JAXWSDeployment;
import org.jboss.ws.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.metadata.UnifiedMetaData;
import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
/**
* A server side meta data builder that is based on JSR-181 annotations
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -27,8 +27,8 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
import org.jboss.ws.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.metadata.UnifiedMetaData;
import org.jboss.ws.metadata.j2ee.UnifiedWebMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
/**
* A server side meta data builder that is based on JSR-181 annotations
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -38,13 +38,13 @@
import org.jboss.ws.Constants;
import org.jboss.ws.deployment.UnifiedDeploymentInfo;
import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.ParameterMetaData;
-import org.jboss.ws.metadata.ServerEndpointMetaData;
-import org.jboss.ws.metadata.ServiceMetaData;
-import org.jboss.ws.metadata.UnifiedMetaData;
-import org.jboss.ws.metadata.EndpointMetaData.Type;
import org.jboss.ws.metadata.builder.MetaDataBuilder;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
import org.jboss.ws.metadata.wsdl.WSDLUtils;
import org.jboss.ws.utils.JavaUtils;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -29,7 +29,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.deployment.JAXWSDeployment;
import org.jboss.ws.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.metadata.UnifiedMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
/** An abstract annotation meta data builder.
*
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -61,24 +61,13 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-import org.jboss.ws.addressing.AddressingPropertiesImpl;
-import org.jboss.ws.addressing.metadata.AddressingOpMetaExt;
import org.jboss.ws.deployment.UnifiedDeploymentInfo;
+import org.jboss.ws.extras.addressing.AddressingPropertiesImpl;
+import org.jboss.ws.extras.addressing.metadata.AddressingOpMetaExt;
import org.jboss.ws.jaxrpc.Style;
import org.jboss.ws.jaxrpc.Use;
import org.jboss.ws.jaxws.DynamicWrapperGenerator;
import org.jboss.ws.jaxws.WrapperGenerator;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.FaultMetaData;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.ParameterMetaData;
-import org.jboss.ws.metadata.ServerEndpointMetaData;
-import org.jboss.ws.metadata.ServiceMetaData;
-import org.jboss.ws.metadata.TypeMappingMetaData;
-import org.jboss.ws.metadata.TypesMetaData;
-import org.jboss.ws.metadata.UnifiedMetaData;
-import org.jboss.ws.metadata.WrappedParameter;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
import org.jboss.ws.metadata.acessor.JAXBAccessor;
import org.jboss.ws.metadata.builder.MetaDataBuilder;
import org.jboss.ws.metadata.config.jaxws.WSEndpointConfigJAXWS;
@@ -86,6 +75,17 @@
import org.jboss.ws.metadata.jsr181.HandlerChainFactory;
import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
import org.jboss.ws.metadata.jsr181.HandlerChainsMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.FaultMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.umdm.TypeMappingMetaData;
+import org.jboss.ws.metadata.umdm.TypesMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+import org.jboss.ws.metadata.umdm.WrappedParameter;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLUtils;
import org.jboss.ws.metadata.wsdl.WSDLWriter;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/WSCommonConfig.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/WSCommonConfig.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/WSCommonConfig.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -25,9 +25,9 @@
import java.util.List;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.HandlerMetaData;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
/**
* A common configuration
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSCommonConfigJAXRPC.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSCommonConfigJAXRPC.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSCommonConfigJAXRPC.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -24,12 +24,12 @@
import java.util.ArrayList;
import java.util.List;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.HandlerMetaData;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
import org.jboss.ws.metadata.config.WSCommonConfig;
import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
// $Id$
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -26,10 +26,10 @@
import java.util.List;
import org.jboss.logging.Logger;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerInitParam;
import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerInitParam;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
import org.jboss.xb.binding.ObjectModelFactory;
import org.jboss.xb.binding.UnmarshallingContext;
import org.xml.sax.Attributes;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSEndpointConfigJAXRPC.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSEndpointConfigJAXRPC.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSEndpointConfigJAXRPC.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -24,11 +24,11 @@
import java.util.ArrayList;
import java.util.List;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.HandlerMetaData;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
// $Id$
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSCommonConfigJAXWS.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSCommonConfigJAXWS.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSCommonConfigJAXWS.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -24,12 +24,12 @@
import java.util.ArrayList;
import java.util.List;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.HandlerMetaData;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
import org.jboss.ws.metadata.config.WSCommonConfig;
import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
// $Id$
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSEndpointConfigJAXWS.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSEndpointConfigJAXWS.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSEndpointConfigJAXWS.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -24,11 +24,11 @@
import java.util.ArrayList;
import java.util.List;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.HandlerMetaData;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
// $Id$
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSHandlerChainsConfigJAXWS.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSHandlerChainsConfigJAXWS.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSHandlerChainsConfigJAXWS.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -24,8 +24,8 @@
import java.util.ArrayList;
import java.util.List;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
/**
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedHandlerMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedHandlerMetaData.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedHandlerMetaData.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -31,12 +31,12 @@
import javax.xml.namespace.QName;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.HandlerMetaDataJAXRPC;
-import org.jboss.ws.metadata.HandlerMetaDataJAXWS;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerInitParam;
import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaDataJAXRPC;
+import org.jboss.ws.metadata.umdm.HandlerMetaDataJAXWS;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerInitParam;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
/**
* The container independent metdata data for a handler element
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr109/WebservicesFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr109/WebservicesFactory.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr109/WebservicesFactory.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -26,9 +26,9 @@
import java.net.URL;
import org.jboss.logging.Logger;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerInitParam;
import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerInitParam;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
import org.jboss.xb.binding.ObjectModelFactory;
import org.jboss.xb.binding.UnmarshallingContext;
import org.xml.sax.Attributes;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr181/HandlerChainFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr181/HandlerChainFactory.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr181/HandlerChainFactory.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -24,9 +24,9 @@
// $Id$
import org.jboss.logging.Logger;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerInitParam;
import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerInitParam;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
import org.jboss.xb.binding.ObjectModelFactory;
import org.jboss.xb.binding.UnmarshallingContext;
import org.xml.sax.Attributes;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr181/HandlerChainMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr181/HandlerChainMetaData.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr181/HandlerChainMetaData.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -29,8 +29,8 @@
import javax.xml.namespace.QName;
import org.jboss.logging.Logger;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
/**
* XML Binding element for handler-config/handler-chain elements
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr181/HandlerChainsMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr181/HandlerChainsMetaData.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr181/HandlerChainsMetaData.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -26,7 +26,7 @@
import java.util.ArrayList;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
/**
* XML Binding root element for JSR-181 HandlerChain
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ClientEndpointMetaData.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ClientEndpointMetaData.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,177 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.metadata.umdm;
+
+// $Id$
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.metadata.config.WSConfigFactory;
+import org.jboss.ws.metadata.config.jaxrpc.WSClientConfigJAXRPC;
+import org.jboss.ws.metadata.config.jaxrpc.WSConfigRootJAXRPC;
+import org.jboss.ws.metadata.config.jaxws.WSClientConfigJAXWS;
+import org.jboss.ws.metadata.config.jaxws.WSConfigRootJAXWS;
+import org.jboss.ws.metadata.config.jaxws.WSHandlerChainsConfigJAXWS;
+import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
+
+/**
+ * Client side endpoint meta data.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-May-2005
+ */
+public class ClientEndpointMetaData extends EndpointMetaData
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(ClientEndpointMetaData.class);
+
+ public ClientEndpointMetaData(ServiceMetaData service, QName qname, QName
interfaceQName, Type type)
+ {
+ super(service, qname, interfaceQName, type);
+ }
+
+ public void setConfigName(String configName)
+ {
+ super.setConfigName(configName);
+ endpointConfig = null;
+ }
+
+ public void setConfigFile(String configFile)
+ {
+ super.setConfigFile(configFile);
+ endpointConfig = null;
+ }
+
+ @Override
+ public Object getEndpointConfig()
+ {
+ if (endpointConfig == null)
+ {
+ String configName = getConfigName();
+ if (configName == null)
+ {
+ configName = "Standard Client";
+ setConfigName(configName);
+ }
+
+ String configFile = getConfigFile();
+ if (configFile == null)
+ {
+ if (getType() == Type.JAXRPC)
+ {
+ configFile = "META-INF/standard-jaxrpc-client-config.xml";
+ }
+ else
+ {
+ configFile = "META-INF/standard-jaxws-client-config.xml";
+ }
+ setConfigFile(configFile);
+ }
+
+ log.debug("getClientConfig: [name=" + configName + ",url=" +
configFile + "]");
+
+ URL configURL = null;
+ try
+ {
+ configURL = new URL(configFile);
+ }
+ catch (MalformedURLException ex)
+ {
+ // ignore
+ }
+
+ // Try to get the URL as resource
+ if (configURL == null)
+ {
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ configURL = cl.getResource(configFile);
+ if (configURL == null)
+ throw new WSException("Cannot get resource: " + configFile);
+ }
+
+ // Get the config root
+ Object wsConfig;
+ try
+ {
+ WSConfigFactory factory = WSConfigFactory.newInstance();
+ wsConfig = factory.parseWithObjectModelFactory(configURL);
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new WSException("Cannot parse client config", ex);
+ }
+
+ // Get the client config
+ if (wsConfig instanceof WSConfigRootJAXRPC)
+ {
+ endpointConfig =
((WSConfigRootJAXRPC)wsConfig).getClientConfigByName(configName);
+ if (endpointConfig == null)
+ throw new WSException("Cannot obtain client config: " +
configName);
+ }
+ else
+ {
+ endpointConfig =
((WSConfigRootJAXWS)wsConfig).getClientConfigByName(configName);
+ if (endpointConfig == null)
+ throw new WSException("Cannot obtain client config: " +
configName);
+ }
+ }
+
+ return endpointConfig;
+ }
+
+ public String toString()
+ {
+ StringBuilder buffer = new StringBuilder("\nClientEndpointMetaData:");
+ buffer.append("\n type=" + getType());
+ buffer.append("\n qname=" + getQName());
+ buffer.append("\n address=" + getEndpointAddress());
+ buffer.append("\n binding=" + getBindingId());
+ buffer.append("\n seiName=" + getServiceEndpointInterfaceName());
+ buffer.append("\n configFile=" + getConfigFile());
+ buffer.append("\n configName=" + getConfigName());
+ buffer.append("\n authMethod=" + getAuthMethod());
+ buffer.append("\n properties=" + getProperties());
+
+ for (OperationMetaData opMetaData : getOperations())
+ {
+ buffer.append("\n" + opMetaData);
+ }
+ for (HandlerMetaData hdlMetaData : getHandlerMetaData(HandlerType.ALL))
+ {
+ buffer.append("\n" + hdlMetaData);
+ }
+ return buffer.toString();
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/EndpointMetaData.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/EndpointMetaData.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,580 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.metadata.umdm;
+
+// $Id$
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.jws.soap.SOAPBinding.ParameterStyle;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.ParameterMode;
+import javax.xml.ws.Service.Mode;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.Constants;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.CommonSOAPBinding;
+import org.jboss.ws.jaxrpc.Style;
+import org.jboss.ws.jaxrpc.TypeMappingImpl;
+import org.jboss.ws.jaxrpc.Use;
+import org.jboss.ws.jaxrpc.encoding.SOAPArrayDeserializerFactory;
+import org.jboss.ws.jaxrpc.encoding.SOAPArraySerializerFactory;
+import org.jboss.ws.jaxws.JAXBDeserializerFactory;
+import org.jboss.ws.jaxws.JAXBSerializerFactory;
+import org.jboss.ws.jbossxb.JBossXBDeserializerFactory;
+import org.jboss.ws.jbossxb.JBossXBSerializerFactory;
+import org.jboss.ws.metadata.config.WSCommonConfig;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
+import org.jboss.ws.utils.JavaUtils;
+
+/**
+ * A Service component describes a set of endpoints.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-May-2005
+ */
+public abstract class EndpointMetaData extends ExtensibleMetaData
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(EndpointMetaData.class);
+
+ public enum Type
+ {
+ JAXRPC, JAXWS
+ }
+
+ // The parent meta data.
+ private ServiceMetaData serviceMetaData;
+
+ // The REQUIRED endpoint config
+ protected WSCommonConfig endpointConfig;
+
+ // The REQUIRED name
+ private QName portName;
+ // The REQUIRED binding id
+ private String bindingId;
+ // The REQUIRED name of the WSDL interface/portType
+ private QName interfaceQName;
+ // The REQUIRED config-name
+ private String configName;
+ // The REQUIRED config-file
+ private String configFile;
+ // The endpoint address
+ private String endpointAddress;
+ // The endpoint interface name
+ private String seiName;
+ // The endpoint interface
+ private Class seiClass;
+ // The optional authentication method
+ private String authMethod;
+ // Arbitrary properties given by <call-property>
+ private Properties properties;
+ // The SOAPBinding style
+ private Style style;
+ // The SOAPBinding use
+ private Use use;
+ // The SOAPBinding parameter style
+ private ParameterStyle parameterStyle;
+ // The JAXWS ServiceMode
+ private Mode serviceMode;
+ // Whether the endpoint was deployed from annotations
+ private Type type;
+ // The list of service meta data
+ private List<OperationMetaData> operations = new
ArrayList<OperationMetaData>();
+ // The optional handlers
+ private List<HandlerMetaData> handlers = new
ArrayList<HandlerMetaData>();
+ // True if the handlers are initialized
+ private boolean handlersInitialized;
+ // Maps the java method to the operation meta data
+ private Map<Method, OperationMetaData> opMetaDataCache = new HashMap<Method,
OperationMetaData>();
+
+ public EndpointMetaData(ServiceMetaData service, QName qname, QName interfaceQName,
Type type)
+ {
+ this.serviceMetaData = service;
+ this.portName = qname;
+ this.interfaceQName = interfaceQName;
+ this.type = type;
+
+ // The default binding
+ this.bindingId = CommonSOAPBinding.SOAP11HTTP_BINDING;
+ }
+
+ public ServiceMetaData getServiceMetaData()
+ {
+ return serviceMetaData;
+ }
+
+ public QName getQName()
+ {
+ return portName;
+ }
+
+ public QName getInterfaceQName()
+ {
+ return interfaceQName;
+ }
+
+ public String getConfigFile()
+ {
+ return configFile;
+ }
+
+ public void setConfigFile(String configFile)
+ {
+ this.configFile = configFile;
+ this.endpointConfig = null;
+ }
+
+ public String getConfigName()
+ {
+ return configName;
+ }
+
+ public void setConfigName(String configName)
+ {
+ this.configName = configName;
+ this.endpointConfig = null;
+ }
+
+ public abstract Object getEndpointConfig();
+
+ public String getEndpointAddress()
+ {
+ return endpointAddress;
+ }
+
+ public void setEndpointAddress(String endpointAddress)
+ {
+ this.endpointAddress = endpointAddress;
+ }
+
+ public String getBindingId()
+ {
+ return bindingId;
+ }
+
+ public void setBindingId(String bindingId)
+ {
+ if (!CommonSOAPBinding.SOAP11HTTP_BINDING.equals(bindingId) &&
!CommonSOAPBinding.SOAP12HTTP_BINDING.equals(bindingId))
+ throw new WSException("Unsupported binding: " + bindingId);
+ this.bindingId = bindingId;
+ }
+
+ public String getServiceEndpointInterfaceName()
+ {
+ return seiName;
+ }
+
+ public void setServiceEndpointInterfaceName(String seiName)
+ {
+ this.seiName = seiName;
+ this.seiClass = null;
+
+ UnifiedMetaData wsMetaData = serviceMetaData.getUnifiedMetaData();
+ if (wsMetaData.isEagerInitialized())
+ {
+ if (UnifiedMetaData.isFinalRelease() == false)
+ log.warn("Set SEI name after eager initialization", new
IllegalStateException());
+
+ // reinitialize
+ initializeInternal();
+ }
+ }
+
+ /** Get the class loader associated with the endpoint meta data */
+ public ClassLoader getClassLoader()
+ {
+ ClassLoader classLoader =
getServiceMetaData().getUnifiedMetaData().getClassLoader();
+ return classLoader;
+ }
+
+ /**
+ * Load the service endpoint interface.
+ * It should only be cached during eager initialization.
+ */
+ public Class getServiceEndpointInterface()
+ {
+ Class tmpClass = seiClass;
+ if (tmpClass == null && seiName != null)
+ {
+ try
+ {
+ ClassLoader classLoader = getClassLoader();
+ tmpClass = classLoader.loadClass(seiName);
+ if (serviceMetaData.getUnifiedMetaData().isEagerInitialized())
+ {
+ log.warn("Loading SEI after eager initialization");
+ seiClass = tmpClass;
+ }
+ }
+ catch (ClassNotFoundException ex)
+ {
+ throw new WSException("Cannot load service endpoint interface: " +
seiName, ex);
+ }
+ }
+ return tmpClass;
+ }
+
+ public Use getEncodingStyle()
+ {
+ if (use == null)
+ {
+ use = Use.getDefaultUse();
+ log.debug("Using default encoding style: " + use);
+ }
+ return use;
+ }
+
+ public void setEncodingStyle(Use value)
+ {
+ if (value != null && use != null && !use.equals(value))
+ throw new WSException("Mixed encoding styles not supported");
+
+ log.trace("setEncodingStyle: " + value);
+ this.use = value;
+ }
+
+ public Style getStyle()
+ {
+ if (style == null)
+ {
+ style = Style.getDefaultStyle();
+ log.debug("Using default style: " + style);
+ }
+ return style;
+ }
+
+ public void setStyle(Style value)
+ {
+ if (value != null && style != null && !style.equals(value))
+ throw new WSException("Mixed styles not supported");
+
+ log.trace("setStyle: " + value);
+ this.style = value;
+ }
+
+ public ParameterStyle getParameterStyle()
+ {
+ if (parameterStyle == null)
+ {
+ parameterStyle = ParameterStyle.WRAPPED;
+ log.debug("Using default parameter style: " + parameterStyle);
+ }
+ return parameterStyle;
+ }
+
+ public void setParameterStyle(ParameterStyle value)
+ {
+ if (value != null && parameterStyle != null &&
!parameterStyle.equals(value))
+ throw new WSException("Mixed SOAP parameter styles not supported");
+
+ log.debug("setParameterStyle: " + value);
+ this.parameterStyle = value;
+ }
+
+ public Mode getServiceMode()
+ {
+ return serviceMode;
+ }
+
+ public void setServiceMode(Mode serviceMode)
+ {
+ this.serviceMode = serviceMode;
+ }
+
+ public Type getType()
+ {
+ return type;
+ }
+
+ public String getAuthMethod()
+ {
+ return authMethod;
+ }
+
+ public void setAuthMethod(String authMethod)
+ {
+ this.authMethod = authMethod;
+ }
+
+ public Properties getProperties()
+ {
+ return properties;
+ }
+
+ public void setProperties(Properties properties)
+ {
+ this.properties = properties;
+ }
+
+ public List<OperationMetaData> getOperations()
+ {
+ return new ArrayList<OperationMetaData>(operations);
+ }
+
+ public OperationMetaData getOperation(QName xmlName)
+ {
+ OperationMetaData opMetaData = null;
+ for (OperationMetaData aux : operations)
+ {
+ QName opQName = aux.getQName();
+ String javaName = aux.getJavaName();
+ if (opQName.equals(xmlName) &&
!javaName.endsWith(Constants.ASYNC_METHOD_SUFFIX))
+ {
+ if (opMetaData == null)
+ {
+ opMetaData = aux;
+ }
+ else
+ {
+ throw new WSException("Cannot uniquely indentify operation: " +
xmlName);
+ }
+ }
+ }
+
+ if (opMetaData == null && getStyle() == Style.DOCUMENT)
+ {
+ for (OperationMetaData auxOperation : operations)
+ {
+ ParameterMetaData paramMetaData = null;
+ for (ParameterMetaData auxParam : auxOperation.getParameters())
+ {
+ ParameterMode mode = auxParam.getMode();
+ if (auxParam.isInHeader() == false && mode == ParameterMode.IN)
+ {
+ paramMetaData = auxParam;
+ break;
+ }
+ }
+ if (paramMetaData != null &&
paramMetaData.getXmlName().equals(xmlName))
+ {
+ if (opMetaData == null)
+ {
+ opMetaData = auxOperation;
+ }
+ else
+ {
+ throw new WSException("Cannot uniquely indentify operation: "
+ xmlName);
+ }
+ }
+ }
+ }
+
+ return opMetaData;
+ }
+
+ public OperationMetaData getOperation(Method method)
+ {
+ if (opMetaDataCache.size() == 0)
+ {
+ // This can happen when the SEI mapping was not found
+ log.warn("Access to empty operation meta data cache,
reinitializing");
+ initializeInternal();
+ }
+
+ OperationMetaData opMetaData = opMetaDataCache.get(method);
+ if (opMetaData == null)
+ {
+ for (OperationMetaData aux : operations)
+ {
+ boolean doesMatch = aux.getJavaMethod().equals(method);
+
+ // fallback for async methods
+ if(!doesMatch &&
method.getName().endsWith(Constants.ASYNC_METHOD_SUFFIX))
+ {
+ String name = method.getName();
+ name = name.substring(0, name.length()-5);
+ doesMatch = aux.getJavaName().equals(name);
+ }
+
+ if (doesMatch)
+ {
+ opMetaDataCache.put(method, aux);
+ opMetaData = aux;
+ break;
+ }
+
+ }
+ }
+ return opMetaData;
+ }
+
+ public void addOperation(OperationMetaData opMetaData)
+ {
+ operations.add(opMetaData);
+ }
+
+ public void clearOperations()
+ {
+ operations.clear();
+ }
+
+ public void addHandlers(List<HandlerMetaData> configHandlers)
+ {
+ handlers.addAll(configHandlers);
+ }
+
+ public void addHandler(HandlerMetaData handler)
+ {
+ handlers.add(handler);
+ }
+
+ public void clearHandlers()
+ {
+ handlers.clear();
+ handlersInitialized = false;
+ }
+
+ public List<HandlerMetaData> getHandlerMetaData(HandlerType type)
+ {
+ List<HandlerMetaData> typeHandlers = new ArrayList<HandlerMetaData>();
+ for (HandlerMetaData hmd : handlers)
+ {
+ if (hmd.getHandlerType() == type || type == HandlerType.ALL)
+ typeHandlers.add(hmd);
+ }
+ return typeHandlers;
+ }
+
+ public boolean isHandlersInitialized()
+ {
+ return handlersInitialized;
+ }
+
+ public void setHandlersInitialized(boolean flag)
+ {
+ this.handlersInitialized = flag;
+ }
+
+ public void validate()
+ {
+ for (HandlerMetaData handler : handlers)
+ handler.validate();
+
+ for (OperationMetaData opMetaData : operations)
+ opMetaData.validate();
+ }
+
+ /**
+ * @see UnifiedMetaData#eagerInitialize()
+ */
+ public void eagerInitialize()
+ {
+ initializeInternal();
+ }
+
+ private void initializeInternal()
+ {
+ // reset sei class
+ seiClass = null;
+
+ // Initialize handlers
+ for (HandlerMetaData handler : handlers)
+ handler.eagerInitialize();
+
+ eagerInitializeOperations();
+ eagerInitializeTypes();
+ }
+
+ private void eagerInitializeOperations()
+ {
+ seiClass = getServiceEndpointInterface();
+ if (seiClass != null)
+ {
+ List<Method> unsynchronizedMethods = new ArrayList<Method>();
+ unsynchronizedMethods.addAll(Arrays.asList(seiClass.getMethods()));
+
+ for (OperationMetaData opMetaData : operations)
+ {
+ opMetaData.eagerInitialize(unsynchronizedMethods);
+ Method method = opMetaData.getJavaMethod();
+ if (method != null)
+ {
+ opMetaDataCache.put(method, opMetaData);
+ unsynchronizedMethods.remove(method);
+ }
+ }
+ }
+ }
+
+ private void eagerInitializeTypes()
+ {
+ TypeMappingImpl typeMapping = serviceMetaData.getTypeMapping();
+ for (TypeMappingMetaData tmMetaData :
serviceMetaData.getTypesMetaData().getTypeMappings())
+ {
+ String javaTypeName = tmMetaData.getJavaTypeName();
+ QName xmlType = tmMetaData.getXmlType();
+ if (xmlType != null)
+ {
+ List<Class> registeredTypes = typeMapping.getJavaTypes(xmlType);
+
+ boolean registered = false;
+ for (Class current : registeredTypes) {
+ if (current.getName().equals(javaTypeName))
+ {
+ registered = true;
+ break;
+ }
+ }
+
+ if (registered == false)
+ {
+ try
+ {
+ ClassLoader classLoader = getClassLoader();
+ Class javaType = JavaUtils.loadJavaType(javaTypeName, classLoader);
+
+ if (JavaUtils.isPrimitive(javaTypeName))
+ javaType = JavaUtils.getWrapperType(javaType);
+
+ if (getEncodingStyle() == Use.ENCODED && javaType.isArray())
+ {
+ typeMapping.register(javaType, xmlType, new
SOAPArraySerializerFactory(), new SOAPArrayDeserializerFactory());
+ }
+ else
+ {
+ if (getType() == Type.JAXWS)
+ {
+ typeMapping.register(javaType, xmlType, new
JAXBSerializerFactory(), new JAXBDeserializerFactory());
+ }
+ else
+ {
+ typeMapping.register(javaType, xmlType, new
JBossXBSerializerFactory(), new JBossXBDeserializerFactory());
+ }
+ }
+ }
+ catch (ClassNotFoundException e)
+ {
+ log.warn("Cannot load class for type: " + xmlType +
"," + javaTypeName);
+ }
+ }
+ }
+ }
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/ExtensibleMetaData.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ExtensibleMetaData.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ExtensibleMetaData.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/ExtensibleMetaData.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,29 @@
+package org.jboss.ws.metadata.umdm;
+
+import java.util.Map;
+import java.util.HashMap;
+
+
+/**
+ * Base class for UMD elements that are extensible.
+ *
+ * @author Heiko Braun, <heiko(a)openj.net>
+ * @since 21-Mar-2006
+ */
+public abstract class ExtensibleMetaData {
+
+ private Map<String, MetaDataExtension> extensions = new HashMap<String,
MetaDataExtension>();
+
+ public Map<String, MetaDataExtension> getExtensions() {
+ return extensions;
+ }
+
+ public void addExtension(MetaDataExtension ext) {
+ getExtensions().put(ext.getExtensionNameSpace(), ext);
+ }
+
+ public MetaDataExtension getExtension(String namespace) {
+ return getExtensions().get(namespace);
+ }
+
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/FaultMetaData.java (from
rev 1557, branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/FaultMetaData.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/FaultMetaData.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/FaultMetaData.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,183 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.metadata.umdm;
+
+// $Id$
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.jaxws.DynamicWrapperGenerator;
+import org.jboss.ws.utils.JavaUtils;
+
+/**
+ * A Fault component describes a fault that a given operation supports.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author jason.greene(a)jboss.com
+ * @since 12-May-2005
+ */
+public class FaultMetaData
+{
+ // provide logging
+ private final Logger log = Logger.getLogger(FaultMetaData.class);
+
+ // The parent operation
+ private OperationMetaData opMetaData;
+
+ private QName xmlName;
+ private QName xmlType;
+ private String javaTypeName;
+ private String faultBeanName;
+ private Class javaType;
+ private Class faultBean;
+
+ public FaultMetaData(OperationMetaData operation, QName xmlName, QName xmlType, String
javaTypeName)
+ {
+ this(operation, xmlName, javaTypeName);
+ setXmlType(xmlType);
+ }
+
+ public FaultMetaData(OperationMetaData operation, QName xmlName, String javaTypeName)
+ {
+ if (xmlName == null)
+ throw new IllegalArgumentException("Invalid null xmlName argument");
+ if (javaTypeName == null)
+ throw new IllegalArgumentException("Invalid null javaTypeName argument,
for: " + xmlName);
+
+ this.opMetaData = operation;
+ this.xmlName = xmlName;
+ this.javaTypeName = javaTypeName;
+ }
+
+ public OperationMetaData getOperationMetaData()
+ {
+ return opMetaData;
+ }
+
+ public QName getXmlName()
+ {
+ return xmlName;
+ }
+
+ public QName getXmlType()
+ {
+ return xmlType;
+ }
+
+ public void setXmlType(QName xmlType)
+ {
+ if (xmlType == null)
+ throw new IllegalArgumentException("Invalid null xmlType argument, for:
" + xmlName);
+
+ this.xmlType = xmlType;
+ }
+
+ public String getJavaTypeName()
+ {
+ return javaTypeName;
+ }
+
+ /** Load the java type.
+ * It should only be cached during eager initialization.
+ */
+ public Class getJavaType()
+ {
+ Class tmpJavaType = javaType;
+ if (tmpJavaType == null && javaTypeName != null)
+ {
+ try
+ {
+ ClassLoader loader = opMetaData.getEndpointMetaData().getClassLoader();
+ tmpJavaType = JavaUtils.loadJavaType(javaTypeName, loader);
+
+ if
(opMetaData.getEndpointMetaData().getServiceMetaData().getUnifiedMetaData().isEagerInitialized())
+ {
+ log.warn("Loading java type after eager initialization");
+ javaType = tmpJavaType;
+ }
+ }
+ catch (ClassNotFoundException ex)
+ {
+ throw new WSException("Cannot load java type: " + javaTypeName,
ex);
+ }
+ }
+ return tmpJavaType;
+ }
+
+ public String getFaultBeanName()
+ {
+ return faultBeanName;
+ }
+
+ public void setFaultBeanName(String faultBeanName)
+ {
+ this.faultBeanName = faultBeanName;
+ }
+
+ public Class getFaultBean()
+ {
+ Class tmpFaultBean = faultBean;
+ if (tmpFaultBean == null && faultBeanName != null)
+ {
+ try
+ {
+ ClassLoader loader = opMetaData.getEndpointMetaData().getClassLoader();
+ tmpFaultBean = JavaUtils.loadJavaType(faultBeanName, loader);
+ }
+ catch (ClassNotFoundException ex)
+ {
+ throw new WSException("Cannot load fault bean: " + faultBeanName,
ex);
+ }
+ }
+ return tmpFaultBean;
+ }
+
+ public void validate()
+ {
+ // nothing to do
+ }
+
+ public void eagerInitialize()
+ {
+ ClassLoader loader = opMetaData.getEndpointMetaData().getClassLoader();
+ new DynamicWrapperGenerator(loader).generate(this);
+
+ // Initialize the cache
+ javaType = getJavaType();
+ if (javaType == null)
+ throw new WSException("Cannot load java type: " + javaTypeName);
+
+ faultBean = getFaultBean();
+ }
+
+ public String toString()
+ {
+ StringBuilder buffer = new StringBuilder("\nFaultMetaData");
+ buffer.append("\n xmlName=" + xmlName);
+ buffer.append("\n xmlType=" + xmlType);
+ buffer.append("\n javaType=" + javaTypeName);
+ buffer.append("\n faultBean=" + faultBeanName);
+ return buffer.toString();
+ }
+}
\ No newline at end of file
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaData.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/HandlerMetaData.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/HandlerMetaData.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaData.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,204 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.metadata.umdm;
+
+// $Id:HandlerMetaData.java 915 2006-09-08 08:40:45Z thomas.diesler(a)jboss.com $
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+
+/**
+ * The common metdata data for a handler element
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public abstract class HandlerMetaData implements Serializable
+{
+ // provide logging
+ private final Logger log = Logger.getLogger(HandlerMetaData.class);
+
+ public enum HandlerType
+ {
+ PRE, ENDPOINT, POST, ALL
+ };
+
+ private transient EndpointMetaData epMetaData;
+
+ // The required <handler-name> element
+ private String handlerName;
+ // The required <handler-class> element
+ private String handlerClassName;
+ // The required handler type
+ private HandlerType handlerType;
+ // The optional <soap-header> elements
+ private Set<QName> soapHeaders = new HashSet<QName>();
+ // The optional <init-param> elements
+ private List<HandlerInitParam> initParams = new
ArrayList<HandlerInitParam>();
+ // The cached handler class
+ private Class handlerClass;
+
+ public HandlerMetaData(EndpointMetaData epMetaData, HandlerType type)
+ {
+ this.epMetaData = epMetaData;
+ this.handlerType = type;
+ }
+
+ public void setEndpointMetaData(EndpointMetaData epMetaData)
+ {
+ this.epMetaData = epMetaData;
+ }
+
+ public EndpointMetaData getEndpointMetaData()
+ {
+ return epMetaData;
+ }
+
+ public void setHandlerName(String value)
+ {
+ this.handlerName = value;
+ }
+
+ public String getHandlerName()
+ {
+ return handlerName;
+ }
+
+ public void setHandlerClassName(String handlerClass)
+ {
+ this.handlerClassName = handlerClass;
+ }
+
+ public String getHandlerClassName()
+ {
+ return handlerClassName;
+ }
+
+ public Class getHandlerClass()
+ {
+ if (handlerClassName == null)
+ throw new IllegalStateException("Handler class name cannot be null");
+
+ Class localClass = handlerClass;
+ if (localClass == null)
+ {
+ try
+ {
+ ClassLoader loader = epMetaData.getClassLoader();
+ localClass = loader.loadClass(handlerClassName);
+ }
+ catch (ClassNotFoundException ex)
+ {
+ throw new WSException("Cannot load handler: " + handlerClassName,
ex);
+ }
+ }
+ return localClass;
+ }
+
+ public HandlerType getHandlerType()
+ {
+ return handlerType;
+ }
+
+ public void setSoapHeaders(Set<QName> soapHeaders)
+ {
+ this.soapHeaders = soapHeaders;
+ }
+
+ public Set<QName> getSoapHeaders()
+ {
+ return soapHeaders;
+ }
+
+ public void seiInitParams(List<HandlerInitParam> initParams)
+ {
+ this.initParams = initParams;
+ }
+
+ public List<HandlerInitParam> getInitParams()
+ {
+ return initParams;
+ }
+
+ public void validate()
+ {
+ List<String> securityHandlers = new ArrayList<String>();
+
securityHandlers.add(org.jboss.ws.extras.security.jaxrpc.WSSecurityHandlerInbound.class.getName());
+
securityHandlers.add(org.jboss.ws.extras.security.jaxrpc.WSSecurityHandlerOutbound.class.getName());
+
securityHandlers.add(org.jboss.ws.extras.security.jaxws.WSSecurityHandlerInbound.class.getName());
+
securityHandlers.add(org.jboss.ws.extras.security.jaxws.WSSecurityHandlerOutbound.class.getName());
+
+ if (securityHandlers.contains(handlerClassName))
+ {
+ if (epMetaData.getServiceMetaData().getSecurityConfiguration() == null)
+ log.warn("WS-Security requires security configuration");
+ }
+ }
+
+ public void eagerInitialize()
+ {
+ handlerClass = getHandlerClass();
+ }
+
+ public static class HandlerInitParam implements Serializable
+ {
+ private static final long serialVersionUID = -8687875291620457318L;
+
+ // The required <handler-name> element
+ private String paramName;
+ // The required <handler-class> element
+ private String paramValue;
+
+ public String getParamName()
+ {
+ return paramName;
+ }
+
+ public void setParamName(String paramName)
+ {
+ this.paramName = paramName;
+ }
+
+ public String getParamValue()
+ {
+ return paramValue;
+ }
+
+ public void setParamValue(String paramValue)
+ {
+ this.paramValue = paramValue;
+ }
+
+ public String toString()
+ {
+ return "[name=" + paramName + ",value=" + paramValue +
"]";
+ }
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXRPC.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/HandlerMetaDataJAXRPC.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/HandlerMetaDataJAXRPC.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXRPC.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.metadata.umdm;
+
+//$Id:HandlerMetaDataJAXRPC.java 915 2006-09-08 08:40:45Z thomas.diesler(a)jboss.com $
+
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+
+
+/**
+ * The JAXRPC metdata data for a handler element
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class HandlerMetaDataJAXRPC extends HandlerMetaData
+{
+ private static final long serialVersionUID = -5232305815202943509L;
+
+ // The optional <soap-role> elements
+ private Set<String> soapRoles = new HashSet<String>();
+ // The optional <port-name> elements
+ private Set<String> portNames = new HashSet<String>();
+
+ public HandlerMetaDataJAXRPC(EndpointMetaData epMetaData, HandlerType type)
+ {
+ super(epMetaData, type);
+ }
+
+ public void setSoapRoles(Set<String> soapRoles)
+ {
+ this.soapRoles = soapRoles;
+ }
+
+ public Set<String> getSoapRoles()
+ {
+ return soapRoles;
+ }
+
+ public void setPortNames(Set<String> portNames)
+ {
+ this.portNames = portNames;
+ }
+
+ public Set<String> getPortNames()
+ {
+ return portNames;
+ }
+
+ public String toString()
+ {
+ StringBuffer buffer = new StringBuffer("\nHandlerMetaDataJAXRPC:");
+ buffer.append("\n type=" + getHandlerType());
+ buffer.append("\n name=" + getHandlerName());
+ buffer.append("\n class=" + getHandlerClassName());
+ buffer.append("\n params=" + getInitParams());
+ buffer.append("\n headers=" + getSoapHeaders());
+ buffer.append("\n roles=" + getSoapRoles());
+ buffer.append("\n ports=" + getPortNames());
+ return buffer.toString();
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXWS.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/HandlerMetaDataJAXWS.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/HandlerMetaDataJAXWS.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXWS.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,94 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.metadata.umdm;
+
+//$Id$
+
+import javax.xml.namespace.QName;
+
+
+/**
+ * The JAXWS metdata data for a handler element
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class HandlerMetaDataJAXWS extends HandlerMetaData
+{
+ private static final long serialVersionUID = 7631133188974299826L;
+
+ // The JAXWS protocol bindings
+ private String protocolBindings;
+ // The JAXWS service name pattern
+ private QName serviceNamePattern;
+ // The JAXWS port name pattern
+ private QName portNamePattern;
+
+ public HandlerMetaDataJAXWS(EndpointMetaData epMetaData, HandlerType type)
+ {
+ super(epMetaData, type);
+ }
+
+ public QName getPortNamePattern()
+ {
+ return portNamePattern;
+ }
+
+ public void setPortNamePattern(QName portNamePattern)
+ {
+ this.portNamePattern = portNamePattern;
+ }
+
+ public String getProtocolBindings()
+ {
+ return protocolBindings;
+ }
+
+ public void setProtocolBindings(String protocolBindings)
+ {
+ this.protocolBindings = protocolBindings;
+ }
+
+ public QName getServiceNamePattern()
+ {
+ return serviceNamePattern;
+ }
+
+ public void setServiceNamePattern(QName serviceNamePattern)
+ {
+ this.serviceNamePattern = serviceNamePattern;
+ }
+
+ public String toString()
+ {
+ StringBuffer buffer = new StringBuffer("\nHandlerMetaDataJAXWS:");
+ buffer.append("\n type=" + getHandlerType());
+ buffer.append("\n name=" + getHandlerName());
+ buffer.append("\n class=" + getHandlerClass());
+ buffer.append("\n params=" + getInitParams());
+ buffer.append("\n protocols=" + getProtocolBindings());
+ buffer.append("\n services=" + getServiceNamePattern());
+ buffer.append("\n ports=" + getPortNamePattern());
+ return buffer.toString();
+ }
+
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/MetaDataExtension.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/MetaDataExtension.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/MetaDataExtension.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/MetaDataExtension.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.metadata.umdm;
+
+// $Id$
+
+/**
+ * Operation metaData extension.
+ *
+ * @author Heiko Braun, <heiko(a)openj.net>
+ * @since 17-Mar-2006
+ */
+public abstract class MetaDataExtension
+{
+ private String extensionNameSpace;
+
+ public MetaDataExtension(String extensionNameSpace)
+ {
+ this.extensionNameSpace = extensionNameSpace;
+ }
+
+ public String getExtensionNameSpace()
+ {
+ return extensionNameSpace;
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/OperationMetaData.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/OperationMetaData.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/OperationMetaData.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/OperationMetaData.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,521 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.metadata.umdm;
+
+// $Id$
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.jws.soap.SOAPBinding.ParameterStyle;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.ParameterMode;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.jaxrpc.Style;
+import org.jboss.ws.jaxrpc.Use;
+import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
+import org.jboss.ws.utils.JavaUtils;
+import org.w3c.dom.Element;
+
+/**
+ * An Operation component describes an operation that a given interface supports.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @since 12-May-2004
+ */
+public class OperationMetaData extends ExtensibleMetaData
+{
+ // provide logging
+ private final Logger log = Logger.getLogger(OperationMetaData.class);
+
+ // The parent interface
+ private EndpointMetaData epMetaData;
+
+ private QName qname;
+ private QName responseName;
+ private String javaName;
+ private Method javaMethod;
+ private boolean oneWay;
+ private String soapAction;
+ private List<ParameterMetaData> parameters = new
ArrayList<ParameterMetaData>();
+ private List<FaultMetaData> faults = new ArrayList<FaultMetaData>();
+ private ParameterMetaData returnParam;
+
+ public OperationMetaData(QName qname, String javaName)
+ {
+ UnifiedMetaData umd = new UnifiedMetaData();
+ ServiceMetaData smd = new ServiceMetaData(umd, new
QName("mock-service"));
+ ServerEndpointMetaData epmd = new ServerEndpointMetaData(smd, new
QName("mock-endpoint"), new QName("mock-interface"), Type.JAXRPC);
+ initOperationMetaData(epmd, qname, javaName);
+ }
+
+ public OperationMetaData(EndpointMetaData epMetaData, QName qname, String javaName)
+ {
+ log.trace("new OperationMetaData: [xmlName=" + qname +
",javaName=" + javaName + "]");
+ initOperationMetaData(epMetaData, qname, javaName);
+ }
+
+ private void initOperationMetaData(EndpointMetaData epMetaData, QName qname, String
javaName)
+ {
+ this.epMetaData = epMetaData;
+ this.qname = qname;
+ this.javaName = javaName;
+
+ if (qname == null)
+ throw new IllegalArgumentException("Invalid null qname argument");
+ if (javaName == null)
+ throw new IllegalArgumentException("Invalid null javaName argument, for:
" + qname);
+
+ String nsURI = qname.getNamespaceURI();
+ String localPart = qname.getLocalPart();
+ this.responseName = new QName(nsURI, localPart + "Response");
+ }
+
+ public EndpointMetaData getEndpointMetaData()
+ {
+ return epMetaData;
+ }
+
+ public QName getQName()
+ {
+ return qname;
+ }
+
+ public QName getResponseName()
+ {
+ return responseName;
+ }
+
+ public String getSOAPAction()
+ {
+ return soapAction;
+ }
+
+ public void setSOAPAction(String soapAction)
+ {
+ this.soapAction = soapAction;
+ }
+
+ public Style getStyle()
+ {
+ return epMetaData.getStyle();
+ }
+
+ public Use getUse()
+ {
+ return epMetaData.getEncodingStyle();
+ }
+
+ public ParameterStyle getParameterStyle()
+ {
+ return epMetaData.getParameterStyle();
+ }
+
+ public boolean isRPCLiteral()
+ {
+ return getStyle() == Style.RPC && getUse() == Use.LITERAL;
+ }
+
+ public boolean isRPCEncoded()
+ {
+ return getStyle() == Style.RPC && getUse() == Use.ENCODED;
+ }
+
+ public boolean isDocumentBare()
+ {
+ return getStyle() == Style.DOCUMENT && getParameterStyle() ==
ParameterStyle.BARE;
+ }
+
+ public boolean isDocumentWrapped()
+ {
+ return getStyle() == Style.DOCUMENT && getParameterStyle() ==
ParameterStyle.WRAPPED;
+ }
+
+ public String getJavaName()
+ {
+ return javaName;
+ }
+
+ public Method getJavaMethod()
+ {
+ Method tmpMethod = javaMethod;
+ Class seiClass = epMetaData.getServiceEndpointInterface();
+ if (tmpMethod == null && seiClass != null)
+ {
+ for (Method method : seiClass.getMethods())
+ {
+ if (isJavaMethod(method))
+ {
+ tmpMethod = method;
+
+ UnifiedMetaData wsMetaData =
epMetaData.getServiceMetaData().getUnifiedMetaData();
+ if (wsMetaData.isEagerInitialized())
+ {
+ if (UnifiedMetaData.isFinalRelease() == false)
+ log.warn("Loading java method after eager initialization",
new IllegalStateException());
+
+ javaMethod = method;
+ }
+
+ break;
+ }
+ }
+
+ if (tmpMethod == null)
+ throw new WSException("Cannot find java method: " + javaName);
+ }
+ return tmpMethod;
+ }
+
+ public boolean isJavaMethod(Method method)
+ {
+ boolean isJavaMethod = method.equals(javaMethod);
+ if (isJavaMethod == false)
+ {
+ String methodName = method.getName();
+ if (javaName.equals(methodName))
+ {
+ log.trace("Found java method: " + method);
+
+ // compare params by java type name
+ if (matchParameters(method, true))
+ {
+ log.debug("Found best matching java method: " + method);
+ isJavaMethod = true;
+ }
+
+ // compare params by assignability
+ if (!isJavaMethod && matchParameters(method, false))
+ {
+ log.debug("Found possible matching java method: " + method);
+ isJavaMethod = true;
+ }
+ }
+ }
+
+ if (log.isTraceEnabled())
+ log.trace("Synchronized java method:\n" + method + "\nwith:
" + toString());
+
+ return isJavaMethod;
+ }
+
+ private boolean matchParameters(Method method, boolean exact)
+ {
+ Class[] paramTypes = method.getParameterTypes();
+ Set<Integer> matches = new HashSet<Integer>(paramTypes.length);
+
+ for (ParameterMetaData param : getParameters())
+ {
+ if (param.matchParameter(method, matches, exact) == false)
+ return false;
+ }
+
+ // We should have an entry for every parameter index if we match
+ if (matches.size() != paramTypes.length)
+ return false;
+
+ ParameterMetaData returnMetaData = getReturnParameter();
+ if (returnMetaData != null)
+ {
+ return returnMetaData.matchParameter(method, matches, exact);
+ }
+
+ return true;
+ }
+
+ /** Return true if this is a generic message style destination that takes a
org.w3c.dom.Element
+ */
+ public boolean isMessageEndpoint()
+ {
+ boolean isMessageEndpoint = false;
+ if (parameters.size() == 1)
+ {
+ ParameterMetaData inParam = parameters.get(0);
+ if (JavaUtils.isAssignableFrom(Element.class, inParam.getJavaType()))
+ {
+ isMessageEndpoint = true;
+ }
+ }
+ return isMessageEndpoint;
+ }
+
+ public boolean isOneWay()
+ {
+ return oneWay;
+ }
+
+ public void setOneWay(boolean oneWay)
+ {
+ this.oneWay = oneWay;
+ assertOneWayOperation();
+ }
+
+ public ParameterMetaData getParameter(QName xmlName)
+ {
+ ParameterMetaData paramMetaData = null;
+ for (int i = 0; paramMetaData == null && i < parameters.size(); i++)
+ {
+ ParameterMetaData aux = parameters.get(i);
+ if (xmlName.equals(aux.getXmlName()))
+ paramMetaData = aux;
+ }
+ return paramMetaData;
+ }
+
+ /** Get the IN or INOUT parameter list */
+ public List<ParameterMetaData> getInputParameters()
+ {
+ List<ParameterMetaData> retList = new ArrayList<ParameterMetaData>();
+ for (ParameterMetaData paramMetaData : parameters)
+ {
+ ParameterMode mode = paramMetaData.getMode();
+ if (mode == ParameterMode.IN || mode == ParameterMode.INOUT)
+ retList.add(paramMetaData);
+ }
+ return retList;
+ }
+
+ /** Get the OUT or INOUT parameter list */
+ public List<ParameterMetaData> getOutputParameters()
+ {
+ List<ParameterMetaData> retList = new ArrayList<ParameterMetaData>();
+ for (ParameterMetaData paramMetaData : parameters)
+ {
+ ParameterMode mode = paramMetaData.getMode();
+ if (mode == ParameterMode.OUT || mode == ParameterMode.INOUT)
+ retList.add(paramMetaData);
+ }
+ return retList;
+ }
+
+ /** Get the non header parameter list */
+ public List<ParameterMetaData> getNonHeaderParameters()
+ {
+ List<ParameterMetaData> retList = new ArrayList<ParameterMetaData>();
+ for (ParameterMetaData paramMetaData : parameters)
+ {
+ if (paramMetaData.isInHeader() == false)
+ retList.add(paramMetaData);
+ }
+ return retList;
+ }
+
+ public List<ParameterMetaData> getParameters()
+ {
+ return new ArrayList<ParameterMetaData>(parameters);
+ }
+
+ public void addParameter(ParameterMetaData pmd)
+ {
+ log.trace("addParameter: [xmlName=" + pmd.getXmlName() +
",xmlType=" + pmd.getXmlType() + "]");
+ parameters.add(pmd);
+ assertOneWayOperation();
+ }
+
+ public void removeAllParameters()
+ {
+ parameters.clear();
+ }
+
+ public ParameterMetaData getReturnParameter()
+ {
+ return returnParam;
+ }
+
+ public void setReturnParameter(ParameterMetaData returnParam)
+ {
+ log.trace("setReturnParameter: " + returnParam);
+ returnParam.setMode(ParameterMode.OUT);
+ returnParam.setIndex(-1);
+ this.returnParam = returnParam;
+ assertOneWayOperation();
+ }
+
+ public List<FaultMetaData> getFaults()
+ {
+ return new ArrayList<FaultMetaData>(faults);
+ }
+
+ public FaultMetaData getFault(QName xmlName)
+ {
+ FaultMetaData faultMetaData = null;
+ for (int i = 0; faultMetaData == null && i < faults.size(); i++)
+ {
+ FaultMetaData aux = faults.get(i);
+ if (aux.getXmlName().equals(xmlName))
+ faultMetaData = aux;
+ }
+ return faultMetaData;
+ }
+
+ public FaultMetaData getFault(Class javaType)
+ {
+ FaultMetaData faultMetaData = null;
+ for (FaultMetaData aux : faults)
+ {
+ if (aux.getJavaType().equals(javaType))
+ {
+ faultMetaData = aux;
+ break;
+ }
+ }
+ return faultMetaData;
+ }
+
+ public void addFault(FaultMetaData fault)
+ {
+ log.trace("addFault: " + fault);
+ faults.add(fault);
+ assertOneWayOperation();
+ }
+
+ // A JSR-181 processor is REQUIRED to report an error if an
+ // operation marked @Oneway has a return value, declares any checked exceptions or has
any
+ // INOUT or OUT parameters.
+ private void assertOneWayOperation()
+ {
+ if (oneWay)
+ {
+ if (returnParam != null)
+ throw new WSException("OneWay operations cannot have a return
parameter");
+
+ if (faults.size() > 0)
+ throw new WSException("OneWay operations cannot have checked
exceptions");
+
+ for (ParameterMetaData paramMetaData : parameters)
+ {
+ if (paramMetaData.getMode() != ParameterMode.IN)
+ throw new WSException("OneWay operations cannot have INOUT or OUT
parameters");
+ }
+ }
+ }
+
+ public void assertDocumentBare()
+ {
+ if (isDocumentBare())
+ {
+ int in = 0;
+ int out = 0;
+
+ for (ParameterMetaData paramMetaData : parameters)
+ {
+ if (paramMetaData.isInHeader())
+ continue;
+
+ ParameterMode mode = paramMetaData.getMode();
+ if (mode != ParameterMode.OUT)
+ in++;
+ if (mode != ParameterMode.IN)
+ out++;
+ }
+
+ if (returnParam != null && !returnParam.isInHeader())
+ out++;
+
+ if (in > 1 || out > (oneWay ? 0 : 1))
+ throw new WSException("The body of a document/literal bare message
requires at most 1 input and at most 1 output (or 0 if oneway). method: " + javaName
+ " in: "
+ + in + " out: " + out);
+ }
+ }
+
+ public void validate()
+ {
+ for (ParameterMetaData parameter : parameters)
+ parameter.validate();
+
+ for (FaultMetaData fault : faults)
+ fault.validate();
+ }
+
+ /**
+ * @see UnifiedMetaData#eagerInitialize()
+ */
+ public void eagerInitialize(List<Method> unsynchronizedMethods)
+ {
+ // reset java method
+ javaMethod = null;
+
+ for (ParameterMetaData parameter : parameters)
+ parameter.eagerInitialize();
+
+ if (returnParam != null)
+ returnParam.eagerInitialize();
+
+ for (FaultMetaData fault : faults)
+ fault.eagerInitialize();
+
+ // Method initialization
+ for (Method method : unsynchronizedMethods)
+ {
+ if (isJavaMethod(method))
+ {
+ javaMethod = method;
+ break;
+ }
+ }
+
+ // Report unsynchronized java method
+ if (javaMethod == null)
+ {
+ StringBuilder errMsg = new StringBuilder("Cannot synchronize to any of
these methods:");
+ for (Method method : unsynchronizedMethods)
+ {
+ errMsg.append("\n" + method);
+ }
+ errMsg.append("\n" + toString());
+ throw new IllegalStateException(errMsg.toString());
+ }
+ }
+
+ public String toString()
+ {
+ StringBuilder buffer = new StringBuilder("\nOperationMetaData:");
+ buffer.append("\n qname=" + qname);
+ buffer.append("\n javaName=" + javaName);
+ buffer.append("\n style=" + getStyle() + "/" + getUse());
+ if (getStyle() == Style.DOCUMENT)
+ {
+ buffer.append("/" + getParameterStyle());
+ }
+ buffer.append("\n oneWay=" + oneWay);
+ buffer.append("\n soapAction=" + soapAction);
+ for (ParameterMetaData param : parameters)
+ {
+ buffer.append(param);
+ }
+ if (returnParam != null)
+ {
+ buffer.append(returnParam.toString());
+ }
+ for (FaultMetaData fault : faults)
+ {
+ buffer.append(fault);
+ }
+ return buffer.toString();
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/ParameterMetaData.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ParameterMetaData.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ParameterMetaData.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/ParameterMetaData.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,469 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.metadata.umdm;
+
+// $Id$
+
+import java.lang.reflect.Method;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.ParameterMode;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.Constants;
+import org.jboss.ws.WSException;
+import org.jboss.ws.jaxrpc.ParameterWrapping;
+import org.jboss.ws.jaxws.DynamicWrapperGenerator;
+import org.jboss.ws.metadata.acessor.ReflectiveMethodAccessor;
+import org.jboss.ws.metadata.umdm.WrappedParameter.AccessorFactory;
+import org.jboss.ws.utils.HolderUtils;
+import org.jboss.ws.utils.JavaUtils;
+
+/**
+ * A request/response parameter that a given operation supports.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @since 12-May-2005
+ */
+public class ParameterMetaData
+{
+ // provide logging
+ private final Logger log = Logger.getLogger(ParameterMetaData.class);
+
+ // The parent operation
+ private OperationMetaData opMetaData;
+
+ private QName xmlName;
+ private String partName;
+ private QName xmlType;
+ private String javaTypeName;
+ private Class javaType;
+ private ParameterMode mode;
+ private Set<String> mimeTypes;
+ private boolean inHeader;
+ private boolean isSwA;
+ private boolean isXOP;
+ private List<WrappedParameter> wrappedParameters;
+ private int index;
+
+ // SOAP-ENC:Array
+ private boolean soapArrayParam;
+ private QName soapArrayCompType;
+ private AccessorFactoryCreator accessorFactoryCreator =
ReflectiveMethodAccessor.FACTORY_CREATOR;
+
+ public static interface AccessorFactoryCreator
+ {
+ public AccessorFactory create(ParameterMetaData parameter);
+ }
+
+ private static final List<String> messageTypes = new ArrayList<String>();
+ static
+ {
+ messageTypes.add("javax.xml.soap.SOAPElement");
+ messageTypes.add("org.w3c.dom.Element");
+ }
+
+ public ParameterMetaData(OperationMetaData opMetaData, QName xmlName, QName xmlType,
String javaTypeName)
+ {
+ this(opMetaData, xmlName, javaTypeName);
+ setXmlType(xmlType);
+ }
+
+ public ParameterMetaData(OperationMetaData opMetaData, QName xmlName, String
javaTypeName)
+ {
+ if (xmlName == null)
+ throw new IllegalArgumentException("Invalid null xmlName argument");
+
+ // Remove the prefixes
+ if (xmlName.getNamespaceURI().length() > 0)
+ xmlName = new QName(xmlName.getNamespaceURI(), xmlName.getLocalPart());
+
+ this.xmlName = xmlName;
+ this.opMetaData = opMetaData;
+ this.mode = ParameterMode.IN;
+ this.partName = xmlName.getLocalPart();
+ this.javaTypeName = javaTypeName;
+ }
+
+ private static boolean matchParameter(Method method, int index, Class expectedType,
Set<Integer> matches, boolean exact, boolean holder)
+ {
+ Class returnType = method.getReturnType();
+ Type[] parameters = method.getGenericParameterTypes();
+
+ if (index == -1 && matchTypes(returnType, expectedType, exact, false))
+ return true;
+
+ if (index < parameters.length && matchTypes(parameters[index],
expectedType, exact, holder))
+ {
+ matches.add(index);
+ return true;
+ }
+
+ return false;
+ }
+
+ private static boolean matchTypes(Type actualType, Class expectedType, boolean exact,
boolean holder)
+ {
+ if (holder && HolderUtils.isHolderType(actualType) == false)
+ return false;
+
+ Type valueType = (holder ? HolderUtils.getValueType(actualType) : actualType);
+ Class valueClass = JavaUtils.erasure(valueType);
+ boolean matched = (exact ? valueClass.getName().equals(expectedType.getName()) :
JavaUtils.isAssignableFrom(valueClass, expectedType));
+
+ return matched;
+ }
+
+ public OperationMetaData getOperationMetaData()
+ {
+ return opMetaData;
+ }
+
+ public QName getXmlName()
+ {
+ return xmlName;
+ }
+
+ public QName getXmlType()
+ {
+ return xmlType;
+ }
+
+ public void setXmlType(QName xmlType)
+ {
+ if (xmlType == null)
+ throw new IllegalArgumentException("Invalid null xmlType");
+
+ // Remove potential prefix
+ if (xmlType.getNamespaceURI().length() > 0)
+ this.xmlType = new QName(xmlType.getNamespaceURI(), xmlType.getLocalPart());
+ else this.xmlType = xmlType;
+
+ // Special case to identify attachments
+ if (Constants.NS_ATTACHMENT_MIME_TYPE.equals(xmlType.getNamespaceURI()))
+ {
+ String mimeType = convertXmlTypeToMimeType(xmlType);
+ setMimeTypes(mimeType);
+ this.isSwA = true;
+ }
+ else if(Constants.NS_SCHEMA_XSD.equals(xmlType.getNamespaceURI())
+ && "base64Binary".equals(xmlType.getLocalPart()))
+ {
+ setXOP(true);
+ }
+ }
+
+ public String getJavaTypeName()
+ {
+ return javaTypeName;
+ }
+
+ public void setJavaTypeName(String typeName)
+ {
+ // Warn if this is called after eager initialization
+ UnifiedMetaData wsMetaData =
opMetaData.getEndpointMetaData().getServiceMetaData().getUnifiedMetaData();
+ if (wsMetaData.isEagerInitialized() && UnifiedMetaData.isFinalRelease() ==
false)
+ log.warn("Set java type name after eager initialization", new
IllegalStateException());
+
+ javaTypeName = typeName;
+ javaType = null;
+ }
+
+ /** Load the java type.
+ * It should only be cached during eager initialization.
+ */
+ public Class getJavaType()
+ {
+ Class tmpJavaType = javaType;
+ if (tmpJavaType == null && javaTypeName != null)
+ {
+ try
+ {
+ ClassLoader loader = opMetaData.getEndpointMetaData().getClassLoader();
+ tmpJavaType = JavaUtils.loadJavaType(javaTypeName, loader);
+
+ UnifiedMetaData wsMetaData =
opMetaData.getEndpointMetaData().getServiceMetaData().getUnifiedMetaData();
+ if (wsMetaData.isEagerInitialized())
+ {
+ // This should not happen, see the warning in setJavaTypeName
+ javaType = tmpJavaType;
+ }
+ }
+ catch (ClassNotFoundException ex)
+ {
+ throw new WSException("Cannot load java type: " + javaTypeName,
ex);
+ }
+ }
+ return tmpJavaType;
+ }
+
+ public ParameterMode getMode()
+ {
+ return mode;
+ }
+
+ public void setMode(String mode)
+ {
+ if ("IN".equals(mode))
+ setMode(ParameterMode.IN);
+ else if ("INOUT".equals(mode))
+ setMode(ParameterMode.INOUT);
+ else if ("OUT".equals(mode))
+ setMode(ParameterMode.OUT);
+ else throw new IllegalArgumentException("Invalid mode: " + mode);
+ }
+
+ public void setMode(ParameterMode mode)
+ {
+ this.mode = mode;
+ }
+
+ public Set<String> getMimeTypes()
+ {
+ return mimeTypes;
+ }
+
+ public void setMimeTypes(String mimeStr)
+ {
+ mimeTypes = new HashSet<String>();
+ StringTokenizer st = new StringTokenizer(mimeStr, ",");
+ while (st.hasMoreTokens())
+ mimeTypes.add(st.nextToken().trim());
+ }
+
+ public boolean isInHeader()
+ {
+ return inHeader;
+ }
+
+ public void setInHeader(boolean inHeader)
+ {
+ this.inHeader = inHeader;
+ }
+
+ public boolean isSwA()
+ {
+ return isSwA;
+ }
+
+ public void setSwA(boolean isSwA)
+ {
+ this.isSwA = isSwA;
+ }
+
+ public boolean isXOP()
+ {
+ return isXOP;
+ }
+
+ public void setXOP(boolean isXOP)
+ {
+ this.isXOP = isXOP;
+ }
+
+ public boolean isSOAPArrayParam()
+ {
+ return soapArrayParam;
+ }
+
+ public void setSOAPArrayParam(boolean soapArrayParam)
+ {
+ this.soapArrayParam = soapArrayParam;
+ }
+
+ public QName getSOAPArrayCompType()
+ {
+ return soapArrayCompType;
+ }
+
+ public void setSOAPArrayCompType(QName xmlType)
+ {
+ this.soapArrayCompType = xmlType;
+ }
+
+ public boolean isMessageType()
+ {
+ return messageTypes.contains(javaTypeName);
+ }
+
+ public static boolean isMessageType(String javaTypeName)
+ {
+ return messageTypes.contains(javaTypeName);
+ }
+
+ /** Converts a proprietary JBossWS attachment xml type to the MIME type that it
represents.
+ */
+ private String convertXmlTypeToMimeType(QName xmlType)
+ {
+ StringBuilder mimeName = new StringBuilder(xmlType.getLocalPart());
+ int pos = mimeName.indexOf("_");
+ if (pos == -1)
+ throw new IllegalArgumentException("Invalid mime type: " + xmlType);
+
+ mimeName.setCharAt(pos, '/');
+ return mimeName.toString();
+ }
+
+ public int getIndex()
+ {
+ return index;
+ }
+
+ public void setIndex(int index)
+ {
+ this.index = index;
+ }
+
+ public List<WrappedParameter> getWrappedParameters()
+ {
+ return wrappedParameters;
+ }
+
+ public void setWrappedParameters(List<WrappedParameter> wrappedParameters)
+ {
+ this.wrappedParameters = wrappedParameters;
+ }
+
+ public String getPartName()
+ {
+ return partName;
+ }
+
+ public void setPartName(String partName)
+ {
+ this.partName = partName;
+ }
+
+ public void validate()
+ {
+ // nothing to do
+ }
+
+ /**
+ * @see UnifiedMetaData#eagerInitialize()
+ */
+ public void eagerInitialize()
+ {
+ // reset java type
+ javaType = null;
+
+ if (getOperationMetaData().isDocumentWrapped() && isMessageType() ==
false)
+ {
+ new DynamicWrapperGenerator(getClassLoader()).generate(this);
+
+ // Initialize accessors
+ AccessorFactory factory = accessorFactoryCreator.create(this);
+ for (WrappedParameter wrapped : wrappedParameters)
+ wrapped.setAccessor(factory.create(wrapped));
+ }
+
+ javaType = getJavaType();
+ if (javaType == null)
+ throw new WSException("Cannot load java type: " + javaTypeName);
+ }
+
+ private ClassLoader getClassLoader()
+ {
+ ClassLoader loader =
opMetaData.getEndpointMetaData().getServiceMetaData().getUnifiedMetaData().getClassLoader();
+ if (loader == null)
+ throw new WSException("ClassLoader not available");
+ return loader;
+ }
+
+ public boolean matchParameter(Method method, Set<Integer> matches, boolean
exact)
+ {
+ ClassLoader loader =
getOperationMetaData().getEndpointMetaData().getClassLoader();
+ List<WrappedParameter> wrappedParameters = getWrappedParameters();
+ Class wrapperType = getJavaType();
+
+ // Standard type
+ if (wrappedParameters == null)
+ return matchParameter(method, getIndex(), getJavaType(), matches, exact, mode !=
ParameterMode.IN);
+
+ // Wrapped type
+ for (WrappedParameter wrapped : wrappedParameters)
+ {
+ String typeName = wrapped.getType();
+
+ try
+ {
+ Class type = (typeName != null) ? JavaUtils.loadJavaType(typeName, loader) :
ParameterWrapping.getWrappedType(wrapped.getVariable(), wrapperType);
+ if (type == null)
+ return false;
+ if (!matchParameter(method, wrapped.getIndex(), type, matches, exact,
wrapped.isHolder()))
+ return false;
+ }
+ catch (Exception ex)
+ {
+ log.debug("Invalid wrapper type:" + typeName, ex);
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public void setAccessorFactoryCreator(AccessorFactoryCreator accessorFactoryCreator)
+ {
+ this.accessorFactoryCreator = accessorFactoryCreator;
+ }
+
+ public String toString()
+ {
+ boolean isReturn = (opMetaData.getReturnParameter() == this);
+ StringBuilder buffer = new StringBuilder("\n" + (isReturn ?
"ReturnMetaData:" : "ParameterMetaData:"));
+ buffer.append("\n xmlName=" + getXmlName());
+ buffer.append("\n partName=" + getPartName());
+ buffer.append("\n xmlType=" + getXmlType());
+ buffer.append("\n javaType=" + getJavaTypeName());
+ buffer.append("\n mode=" + getMode());
+ buffer.append("\n inHeader=" + isInHeader());
+ buffer.append("\n index=" + index);
+
+ if (soapArrayParam)
+ buffer.append("\n soapArrayCompType=" + soapArrayCompType);
+
+ if (isSwA())
+ {
+ buffer.append("\n isSwA=" + isSwA());
+ buffer.append("\n mimeTypes=" + getMimeTypes());
+ }
+
+ if (wrappedParameters != null)
+ buffer.append("\n wrappedParameters=" + wrappedParameters);
+
+ if (isXOP())
+ {
+ buffer.append("\n isXOP=" + isXOP());
+ buffer.append("\n mimeTypes=" + getMimeTypes());
+ }
+
+ return buffer.toString();
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ServerEndpointMetaData.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ServerEndpointMetaData.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,300 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.metadata.umdm;
+
+// $Id$
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.management.ObjectName;
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.metadata.config.WSCommonConfig;
+import org.jboss.ws.metadata.config.WSConfigFactory;
+import org.jboss.ws.metadata.config.jaxrpc.WSConfigRootJAXRPC;
+import org.jboss.ws.metadata.config.jaxws.WSConfigRootJAXWS;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
+import org.jboss.ws.server.ServiceEndpoint;
+
+/**
+ * Client side endpoint meta data.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @since 12-May-2005
+ */
+public class ServerEndpointMetaData extends EndpointMetaData
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(ServerEndpointMetaData.class);
+
+ public static final String SEPID_DOMAIN = "jboss.ws";
+ public static final String SEPID_PROPERTY_CONTEXT = "context";
+ public static final String SEPID_PROPERTY_ENDPOINT = "endpoint";
+
+ // The REQUIRED link name
+ private String linkName;
+ // Legacy JSR-109 port component name
+ private String portComponentName;
+ // The endpoint implementation bean
+ private String implName;
+ // The unique service endpointID
+ private ObjectName sepID;
+ // The HTTP context root
+ private String contextRoot;
+ // The HTTP virtual hosts
+ private String[] virtualHosts;
+ // The HTTP url parttern
+ private String urlPattern;
+ // The optional transport guarantee
+ private String transportGuarantee;
+ // The bean that registers with the ServiceEndpointManager
+ private String managedEndpointBean = ServiceEndpoint.class.getName();
+
+ public ServerEndpointMetaData(ServiceMetaData service, QName qname, QName
interfaceQName, Type type)
+ {
+ super(service, qname, interfaceQName, type);
+ }
+
+ public void setConfigName(String configName)
+ {
+ super.setConfigName(configName);
+ endpointConfig = null;
+ }
+
+ public void setConfigFile(String configFile)
+ {
+ super.setConfigFile(configFile);
+ endpointConfig = null;
+ }
+
+ public String getLinkName()
+ {
+ return linkName;
+ }
+
+ public void setLinkName(String linkName)
+ {
+ this.linkName = linkName;
+ }
+
+ public String getPortComponentName()
+ {
+ return portComponentName;
+ }
+
+ public void setPortComponentName(String portComponentName)
+ {
+ this.portComponentName = portComponentName;
+ }
+
+ public String getServiceEndpointImplName()
+ {
+ return implName;
+ }
+
+ public void setServiceEndpointImplName(String endpointImpl)
+ {
+ this.implName = endpointImpl;
+ }
+
+ public ObjectName getServiceEndpointID()
+ {
+ return sepID;
+ }
+
+ public void setServiceEndpointID(ObjectName endpointID)
+ {
+ this.sepID = endpointID;
+ }
+
+ public String getContextRoot()
+ {
+ return contextRoot;
+ }
+
+ public void setContextRoot(String contextRoot)
+ {
+ if (contextRoot != null && contextRoot.startsWith("/") == false)
+ throw new IllegalArgumentException("context root should start with
'/'");
+
+ this.contextRoot = contextRoot;
+ }
+
+ public String[] getVirtualHosts()
+ {
+ return virtualHosts;
+ }
+
+ public void setVirtualHosts(String[] virtualHosts)
+ {
+ this.virtualHosts = virtualHosts;
+ }
+
+ public String getURLPattern()
+ {
+ return urlPattern;
+ }
+
+ public void setURLPattern(String urlPattern)
+ {
+ if (urlPattern != null && urlPattern.startsWith("/") == false)
+ throw new IllegalArgumentException("url pattern should start with
'/'");
+
+ this.urlPattern = urlPattern;
+ }
+
+ public String getTransportGuarantee()
+ {
+ return transportGuarantee;
+ }
+
+ public void setTransportGuarantee(String transportGuarantee)
+ {
+ this.transportGuarantee = transportGuarantee;
+ }
+
+ public String getManagedEndpointBean()
+ {
+ return managedEndpointBean;
+ }
+
+ public void setManagedEndpointBean(String managedEndpointBean)
+ {
+ this.managedEndpointBean = managedEndpointBean;
+ }
+
+ @Override
+ public WSCommonConfig getEndpointConfig()
+ {
+ if (endpointConfig == null)
+ {
+ String configName = getConfigName();
+ if (configName == null)
+ {
+ configName = "Standard Endpoint";
+ setConfigName(configName);
+ }
+
+ String configFile = getConfigFile();
+ if (configFile == null)
+ {
+ if (getType() == Type.JAXRPC)
+ {
+ configFile = "META-INF/standard-jaxrpc-endpoint-config.xml";
+ }
+ else
+ {
+ configFile = "META-INF/standard-jaxws-endpoint-config.xml";
+ }
+ setConfigFile(configFile);
+ }
+
+ log.debug("getEndpointConfig: [name=" + configName + ",url="
+ configFile + "]");
+
+ URL configURL = null;
+ try
+ {
+ configURL = new URL(configFile);
+ }
+ catch (MalformedURLException ex)
+ {
+ // ignore
+ }
+
+ // Try to get the URL as resource
+ if (configURL == null)
+ {
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ configURL = cl.getResource(configFile);
+ if (configURL == null)
+ throw new WSException("Cannot get resource: " + configFile);
+ }
+
+ // Get the config root
+ Object wsConfig;
+ try
+ {
+ WSConfigFactory factory = WSConfigFactory.newInstance();
+ wsConfig = factory.parseWithObjectModelFactory(configURL);
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new WSException("Cannot parse client config", ex);
+ }
+
+ // Get the endpoint config
+ if (wsConfig instanceof WSConfigRootJAXRPC)
+ {
+ endpointConfig =
((WSConfigRootJAXRPC)wsConfig).getEndpointConfigByName(configName);
+ if (endpointConfig == null)
+ throw new WSException("Cannot obtain endpoint config: " +
configName);
+ }
+ else
+ {
+ endpointConfig =
((WSConfigRootJAXWS)wsConfig).getEndpointConfigByName(configName);
+ if (endpointConfig == null)
+ throw new WSException("Cannot obtain endpoint config: " +
configName);
+ }
+ }
+ return endpointConfig;
+ }
+
+ public String toString()
+ {
+ StringBuilder buffer = new StringBuilder("\nServerEndpointMetaData:");
+ buffer.append("\n type=" + getType());
+ buffer.append("\n qname=" + getQName());
+ buffer.append("\n id=" + getServiceEndpointID().getCanonicalName());
+ buffer.append("\n address=" + getEndpointAddress());
+ buffer.append("\n binding=" + getBindingId());
+ buffer.append("\n linkName=" + getLinkName());
+ buffer.append("\n implName=" + getServiceEndpointImplName());
+ buffer.append("\n seiName=" + getServiceEndpointInterfaceName());
+ buffer.append("\n serviceMode=" + getServiceMode());
+ buffer.append("\n portComponentName=" + getPortComponentName());
+ buffer.append("\n contextRoot=" + getContextRoot());
+ buffer.append("\n urlPattern=" + getURLPattern());
+ buffer.append("\n configFile=" + getConfigFile());
+ buffer.append("\n configName=" + getConfigName());
+ buffer.append("\n authMethod=" + getAuthMethod());
+ buffer.append("\n transportGuarantee=" + getTransportGuarantee());
+ buffer.append("\n properties=" + getProperties());
+
+ for (OperationMetaData opMetaData : getOperations())
+ {
+ buffer.append("\n" + opMetaData);
+ }
+ for (HandlerMetaData hdlMetaData : getHandlerMetaData(HandlerType.ALL))
+ {
+ buffer.append("\n" + hdlMetaData);
+ }
+ return buffer.toString();
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ServiceMetaData.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ServiceMetaData.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,416 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.metadata.umdm;
+
+// $Id$
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.encoding.TypeMappingRegistry;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.jaxrpc.TypeMappingImpl;
+import org.jboss.ws.jaxrpc.TypeMappingRegistryImpl;
+import org.jboss.ws.jaxrpc.Use;
+import org.jboss.ws.jbossxb.SchemaBindingBuilder;
+import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
+import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.metadata.wsdl.WSDLTypes;
+import org.jboss.ws.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+
+/**
+ * A Service component describes a set of endpoints.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-May-2005
+ */
+public class ServiceMetaData
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(ServiceMetaData.class);
+
+ // The parent meta data.
+ private UnifiedMetaData wsMetaData;
+
+ // The service endpoints
+ private Map<QName, EndpointMetaData> endpoints = new LinkedHashMap<QName,
EndpointMetaData>();
+
+ private QName serviceName;
+ private String wsdName;
+ private String wsdlFile;
+ private String jaxrpcMappingFile;
+ private String wsdlPublishLocation;
+
+ // The type mapping that is maintained by this service
+ private TypesMetaData types;
+ private TypeMappingRegistry tmRegistry = new TypeMappingRegistryImpl();
+ private SchemaBinding schemaBinding;
+
+ // Arbitrary properties given by <call-property>
+ private Properties properties;
+
+ // derived cached encoding style
+ private Use encStyle;
+
+ // The security configuration
+ private WSSecurityConfiguration securityConfiguration;
+
+ public ServiceMetaData(UnifiedMetaData wsMetaData, QName serviceName)
+ {
+ this.wsMetaData = wsMetaData;
+ this.serviceName = serviceName;
+ this.types = new TypesMetaData(this);
+ }
+
+ public UnifiedMetaData getUnifiedMetaData()
+ {
+ return wsMetaData;
+ }
+
+ public void setServiceName(QName serviceName)
+ {
+ this.serviceName = serviceName;
+ }
+
+ public QName getServiceName()
+ {
+ return serviceName;
+ }
+
+ public String getWebserviceDescriptionName()
+ {
+ return wsdName;
+ }
+
+ public void setWebserviceDescriptionName(String wsdName)
+ {
+ this.wsdName = wsdName;
+ }
+
+ public String getWsdlFile()
+ {
+ return wsdlFile;
+ }
+
+ public void setWsdlFile(String wsdlFile)
+ {
+ this.wsdlFile = wsdlFile;
+ }
+
+ public String getWsdlPublishLocation()
+ {
+ return wsdlPublishLocation;
+ }
+
+ public void setWsdlPublishLocation(String wsdlPublishLocation)
+ {
+ this.wsdlPublishLocation = wsdlPublishLocation;
+ }
+
+ public Properties getProperties()
+ {
+ return properties;
+ }
+
+ public void setProperties(Properties properties)
+ {
+ this.properties = properties;
+ }
+
+ public TypesMetaData getTypesMetaData()
+ {
+ return types;
+ }
+
+ public List<EndpointMetaData> getEndpoints()
+ {
+ return new ArrayList<EndpointMetaData>(endpoints.values());
+ }
+
+ public EndpointMetaData getEndpoint(QName portName)
+ {
+ return endpoints.get(portName);
+ }
+
+ public EndpointMetaData getEndpointByServiceEndpointInterface(String seiName)
+ {
+ EndpointMetaData epMetaData = null;
+ for (EndpointMetaData epmd : endpoints.values())
+ {
+ if (seiName.equals(epmd.getServiceEndpointInterfaceName()))
+ {
+ if (epMetaData != null)
+ {
+ // The CTS uses Service.getPort(Class) with multiple endpoints
implementing the same SEI
+ log.warn("Multiple possible endpoints implementing SEI: " +
seiName);
+ }
+ epMetaData = epmd;
+ }
+ }
+ return epMetaData;
+ }
+
+ public void addEndpoint(EndpointMetaData epMetaData)
+ {
+ QName portName = epMetaData.getQName();
+
+ // This happends when we have multiple port components in sharing the same wsdl
port
+ // The EndpointMetaData name is the wsdl port, so we cannot have multiple meta data
for the same port.
+ if (endpoints.get(portName) != null)
+ throw new WSException("EndpointMetaData name must be unique: " +
portName);
+
+ endpoints.put(portName, epMetaData);
+ }
+
+ public String getJaxrpcMappingFile()
+ {
+ return jaxrpcMappingFile;
+ }
+
+ public void setJaxrpcMappingFile(String jaxrpcMappingFile)
+ {
+ this.jaxrpcMappingFile = jaxrpcMappingFile;
+ }
+
+ public JavaWsdlMapping getJavaWsdlMapping()
+ {
+ JavaWsdlMapping javaWsdlMapping =
(JavaWsdlMapping)wsMetaData.getMappingDefinition(jaxrpcMappingFile);
+ if (javaWsdlMapping == null && jaxrpcMappingFile != null)
+ {
+ URL mappingLocation = null;
+ try
+ {
+ mappingLocation = new URL(jaxrpcMappingFile);
+ }
+ catch (MalformedURLException e)
+ {
+ // ignore
+ }
+ if (mappingLocation == null)
+ {
+ mappingLocation =
wsMetaData.getClassLoader().getResource(jaxrpcMappingFile);
+ }
+
+ if (mappingLocation == null)
+ throw new IllegalArgumentException("Cannot find jaxrpc-mapping.xml in
deployment: " + jaxrpcMappingFile);
+
+ try
+ {
+ JavaWsdlMappingFactory mappingFactory =
JavaWsdlMappingFactory.newInstance();
+ javaWsdlMapping = mappingFactory.parse(mappingLocation);
+ wsMetaData.addMappingDefinition(jaxrpcMappingFile, javaWsdlMapping);
+ }
+ catch (IOException e)
+ {
+ throw new WSException("Cannot parse jaxrpc-mapping.xml", e);
+ }
+ }
+ return javaWsdlMapping;
+ }
+
+ /**
+ * Get the wsdl definition that corresponds to the wsdl-file element.
+ */
+ public WSDLDefinitions getWsdlDefinitions()
+ {
+ WSDLDefinitions wsdlDefinitions =
(WSDLDefinitions)wsMetaData.getWSDLDefinition(wsdlFile);
+ if (wsdlDefinitions == null && wsdlFile != null)
+ {
+ URL wsdlLocation = getWsdlLocation();
+ if (wsdlLocation == null)
+ throw new IllegalArgumentException("Cannot find wsdl in deployment:
" + wsdlFile);
+
+ WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
+ wsdlDefinitions = factory.parse(wsdlLocation);
+ wsMetaData.addWSDLDefinition(wsdlFile, wsdlDefinitions);
+ }
+ return wsdlDefinitions;
+ }
+
+ public URL getWsdlLocation()
+ {
+ URL wsdlLocation = null;
+ if (wsdlFile != null)
+ {
+ try
+ {
+ wsdlLocation = new URL(wsdlFile);
+ }
+ catch (MalformedURLException e)
+ {
+ // ignore
+ }
+ if (wsdlLocation == null)
+ {
+ wsdlLocation = wsMetaData.getClassLoader().getResource(wsdlFile);
+ }
+ }
+ return wsdlLocation;
+ }
+
+ public TypeMappingImpl getTypeMapping()
+ {
+ Use encStyle = getEncodingStyle();
+ TypeMappingImpl typeMapping =
(TypeMappingImpl)tmRegistry.getTypeMapping(encStyle.toURI());
+ if (typeMapping == null)
+ throw new WSException("No type mapping for encoding style: " +
encStyle);
+
+ return typeMapping;
+ }
+
+ public WSSecurityConfiguration getSecurityConfiguration()
+ {
+ return securityConfiguration;
+ }
+
+ public void setSecurityConfiguration(WSSecurityConfiguration securityConfiguration)
+ {
+ this.securityConfiguration = securityConfiguration;
+ }
+
+ public Use getEncodingStyle()
+ {
+ if (encStyle == null)
+ {
+ if (endpoints.size() > 0)
+ {
+ for (EndpointMetaData epMetaData : endpoints.values())
+ {
+ if (encStyle == null)
+ {
+ encStyle = epMetaData.getEncodingStyle();
+ }
+ else if (encStyle.equals(epMetaData.getEncodingStyle()) == false)
+ {
+ throw new WSException("Conflicting encoding styles not
supported");
+ }
+ }
+ }
+ else
+ {
+ encStyle = Use.LITERAL;
+ }
+ }
+ return encStyle;
+ }
+
+ public SchemaBinding getSchemaBinding()
+ {
+ JavaWsdlMapping wsdlMapping = getJavaWsdlMapping();
+ if (schemaBinding == null && getEncodingStyle() == Use.LITERAL &&
wsdlMapping != null)
+ {
+ JBossXSModel xsModel = types.getSchemaModel();
+ SchemaBindingBuilder bindingBuilder = new SchemaBindingBuilder();
+ schemaBinding = bindingBuilder.buildSchemaBinding(xsModel, wsdlMapping);
+ }
+ return schemaBinding;
+ }
+
+ public void validate()
+ {
+ // Validate that there is at least one handler configured
+ // if we have a security configuration
+ if (securityConfiguration != null)
+ {
+ int handlerCount = 0;
+ for (EndpointMetaData epMetaData : endpoints.values())
+ {
+ handlerCount += epMetaData.getHandlerMetaData(HandlerType.ALL).size();
+ }
+ if (handlerCount == 0)
+ log.warn("WS-Security requires a security handler to be
configured");
+ }
+
+ // Validate endpoints
+ for (EndpointMetaData epMetaData : endpoints.values())
+ epMetaData.validate();
+ }
+
+ /**
+ * @see UnifiedMetaData#eagerInitialize()
+ */
+ public void eagerInitialize()
+ {
+ // Initialize all wsdl definitions and schema objects
+ WSDLDefinitions definitions = getWsdlDefinitions();
+ if (definitions != null)
+ {
+ WSDLTypes types = definitions.getWsdlTypes();
+ if (types != null)
+ {
+ JBossXSModel model = WSDLUtils.getSchemaModel(types);
+ if (model != null)
+ model.eagerInitialize();
+ }
+ }
+
+ // Initialize jaxrpc-mapping data
+ getJavaWsdlMapping();
+
+ // Initialize endpoints
+ for (EndpointMetaData epMetaData : endpoints.values())
+ epMetaData.eagerInitialize();
+
+ // Initialize schema binding
+ getSchemaBinding();
+ }
+
+ /** Assert that the given namespace is the WSDL's target namespace */
+ public void assertTargetNamespace(String targetNS)
+ {
+ if (getServiceName().getNamespaceURI().equals(targetNS) == false)
+ throw new WSException("Requested namespace is not WSDL target namespace:
" + targetNS);
+ }
+
+ public String toString()
+ {
+ StringBuilder buffer = new StringBuilder("\nServiceMetaData:");
+ buffer.append("\n qname=" + serviceName);
+ buffer.append("\n wsdName=" + wsdName);
+ buffer.append("\n wsdlFile=" + wsdlFile);
+ buffer.append("\n jaxrpcFile=" + jaxrpcMappingFile);
+ buffer.append("\n publishLocation=" + wsdlPublishLocation);
+ buffer.append("\n properties=" + properties);
+ buffer.append("\n" + types);
+ buffer.append("\n");
+ for (EndpointMetaData epMetaData : endpoints.values())
+ {
+ buffer.append(epMetaData);
+ }
+ return buffer.toString();
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/TypeMappingMetaData.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/TypeMappingMetaData.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/TypeMappingMetaData.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/TypeMappingMetaData.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,110 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.metadata.umdm;
+
+// $Id$
+
+import java.util.Arrays;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+
+/**
+ * Type mapping meta data
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-May-2005
+ */
+public class TypeMappingMetaData
+{
+ // The parent meta data.
+ private TypesMetaData typesMetaData;
+
+ private QName xmlType;
+ private String javaTypeName;
+ private String qnameScope;
+
+ // List of allowed qname scopes
+ public static final String QNAME_SCOPE_SIMPLE_TYPE = "simpleType";
+ public static final String QNAME_SCOPE_COMPLEX_TYPE = "complexType";
+ public static final String QNAME_SCOPE_ELEMENT = "element";
+ private static List<String> allowedScopes = Arrays.asList(new String[] {
QNAME_SCOPE_COMPLEX_TYPE, QNAME_SCOPE_SIMPLE_TYPE, QNAME_SCOPE_ELEMENT });
+
+ public TypeMappingMetaData(TypesMetaData typesMetaData, QName xmlType, String
javaTypeName)
+ {
+ if (xmlType == null)
+ throw new IllegalArgumentException("Invalid null xmlType");
+ if (javaTypeName == null)
+ throw new IllegalArgumentException("Invalid null javaTypeName");
+
+ this.typesMetaData = typesMetaData;
+ this.javaTypeName = javaTypeName;
+ this.xmlType = xmlType;
+ this.qnameScope = QNAME_SCOPE_COMPLEX_TYPE;
+ }
+
+ public TypesMetaData getTypesMetaData()
+ {
+ return typesMetaData;
+ }
+
+ public String getJavaTypeName()
+ {
+ return javaTypeName;
+ }
+
+ public QName getXmlType()
+ {
+ return xmlType;
+ }
+
+ public String getQNameScope()
+ {
+ return qnameScope;
+ }
+
+ public void setQNameScope(String qnameScope)
+ {
+ if (allowedScopes.contains(qnameScope) == false)
+ throw new IllegalArgumentException("Invalid qname scope: " +
qnameScope);
+
+ this.qnameScope = qnameScope;
+ }
+
+ public int hashCode()
+ {
+ return toString().hashCode();
+ }
+
+ public boolean equals(Object obj)
+ {
+ if (obj instanceof TypeMappingMetaData == false) return false;
+ TypeMappingMetaData other = (TypeMappingMetaData)obj;
+ return toString().equals(other.toString());
+ }
+
+ public String toString()
+ {
+ return "[" + qnameScope + "=" + xmlType +
",javaType=" + javaTypeName + "]";
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/TypesMetaData.java (from
rev 1557, branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/TypesMetaData.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/TypesMetaData.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/TypesMetaData.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,193 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.metadata.umdm;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.xerces.xs.XSSimpleTypeDefinition;
+import org.apache.xerces.xs.XSTypeDefinition;
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
+
+/**
+ * Types meta data
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-May-2005
+ */
+public class TypesMetaData
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(TypesMetaData.class);
+
+ // The parent meta data.
+ private ServiceMetaData serviceMetaData;
+ // The list of type meta data
+ private List<TypeMappingMetaData> typeList = new
ArrayList<TypeMappingMetaData>();
+
+ private JBossXSModel schemaModel;
+
+ public TypesMetaData(ServiceMetaData serviceMetaData)
+ {
+ this.serviceMetaData = serviceMetaData;
+ }
+
+ public ServiceMetaData getServiceMetaData()
+ {
+ return serviceMetaData;
+ }
+
+ public JBossXSModel getSchemaModel()
+ {
+ return schemaModel;
+ }
+
+ public void setSchemaModel(JBossXSModel model)
+ {
+ this.schemaModel = model;
+ }
+
+ public void addSchemaModel(JBossXSModel model)
+ {
+ if (this.schemaModel == null)
+ {
+ this.schemaModel = model;
+ }
+ else
+ {
+ this.schemaModel.merge(model);
+ }
+ }
+
+ public List<TypeMappingMetaData> getTypeMappings()
+ {
+ return new ArrayList<TypeMappingMetaData>(typeList);
+ }
+
+ public void addTypeMapping(TypeMappingMetaData tmMetaData)
+ {
+ if (typeList.contains(tmMetaData) == false)
+ {
+ log.trace("Add type mapping: " + tmMetaData);
+ typeList.add(tmMetaData);
+ }
+ }
+
+ public TypeMappingMetaData getTypeMappingByXMLType(QName xmlType)
+ {
+ TypeMappingMetaData tmMetaData = null;
+ for (TypeMappingMetaData aux : typeList)
+ {
+ boolean isElementScope =
TypeMappingMetaData.QNAME_SCOPE_ELEMENT.equals(aux.getQNameScope());
+ if (aux.getXmlType().equals(xmlType) && isElementScope == false)
+ {
+ if (tmMetaData != null)
+ {
+ log.error(tmMetaData + "\n" + aux);
+ throw new WSException("Ambiguous type mappping for: " +
xmlType);
+ }
+ tmMetaData = aux;
+ }
+ }
+
+ if (tmMetaData == null && schemaModel != null)
+ {
+ // Simple types are not neccessary mapped in jaxrpc-mapping.xml, lazily add the
mapping here
+ XSTypeDefinition xsType = schemaModel.getTypeDefinition(xmlType.getLocalPart(),
xmlType.getNamespaceURI());
+ if (xsType instanceof XSSimpleTypeDefinition)
+ {
+ XSSimpleTypeDefinition xsSimpleType = (XSSimpleTypeDefinition)xsType;
+ String javaTypeName = null;
+
+ // <simpleType name="FooStringListType">
+ // <list itemType="string"/>
+ // </simpleType>
+ if (xsSimpleType.getVariety() == XSSimpleTypeDefinition.VARIETY_LIST)
+ {
+ XSSimpleTypeDefinition itemType = xsSimpleType.getItemType();
+ QName xmlBaseType = new QName(itemType.getNamespace(),
itemType.getName());
+ javaTypeName = new LiteralTypeMapping().getJavaTypeName(xmlBaseType);
+ if (javaTypeName != null)
+ {
+ javaTypeName += "[]";
+ }
+ }
+
+ // <simpleType name="FooIType">
+ // <restriction base="normalizedString">
+ // <pattern value="\d{3}-[A-Z0-9]{5}"/>
+ // </restriction>
+ // </simpleType>
+ XSTypeDefinition xsBaseType = xsType.getBaseType();
+ while (javaTypeName == null && xsBaseType != null)
+ {
+ QName xmlBaseType = new QName(xsBaseType.getNamespace(),
xsBaseType.getName());
+ javaTypeName = new LiteralTypeMapping().getJavaTypeName(xmlBaseType);
+ xsBaseType = xsBaseType.getBaseType();
+ }
+
+ if (javaTypeName != null)
+ {
+ tmMetaData = new TypeMappingMetaData(this, xmlType, javaTypeName);
+ tmMetaData.setQNameScope(TypeMappingMetaData.QNAME_SCOPE_SIMPLE_TYPE);
+ log.debug("Adding a simpleType without jaxrpc-mapping: " +
tmMetaData);
+ addTypeMapping(tmMetaData);
+ }
+ else
+ {
+ log.warn("Cannot obtain javaTypeName for xmlType: " + xmlType);
+ }
+ }
+ }
+
+ return tmMetaData;
+ }
+
+ public TypeMappingMetaData getTypeMappingByJavaType(String javaTypeName)
+ {
+ TypeMappingMetaData tmMetaData = null;
+ for (TypeMappingMetaData aux : typeList)
+ {
+ if (aux.getJavaTypeName().equals(javaTypeName))
+ tmMetaData = aux;
+ }
+ return tmMetaData;
+ }
+
+ public String toString()
+ {
+ StringBuilder buffer = new StringBuilder("\nTypesMetaData: ");
+ for (TypeMappingMetaData tmd : typeList)
+ {
+ buffer.append("\n " + tmd);
+ }
+ buffer.append("\n" + (schemaModel != null ? schemaModel.serialize() :
"<schema/>"));
+ return buffer.toString();
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/UnifiedMetaData.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/UnifiedMetaData.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/UnifiedMetaData.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/UnifiedMetaData.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,219 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.metadata.umdm;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.StringTokenizer;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.server.ServiceEndpointManager;
+
+/**
+ * The top level meta data.
+ *
+ * <h4>Thread safety</h4>
+ * <p>A <code>UnifiedMetaData</code> instance may be shared accross
threads provided that the following conditions are met:
+ * <ol>
+ * <li>{@link #eagerInitialize() eagerInitialize()} is called from a single thread
on startup</li>
+ * <li>Multi-thread access is limited to read-only calls</li>
+ * </ol></p>
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @since 12-May-2005
+ */
+public class UnifiedMetaData
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(UnifiedMetaData.class);
+
+ // The canonical deployment name
+ private String deploymentName;
+ // The modules class loader
+ private ClassLoader classLoader;
+ // The optional security domain
+ private String securityDomain;
+ // The implementation version
+ private static String implementationVersion;
+ // True if this is a final release
+ private static boolean isFinalRelease;
+ // Map<String, WSDLDefinitions> the wsdl-file to the wsdl Document
+ // Note the same wsdl can be used in multiple webservice descriptions
+ Map<String, WSDLDefinitions> wsdlMap = new HashMap<String,
WSDLDefinitions>();
+ // Maps the jaxrpc-mapping-file to {@link JavaWsdlMapping} object
+ // Note the same jaxrpc-mapping.xml can be used in multiple webservice descriptions
+ Map<String, JavaWsdlMapping> jaxrpcMap = new HashMap<String,
JavaWsdlMapping>();
+ // The list of service meta data
+ private List<ServiceMetaData> services = new
ArrayList<ServiceMetaData>();
+ // Used by eager initialization
+ private boolean eagerInitialized;
+ // Used by validate
+ private boolean validated;
+
+ public UnifiedMetaData()
+ {
+ this.classLoader = Thread.currentThread().getContextClassLoader();
+ }
+
+ public ClassLoader getClassLoader()
+ {
+ if (classLoader == null)
+ throw new IllegalStateException ("Class loader not available");
+
+ return classLoader;
+ }
+
+ public void setClassLoader(ClassLoader classLoader)
+ {
+ this.classLoader = classLoader;
+ }
+
+ public String getDeploymentName()
+ {
+ return deploymentName;
+ }
+
+ public void setDeploymentName(String deploymentName)
+ {
+ this.deploymentName = deploymentName;
+ }
+
+ public String getSecurityDomain()
+ {
+ return securityDomain;
+ }
+
+ public void setSecurityDomain(String domain)
+ {
+ String prefix = "java:/jaas/";
+ if (domain != null && domain.startsWith(prefix))
+ domain = domain.substring(prefix.length());
+
+ this.securityDomain = domain;
+ }
+
+ public List<ServiceMetaData> getServices()
+ {
+ return new ArrayList<ServiceMetaData>(services);
+ }
+
+ public void addService(ServiceMetaData serviceMetaData)
+ {
+ services.add(serviceMetaData);
+ }
+
+ public void addWSDLDefinition(String wsdlFile, WSDLDefinitions wsdlDefinitions)
+ {
+ wsdlMap.put(wsdlFile, wsdlDefinitions);
+ }
+
+ public WSDLDefinitions getWSDLDefinition(String wsdlFile)
+ {
+ return wsdlMap.get(wsdlFile);
+ }
+
+ public void addMappingDefinition(String jaxrpcFile, JavaWsdlMapping javaWsdlMapping)
+ {
+ jaxrpcMap.put(jaxrpcFile, javaWsdlMapping);
+ }
+
+ public JavaWsdlMapping getMappingDefinition(String jaxrpcFile)
+ {
+ return jaxrpcMap.get(jaxrpcFile);
+ }
+
+ public void validate()
+ {
+ if (validated == false)
+ {
+ for (ServiceMetaData service : services)
+ {
+ service.validate();
+ }
+ validated = true;
+ }
+ }
+
+ public boolean isEagerInitialized()
+ {
+ return eagerInitialized;
+ }
+
+ /**
+ * Eagerly initialize all cache values that are normally lazy-loaded. This
+ * allows for concurrent read-only access to a
<code>UnifiedMetaData</code>
+ * instance. This method, however, must be called from a single thread.
+ */
+ public void eagerInitialize()
+ {
+ if (eagerInitialized == false)
+ {
+ log.debug("Eagerly initialize the meta data model");
+ for (ServiceMetaData service : services)
+ {
+ service.eagerInitialize();
+ }
+ eagerInitialized = true;
+ }
+ }
+
+ public static String getImplementationVersion()
+ {
+ if (implementationVersion == null)
+ {
+ implementationVersion =
ServiceEndpointManager.class.getPackage().getImplementationVersion();
+ if (implementationVersion != null)
+ isFinalRelease = new
StringTokenizer(implementationVersion).nextToken().endsWith(".GA");
+ }
+ return implementationVersion;
+ }
+
+ public static boolean isFinalRelease()
+ {
+ getImplementationVersion();
+ return isFinalRelease;
+ }
+
+ public String toString()
+ {
+ StringBuilder buffer = new StringBuilder("\nUnifiedMetaData: ");
+ buffer.append("\n implementation: " + getImplementationVersion());
+ buffer.append("\n deploymentName: " + getDeploymentName());
+ buffer.append("\n securityDomain: " + getSecurityDomain());
+ //buffer.append("\n resourceLoader: " + resourceLoader);
+ //buffer.append("\n classLoader: " + classLoader);
+ buffer.append("\n");
+
+ for (ServiceMetaData serviceMetaData : services)
+ {
+ buffer.append(serviceMetaData);
+ }
+ return buffer.toString();
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/WrappedParameter.java
(from rev 1557,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/WrappedParameter.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/WrappedParameter.java 2006-12-05
23:29:55 UTC (rev 1557)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/WrappedParameter.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -0,0 +1,138 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.metadata.umdm;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.ws.utils.JavaUtils;
+
+/**
+ * WrappedParameter represents a document/literal wrapped parameter.
+ *
+ * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public class WrappedParameter
+{
+ public static final int RETURN = -1;
+ private QName name;
+ private String type;
+ private String[] typeArguments;
+ private String variable;
+ private boolean holder = false;
+ private int index = -2;
+ private Accessor accessor;
+
+ public static interface AccessorFactory
+ {
+ public Accessor create(WrappedParameter parameter);
+ }
+
+ public static interface Accessor
+ {
+ public void set(Object bean, Object value);
+ public Object get(Object bean);
+ }
+
+ public WrappedParameter(QName name, String type, String variable, int index)
+ {
+ this.setName(name);
+ this.setType(type);
+ this.setVariable(variable);
+ this.setIndex(index);
+ }
+
+ public Accessor accessor()
+ {
+ return accessor;
+ }
+
+ public void setName(QName name)
+ {
+ this.name = name;
+ }
+
+ public QName getName()
+ {
+ return name;
+ }
+
+ public void setType(String type)
+ {
+ this.type = type;
+ }
+
+ public String getType()
+ {
+ return type;
+ }
+
+ public void setTypeArguments(String[] typeArguments)
+ {
+ this.typeArguments = typeArguments;
+ }
+
+ public String[] getTypeArguments()
+ {
+ return typeArguments;
+ }
+
+ public void setVariable(String variable)
+ {
+ this.variable = variable;
+ }
+
+ public String getVariable()
+ {
+ return variable;
+ }
+
+ public void setHolder(boolean holder)
+ {
+ this.holder = holder;
+ }
+
+ public boolean isHolder()
+ {
+ return holder;
+ }
+
+ public void setIndex(int index)
+ {
+ this.index = index;
+ }
+
+ public int getIndex()
+ {
+ return index;
+ }
+
+ void setAccessor(Accessor accessor)
+ {
+ this.accessor = accessor;
+ }
+
+ public String toString()
+ {
+ return "[name = " + getName() + ", type = " + getType() +
", typeArgs = " + JavaUtils.printArray(getTypeArguments()) + ", variable =
" + getVariable() + ", index = " + getIndex() + "]";
+ }
+}
\ No newline at end of file
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/AbstractServiceEndpointInvoker.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/AbstractServiceEndpointInvoker.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/AbstractServiceEndpointInvoker.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -43,17 +43,17 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.binding.EndpointInvocation;
-import org.jboss.ws.common.CommonBinding;
-import org.jboss.ws.common.CommonBindingProvider;
-import org.jboss.ws.common.CommonMessageContext;
-import org.jboss.ws.common.CommonSOAPBinding;
+import org.jboss.ws.core.CommonBinding;
+import org.jboss.ws.core.CommonBindingProvider;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.CommonSOAPBinding;
import org.jboss.ws.jaxrpc.handler.HandlerDelegateJAXRPC;
import org.jboss.ws.jaxws.core.BindingProviderImpl;
import org.jboss.ws.jaxws.handler.HandlerDelegateJAXWS;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.ServerEndpointMetaData;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.soap.MessageContextAssociation;
import org.jboss.ws.soap.SOAPBodyImpl;
import org.jboss.ws.soap.SOAPMessageImpl;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/AbstractServiceEndpointServlet.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/AbstractServiceEndpointServlet.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/AbstractServiceEndpointServlet.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -37,7 +37,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-import org.jboss.ws.metadata.ServerEndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
import org.jboss.ws.utils.ObjectNameFactory;
/**
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/HandlerDelegate.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/HandlerDelegate.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/HandlerDelegate.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -23,7 +23,7 @@
// $Id$
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
/** An implementation of handles invocations on the endpoint
*
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/ServiceEndpoint.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/ServiceEndpoint.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/ServiceEndpoint.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -38,14 +38,14 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
-import org.jboss.ws.xop.XOPContext;
import org.jboss.ws.binding.BindingException;
-import org.jboss.ws.common.CommonBindingProvider;
-import org.jboss.ws.common.CommonMessageContext;
-import org.jboss.ws.common.CommonSOAPBinding;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.ServerEndpointMetaData;
-import org.jboss.ws.metadata.UnifiedMetaData;
+import org.jboss.ws.core.CommonBindingProvider;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.CommonSOAPBinding;
+import org.jboss.ws.extras.xop.XOPContext;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
import org.jboss.ws.soap.MessageContextAssociation;
import org.jboss.ws.soap.MessageFactoryImpl;
import org.jboss.ws.soap.SOAPElementImpl;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/ServiceEndpointInfo.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/ServiceEndpointInfo.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/ServiceEndpointInfo.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -28,11 +28,11 @@
import org.jboss.ws.WSException;
import org.jboss.ws.deployment.UnifiedDeploymentInfo;
import org.jboss.ws.deployment.UnifiedDeploymentInfo.DeploymentType;
-import org.jboss.ws.metadata.ServerEndpointMetaData;
import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
import org.jboss.ws.metadata.j2ee.UnifiedMessageDrivenMetaData;
import org.jboss.ws.metadata.j2ee.UnifiedSessionMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
/**
* This object registered with the EndpointManager service.
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/ServiceEndpointInvokerJSE.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/ServiceEndpointInvokerJSE.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/ServiceEndpointInvokerJSE.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -33,10 +33,10 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
import org.jboss.ws.binding.EndpointInvocation;
-import org.jboss.ws.common.CommonMessageContext;
+import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.jaxrpc.ServletEndpointContextImpl;
import org.jboss.ws.jaxws.handler.SOAPMessageContextJAXWS;
-import org.jboss.ws.metadata.ServerEndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
import org.jboss.ws.soap.MessageContextAssociation;
/**
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/ServiceEndpointManager.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/ServiceEndpointManager.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/ServiceEndpointManager.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -57,19 +57,19 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-import org.jboss.ws.addressing.AddressingConstantsImpl;
-import org.jboss.ws.common.CommonMessageContext;
-import org.jboss.ws.common.MessageContextPropertyHelper;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.MessageContextPropertyHelper;
+import org.jboss.ws.extras.addressing.AddressingConstantsImpl;
import org.jboss.ws.jaxrpc.handler.MessageContextJAXRPC;
import org.jboss.ws.jaxrpc.handler.SOAPMessageContextJAXRPC;
import org.jboss.ws.jaxws.handler.MessageContextJAXWS;
import org.jboss.ws.jaxws.handler.SOAPMessageContextJAXWS;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.HandlerMetaData;
-import org.jboss.ws.metadata.ServerEndpointMetaData;
-import org.jboss.ws.metadata.UnifiedMetaData;
-import org.jboss.ws.metadata.EndpointMetaData.Type;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.soap.MessageContextAssociation;
import org.jboss.ws.soap.SOAPConnectionImpl;
import org.jboss.ws.utils.ThreadLocalAssociation;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/ServiceEndpointManagerMBean.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/ServiceEndpointManagerMBean.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/ServiceEndpointManagerMBean.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -26,7 +26,7 @@
import javax.management.ObjectName;
-import org.jboss.ws.metadata.HandlerMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData;
import org.jboss.ws.utils.ObjectNameFactory;
/**
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/WSDLFilePublisher.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/WSDLFilePublisher.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/WSDLFilePublisher.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -45,8 +45,8 @@
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
import org.jboss.ws.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.metadata.ServiceMetaData;
-import org.jboss.ws.metadata.UnifiedMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.utils.IOUtils;
import org.w3c.dom.Document;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/WSDLRequestHandler.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/WSDLRequestHandler.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/WSDLRequestHandler.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -29,7 +29,7 @@
import java.net.URL;
import org.jboss.logging.Logger;
-import org.jboss.ws.metadata.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.utils.DOMUtils;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/EndpointInfo.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/EndpointInfo.java 2006-12-06
00:28:12 UTC (rev 1558)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/EndpointInfo.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -28,7 +28,7 @@
import java.util.Map;
import java.util.Properties;
-import org.jboss.ws.metadata.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
/** A wrapper object that associates the target address with some metadata
*
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/MessageContextAssociation.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/MessageContextAssociation.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/MessageContextAssociation.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -26,7 +26,7 @@
import java.util.Stack;
import org.jboss.logging.Logger;
-import org.jboss.ws.common.CommonMessageContext;
+import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.utils.ThreadLocalAssociation;
/**
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/MessageFactoryImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/MessageFactoryImpl.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/MessageFactoryImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -42,7 +42,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
-import org.jboss.ws.common.CommonMessageContext;
+import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.jaxrpc.Style;
import org.jboss.ws.soap.attachment.MimeConstants;
import org.jboss.ws.soap.attachment.MultipartRelatedDecoder;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/SOAPBodyImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/SOAPBodyImpl.java 2006-12-06
00:28:12 UTC (rev 1558)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/SOAPBodyImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -48,8 +48,8 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-import org.jboss.ws.common.CommonMessageContext;
-import org.jboss.ws.metadata.UnifiedMetaData;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
import org.jboss.ws.utils.DOMUtils;
import org.jboss.ws.utils.DOMWriter;
import org.w3c.dom.DOMException;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/SOAPConnectionImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/SOAPConnectionImpl.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/SOAPConnectionImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -46,8 +46,8 @@
import org.jboss.remoting.transport.http.HTTPMetadataConstants;
import org.jboss.ws.binding.soap.SOAPMessageMarshaller;
import org.jboss.ws.binding.soap.SOAPMessageUnMarshaller;
+import org.jboss.ws.extras.xop.XOPContext;
import org.jboss.ws.jaxrpc.StubExt;
-import org.jboss.ws.xop.XOPContext;
/**
* SOAPConnection implementation
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/SOAPContentElement.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/SOAPContentElement.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/SOAPContentElement.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -31,18 +31,18 @@
import org.jboss.ws.binding.DeserializerSupport;
import org.jboss.ws.binding.SerializationContext;
import org.jboss.ws.binding.SerializerSupport;
-import org.jboss.ws.common.CommonMessageContext;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.extras.xop.XOPContext;
import org.jboss.ws.jaxrpc.TypeMappingImpl;
import org.jboss.ws.jaxrpc.encoding.DeserializerFactoryBase;
import org.jboss.ws.jaxrpc.encoding.NullValueSerializer;
import org.jboss.ws.jaxrpc.encoding.SerializerFactoryBase;
-import org.jboss.ws.metadata.ParameterMetaData;
-import org.jboss.ws.metadata.UnifiedMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
import org.jboss.ws.utils.DOMUtils;
import org.jboss.ws.utils.DOMWriter;
import org.jboss.ws.utils.JavaUtils;
import org.jboss.ws.utils.MimeUtils;
-import org.jboss.ws.xop.XOPContext;
import org.w3c.dom.*;
import javax.xml.namespace.QName;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/SOAPMessageDispatcher.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/SOAPMessageDispatcher.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/SOAPMessageDispatcher.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -35,10 +35,10 @@
import javax.xml.ws.addressing.JAXWSAConstants;
import org.jboss.logging.Logger;
-import org.jboss.ws.common.CommonMessageContext;
+import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.OperationMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
/**
* Derive the operation meta data from incomming SOAP message
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/SOAPMessageImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/SOAPMessageImpl.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/SOAPMessageImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -41,15 +41,15 @@
import javax.xml.soap.SOAPPart;
import org.jboss.ws.WSException;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.OperationMetaData;
+import org.jboss.ws.extras.xop.XOPContext;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.soap.attachment.AttachmentPartImpl;
import org.jboss.ws.soap.attachment.CIDGenerator;
import org.jboss.ws.soap.attachment.MimeConstants;
import org.jboss.ws.soap.attachment.MultipartRelatedEncoder;
import org.jboss.ws.soap.attachment.MultipartRelatedSwAEncoder;
import org.jboss.ws.soap.attachment.MultipartRelatedXOPEncoder;
-import org.jboss.ws.xop.XOPContext;
/**
* The root class for all SOAP messages. As transmitted on the "wire", a SOAP
message is an XML document or a
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL.java 2006-12-06
00:28:12 UTC (rev 1558)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -35,8 +35,8 @@
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.metadata.UnifiedMetaData;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.tools.Configuration.OperationConfig;
import org.jboss.ws.tools.metadata.ToolsUnifiedMetaDataBuilder;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL11.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL11.java 2006-12-06
00:28:12 UTC (rev 1558)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL11.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -30,10 +30,10 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.ServiceMetaData;
-import org.jboss.ws.metadata.UnifiedMetaData;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLUtils;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/SourceWrapperGenerator.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/SourceWrapperGenerator.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/SourceWrapperGenerator.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -34,10 +34,10 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
import org.jboss.ws.jaxws.WrapperGenerator;
-import org.jboss.ws.metadata.FaultMetaData;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.ParameterMetaData;
-import org.jboss.ws.metadata.WrappedParameter;
+import org.jboss.ws.metadata.umdm.FaultMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.jboss.ws.metadata.umdm.WrappedParameter;
import org.jboss.ws.utils.JavaUtils;
import com.sun.codemodel.JAnnotationArrayMember;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -40,15 +40,9 @@
import org.apache.xerces.xs.XSTypeDefinition;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-import org.jboss.ws.common.CommonSOAPBinding;
+import org.jboss.ws.core.CommonSOAPBinding;
import org.jboss.ws.jaxrpc.LiteralTypeMapping;
import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.FaultMetaData;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.ParameterMetaData;
-import org.jboss.ws.metadata.ServerEndpointMetaData;
-import org.jboss.ws.metadata.WrappedParameter;
import org.jboss.ws.metadata.jaxrpcmapping.ExceptionMapping;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.jaxrpcmapping.JavaXmlTypeMapping;
@@ -61,6 +55,12 @@
import org.jboss.ws.metadata.jaxrpcmapping.VariableMapping;
import org.jboss.ws.metadata.jaxrpcmapping.WsdlMessageMapping;
import org.jboss.ws.metadata.jaxrpcmapping.WsdlReturnValueMapping;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.FaultMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.ws.metadata.umdm.WrappedParameter;
import org.jboss.ws.metadata.wsdl.NCName;
import org.jboss.ws.metadata.wsdl.WSDLBinding;
import org.jboss.ws.metadata.wsdl.WSDLBindingFault;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -40,14 +40,14 @@
import org.jboss.ws.WSException;
import org.jboss.ws.jaxrpc.LiteralTypeMapping;
import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.ParameterMetaData;
-import org.jboss.ws.metadata.ServiceMetaData;
-import org.jboss.ws.metadata.UnifiedMetaData;
-import org.jboss.ws.metadata.WrappedParameter;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.jaxrpcmapping.JavaXmlTypeMapping;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+import org.jboss.ws.metadata.umdm.WrappedParameter;
import org.jboss.ws.metadata.wsdl.NCName;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLService;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/jaxws/JAXBWSDLGenerator.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/jaxws/JAXBWSDLGenerator.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/jaxws/JAXBWSDLGenerator.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -31,8 +31,8 @@
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
+import org.jboss.ws.extras.security.Util;
import org.jboss.ws.metadata.wsdl.DOMTypes;
-import org.jboss.ws.wsse.Util;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/jaxws/WSDLGenerator.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/jaxws/WSDLGenerator.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/jaxws/WSDLGenerator.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -28,12 +28,12 @@
import org.jboss.ws.Constants;
import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.FaultMetaData;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.ParameterMetaData;
-import org.jboss.ws.metadata.ServerEndpointMetaData;
-import org.jboss.ws.metadata.ServiceMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.FaultMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
import org.jboss.ws.metadata.wsdl.NCName;
import org.jboss.ws.metadata.wsdl.WSDLBinding;
import org.jboss.ws.metadata.wsdl.WSDLBindingFault;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/metadata/ReflectiveMetaDataBuilder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/metadata/ReflectiveMetaDataBuilder.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/metadata/ReflectiveMetaDataBuilder.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -36,10 +36,10 @@
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
import org.jboss.ws.jaxrpc.ParameterWrapping;
-import org.jboss.ws.metadata.FaultMetaData;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.ParameterMetaData;
-import org.jboss.ws.metadata.WrappedParameter;
+import org.jboss.ws.metadata.umdm.FaultMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.jboss.ws.metadata.umdm.WrappedParameter;
import org.jboss.ws.metadata.wsdl.WSDLUtils;
import org.jboss.ws.tools.ToolsUtils;
import org.jboss.ws.tools.Configuration.OperationConfig;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/metadata/ToolsAnnotationMetaDataBuilder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/metadata/ToolsAnnotationMetaDataBuilder.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/metadata/ToolsAnnotationMetaDataBuilder.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -37,9 +37,9 @@
import org.jboss.ws.WSException;
import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.metadata.FaultMetaData;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.ParameterMetaData;
+import org.jboss.ws.metadata.umdm.FaultMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
import org.jboss.ws.metadata.wsdl.WSDLUtils;
import org.jboss.ws.tools.ToolsUtils;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/metadata/ToolsEndpointMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/metadata/ToolsEndpointMetaData.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/metadata/ToolsEndpointMetaData.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -26,8 +26,8 @@
import javax.xml.namespace.QName;
import org.jboss.util.NotImplementedException;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.ServiceMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
/**
* Tools Endpoint Metadata
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/metadata/ToolsUnifiedMetaDataBuilder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/metadata/ToolsUnifiedMetaDataBuilder.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/metadata/ToolsUnifiedMetaDataBuilder.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -33,8 +33,8 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.metadata.ServiceMetaData;
-import org.jboss.ws.metadata.UnifiedMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
import org.jboss.ws.metadata.wsdl.WSDLUtils;
import org.jboss.ws.tools.Configuration.OperationConfig;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/utils/ThreadLocalAssociation.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/utils/ThreadLocalAssociation.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/utils/ThreadLocalAssociation.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -25,8 +25,8 @@
import java.util.Stack;
-import org.jboss.ws.common.CommonMessageContext;
-import org.jboss.ws.wsse.SecurityStore;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.extras.security.SecurityStore;
/**
* Maintain thread locals at a single point.
@@ -49,7 +49,7 @@
private static ThreadLocal<Stack<CommonMessageContext>> msgContextAssoc =
new ThreadLocal<Stack<CommonMessageContext>>();
/**
- * @see org.jboss.ws.wsse.STRTransform
+ * @see org.jboss.ws.extras.security.STRTransform
*/
private static ThreadLocal<SecurityStore> strTransformAssoc = new
ThreadLocal<SecurityStore>();
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -38,15 +38,15 @@
import org.jboss.ws.Constants;
import org.jboss.ws.binding.EndpointInvocation;
import org.jboss.ws.binding.UnboundHeader;
-import org.jboss.ws.common.CommonBinding;
-import org.jboss.ws.common.CommonBindingProvider;
-import org.jboss.ws.common.CommonMessageContext;
-import org.jboss.ws.common.CommonSOAPBinding;
+import org.jboss.ws.core.CommonBinding;
+import org.jboss.ws.core.CommonBindingProvider;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.CommonSOAPBinding;
import org.jboss.ws.jaxrpc.CallImpl;
import org.jboss.ws.jaxrpc.handler.SOAPMessageContextJAXRPC;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.ParameterMetaData;
-import org.jboss.ws.metadata.EndpointMetaData.Type;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
import org.jboss.ws.soap.MessageContextAssociation;
import org.jboss.ws.soap.MessageFactoryImpl;
import org.jboss.ws.utils.DOMUtils;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/soap/attachment/GenericAttachmentTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/soap/attachment/GenericAttachmentTestCase.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/soap/attachment/GenericAttachmentTestCase.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -42,13 +42,13 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.Constants;
import org.jboss.ws.binding.EndpointInvocation;
-import org.jboss.ws.common.CommonBinding;
-import org.jboss.ws.common.CommonBindingProvider;
-import org.jboss.ws.common.CommonSOAPBinding;
+import org.jboss.ws.core.CommonBinding;
+import org.jboss.ws.core.CommonBindingProvider;
+import org.jboss.ws.core.CommonSOAPBinding;
import org.jboss.ws.jaxrpc.CallImpl;
import org.jboss.ws.jaxrpc.handler.SOAPMessageContextJAXRPC;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.EndpointMetaData.Type;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
import org.jboss.ws.soap.MessageContextAssociation;
import org.jboss.ws.soap.MessageFactoryImpl;
import org.jboss.ws.soap.attachment.MimeConstants;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDL11TestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDL11TestCase.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDL11TestCase.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -27,7 +27,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.Constants;
-import org.jboss.ws.eventing.EventingConstants;
+import org.jboss.ws.extras.eventing.EventingConstants;
import org.jboss.ws.metadata.wsdl.NCName;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1179/TestEndpointImpl.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1179/TestEndpointImpl.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1179/TestEndpointImpl.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -25,7 +25,7 @@
import javax.servlet.http.HttpSession;
-import org.jboss.ws.common.CommonMessageContext;
+import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.jaxrpc.handler.MessageContextJAXRPC;
import org.jboss.ws.soap.MessageContextAssociation;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/dynamichandler/DynamicHandlerTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/dynamichandler/DynamicHandlerTestCase.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/dynamichandler/DynamicHandlerTestCase.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -36,7 +36,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.jaxrpc.ServiceExt;
-import org.jboss.ws.metadata.HandlerMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData;
import org.jboss.ws.utils.ObjectNameFactory;
/**
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wseventing/SysmonTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wseventing/SysmonTestCase.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wseventing/SysmonTestCase.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -42,18 +42,18 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.addressing.AddressingClientUtil;
-import org.jboss.ws.addressing.jaxrpc.WSAddressingClientHandler;
-import org.jboss.ws.eventing.EventSourceEndpoint;
-import org.jboss.ws.eventing.EventingConstants;
-import org.jboss.ws.eventing.SubscriptionManagerEndpoint;
-import org.jboss.ws.eventing.element.DeliveryType;
-import org.jboss.ws.eventing.element.EndpointReference;
-import org.jboss.ws.eventing.element.FilterType;
-import org.jboss.ws.eventing.element.StatusRequest;
-import org.jboss.ws.eventing.element.SubscribeRequest;
-import org.jboss.ws.eventing.element.SubscribeResponse;
-import org.jboss.ws.eventing.element.UnsubscribeRequest;
+import org.jboss.ws.extras.addressing.AddressingClientUtil;
+import org.jboss.ws.extras.addressing.jaxrpc.WSAddressingClientHandler;
+import org.jboss.ws.extras.eventing.EventSourceEndpoint;
+import org.jboss.ws.extras.eventing.EventingConstants;
+import org.jboss.ws.extras.eventing.SubscriptionManagerEndpoint;
+import org.jboss.ws.extras.eventing.element.DeliveryType;
+import org.jboss.ws.extras.eventing.element.EndpointReference;
+import org.jboss.ws.extras.eventing.element.FilterType;
+import org.jboss.ws.extras.eventing.element.StatusRequest;
+import org.jboss.ws.extras.eventing.element.SubscribeRequest;
+import org.jboss.ws.extras.eventing.element.SubscribeResponse;
+import org.jboss.ws.extras.eventing.element.UnsubscribeRequest;
import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
import org.jboss.ws.jaxrpc.ServiceImpl;
import org.jboss.ws.jaxrpc.StubExt;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wseventing/SysmonUtil.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wseventing/SysmonUtil.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wseventing/SysmonUtil.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -10,9 +10,9 @@
import javax.xml.ws.addressing.JAXWSAConstants;
import org.jboss.logging.Logger;
-import org.jboss.ws.addressing.AddressingClientUtil;
-import org.jboss.ws.eventing.element.EndpointReference;
-import org.jboss.ws.eventing.element.SubscribeResponse;
+import org.jboss.ws.extras.addressing.AddressingClientUtil;
+import org.jboss.ws.extras.eventing.element.EndpointReference;
+import org.jboss.ws.extras.eventing.element.SubscribeResponse;
/**
* Util methods that drive the SysmoneTestCase.
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/SimpleEncryptTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/SimpleEncryptTestCase.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/SimpleEncryptTestCase.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -37,9 +37,9 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.ws.extras.security.jaxrpc.WSSecurityHandlerOutbound;
import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
import org.jboss.ws.jaxrpc.ServiceImpl;
-import org.jboss.ws.wsse.jaxrpc.WSSecurityHandlerOutbound;
/**
* Test WS-Security with RPC/Literal
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/SimpleSignTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/SimpleSignTestCase.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/SimpleSignTestCase.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -37,9 +37,9 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.ws.extras.security.jaxrpc.WSSecurityHandlerOutbound;
import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
import org.jboss.ws.jaxrpc.ServiceImpl;
-import org.jboss.ws.wsse.jaxrpc.WSSecurityHandlerOutbound;
/**
* Test WS-Security with RPC/Literal
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/StorePassEncryptTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/StorePassEncryptTestCase.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/StorePassEncryptTestCase.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -37,9 +37,9 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.ws.extras.security.jaxrpc.WSSecurityHandlerOutbound;
import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
import org.jboss.ws.jaxrpc.ServiceImpl;
-import org.jboss.ws.wsse.jaxrpc.WSSecurityHandlerOutbound;
/**
* This test simulates simulates the usage of a jboss-ws-security keystore and truststore
use cases
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/DIIClientTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/DIIClientTestCase.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/DIIClientTestCase.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -43,17 +43,17 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.addressing.AddressingClientUtil;
-import org.jboss.ws.addressing.jaxrpc.WSAddressingClientHandler;
-import org.jboss.ws.eventing.EventSourceEndpoint;
-import org.jboss.ws.eventing.EventingConstants;
-import org.jboss.ws.eventing.SubscriptionManagerEndpoint;
-import org.jboss.ws.eventing.element.DeliveryType;
-import org.jboss.ws.eventing.element.EndpointReference;
-import org.jboss.ws.eventing.element.FilterType;
-import org.jboss.ws.eventing.element.SubscribeRequest;
-import org.jboss.ws.eventing.element.SubscribeResponse;
-import org.jboss.ws.eventing.element.UnsubscribeRequest;
+import org.jboss.ws.extras.addressing.AddressingClientUtil;
+import org.jboss.ws.extras.addressing.jaxrpc.WSAddressingClientHandler;
+import org.jboss.ws.extras.eventing.EventSourceEndpoint;
+import org.jboss.ws.extras.eventing.EventingConstants;
+import org.jboss.ws.extras.eventing.SubscriptionManagerEndpoint;
+import org.jboss.ws.extras.eventing.element.DeliveryType;
+import org.jboss.ws.extras.eventing.element.EndpointReference;
+import org.jboss.ws.extras.eventing.element.FilterType;
+import org.jboss.ws.extras.eventing.element.SubscribeRequest;
+import org.jboss.ws.extras.eventing.element.SubscribeResponse;
+import org.jboss.ws.extras.eventing.element.UnsubscribeRequest;
import org.jboss.ws.jaxrpc.ServiceExt;
import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
import org.jboss.ws.jaxrpc.StubExt;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingSupport.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingSupport.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingSupport.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -35,15 +35,15 @@
import javax.xml.ws.addressing.JAXWSAConstants;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.addressing.AddressingClientUtil;
-import org.jboss.ws.eventing.EventSourceEndpoint;
-import org.jboss.ws.eventing.EventingConstants;
-import org.jboss.ws.eventing.SubscriptionManagerEndpoint;
-import org.jboss.ws.eventing.element.DeliveryType;
-import org.jboss.ws.eventing.element.EndpointReference;
-import org.jboss.ws.eventing.element.FilterType;
-import org.jboss.ws.eventing.element.SubscribeRequest;
-import org.jboss.ws.eventing.element.SubscribeResponse;
+import org.jboss.ws.extras.addressing.AddressingClientUtil;
+import org.jboss.ws.extras.eventing.EventSourceEndpoint;
+import org.jboss.ws.extras.eventing.EventingConstants;
+import org.jboss.ws.extras.eventing.SubscriptionManagerEndpoint;
+import org.jboss.ws.extras.eventing.element.DeliveryType;
+import org.jboss.ws.extras.eventing.element.EndpointReference;
+import org.jboss.ws.extras.eventing.element.FilterType;
+import org.jboss.ws.extras.eventing.element.SubscribeRequest;
+import org.jboss.ws.extras.eventing.element.SubscribeResponse;
import org.jboss.ws.jaxrpc.StubExt;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingTestCase.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingTestCase.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -32,16 +32,16 @@
import junit.framework.Test;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.addressing.AddressingClientUtil;
-import org.jboss.ws.eventing.EventingConstants;
-import org.jboss.ws.eventing.element.DeliveryType;
-import org.jboss.ws.eventing.element.RenewRequest;
-import org.jboss.ws.eventing.element.RenewResponse;
-import org.jboss.ws.eventing.element.StatusRequest;
-import org.jboss.ws.eventing.element.StatusResponse;
-import org.jboss.ws.eventing.element.SubscribeRequest;
-import org.jboss.ws.eventing.element.SubscribeResponse;
-import org.jboss.ws.eventing.element.UnsubscribeRequest;
+import org.jboss.ws.extras.addressing.AddressingClientUtil;
+import org.jboss.ws.extras.eventing.EventingConstants;
+import org.jboss.ws.extras.eventing.element.DeliveryType;
+import org.jboss.ws.extras.eventing.element.RenewRequest;
+import org.jboss.ws.extras.eventing.element.RenewResponse;
+import org.jboss.ws.extras.eventing.element.StatusRequest;
+import org.jboss.ws.extras.eventing.element.StatusResponse;
+import org.jboss.ws.extras.eventing.element.SubscribeRequest;
+import org.jboss.ws.extras.eventing.element.SubscribeResponse;
+import org.jboss.ws.extras.eventing.element.UnsubscribeRequest;
import org.jboss.ws.jaxrpc.StubExt;
/**
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/NotificationTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/NotificationTestCase.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/NotificationTestCase.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -28,9 +28,9 @@
import junit.framework.Test;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.eventing.EventingConstants;
-import org.jboss.ws.eventing.element.SubscribeResponse;
-import org.jboss.ws.eventing.mgmt.EventDispatcher;
+import org.jboss.ws.extras.eventing.EventingConstants;
+import org.jboss.ws.extras.eventing.element.SubscribeResponse;
+import org.jboss.ws.extras.eventing.mgmt.EventDispatcher;
import org.jboss.ws.utils.DOMUtils;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/SubscriptionManagerTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/SubscriptionManagerTestCase.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/SubscriptionManagerTestCase.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -27,12 +27,12 @@
import java.util.Date;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.eventing.EventingConstants;
-import org.jboss.ws.eventing.deployment.EventingEndpointDI;
-import org.jboss.ws.eventing.element.EndpointReference;
-import org.jboss.ws.eventing.mgmt.Filter;
-import org.jboss.ws.eventing.mgmt.SubscriptionManager;
-import org.jboss.ws.eventing.mgmt.SubscriptionTicket;
+import org.jboss.ws.extras.eventing.EventingConstants;
+import org.jboss.ws.extras.eventing.deployment.EventingEndpointDI;
+import org.jboss.ws.extras.eventing.element.EndpointReference;
+import org.jboss.ws.extras.eventing.mgmt.Filter;
+import org.jboss.ws.extras.eventing.mgmt.SubscriptionManager;
+import org.jboss.ws.extras.eventing.mgmt.SubscriptionTicket;
import org.jboss.ws.utils.DOMUtils;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/MicrosoftInteropTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/MicrosoftInteropTestCase.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/MicrosoftInteropTestCase.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -32,12 +32,12 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.test.ws.JBossWSTest;
+import org.jboss.ws.extras.security.Constants;
+import org.jboss.ws.extras.security.SecurityDecoder;
+import org.jboss.ws.extras.security.SecurityStore;
+import org.jboss.ws.extras.security.Util;
import org.jboss.ws.soap.MessageFactoryImpl;
import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.wsse.Constants;
-import org.jboss.ws.wsse.SecurityDecoder;
-import org.jboss.ws.wsse.SecurityStore;
-import org.jboss.ws.wsse.Util;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/RoundTripTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/RoundTripTestCase.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/RoundTripTestCase.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -34,23 +34,23 @@
import org.jboss.security.SecurityAssociation;
import org.jboss.test.ws.JBossWSTest;
+import org.jboss.ws.extras.security.Constants;
+import org.jboss.ws.extras.security.EncryptionOperation;
+import org.jboss.ws.extras.security.OperationDescription;
+import org.jboss.ws.extras.security.QNameTarget;
+import org.jboss.ws.extras.security.RequireEncryptionOperation;
+import org.jboss.ws.extras.security.RequireSignatureOperation;
+import org.jboss.ws.extras.security.SecurityDecoder;
+import org.jboss.ws.extras.security.SecurityEncoder;
+import org.jboss.ws.extras.security.SecurityStore;
+import org.jboss.ws.extras.security.SendUsernameOperation;
+import org.jboss.ws.extras.security.SignatureOperation;
+import org.jboss.ws.extras.security.Target;
+import org.jboss.ws.extras.security.TimestampOperation;
+import org.jboss.ws.extras.security.Util;
+import org.jboss.ws.extras.security.WsuIdTarget;
import org.jboss.ws.soap.MessageFactoryImpl;
import org.jboss.ws.utils.DOMWriter;
-import org.jboss.ws.wsse.Constants;
-import org.jboss.ws.wsse.EncryptionOperation;
-import org.jboss.ws.wsse.OperationDescription;
-import org.jboss.ws.wsse.QNameTarget;
-import org.jboss.ws.wsse.RequireEncryptionOperation;
-import org.jboss.ws.wsse.RequireSignatureOperation;
-import org.jboss.ws.wsse.SecurityDecoder;
-import org.jboss.ws.wsse.SecurityEncoder;
-import org.jboss.ws.wsse.SecurityStore;
-import org.jboss.ws.wsse.SendUsernameOperation;
-import org.jboss.ws.wsse.SignatureOperation;
-import org.jboss.ws.wsse.Target;
-import org.jboss.ws.wsse.TimestampOperation;
-import org.jboss.ws.wsse.Util;
-import org.jboss.ws.wsse.WsuIdTarget;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/SunInteropTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/SunInteropTestCase.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/SunInteropTestCase.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -31,12 +31,12 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.test.ws.JBossWSTest;
+import org.jboss.ws.extras.security.Constants;
+import org.jboss.ws.extras.security.SecurityDecoder;
+import org.jboss.ws.extras.security.SecurityStore;
+import org.jboss.ws.extras.security.Util;
import org.jboss.ws.soap.MessageFactoryImpl;
import org.jboss.ws.utils.DOMWriter;
-import org.jboss.ws.wsse.Constants;
-import org.jboss.ws.wsse.SecurityDecoder;
-import org.jboss.ws.wsse.SecurityStore;
-import org.jboss.ws.wsse.Util;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/XOPTypeDefTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/XOPTypeDefTestCase.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/XOPTypeDefTestCase.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -7,10 +7,10 @@
import org.apache.xerces.xs.XSComplexTypeDefinition;
import org.apache.xerces.xs.XSModel;
import org.apache.xerces.xs.XSTypeDefinition;
+import org.jboss.ws.extras.xop.jaxrpc.XOPScanner;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
import org.jboss.ws.metadata.wsdl.xmlschema.WSSchemaUtils;
import org.jboss.ws.metadata.wsdl.xsd.SchemaUtils;
-import org.jboss.ws.xop.jaxrpc.XOPScanner;
import org.jboss.xb.binding.NamespaceRegistry;
/**
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/MTOMServiceBase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/MTOMServiceBase.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/MTOMServiceBase.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -21,10 +21,10 @@
*/
package org.jboss.test.ws.jaxrpc.xop.shared;
-import org.jboss.ws.common.CommonMessageContext;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.extras.xop.XOPContext;
import org.jboss.ws.soap.MessageContextAssociation;
import org.jboss.ws.jaxrpc.StubExt;
-import org.jboss.ws.xop.XOPContext;
import java.util.StringTokenizer;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webparam/JSR181WebParamTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webparam/JSR181WebParamTestCase.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webparam/JSR181WebParamTestCase.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -34,8 +34,8 @@
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.jaxrpc.CallImpl;
import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.ParameterMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
/**
* Test the JSR-181 annotation: javax.jws.WebParam
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webresult/JSR181WebResultTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webresult/JSR181WebResultTestCase.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webresult/JSR181WebResultTestCase.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -39,7 +39,7 @@
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.jaxrpc.CallImpl;
import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.metadata.OperationMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.soap.NameImpl;
/**
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/handler/SOAPMessageTrace.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/handler/SOAPMessageTrace.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/handler/SOAPMessageTrace.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -22,7 +22,7 @@
package org.jboss.test.ws.jaxws.samples.retail.handler;
import org.jboss.ws.jaxws.handler.GenericSOAPHandler;
-import org.jboss.ws.common.CommonMessageContext;
+import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.soap.MessageContextAssociation;
import org.jboss.ws.soap.SOAPMessageImpl;
import org.jboss.ws.soap.SOAPElementWriter;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/wsaddressing/AddressingStatefulTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/wsaddressing/AddressingStatefulTestCase.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/wsaddressing/AddressingStatefulTestCase.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -33,7 +33,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.addressing.jaxws.WSAddressingClientHandler;
+import org.jboss.ws.extras.addressing.jaxws.WSAddressingClientHandler;
/**
* Test stateful endpoint using ws-addressing
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/EndpointReferenceTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/EndpointReferenceTestCase.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/EndpointReferenceTestCase.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -24,7 +24,7 @@
//$Id$
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.addressing.EndpointReferenceImpl;
+import org.jboss.ws.extras.addressing.EndpointReferenceImpl;
import org.jboss.ws.utils.DOMUtils;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/xop/MimeDeclarationTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/xop/MimeDeclarationTestCase.java 2006-12-06
00:28:12 UTC (rev 1558)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/xop/MimeDeclarationTestCase.java 2006-12-06
00:29:48 UTC (rev 1559)
@@ -27,7 +27,7 @@
import java.awt.*;
import java.lang.reflect.Method;
-import org.jboss.ws.xop.jaxws.ReflectiveXOPScanner;
+import org.jboss.ws.extras.xop.jaxws.ReflectiveXOPScanner;
/**
* Test the ReflectiveXOPScanner.