Author: thomas.diesler(a)jboss.com
Date: 2006-12-07 05:43:36 -0500 (Thu, 07 Dec 2006)
New Revision: 1600
Added:
trunk/src/main/java/org/jboss/ws/Constants.java
trunk/src/main/java/org/jboss/ws/core/
trunk/src/main/java/org/jboss/ws/core/CommonClient.java
trunk/src/main/java/org/jboss/ws/core/CommonContextServlet.java
trunk/src/main/java/org/jboss/ws/core/CommonMessageContext.java
trunk/src/main/java/org/jboss/ws/core/EndpointInvocation.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/
trunk/src/main/java/org/jboss/ws/core/jaxrpc/CallImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/CallProxy.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/EncodedTypeMapping.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/HandlerRegistryImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/LiteralTypeMapping.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/ParameterWrapping.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAP11BindingJAXRPC.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAP12BindingJAXRPC.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAPBindingJAXRPC.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAPFaultHelperJAXRPC.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/SchemaGenerator.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/SerializationContextJAXRPC.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceExt.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceFactoryImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceObjectFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceProxy.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceReferenceable.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServletEndpointContextImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/StubExt.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/Style.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingRegistryImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/UnqualifiedCallParameter.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/UnqualifiedFaultException.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/Use.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/Base64Deserializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/Base64DeserializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/Base64Serializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/Base64SerializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/BindingException.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarDeserializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarDeserializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarSerializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarSerializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CommonBinding.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CommonBindingProvider.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CommonSOAP11Binding.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CommonSOAP12Binding.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CommonSOAPBinding.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ComplexTypeDeserializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ComplexTypeSerializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DateDeserializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DateDeserializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DateSerializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DateSerializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DeserializerFactoryBase.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DeserializerSupport.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementDeserializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementDeserializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementSerializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementSerializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/HexDeserializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/HexDeserializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/HexSerializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/HexSerializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/JBossXBDeserializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/JBossXBDeserializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/JBossXBSerializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/JBossXBSerializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/NullValueSerializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/QNameDeserializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/QNameDeserializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/QNameSerializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/QNameSerializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArrayDeserializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArrayDeserializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArraySerializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArraySerializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementDeserializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementDeserializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementSerializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementSerializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SerializationContext.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SerializerFactoryBase.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SerializerSupport.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleDeserializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleDeserializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleSerializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleSerializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBConstants.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBMarshaller.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBMarshallerImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBSupport.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBUnmarshaller.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBUnmarshallerImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/MarshalException.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/SchemaBindingBuilder.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/UnmarshalException.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/XercesXSMarshallerImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/
trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/ClientHandlerChain.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerChainBaseImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerWrapper.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/MessageContextJAXRPC.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/SOAPMessageContextJAXRPC.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/ServerHandlerChain.java
trunk/src/main/java/org/jboss/ws/core/jaxws/
trunk/src/main/java/org/jboss/ws/core/jaxws/DynamicWrapperGenerator.java
trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java
trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java
trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxws/SOAPFaultHelperJAXWS.java
trunk/src/main/java/org/jboss/ws/core/jaxws/SerializationContextJAXWS.java
trunk/src/main/java/org/jboss/ws/core/jaxws/WebServiceContextImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxws/WrapperGenerator.java
trunk/src/main/java/org/jboss/ws/core/jaxws/binding/
trunk/src/main/java/org/jboss/ws/core/jaxws/binding/BindingExt.java
trunk/src/main/java/org/jboss/ws/core/jaxws/binding/BindingImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxws/binding/BindingProviderImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxws/binding/HTTPBindingJAXWS.java
trunk/src/main/java/org/jboss/ws/core/jaxws/binding/MessageBinding.java
trunk/src/main/java/org/jboss/ws/core/jaxws/binding/PayloadBinding.java
trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAP11BindingJAXWS.java
trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAP12BindingJAXWS.java
trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAPBindingJAXWS.java
trunk/src/main/java/org/jboss/ws/core/jaxws/client/
trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientProxy.java
trunk/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxws/client/ResponseImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxws/client/ServiceObjectFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxws/client/ServiceReferenceable.java
trunk/src/main/java/org/jboss/ws/core/jaxws/client/UnifiedServiceRef.java
trunk/src/main/java/org/jboss/ws/core/jaxws/client/WebServiceRefDeployer.java
trunk/src/main/java/org/jboss/ws/core/jaxws/handler/
trunk/src/main/java/org/jboss/ws/core/jaxws/handler/GenericHandler.java
trunk/src/main/java/org/jboss/ws/core/jaxws/handler/GenericLogicalHandler.java
trunk/src/main/java/org/jboss/ws/core/jaxws/handler/GenericSOAPHandler.java
trunk/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java
trunk/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java
trunk/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerResolverImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxws/handler/LogicalMessageContextImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java
trunk/src/main/java/org/jboss/ws/core/jaxws/handler/PortInfoImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxws/handler/SOAPMessageContextJAXWS.java
trunk/src/main/java/org/jboss/ws/core/jaxws/spi/
trunk/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxws/util/
trunk/src/main/java/org/jboss/ws/core/jaxws/util/FactoryFinder.java
trunk/src/main/java/org/jboss/ws/core/server/
trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointPublisher.java
trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointServlet.java
trunk/src/main/java/org/jboss/ws/core/server/EndpointContext.java
trunk/src/main/java/org/jboss/ws/core/server/HandlerDelegate.java
trunk/src/main/java/org/jboss/ws/core/server/HeaderSource.java
trunk/src/main/java/org/jboss/ws/core/server/HttpContext.java
trunk/src/main/java/org/jboss/ws/core/server/HttpServer.java
trunk/src/main/java/org/jboss/ws/core/server/JAXWSDeployment.java
trunk/src/main/java/org/jboss/ws/core/server/KernelLocator.java
trunk/src/main/java/org/jboss/ws/core/server/MessageContextInjector.java
trunk/src/main/java/org/jboss/ws/core/server/MessageContextPropertyHelper.java
trunk/src/main/java/org/jboss/ws/core/server/ServerConfig.java
trunk/src/main/java/org/jboss/ws/core/server/ServerConfigFactory.java
trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpoint.java
trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointDeployer.java
trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInfo.java
trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java
trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvokerJSE.java
trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointManager.java
trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointManagerFactory.java
trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointManagerMBean.java
trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointMetrics.java
trunk/src/main/java/org/jboss/ws/core/server/ServletHeaderSource.java
trunk/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java
trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java
trunk/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java
trunk/src/main/java/org/jboss/ws/core/soap/
trunk/src/main/java/org/jboss/ws/core/soap/AttrImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/DetailEntryImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/DetailImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/DocumentFragmentImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/EndpointInfo.java
trunk/src/main/java/org/jboss/ws/core/soap/JAXWSPayloadBuilder.java
trunk/src/main/java/org/jboss/ws/core/soap/MessageContextAssociation.java
trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/NameImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/NodeImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/NodeListImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/PayloadBuilder.java
trunk/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderDOM.java
trunk/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderStax.java
trunk/src/main/java/org/jboss/ws/core/soap/SAAJVisitable.java
trunk/src/main/java/org/jboss/ws/core/soap/SAAJVisitor.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementDoc.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementMessage.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementRpc.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPConnectionFactoryImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPConnectionImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPDocument.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPElementImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPElementWriter.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPEnvelopeImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPFactoryImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPFaultElementImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPFaultImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPHeaderElementImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPHeaderImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageMarshaller.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshaller.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPPartImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/TextImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/UnboundHeader.java
trunk/src/main/java/org/jboss/ws/core/soap/attachment/
trunk/src/main/java/org/jboss/ws/core/soap/attachment/AttachmentPartImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/attachment/BoundaryDelimitedInputStream.java
trunk/src/main/java/org/jboss/ws/core/soap/attachment/ByteArrayContentHandler.java
trunk/src/main/java/org/jboss/ws/core/soap/attachment/CIDGenerator.java
trunk/src/main/java/org/jboss/ws/core/soap/attachment/ContentHandlerRegistry.java
trunk/src/main/java/org/jboss/ws/core/soap/attachment/ImageDataContentHandler.java
trunk/src/main/java/org/jboss/ws/core/soap/attachment/MimeConstants.java
trunk/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedDecoder.java
trunk/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedEncoder.java
trunk/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedSwAEncoder.java
trunk/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedXOPEncoder.java
trunk/src/main/java/org/jboss/ws/core/soap/attachment/RawByteArrayOutputStream.java
trunk/src/main/java/org/jboss/ws/core/soap/attachment/SimpleBoyerMoore.java
trunk/src/main/java/org/jboss/ws/core/soap/attachment/SwapableMemoryDataSource.java
trunk/src/main/java/org/jboss/ws/core/soap/attachment/XmlDataContentHandler.java
trunk/src/main/java/org/jboss/ws/core/utils/
trunk/src/main/java/org/jboss/ws/core/utils/DOMUtils.java
trunk/src/main/java/org/jboss/ws/core/utils/DOMWriter.java
trunk/src/main/java/org/jboss/ws/core/utils/HolderUtils.java
trunk/src/main/java/org/jboss/ws/core/utils/IOUtils.java
trunk/src/main/java/org/jboss/ws/core/utils/JBossWSEntityResolver.java
trunk/src/main/java/org/jboss/ws/core/utils/JavaUtils.java
trunk/src/main/java/org/jboss/ws/core/utils/JavassistUtils.java
trunk/src/main/java/org/jboss/ws/core/utils/MimeUtils.java
trunk/src/main/java/org/jboss/ws/core/utils/ObjectNameFactory.java
trunk/src/main/java/org/jboss/ws/core/utils/ThreadLocalAssociation.java
trunk/src/main/java/org/jboss/ws/core/utils/UUIDGenerator.java
trunk/src/main/java/org/jboss/ws/core/utils/XMLPredefinedEntityReferenceResolver.java
trunk/src/main/java/org/jboss/ws/extensions/
trunk/src/main/java/org/jboss/ws/extensions/SomeClass.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/
trunk/src/main/java/org/jboss/ws/extensions/addressing/AddressingBuilderImpl.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/AddressingClientUtil.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/AddressingConstantsImpl.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/AddressingPropertiesImpl.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/AddressingTypeImpl.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/AttributeElementExtensibleImpl.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/AttributeExtensibleImpl.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/AttributedQNameImpl.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/AttributedURIImpl.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/ElementExtensibleImpl.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/EndpointReferenceImpl.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/MetadataImpl.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/ReferenceParametersImpl.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/RelationshipImpl.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxrpc/
trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxrpc/WSAddressingClientHandler.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxrpc/WSAddressingServerHandler.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxws/
trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingClientHandler.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingServerHandler.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/metadata/
trunk/src/main/java/org/jboss/ws/extensions/addressing/metadata/AddressingOpMetaExt.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/soap/
trunk/src/main/java/org/jboss/ws/extensions/addressing/soap/SOAPAddressingBuilderImpl.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/soap/SOAPAddressingPropertiesImpl.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/
trunk/src/main/java/org/jboss/ws/extensions/eventing/EventSourceEndpoint.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/EventSourceEndpointImpl.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/EventingConstants.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/EventingEndpointBase.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/EventingService.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/SubscriptionManagerEndpoint.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/SubscriptionManagerEndpointImpl.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/deployment/
trunk/src/main/java/org/jboss/ws/extensions/eventing/deployment/EventingEndpoint.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/deployment/EventingEndpointDI.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/DeliveryType.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/EndpointReference.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/FilterType.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/MetaData.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/ReferenceParameters.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/RenewRequest.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/RenewResponse.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/StatusRequest.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/StatusResponse.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/SubscribeRequest.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/SubscribeResponse.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/SubscriptionEndRequest.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/UnsubscribeRequest.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/metadata/
trunk/src/main/java/org/jboss/ws/extensions/eventing/metadata/EventingEpMetaExt.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatchJob.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatcherDelegate.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatcherFactory.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/EventDispatcher.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/EventSource.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/EventingBuilder.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/Filter.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/Subscription.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionError.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManager.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManagerFactory.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManagerMBean.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionTicket.java
trunk/src/main/java/org/jboss/ws/extensions/policy/
trunk/src/main/java/org/jboss/ws/extensions/policy/Policy.java
trunk/src/main/java/org/jboss/ws/extensions/policy/PolicyAlternative.java
trunk/src/main/java/org/jboss/ws/extensions/policy/PolicyAssertion.java
trunk/src/main/java/org/jboss/ws/extensions/policy/PolicyFactory.java
trunk/src/main/java/org/jboss/ws/extensions/security/
trunk/src/main/java/org/jboss/ws/extensions/security/BinarySecurityTokenValidator.java
trunk/src/main/java/org/jboss/ws/extensions/security/Constants.java
trunk/src/main/java/org/jboss/ws/extensions/security/DecodingOperation.java
trunk/src/main/java/org/jboss/ws/extensions/security/DecryptionOperation.java
trunk/src/main/java/org/jboss/ws/extensions/security/EncodingOperation.java
trunk/src/main/java/org/jboss/ws/extensions/security/EncryptionOperation.java
trunk/src/main/java/org/jboss/ws/extensions/security/FailedAuthenticationException.java
trunk/src/main/java/org/jboss/ws/extensions/security/FailedCheckException.java
trunk/src/main/java/org/jboss/ws/extensions/security/InvalidSecurityHeaderException.java
trunk/src/main/java/org/jboss/ws/extensions/security/InvalidSecurityTokenException.java
trunk/src/main/java/org/jboss/ws/extensions/security/KeyResolver.java
trunk/src/main/java/org/jboss/ws/extensions/security/Operation.java
trunk/src/main/java/org/jboss/ws/extensions/security/OperationDescription.java
trunk/src/main/java/org/jboss/ws/extensions/security/QNameTarget.java
trunk/src/main/java/org/jboss/ws/extensions/security/ReceiveUsernameOperation.java
trunk/src/main/java/org/jboss/ws/extensions/security/RequireEncryptionOperation.java
trunk/src/main/java/org/jboss/ws/extensions/security/RequireOperation.java
trunk/src/main/java/org/jboss/ws/extensions/security/RequireSignatureOperation.java
trunk/src/main/java/org/jboss/ws/extensions/security/RequireTargetableOperation.java
trunk/src/main/java/org/jboss/ws/extensions/security/RequireTimestampOperation.java
trunk/src/main/java/org/jboss/ws/extensions/security/STRTransform.java
trunk/src/main/java/org/jboss/ws/extensions/security/SecurityAdaptor.java
trunk/src/main/java/org/jboss/ws/extensions/security/SecurityAdaptorFactory.java
trunk/src/main/java/org/jboss/ws/extensions/security/SecurityDecoder.java
trunk/src/main/java/org/jboss/ws/extensions/security/SecurityEncoder.java
trunk/src/main/java/org/jboss/ws/extensions/security/SecurityStore.java
trunk/src/main/java/org/jboss/ws/extensions/security/SecurityTokenUnavailableException.java
trunk/src/main/java/org/jboss/ws/extensions/security/SendUsernameOperation.java
trunk/src/main/java/org/jboss/ws/extensions/security/SignatureOperation.java
trunk/src/main/java/org/jboss/ws/extensions/security/SignatureVerificationOperation.java
trunk/src/main/java/org/jboss/ws/extensions/security/SimplePrincipal.java
trunk/src/main/java/org/jboss/ws/extensions/security/Target.java
trunk/src/main/java/org/jboss/ws/extensions/security/TimestampOperation.java
trunk/src/main/java/org/jboss/ws/extensions/security/TimestampVerificationOperation.java
trunk/src/main/java/org/jboss/ws/extensions/security/TokenOperation.java
trunk/src/main/java/org/jboss/ws/extensions/security/UnsupportedAlgorithmException.java
trunk/src/main/java/org/jboss/ws/extensions/security/UnsupportedSecurityTokenException.java
trunk/src/main/java/org/jboss/ws/extensions/security/Util.java
trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java
trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityException.java
trunk/src/main/java/org/jboss/ws/extensions/security/WsuIdResolver.java
trunk/src/main/java/org/jboss/ws/extensions/security/WsuIdTarget.java
trunk/src/main/java/org/jboss/ws/extensions/security/element/
trunk/src/main/java/org/jboss/ws/extensions/security/element/BinarySecurityToken.java
trunk/src/main/java/org/jboss/ws/extensions/security/element/DirectReference.java
trunk/src/main/java/org/jboss/ws/extensions/security/element/EncryptedKey.java
trunk/src/main/java/org/jboss/ws/extensions/security/element/KeyIdentifier.java
trunk/src/main/java/org/jboss/ws/extensions/security/element/Reference.java
trunk/src/main/java/org/jboss/ws/extensions/security/element/ReferenceList.java
trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityElement.java
trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityHeader.java
trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityProcess.java
trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityTokenReference.java
trunk/src/main/java/org/jboss/ws/extensions/security/element/Signature.java
trunk/src/main/java/org/jboss/ws/extensions/security/element/Timestamp.java
trunk/src/main/java/org/jboss/ws/extensions/security/element/Token.java
trunk/src/main/java/org/jboss/ws/extensions/security/element/UsernameToken.java
trunk/src/main/java/org/jboss/ws/extensions/security/element/X509IssuerSerial.java
trunk/src/main/java/org/jboss/ws/extensions/security/element/X509Token.java
trunk/src/main/java/org/jboss/ws/extensions/security/jaxrpc/
trunk/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandler.java
trunk/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandlerInbound.java
trunk/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandlerOutbound.java
trunk/src/main/java/org/jboss/ws/extensions/security/jaxws/
trunk/src/main/java/org/jboss/ws/extensions/security/jaxws/WSSecurityHandler.java
trunk/src/main/java/org/jboss/ws/extensions/security/jaxws/WSSecurityHandlerInbound.java
trunk/src/main/java/org/jboss/ws/extensions/security/jaxws/WSSecurityHandlerOutbound.java
trunk/src/main/java/org/jboss/ws/extensions/xop/
trunk/src/main/java/org/jboss/ws/extensions/xop/CreateAttachmentVisitor.java
trunk/src/main/java/org/jboss/ws/extensions/xop/DisableMTOMHandler.java
trunk/src/main/java/org/jboss/ws/extensions/xop/RestoreXOPElementVisitor.java
trunk/src/main/java/org/jboss/ws/extensions/xop/XOPContext.java
trunk/src/main/java/org/jboss/ws/extensions/xop/jaxrpc/
trunk/src/main/java/org/jboss/ws/extensions/xop/jaxrpc/JBossXBContentAdapter.java
trunk/src/main/java/org/jboss/ws/extensions/xop/jaxrpc/XOPMarshallerImpl.java
trunk/src/main/java/org/jboss/ws/extensions/xop/jaxrpc/XOPScanner.java
trunk/src/main/java/org/jboss/ws/extensions/xop/jaxrpc/XOPUnmarshallerImpl.java
trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws/
trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentMarshallerImpl.java
trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentUnmarshallerImpl.java
trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws/ReflectiveXOPScanner.java
trunk/src/main/java/org/jboss/ws/metadata/
trunk/src/main/java/org/jboss/ws/metadata/acessor/
trunk/src/main/java/org/jboss/ws/metadata/acessor/JAXBAccessor.java
trunk/src/main/java/org/jboss/ws/metadata/acessor/ReflectiveMethodAccessor.java
trunk/src/main/java/org/jboss/ws/metadata/builder/
trunk/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientDeployment.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCDeployment.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientEndpointMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB21.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/config/
trunk/src/main/java/org/jboss/ws/metadata/config/WSCommonConfig.java
trunk/src/main/java/org/jboss/ws/metadata/config/WSConfigFactory.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/
trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSClientConfigJAXRPC.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSCommonConfigJAXRPC.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigRootJAXRPC.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSEndpointConfigJAXRPC.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/
trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSClientConfigJAXWS.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSCommonConfigJAXWS.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSConfigFactoryJAXWS.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSConfigRootJAXWS.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSEndpointConfigJAXWS.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSHandlerChainsConfigJAXWS.java
trunk/src/main/java/org/jboss/ws/metadata/j2ee/
trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedApplicationMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedBeanMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedEjbPortComponentMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedHandlerMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedMessageDrivenMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedPortComponentRefMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedServiceRefMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedSessionMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedWebMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedWebSecurityMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ExceptionMapping.java
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaWsdlMapping.java
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaWsdlMappingFactory.java
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaXmlTypeMapping.java
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/MethodParamPartsMapping.java
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/PackageMapping.java
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/PortMapping.java
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ServiceEndpointInterfaceMapping.java
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ServiceEndpointMethodMapping.java
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ServiceInterfaceMapping.java
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/VariableMapping.java
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/WsdlMessageMapping.java
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/WsdlReturnValueMapping.java
trunk/src/main/java/org/jboss/ws/metadata/jsr181/
trunk/src/main/java/org/jboss/ws/metadata/jsr181/HandlerChainFactory.java
trunk/src/main/java/org/jboss/ws/metadata/jsr181/HandlerChainMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/jsr181/HandlerChainsMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/
trunk/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/ExtensibleMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/FaultMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXRPC.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXWS.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/MetaDataExtension.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/OperationMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/ParameterMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/TypeMappingMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/TypesMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/UnifiedMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/WrappedParameter.java
trunk/src/main/java/org/jboss/ws/metadata/webservices/
trunk/src/main/java/org/jboss/ws/metadata/webservices/PortComponentMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/webservices/WebserviceDescriptionMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/webservices/WebservicesFactory.java
trunk/src/main/java/org/jboss/ws/metadata/webservices/WebservicesMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/
trunk/src/main/java/org/jboss/ws/metadata/wsdl/DOMTypes.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/Extendable.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/NCName.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBinding.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingFault.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingMessageReference.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingOperation.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingOperationInput.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingOperationOutput.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitions.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDocumentation.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLEndpoint.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLException.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLFeature.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLImport.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInclude.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterface.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceFault.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceMessageReference.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperation.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationInfault.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationInput.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationOutfault.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationOutput.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLMIMEPart.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLProperty.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLRPCPart.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLRPCSignatureItem.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLSOAPHeader.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLService.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLTypes.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLUtils.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/XSModelTypes.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSComplexTypeDefinition.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSElementDeclaration.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSEntityResolver.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSErrorHandler.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModel.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModelGroup.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSNamedMap.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSNamespaceItem.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSNamespaceItemList.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSObject.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSObjectList.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSParticle.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSSimpleTypeDefinition.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSStringList.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSTypeDefinition.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/WSSchemaUtils.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xsd/
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xsd/SchemaUtils.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xsd/XSDWriter.java
trunk/src/main/java/org/jboss/ws/metadata/wsse/
trunk/src/main/java/org/jboss/ws/metadata/wsse/Config.java
trunk/src/main/java/org/jboss/ws/metadata/wsse/Encrypt.java
trunk/src/main/java/org/jboss/ws/metadata/wsse/Operation.java
trunk/src/main/java/org/jboss/ws/metadata/wsse/Port.java
trunk/src/main/java/org/jboss/ws/metadata/wsse/RequireEncryption.java
trunk/src/main/java/org/jboss/ws/metadata/wsse/RequireSignature.java
trunk/src/main/java/org/jboss/ws/metadata/wsse/RequireTimestamp.java
trunk/src/main/java/org/jboss/ws/metadata/wsse/Requires.java
trunk/src/main/java/org/jboss/ws/metadata/wsse/Sign.java
trunk/src/main/java/org/jboss/ws/metadata/wsse/Target.java
trunk/src/main/java/org/jboss/ws/metadata/wsse/Targetable.java
trunk/src/main/java/org/jboss/ws/metadata/wsse/Timestamp.java
trunk/src/main/java/org/jboss/ws/metadata/wsse/Username.java
trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfiguration.java
trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigurationFactory.java
trunk/src/main/java/org/jboss/ws/tools/wsdl/
trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11DefinitionFactory.java
trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java
trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java
trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java
trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLLocatorImpl.java
trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLWriter.java
trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLWriterResolver.java
Removed:
trunk/src/main/java/org/jboss/ws/Constants.java
trunk/src/main/java/org/jboss/ws/addressing/
trunk/src/main/java/org/jboss/ws/binding/
trunk/src/main/java/org/jboss/ws/common/
trunk/src/main/java/org/jboss/ws/core/CommonClient.java
trunk/src/main/java/org/jboss/ws/core/CommonContextServlet.java
trunk/src/main/java/org/jboss/ws/core/CommonMessageContext.java
trunk/src/main/java/org/jboss/ws/core/EndpointInvocation.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/
trunk/src/main/java/org/jboss/ws/core/jaxrpc/CallImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/CallProxy.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/EncodedTypeMapping.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/HandlerRegistryImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/LiteralTypeMapping.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/ParameterWrapping.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAP11BindingJAXRPC.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAP12BindingJAXRPC.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAPBindingJAXRPC.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAPFaultHelperJAXRPC.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/SchemaGenerator.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/SerializationContextJAXRPC.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceExt.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceFactoryImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceObjectFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceProxy.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceReferenceable.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServletEndpointContextImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/StubExt.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/Style.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingRegistryImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/UnqualifiedCallParameter.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/UnqualifiedFaultException.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/Use.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/Base64Deserializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/Base64DeserializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/Base64Serializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/Base64SerializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/BindingException.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarDeserializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarDeserializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarSerializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarSerializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CommonBinding.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CommonBindingProvider.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CommonSOAP11Binding.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CommonSOAP12Binding.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CommonSOAPBinding.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ComplexTypeDeserializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ComplexTypeSerializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DateDeserializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DateDeserializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DateSerializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DateSerializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DeserializerFactoryBase.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DeserializerSupport.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementDeserializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementDeserializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementSerializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementSerializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/HexDeserializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/HexDeserializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/HexSerializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/HexSerializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/JBossXBDeserializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/JBossXBDeserializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/JBossXBSerializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/JBossXBSerializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/NullValueSerializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/QNameDeserializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/QNameDeserializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/QNameSerializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/QNameSerializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArrayDeserializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArrayDeserializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArraySerializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArraySerializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementDeserializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementDeserializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementSerializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementSerializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SerializationContext.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SerializerFactoryBase.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SerializerSupport.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleDeserializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleDeserializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleSerializer.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleSerializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBConstants.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBMarshaller.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBMarshallerImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBSupport.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBUnmarshaller.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBUnmarshallerImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/MarshalException.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/SchemaBindingBuilder.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/UnmarshalException.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/XercesXSMarshallerImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/
trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/ClientHandlerChain.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerChainBaseImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerWrapper.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/MessageContextJAXRPC.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/SOAPMessageContextJAXRPC.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/ServerHandlerChain.java
trunk/src/main/java/org/jboss/ws/core/jaxws/
trunk/src/main/java/org/jboss/ws/core/jaxws/DynamicWrapperGenerator.java
trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java
trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java
trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializerFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxws/SOAPFaultHelperJAXWS.java
trunk/src/main/java/org/jboss/ws/core/jaxws/SerializationContextJAXWS.java
trunk/src/main/java/org/jboss/ws/core/jaxws/WebServiceContextImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxws/WrapperGenerator.java
trunk/src/main/java/org/jboss/ws/core/jaxws/binding/
trunk/src/main/java/org/jboss/ws/core/jaxws/binding/BindingExt.java
trunk/src/main/java/org/jboss/ws/core/jaxws/binding/BindingImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxws/binding/BindingProviderImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxws/binding/HTTPBindingJAXWS.java
trunk/src/main/java/org/jboss/ws/core/jaxws/binding/MessageBinding.java
trunk/src/main/java/org/jboss/ws/core/jaxws/binding/PayloadBinding.java
trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAP11BindingJAXWS.java
trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAP12BindingJAXWS.java
trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAPBindingJAXWS.java
trunk/src/main/java/org/jboss/ws/core/jaxws/client/
trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientProxy.java
trunk/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxws/client/ResponseImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxws/client/ServiceObjectFactory.java
trunk/src/main/java/org/jboss/ws/core/jaxws/client/ServiceReferenceable.java
trunk/src/main/java/org/jboss/ws/core/jaxws/client/UnifiedServiceRef.java
trunk/src/main/java/org/jboss/ws/core/jaxws/client/WebServiceRefDeployer.java
trunk/src/main/java/org/jboss/ws/core/jaxws/handler/
trunk/src/main/java/org/jboss/ws/core/jaxws/handler/GenericHandler.java
trunk/src/main/java/org/jboss/ws/core/jaxws/handler/GenericLogicalHandler.java
trunk/src/main/java/org/jboss/ws/core/jaxws/handler/GenericSOAPHandler.java
trunk/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java
trunk/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java
trunk/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerResolverImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxws/handler/LogicalMessageContextImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java
trunk/src/main/java/org/jboss/ws/core/jaxws/handler/PortInfoImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxws/handler/SOAPMessageContextJAXWS.java
trunk/src/main/java/org/jboss/ws/core/jaxws/spi/
trunk/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxws/util/
trunk/src/main/java/org/jboss/ws/core/jaxws/util/FactoryFinder.java
trunk/src/main/java/org/jboss/ws/core/server/
trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointPublisher.java
trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointServlet.java
trunk/src/main/java/org/jboss/ws/core/server/EndpointContext.java
trunk/src/main/java/org/jboss/ws/core/server/HandlerDelegate.java
trunk/src/main/java/org/jboss/ws/core/server/HeaderSource.java
trunk/src/main/java/org/jboss/ws/core/server/HttpContext.java
trunk/src/main/java/org/jboss/ws/core/server/HttpServer.java
trunk/src/main/java/org/jboss/ws/core/server/JAXWSDeployment.java
trunk/src/main/java/org/jboss/ws/core/server/KernelLocator.java
trunk/src/main/java/org/jboss/ws/core/server/MessageContextInjector.java
trunk/src/main/java/org/jboss/ws/core/server/MessageContextPropertyHelper.java
trunk/src/main/java/org/jboss/ws/core/server/ServerConfig.java
trunk/src/main/java/org/jboss/ws/core/server/ServerConfigFactory.java
trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpoint.java
trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointDeployer.java
trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInfo.java
trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java
trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvokerJSE.java
trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointManager.java
trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointManagerFactory.java
trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointManagerMBean.java
trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointMetrics.java
trunk/src/main/java/org/jboss/ws/core/server/ServletHeaderSource.java
trunk/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java
trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java
trunk/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java
trunk/src/main/java/org/jboss/ws/core/soap/
trunk/src/main/java/org/jboss/ws/core/soap/AttrImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/DetailEntryImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/DetailImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/DocumentFragmentImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/EndpointInfo.java
trunk/src/main/java/org/jboss/ws/core/soap/JAXWSPayloadBuilder.java
trunk/src/main/java/org/jboss/ws/core/soap/MessageContextAssociation.java
trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/NameImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/NodeImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/NodeListImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/PayloadBuilder.java
trunk/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderDOM.java
trunk/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderStax.java
trunk/src/main/java/org/jboss/ws/core/soap/SAAJVisitable.java
trunk/src/main/java/org/jboss/ws/core/soap/SAAJVisitor.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementDoc.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementMessage.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementRpc.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPConnectionFactoryImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPConnectionImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPDocument.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPElementImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPElementWriter.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPEnvelopeImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPFactoryImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPFaultElementImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPFaultImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPHeaderElementImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPHeaderImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageMarshaller.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshaller.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPPartImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/TextImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/UnboundHeader.java
trunk/src/main/java/org/jboss/ws/core/soap/attachment/
trunk/src/main/java/org/jboss/ws/core/soap/attachment/AttachmentPartImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/attachment/BoundaryDelimitedInputStream.java
trunk/src/main/java/org/jboss/ws/core/soap/attachment/ByteArrayContentHandler.java
trunk/src/main/java/org/jboss/ws/core/soap/attachment/CIDGenerator.java
trunk/src/main/java/org/jboss/ws/core/soap/attachment/ContentHandlerRegistry.java
trunk/src/main/java/org/jboss/ws/core/soap/attachment/ImageDataContentHandler.java
trunk/src/main/java/org/jboss/ws/core/soap/attachment/MimeConstants.java
trunk/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedDecoder.java
trunk/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedEncoder.java
trunk/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedSwAEncoder.java
trunk/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedXOPEncoder.java
trunk/src/main/java/org/jboss/ws/core/soap/attachment/RawByteArrayOutputStream.java
trunk/src/main/java/org/jboss/ws/core/soap/attachment/SimpleBoyerMoore.java
trunk/src/main/java/org/jboss/ws/core/soap/attachment/SwapableMemoryDataSource.java
trunk/src/main/java/org/jboss/ws/core/soap/attachment/XmlDataContentHandler.java
trunk/src/main/java/org/jboss/ws/core/utils/
trunk/src/main/java/org/jboss/ws/core/utils/DOMUtils.java
trunk/src/main/java/org/jboss/ws/core/utils/DOMWriter.java
trunk/src/main/java/org/jboss/ws/core/utils/HolderUtils.java
trunk/src/main/java/org/jboss/ws/core/utils/IOUtils.java
trunk/src/main/java/org/jboss/ws/core/utils/JBossWSEntityResolver.java
trunk/src/main/java/org/jboss/ws/core/utils/JavaUtils.java
trunk/src/main/java/org/jboss/ws/core/utils/JavassistUtils.java
trunk/src/main/java/org/jboss/ws/core/utils/MimeUtils.java
trunk/src/main/java/org/jboss/ws/core/utils/ObjectNameFactory.java
trunk/src/main/java/org/jboss/ws/core/utils/ThreadLocalAssociation.java
trunk/src/main/java/org/jboss/ws/core/utils/UUIDGenerator.java
trunk/src/main/java/org/jboss/ws/core/utils/XMLPredefinedEntityReferenceResolver.java
trunk/src/main/java/org/jboss/ws/deployment/
trunk/src/main/java/org/jboss/ws/eventing/
trunk/src/main/java/org/jboss/ws/extensions/SomeClass.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/
trunk/src/main/java/org/jboss/ws/extensions/addressing/AddressingBuilderImpl.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/AddressingClientUtil.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/AddressingConstantsImpl.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/AddressingPropertiesImpl.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/AddressingTypeImpl.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/AttributeElementExtensibleImpl.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/AttributeExtensibleImpl.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/AttributedQNameImpl.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/AttributedURIImpl.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/ElementExtensibleImpl.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/EndpointReferenceImpl.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/MetadataImpl.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/ReferenceParametersImpl.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/RelationshipImpl.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxrpc/
trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxrpc/WSAddressingClientHandler.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxrpc/WSAddressingServerHandler.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxws/
trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingClientHandler.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingServerHandler.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/metadata/
trunk/src/main/java/org/jboss/ws/extensions/addressing/metadata/AddressingOpMetaExt.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/soap/
trunk/src/main/java/org/jboss/ws/extensions/addressing/soap/SOAPAddressingBuilderImpl.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/soap/SOAPAddressingPropertiesImpl.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/
trunk/src/main/java/org/jboss/ws/extensions/eventing/EventSourceEndpoint.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/EventSourceEndpointImpl.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/EventingConstants.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/EventingEndpointBase.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/EventingService.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/SubscriptionManagerEndpoint.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/SubscriptionManagerEndpointImpl.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/deployment/
trunk/src/main/java/org/jboss/ws/extensions/eventing/deployment/EventingEndpoint.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/deployment/EventingEndpointDI.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/DeliveryType.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/EndpointReference.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/FilterType.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/MetaData.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/ReferenceParameters.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/RenewRequest.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/RenewResponse.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/StatusRequest.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/StatusResponse.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/SubscribeRequest.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/SubscribeResponse.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/SubscriptionEndRequest.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/UnsubscribeRequest.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/metadata/
trunk/src/main/java/org/jboss/ws/extensions/eventing/metadata/EventingEpMetaExt.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatchJob.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatcherDelegate.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatcherFactory.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/EventDispatcher.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/EventSource.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/EventingBuilder.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/Filter.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/Subscription.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionError.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManager.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManagerFactory.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManagerMBean.java
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionTicket.java
trunk/src/main/java/org/jboss/ws/extensions/policy/
trunk/src/main/java/org/jboss/ws/extensions/policy/Policy.java
trunk/src/main/java/org/jboss/ws/extensions/policy/PolicyAlternative.java
trunk/src/main/java/org/jboss/ws/extensions/policy/PolicyAssertion.java
trunk/src/main/java/org/jboss/ws/extensions/policy/PolicyFactory.java
trunk/src/main/java/org/jboss/ws/extensions/security/
trunk/src/main/java/org/jboss/ws/extensions/security/BinarySecurityTokenValidator.java
trunk/src/main/java/org/jboss/ws/extensions/security/Constants.java
trunk/src/main/java/org/jboss/ws/extensions/security/DecodingOperation.java
trunk/src/main/java/org/jboss/ws/extensions/security/DecryptionOperation.java
trunk/src/main/java/org/jboss/ws/extensions/security/EncodingOperation.java
trunk/src/main/java/org/jboss/ws/extensions/security/EncryptionOperation.java
trunk/src/main/java/org/jboss/ws/extensions/security/FailedAuthenticationException.java
trunk/src/main/java/org/jboss/ws/extensions/security/FailedCheckException.java
trunk/src/main/java/org/jboss/ws/extensions/security/InvalidSecurityHeaderException.java
trunk/src/main/java/org/jboss/ws/extensions/security/InvalidSecurityTokenException.java
trunk/src/main/java/org/jboss/ws/extensions/security/KeyResolver.java
trunk/src/main/java/org/jboss/ws/extensions/security/Operation.java
trunk/src/main/java/org/jboss/ws/extensions/security/OperationDescription.java
trunk/src/main/java/org/jboss/ws/extensions/security/QNameTarget.java
trunk/src/main/java/org/jboss/ws/extensions/security/ReceiveUsernameOperation.java
trunk/src/main/java/org/jboss/ws/extensions/security/RequireEncryptionOperation.java
trunk/src/main/java/org/jboss/ws/extensions/security/RequireOperation.java
trunk/src/main/java/org/jboss/ws/extensions/security/RequireSignatureOperation.java
trunk/src/main/java/org/jboss/ws/extensions/security/RequireTargetableOperation.java
trunk/src/main/java/org/jboss/ws/extensions/security/RequireTimestampOperation.java
trunk/src/main/java/org/jboss/ws/extensions/security/STRTransform.java
trunk/src/main/java/org/jboss/ws/extensions/security/SecurityAdaptor.java
trunk/src/main/java/org/jboss/ws/extensions/security/SecurityAdaptorFactory.java
trunk/src/main/java/org/jboss/ws/extensions/security/SecurityDecoder.java
trunk/src/main/java/org/jboss/ws/extensions/security/SecurityEncoder.java
trunk/src/main/java/org/jboss/ws/extensions/security/SecurityStore.java
trunk/src/main/java/org/jboss/ws/extensions/security/SecurityTokenUnavailableException.java
trunk/src/main/java/org/jboss/ws/extensions/security/SendUsernameOperation.java
trunk/src/main/java/org/jboss/ws/extensions/security/SignatureOperation.java
trunk/src/main/java/org/jboss/ws/extensions/security/SignatureVerificationOperation.java
trunk/src/main/java/org/jboss/ws/extensions/security/SimplePrincipal.java
trunk/src/main/java/org/jboss/ws/extensions/security/Target.java
trunk/src/main/java/org/jboss/ws/extensions/security/TimestampOperation.java
trunk/src/main/java/org/jboss/ws/extensions/security/TimestampVerificationOperation.java
trunk/src/main/java/org/jboss/ws/extensions/security/TokenOperation.java
trunk/src/main/java/org/jboss/ws/extensions/security/UnsupportedAlgorithmException.java
trunk/src/main/java/org/jboss/ws/extensions/security/UnsupportedSecurityTokenException.java
trunk/src/main/java/org/jboss/ws/extensions/security/Util.java
trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java
trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityException.java
trunk/src/main/java/org/jboss/ws/extensions/security/WsuIdResolver.java
trunk/src/main/java/org/jboss/ws/extensions/security/WsuIdTarget.java
trunk/src/main/java/org/jboss/ws/extensions/security/element/
trunk/src/main/java/org/jboss/ws/extensions/security/element/BinarySecurityToken.java
trunk/src/main/java/org/jboss/ws/extensions/security/element/DirectReference.java
trunk/src/main/java/org/jboss/ws/extensions/security/element/EncryptedKey.java
trunk/src/main/java/org/jboss/ws/extensions/security/element/KeyIdentifier.java
trunk/src/main/java/org/jboss/ws/extensions/security/element/Reference.java
trunk/src/main/java/org/jboss/ws/extensions/security/element/ReferenceList.java
trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityElement.java
trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityHeader.java
trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityProcess.java
trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityTokenReference.java
trunk/src/main/java/org/jboss/ws/extensions/security/element/Signature.java
trunk/src/main/java/org/jboss/ws/extensions/security/element/Timestamp.java
trunk/src/main/java/org/jboss/ws/extensions/security/element/Token.java
trunk/src/main/java/org/jboss/ws/extensions/security/element/UsernameToken.java
trunk/src/main/java/org/jboss/ws/extensions/security/element/X509IssuerSerial.java
trunk/src/main/java/org/jboss/ws/extensions/security/element/X509Token.java
trunk/src/main/java/org/jboss/ws/extensions/security/jaxrpc/
trunk/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandler.java
trunk/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandlerInbound.java
trunk/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandlerOutbound.java
trunk/src/main/java/org/jboss/ws/extensions/security/jaxws/
trunk/src/main/java/org/jboss/ws/extensions/security/jaxws/WSSecurityHandler.java
trunk/src/main/java/org/jboss/ws/extensions/security/jaxws/WSSecurityHandlerInbound.java
trunk/src/main/java/org/jboss/ws/extensions/security/jaxws/WSSecurityHandlerOutbound.java
trunk/src/main/java/org/jboss/ws/extensions/xop/
trunk/src/main/java/org/jboss/ws/extensions/xop/CreateAttachmentVisitor.java
trunk/src/main/java/org/jboss/ws/extensions/xop/DisableMTOMHandler.java
trunk/src/main/java/org/jboss/ws/extensions/xop/RestoreXOPElementVisitor.java
trunk/src/main/java/org/jboss/ws/extensions/xop/XOPContext.java
trunk/src/main/java/org/jboss/ws/extensions/xop/jaxrpc/
trunk/src/main/java/org/jboss/ws/extensions/xop/jaxrpc/JBossXBContentAdapter.java
trunk/src/main/java/org/jboss/ws/extensions/xop/jaxrpc/XOPMarshallerImpl.java
trunk/src/main/java/org/jboss/ws/extensions/xop/jaxrpc/XOPScanner.java
trunk/src/main/java/org/jboss/ws/extensions/xop/jaxrpc/XOPUnmarshallerImpl.java
trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws/
trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentMarshallerImpl.java
trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentUnmarshallerImpl.java
trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws/ReflectiveXOPScanner.java
trunk/src/main/java/org/jboss/ws/jaxrpc/
trunk/src/main/java/org/jboss/ws/jaxws/
trunk/src/main/java/org/jboss/ws/jbossxb/
trunk/src/main/java/org/jboss/ws/metadata/
trunk/src/main/java/org/jboss/ws/metadata/acessor/
trunk/src/main/java/org/jboss/ws/metadata/acessor/JAXBAccessor.java
trunk/src/main/java/org/jboss/ws/metadata/acessor/ReflectiveMethodAccessor.java
trunk/src/main/java/org/jboss/ws/metadata/builder/
trunk/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientDeployment.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCDeployment.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientEndpointMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB21.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/config/
trunk/src/main/java/org/jboss/ws/metadata/config/WSCommonConfig.java
trunk/src/main/java/org/jboss/ws/metadata/config/WSConfigFactory.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/
trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSClientConfigJAXRPC.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSCommonConfigJAXRPC.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigRootJAXRPC.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSEndpointConfigJAXRPC.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/
trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSClientConfigJAXWS.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSCommonConfigJAXWS.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSConfigFactoryJAXWS.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSConfigRootJAXWS.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSEndpointConfigJAXWS.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSHandlerChainsConfigJAXWS.java
trunk/src/main/java/org/jboss/ws/metadata/j2ee/
trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedApplicationMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedBeanMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedEjbPortComponentMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedHandlerMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedMessageDrivenMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedPortComponentRefMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedServiceRefMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedSessionMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedWebMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedWebSecurityMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ExceptionMapping.java
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaWsdlMapping.java
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaWsdlMappingFactory.java
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaXmlTypeMapping.java
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/MethodParamPartsMapping.java
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/PackageMapping.java
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/PortMapping.java
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ServiceEndpointInterfaceMapping.java
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ServiceEndpointMethodMapping.java
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ServiceInterfaceMapping.java
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/VariableMapping.java
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/WsdlMessageMapping.java
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/WsdlReturnValueMapping.java
trunk/src/main/java/org/jboss/ws/metadata/jsr181/
trunk/src/main/java/org/jboss/ws/metadata/jsr181/HandlerChainFactory.java
trunk/src/main/java/org/jboss/ws/metadata/jsr181/HandlerChainMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/jsr181/HandlerChainsMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/
trunk/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/ExtensibleMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/FaultMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXRPC.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXWS.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/MetaDataExtension.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/OperationMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/ParameterMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/TypeMappingMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/TypesMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/UnifiedMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/WrappedParameter.java
trunk/src/main/java/org/jboss/ws/metadata/webservices/
trunk/src/main/java/org/jboss/ws/metadata/webservices/PortComponentMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/webservices/WebserviceDescriptionMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/webservices/WebservicesFactory.java
trunk/src/main/java/org/jboss/ws/metadata/webservices/WebservicesMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/
trunk/src/main/java/org/jboss/ws/metadata/wsdl/DOMTypes.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/Extendable.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/NCName.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBinding.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingFault.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingMessageReference.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingOperation.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingOperationInput.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingOperationOutput.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitions.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDocumentation.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLEndpoint.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLException.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLFeature.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLImport.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInclude.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterface.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceFault.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceMessageReference.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperation.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationInfault.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationInput.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationOutfault.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationOutput.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLMIMEPart.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLProperty.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLRPCPart.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLRPCSignatureItem.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLSOAPHeader.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLService.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLTypes.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLUtils.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/XSModelTypes.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSComplexTypeDefinition.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSElementDeclaration.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSEntityResolver.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSErrorHandler.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModel.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModelGroup.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSNamedMap.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSNamespaceItem.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSNamespaceItemList.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSObject.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSObjectList.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSParticle.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSSimpleTypeDefinition.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSStringList.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSTypeDefinition.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/WSSchemaUtils.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xsd/
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xsd/SchemaUtils.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xsd/XSDWriter.java
trunk/src/main/java/org/jboss/ws/metadata/wsse/
trunk/src/main/java/org/jboss/ws/metadata/wsse/Config.java
trunk/src/main/java/org/jboss/ws/metadata/wsse/Encrypt.java
trunk/src/main/java/org/jboss/ws/metadata/wsse/Operation.java
trunk/src/main/java/org/jboss/ws/metadata/wsse/Port.java
trunk/src/main/java/org/jboss/ws/metadata/wsse/RequireEncryption.java
trunk/src/main/java/org/jboss/ws/metadata/wsse/RequireSignature.java
trunk/src/main/java/org/jboss/ws/metadata/wsse/RequireTimestamp.java
trunk/src/main/java/org/jboss/ws/metadata/wsse/Requires.java
trunk/src/main/java/org/jboss/ws/metadata/wsse/Sign.java
trunk/src/main/java/org/jboss/ws/metadata/wsse/Target.java
trunk/src/main/java/org/jboss/ws/metadata/wsse/Targetable.java
trunk/src/main/java/org/jboss/ws/metadata/wsse/Timestamp.java
trunk/src/main/java/org/jboss/ws/metadata/wsse/Username.java
trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfiguration.java
trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigurationFactory.java
trunk/src/main/java/org/jboss/ws/server/
trunk/src/main/java/org/jboss/ws/soap/
trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11DefinitionFactory.java
trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java
trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java
trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java
trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLLocatorImpl.java
trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLWriter.java
trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLWriterResolver.java
trunk/src/main/java/org/jboss/ws/utils/
trunk/src/main/java/org/jboss/ws/wspolicy/
trunk/src/main/java/org/jboss/ws/wsse/
trunk/src/main/java/org/jboss/ws/xop/
trunk/src/test/java/org/jboss/test/ws/tools/WSDL11ToWSDL20TestCase.java
Modified:
trunk/build.xml
trunk/src/main/java/javax/xml/rpc/ServiceFactory.java
trunk/src/main/java/javax/xml/soap/MessageFactory.java
trunk/src/main/java/javax/xml/soap/SOAPConnectionFactory.java
trunk/src/main/java/javax/xml/soap/SOAPFactory.java
trunk/src/main/java/javax/xml/ws/WebServiceRefs.java
trunk/src/main/java/javax/xml/ws/addressing/JAXWSAConstants.java
trunk/src/main/java/javax/xml/ws/spi/Provider.java
trunk/src/main/java/org/jboss/ws/integration/SecurityAdaptorFactoryImpl.java
trunk/src/main/java/org/jboss/ws/integration/jboss50/AbstractDeployer.java
trunk/src/main/java/org/jboss/ws/integration/jboss50/AbstractEJBDeployer.java
trunk/src/main/java/org/jboss/ws/integration/jboss50/AbstractJSEDeployer.java
trunk/src/main/java/org/jboss/ws/integration/jboss50/DeploymentInfoAdaptor.java
trunk/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerJSE.java
trunk/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerEJB3.java
trunk/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerJSE.java
trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossContextServlet.java
trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossServiceEndpointServlet.java
trunk/src/main/java/org/jboss/ws/integration/jboss50/PortComponentLinkServlet.java
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServerConfigImpl.java
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointGeneratorEJB.java
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointGeneratorEJB3.java
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointInvokerEJB3.java
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointLifecycleDeployer.java
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointPublisher.java
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefHandler.java
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefHandlerMBean.java
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefMetaDataAdaptor.java
trunk/src/main/java/org/jboss/ws/integration/tomcat/DeploymentInfoAdaptor.java
trunk/src/main/java/org/jboss/ws/integration/tomcat/KernelBootstrap.java
trunk/src/main/java/org/jboss/ws/integration/tomcat/ServerConfigImpl.java
trunk/src/main/java/org/jboss/ws/integration/tomcat/TomcatContextServlet.java
trunk/src/main/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointPublisher.java
trunk/src/main/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java
trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL.java
trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL11.java
trunk/src/main/java/org/jboss/ws/tools/JavaToXSD.java
trunk/src/main/java/org/jboss/ws/tools/SourceWrapperGenerator.java
trunk/src/main/java/org/jboss/ws/tools/ToolsUtils.java
trunk/src/main/java/org/jboss/ws/tools/WSDLToJava.java
trunk/src/main/java/org/jboss/ws/tools/WSDotXMLCreator.java
trunk/src/main/java/org/jboss/ws/tools/XSDToJava.java
trunk/src/main/java/org/jboss/ws/tools/XSDTypeToJava.java
trunk/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java
trunk/src/main/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java
trunk/src/main/java/org/jboss/ws/tools/helpers/ReformatXML.java
trunk/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java
trunk/src/main/java/org/jboss/ws/tools/interfaces/SchemaCreatorIntf.java
trunk/src/main/java/org/jboss/ws/tools/interfaces/WSDLToJavaIntf.java
trunk/src/main/java/org/jboss/ws/tools/interfaces/XSDToJavaIntf.java
trunk/src/main/java/org/jboss/ws/tools/jaxws/JAXBWSDLGenerator.java
trunk/src/main/java/org/jboss/ws/tools/jaxws/WSDLGenerator.java
trunk/src/main/java/org/jboss/ws/tools/mapping/MappingFileGenerator.java
trunk/src/main/java/org/jboss/ws/tools/metadata/ReflectiveMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/tools/metadata/ToolsAnnotationMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/tools/metadata/ToolsEndpointMetaData.java
trunk/src/main/java/org/jboss/ws/tools/metadata/ToolsUnifiedMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/tools/schema/SchemaTypeCreator.java
trunk/src/main/resources/jbossws.beans/META-INF/jboss-beans.xml
trunk/src/main/resources/jbossws.sar/META-INF/jboss-service.xml
trunk/src/main/resources/jbossws.sar/META-INF/standard-jaxrpc-client-config.xml
trunk/src/main/resources/jbossws.sar/META-INF/standard-jaxrpc-endpoint-config.xml
trunk/src/main/resources/jbossws.sar/META-INF/standard-jaxws-client-config.xml
trunk/src/main/resources/jbossws.sar/META-INF/standard-jaxws-endpoint-config.xml
trunk/src/main/resources/jbossws.war/Tomcat/META-INF/jboss-beans.xml
trunk/src/test/build.xml
trunk/src/test/java/org/jboss/test/ws/JBossWSTest.java
trunk/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java
trunk/src/test/java/org/jboss/test/ws/common/config/WSConfigTestCase.java
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/SerializerDeserializerTestCase.java
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/BigDecimalArrayMarshallerTestCase.java
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/BigDecimalArrayUnmarshallerTestCase.java
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/CalendarArrayMarshallerTestCase.java
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/CalendarArrayUnmarshallerTestCase.java
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/QNameArrayMarshallerTestCase.java
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/QNameArrayUnmarshallerTestCase.java
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/complex/ComplexTypeMarshallerTestCase.java
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/complex/ComplexTypeUnmarshallerTestCase.java
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/docstyle/DocumentStyleMarshallerTestCase.java
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/docstyle/DocumentStyleUnmarshallerTestCase.java
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeMarshallerTestCase.java
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeUnmarshallerTestCase.java
trunk/src/test/java/org/jboss/test/ws/common/soap/MessageFactoryTestCase.java
trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPConnectionTestCase.java
trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPContentElementTestCase.java
trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPEnvelopeTestCase.java
trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPFactoryTestCase.java
trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPFaultTestCase.java
trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPHeaderElementTestCase.java
trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPHeaderTestCase.java
trunk/src/test/java/org/jboss/test/ws/common/soap/attachment/GenericAttachmentTestCase.java
trunk/src/test/java/org/jboss/test/ws/common/utils/DOMWriterTestCase.java
trunk/src/test/java/org/jboss/test/ws/common/utils/JavaUtilsTestCase.java
trunk/src/test/java/org/jboss/test/ws/common/wsdl11/MicrosoftGeneratedWSDLTestCase.java
trunk/src/test/java/org/jboss/test/ws/common/wsdl11/MultiSchemaTestCase.java
trunk/src/test/java/org/jboss/test/ws/common/wsdl11/SimpleFileImportTestCase.java
trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDL11TestCase.java
trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLTypesTestCase.java
trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLWithAnonTypesTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/encoded/marshalltest/JavaBean.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/encoded/marshalltest/ValueType.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1068/JBWS1068TestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1093/JBWS1093TestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1107/JBWS1107TestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1124/JBWS1124TestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1179/TestEndpointImpl.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1186/JBWS1186TestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1186/ServerHandler.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1190/TestEndpointImpl.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1205/TestEndpointImpl.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws434/JBWS434TestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws775/JBWS775TestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws812/JBWS812TestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws812/ServerHandler.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws950/JBWS950TestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws955/JBWS955TestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws956/JBWS956TestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws958/JBWS958TestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/marshall/MarshallRpcLitDIITestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/marshall/MarshallTest.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/docstyle/bare/TrivialServiceDocBareTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/docstyle/wrapped/TrivialServiceDocWrappedTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/dynamichandler/DynamicHandlerTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/exception/ExceptionTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderClientTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderDIITestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderProxyTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/holder/HolderTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jmstransport/JMSTransportTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109ejb/RpcDIIConfiguredCallTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109ejb/RpcDIIUnconfiguredCallTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109ejb/RpcProxyTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/DocJSETestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcDIIConfiguredCallTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcDIIUnconfiguredCallTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcJSETestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcProxyTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/message/MessageTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/message/MessageTestServiceBean.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/EmployeeRecordsImpl.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/MTOMTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/oneway/OneWayTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/rpcstyle/TrivialServiceRpcTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/swa/AttachmentProxyTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/swa/AttachmentSAAJTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wseventing/SysmonTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wseventing/SysmonUtil.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/SimpleEncryptTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/SimpleSignTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/StorePassEncryptTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefClientTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefEJBTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefServletTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/DIIClientTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventSinkServlet.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingSupport.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/NotificationTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/SubscriptionManagerTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/MicrosoftInteropTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/RoundTripTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/SunInteropTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/XOPTypeDefTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/InlineHandler.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPBase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/InlineHandler.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPBase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/MTOMServiceBase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/asynchronous/AsynchronousDispatchTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/asynchronous/AsynchronousProxyTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/binding/ClientHandler.java
trunk/src/test/java/org/jboss/test/ws/jaxws/context/WebServiceContextTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointServlet.java
trunk/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/exception/ExceptionEndpointImpl.java
trunk/src/test/java/org/jboss/test/ws/jaxws/handlerscope/ProtocolHandler.java
trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java
trunk/src/test/java/org/jboss/test/ws/jaxws/jbws860/JBWS860TestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/jbws944/JBWS944TestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/complex/client/JSR181ComplexTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/handlerchain/AuthorizationHandler.java
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/handlerchain/LogHandler.java
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/handlerchain/RoutingHandler.java
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/oneway/JSR181OneWayTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/soapbinding/JSR181SOAPBindingTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webmethod/JSR181WebMethodTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webparam/JSR181WebParamTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webresult/JSR181WebResultTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceBase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/logicalhandler/LogicalJAXBHandler.java
trunk/src/test/java/org/jboss/test/ws/jaxws/logicalhandler/LogicalSourceHandler.java
trunk/src/test/java/org/jboss/test/ws/jaxws/logicalhandler/ProtocolHandler.java
trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderBeanPayload.java
trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderJAXBTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderMessageTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderPayloadTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jsr181ejb/JSR181WebServiceEJB3TestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jsr181pojo/JSR181WebServiceJSETestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/RetailSampleTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/handler/SOAPMessageTrace.java
trunk/src/test/java/org/jboss/test/ws/jaxws/samples/wsaddressing/AddressingStatefulTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/samples/wsaddressing/ClientHandler.java
trunk/src/test/java/org/jboss/test/ws/jaxws/samples/wsaddressing/ServerHandler.java
trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefClientTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefEJB3TestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefServletTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/EndpointReferenceTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/ClientHandler.java
trunk/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/FaultToEndpointImpl.java
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/MimeDeclarationTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpointBean.java
trunk/src/test/java/org/jboss/test/ws/tools/JavaToWSDL11TestCase.java
trunk/src/test/java/org/jboss/test/ws/tools/SchemaGeneratorTestCase.java
trunk/src/test/java/org/jboss/test/ws/tools/WSDL11ToJavaTestCase.java
trunk/src/test/java/org/jboss/test/ws/tools/WSToolsTest.java
trunk/src/test/java/org/jboss/test/ws/tools/clientside/ClientSideArtifactsTestCase.java
trunk/src/test/java/org/jboss/test/ws/tools/doclit/ToolsDocLitTestCase.java
trunk/src/test/java/org/jboss/test/ws/tools/enums/EnumTestCase.java
trunk/src/test/java/org/jboss/test/ws/tools/holders/StandardHoldersTestCase.java
trunk/src/test/java/org/jboss/test/ws/tools/java2xsd/SchemaModelTestCase.java
trunk/src/test/java/org/jboss/test/ws/tools/java2xsd/SchemaTypesCreatorTestCase.java
trunk/src/test/java/org/jboss/test/ws/tools/jbws1079/JBWS1079TestCase.java
trunk/src/test/java/org/jboss/test/ws/tools/jbws1170/JBWS1170TestCase.java
trunk/src/test/java/org/jboss/test/ws/tools/jbws1253/JBWS1253TestCase.java
trunk/src/test/java/org/jboss/test/ws/tools/jbws818/JBWS818TestCase.java
trunk/src/test/java/org/jboss/test/ws/tools/jbws_204/AnonTypesTestCase.java
trunk/src/test/java/org/jboss/test/ws/tools/jbws_204/NillableTypesTestCase.java
trunk/src/test/java/org/jboss/test/ws/tools/jbws_204/StandardArraysTestCase.java
trunk/src/test/java/org/jboss/test/ws/tools/jbws_204/StandardDoubleArraysTestCase.java
trunk/src/test/java/org/jboss/test/ws/tools/metadata/JavaWsdlMappingMetaDataTestCase.java
trunk/src/test/java/org/jboss/test/ws/tools/metadata/WebServicesMetaDataTestCase.java
trunk/src/test/java/org/jboss/test/ws/tools/validation/WSDL11ValidationTestCase.java
trunk/src/test/java/org/jboss/test/ws/tools/xmlschema/WSDLTypesTestCase.java
trunk/src/test/java/org/jboss/test/ws/tools/xmlschema/XercesSchemaParserTestCase.java
trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/AnonymousTypesTestCase.java
trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/ComplexTypesTestCase.java
trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/NillableTypesTestCase.java
trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/ReferencesTestCase.java
trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/SimpleTypesTestCase.java
trunk/src/test/resources/common/config/jaxrpc-endpoint-config.xml
trunk/src/test/resources/common/config/jaxws-endpoint-config.xml
trunk/src/test/resources/interop/microsoft/addressing/sep06/wsa10/META-INF/application-client.xml
trunk/src/test/resources/interop/microsoft/addressing/sep06/wsa10/WEB-INF/webservices.xml
trunk/src/test/resources/interop/microsoft/addressing/wsa10/META-INF/application-client.xml
trunk/src/test/resources/interop/microsoft/addressing/wsaTestService/WEB-INF/webservices.xml
trunk/src/test/resources/jaxrpc/marshall-rpclit/WEB-INF/webservices.xml
trunk/src/test/resources/jaxrpc/samples/wseventing/META-INF/application-client.xml
trunk/src/test/resources/jaxrpc/samples/wseventing/WEB-INF/jaxrpc-mapping.xml
trunk/src/test/resources/jaxrpc/samples/wseventing/WEB-INF/web.xml
trunk/src/test/resources/jaxrpc/samples/wseventing/WEB-INF/webservices.xml
trunk/src/test/resources/jaxrpc/wseventing/META-INF/application-client.xml
trunk/src/test/resources/jaxrpc/wseventing/WEB-INF/jaxrpc-mapping.xml
trunk/src/test/resources/jaxrpc/wseventing/WEB-INF/web.xml
trunk/src/test/resources/jaxrpc/wseventing/WEB-INF/webservices.xml
trunk/src/test/resources/jaxws/samples/jsr181ejb/config/ServerHandlers.xml
trunk/src/test/resources/jaxws/wsaddressing/action/META-INF/jbossws-client-config.xml
Log:
reorganize package structure
Modified: trunk/build.xml
===================================================================
--- trunk/build.xml 2006-12-07 10:45:48 UTC (rev 1599)
+++ trunk/build.xml 2006-12-07 10:43:36 UTC (rev 1600)
@@ -386,7 +386,19 @@
<target name="deploy-to-server">
<copy todir="${jboss.deploy.home}/client"
file="${thirdparty.dir}/jboss-xml-binding.jar" overwrite="true"/>
<copy todir="${jboss.deploy.home}/lib"
file="${thirdparty.dir}/jboss-xml-binding.jar" overwrite="true"/>
- <copy todir="${jboss.deploy.home}/client"
file="${build.lib.dir}/${jbossws}-client.jar" overwrite="true"/>
+ <copy todir="${jboss.deploy.home}/client"
overwrite="true">
+ <fileset dir="${build.lib.dir}">
+ <include name="jboss-jaxrpc.jar"/>
+ <include name="jboss-saaj.jar"/>
+ <include name="${jbossws}-client.jar"/>
+ </fileset>
+ </copy>
+ <copy todir="${jboss.deploy.home}/server/${jboss.server.instance}/lib"
overwrite="true">
+ <fileset dir="${build.lib.dir}">
+ <include name="jboss-jaxrpc.jar"/>
+ <include name="jboss-saaj.jar"/>
+ </fileset>
+ </copy>
<delete
dir="${jboss.deploy.home}/server/${jboss.server.instance}/deploy/${jbossws}.sar"/>
<mkdir
dir="${jboss.deploy.home}/server/${jboss.server.instance}/deploy/${jbossws}.sar"/>
<unjar
dest="${jboss.deploy.home}/server/${jboss.server.instance}/deploy/${jbossws}.sar"
src="${build.lib.dir}/${jbossws}.sar"/>
Modified: trunk/src/main/java/javax/xml/rpc/ServiceFactory.java
===================================================================
--- trunk/src/main/java/javax/xml/rpc/ServiceFactory.java 2006-12-07 10:45:48 UTC (rev
1599)
+++ trunk/src/main/java/javax/xml/rpc/ServiceFactory.java 2006-12-07 10:43:36 UTC (rev
1600)
@@ -54,7 +54,7 @@
/** A constant representing the property used to lookup the name of a ServiceFactory
implementation class. */
public static final String SERVICEFACTORY_PROPERTY =
"javax.xml.rpc.ServiceFactory";
- private static final String DEFAULT_SERVICE_FACTORY =
"org.jboss.ws.jaxrpc.ServiceFactoryImpl";
+ private static final String DEFAULT_SERVICE_FACTORY =
"org.jboss.ws.core.jaxrpc.ServiceFactoryImpl";
private static final String[] alternativeFactories = new String[] {};
protected ServiceFactory()
Modified: trunk/src/main/java/javax/xml/soap/MessageFactory.java
===================================================================
--- trunk/src/main/java/javax/xml/soap/MessageFactory.java 2006-12-07 10:45:48 UTC (rev
1599)
+++ trunk/src/main/java/javax/xml/soap/MessageFactory.java 2006-12-07 10:43:36 UTC (rev
1600)
@@ -62,7 +62,7 @@
// provide logging
private static Logger log = Logger.getLogger(MessageFactory.class);
- private static final String DEFAULT_MESSAGE_FACTORY =
"org.jboss.ws.soap.MessageFactoryImpl";
+ private static final String DEFAULT_MESSAGE_FACTORY =
"org.jboss.ws.core.soap.MessageFactoryImpl";
private static final String[] alternativeFactories = new String[] {
"org.jboss.axis.soap.MessageFactoryImpl" };
/** Creates a new MessageFactory object that is an instance of the default
implementation.
Modified: trunk/src/main/java/javax/xml/soap/SOAPConnectionFactory.java
===================================================================
--- trunk/src/main/java/javax/xml/soap/SOAPConnectionFactory.java 2006-12-07 10:45:48 UTC
(rev 1599)
+++ trunk/src/main/java/javax/xml/soap/SOAPConnectionFactory.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -42,7 +42,7 @@
// provide logging
private static Logger log = Logger.getLogger(SOAPConnectionFactory.class);
- private static final String DEFAULT_SOAP_CONNECTION_FACTORY =
"org.jboss.ws.soap.SOAPConnectionFactoryImpl";
+ private static final String DEFAULT_SOAP_CONNECTION_FACTORY =
"org.jboss.ws.core.soap.SOAPConnectionFactoryImpl";
private static final String[] alternativeFactories = new String[] {
"org.jboss.webservice.soap.SOAPConnectionFactoryImpl",
"org.jboss.axis.soap.SOAPConnectionFactoryImpl" };
Modified: trunk/src/main/java/javax/xml/soap/SOAPFactory.java
===================================================================
--- trunk/src/main/java/javax/xml/soap/SOAPFactory.java 2006-12-07 10:45:48 UTC (rev
1599)
+++ trunk/src/main/java/javax/xml/soap/SOAPFactory.java 2006-12-07 10:43:36 UTC (rev
1600)
@@ -44,7 +44,7 @@
// provide logging
private static Logger log = Logger.getLogger(SOAPFactory.class);
- private static final String DEFAULT_SOAP_FACTORY =
"org.jboss.ws.soap.SOAPFactoryImpl";
+ private static final String DEFAULT_SOAP_FACTORY =
"org.jboss.ws.core.soap.SOAPFactoryImpl";
private static final String[] alternativeFactories = new String[] {
"org.jboss.axis.soap.SOAPFactoryImpl" };
/** Creates a new instance of SOAPFactory.
Modified: trunk/src/main/java/javax/xml/ws/WebServiceRefs.java
===================================================================
--- trunk/src/main/java/javax/xml/ws/WebServiceRefs.java 2006-12-07 10:45:48 UTC (rev
1599)
+++ trunk/src/main/java/javax/xml/ws/WebServiceRefs.java 2006-12-07 10:43:36 UTC (rev
1600)
@@ -21,11 +21,12 @@
*/
package javax.xml.ws;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
import java.lang.annotation.Target;
-import java.lang.annotation.Retention;
-import static java.lang.annotation.ElementType.*;
-import static java.lang.annotation.RetentionPolicy.*;
/**
* The <code>WebServiceRefs</code> annotation allows
Modified: trunk/src/main/java/javax/xml/ws/addressing/JAXWSAConstants.java
===================================================================
--- trunk/src/main/java/javax/xml/ws/addressing/JAXWSAConstants.java 2006-12-07 10:45:48
UTC (rev 1599)
+++ trunk/src/main/java/javax/xml/ws/addressing/JAXWSAConstants.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -36,7 +36,7 @@
public static final String ADDRESSING_BUILDER_PROPERTY =
"javax.xml.ws.addressing.AddressingBuilder";
- public static final String DEFAULT_ADDRESSING_BUILDER =
"org.jboss.ws.addressing.soap.SOAPAddressingBuilderImpl";
+ public static final String DEFAULT_ADDRESSING_BUILDER =
"org.jboss.ws.extensions.addressing.soap.SOAPAddressingBuilderImpl";
public static final String SOAP11_NAMESPACE_NAME =
"http://schemas.xmlsoap.org/soap/envelope/";
Modified: trunk/src/main/java/javax/xml/ws/spi/Provider.java
===================================================================
--- trunk/src/main/java/javax/xml/ws/spi/Provider.java 2006-12-07 10:45:48 UTC (rev 1599)
+++ trunk/src/main/java/javax/xml/ws/spi/Provider.java 2006-12-07 10:43:36 UTC (rev 1600)
@@ -29,7 +29,7 @@
import javax.xml.ws.Endpoint;
import javax.xml.ws.WebServiceException;
-import org.jboss.ws.jaxws.util.FactoryFinder;
+import org.jboss.ws.core.jaxws.util.FactoryFinder;
/**
* Service provider for ServiceDelegate and Endpoint objects.
@@ -40,7 +40,7 @@
public abstract class Provider
{
public static final String JAXWSPROVIDER_PROPERTY =
"javax.xml.ws.spi.Provider";
- private static final String DEFAULT_JAXWSPROVIDER =
"org.jboss.ws.jaxws.spi.ProviderImpl";
+ private static final String DEFAULT_JAXWSPROVIDER =
"org.jboss.ws.core.jaxws.spi.ProviderImpl";
protected Provider()
{
Deleted: trunk/src/main/java/org/jboss/ws/Constants.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/Constants.java 2006-12-07 10:45:48 UTC (rev 1599)
+++ trunk/src/main/java/org/jboss/ws/Constants.java 2006-12-07 10:43:36 UTC (rev 1600)
@@ -1,272 +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;
-
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.Name;
-
-import org.jboss.ws.soap.NameImpl;
-
-/**
- * A collection of constants relevant to JBossWS
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author Anil.Saldhana(a)jboss.org
- * @since 10-Oct-2004
- */
-public interface Constants
-{
- /** Header for XML Documents */
- static final String XML_HEADER = "<?xml version='1.0'
encoding='UTF-8'?>";
-
- /** Default charset for XML Documents */
- static final String DEFAULT_XML_CHARSET = "UTF-8";
-
- /** JBossWS namespace URI */
- static final String NS_JBOSSWS_URI = "http://www.jboss.org/jbossws";
- /** XML Namespace */
- static final String NS_XML = "http://www.w3.org/XML/1998/namespace";
- /** XMLSchema namespace
http://www.w3.org/2001/XMLSchema */
- static final String NS_SCHEMA_XSD = "http://www.w3.org/2001/XMLSchema";
- /** XMLSchema instance namespace
http://www.w3.org/2001/XMLSchema-instance */
- static final String NS_SCHEMA_XSI =
"http://www.w3.org/2001/XMLSchema-instance";
- /** SOAP-1.1 namespace
http://schemas.xmlsoap.org/wsdl/soap/ */
- static final String NS_SOAP11 = "http://schemas.xmlsoap.org/wsdl/soap/";
- /** SOAP-1.1 envelope namespace
http://schemas.xmlsoap.org/soap/envelope/ */
- static final String NS_SOAP11_ENV =
"http://schemas.xmlsoap.org/soap/envelope/";
- /** SOAP-1.2 namespace
http://schemas.xmlsoap.org/wsdl/soap12/ */
- static final String NS_SOAP12 = "http://schemas.xmlsoap.org/wsdl/soap12/";
- /** SOAP-1.2 envelope namespace
http://www.w3.org/2003/05/soap-envelope */
- static final String NS_SOAP12_ENV =
"http://www.w3.org/2003/05/soap-envelope";
- /** The namespace for the SwA mime type */
- static final String NS_SWA_MIME = "http://schemas.xmlsoap.org/wsdl/mime/";
- /** Default namespace for WSDL-1.1
http://schemas.xmlsoap.org/wsdl/ */
- static final String NS_WSDL11 = "http://schemas.xmlsoap.org/wsdl/";
- /** Default namespace for WSDL-2.0
http://www.w3.org/TR/wsdl20 */
- static final String NS_WSDL20 = "http://www.w3.org/2003/11/wsdl";
- /** The namespace for the MTOM content type attribute. */
- static final String NS_XML_MIME = "http://www.w3.org/2005/05/xmlmime";
- /** The namespace for XOP. */
- static final String NS_XOP = "http://www.w3.org/2004/08/xop/include";
-
- /** SOAP-1.1 encoding URI */
- static final String URI_SOAP11_ENC =
"http://schemas.xmlsoap.org/soap/encoding/";
- /** SOAP-1.2 encoding URI */
- static final String URI_SOAP12_ENC =
"http://www.w3.org/2003/05/soap-encoding";
- /** Literal encoding URI */
- static final String URI_LITERAL_ENC = "";
- /** WSDL 2.0 Encoding Rules */
- static final String URI_STYLE_RPC =
"http://www.w3.org/2004/03/wsdl/style/rpc";
- static final String URI_STYLE_IRI =
"http://www.w3.org/2004/03/wsdl/style/iri"; //represents doc
- /**Style of WSDL */
- static final String RPC_LITERAL = "RPC/Literal";
- static final String DOCUMENT_LITERAL = "Document/Literal";
-
- // Some prefixes
- static final String PREFIX_ENV = "env";
- static final String PREFIX_XMIME = "xmime";
- static final String PREFIX_SOAP11 = "soap";
- static final String PREFIX_SOAP12 = "soap12";
- static final String PREFIX_SOAP11_ENC = "soap11-enc";
- static final String PREFIX_TNS = "tns";
- static final String PREFIX_WSDL = "wsdl";
- static final String PREFIX_XOP = "xop";
- static final String PREFIX_XSD = "xsd";
- static final String PREFIX_XSI = "xsi";
- static final String PREFIX_XML = "xml";
-
- /** XOP Include */
- static final Name NAME_XOP_INCLUDE = new NameImpl("Include", PREFIX_XOP,
NS_XOP);
-
- /** SOAP-1.1 roles */
- static final String URI_SOAP11_NEXT_ACTOR =
"http://schemas.xmlsoap.org/soap/actor/next";
-
- /** SOAP-1.1 attributes */
- static final String SOAP11_ATTR_ACTOR = "actor";
- static final String SOAP11_ATTR_ROLE = "role";
- static final String SOAP11_ATTR_MUST_UNDERSTAND = "mustUnderstand";
-
- /** SOAP-1.1 fault codes */
- static final QName SOAP11_FAULT_CODE_CLIENT = new QName(NS_SOAP11_ENV,
"Client", PREFIX_ENV);
- static final QName SOAP11_FAULT_CODE_SERVER = new QName(NS_SOAP11_ENV,
"Server", PREFIX_ENV);
- static final QName SOAP11_FAULT_CODE_VERSION_MISMATCH = new QName(NS_SOAP11_ENV,
"VersionMismatch", PREFIX_ENV);
- static final QName SOAP11_FAULT_CODE_MUST_UNDERSTAND = new QName(NS_SOAP11_ENV,
"MustUnderstand", PREFIX_ENV);
-
- /** SOAP-1.1 elements */
- static final Name SOAP11_ENVELOPE = new NameImpl("Envelope", PREFIX_ENV,
NS_SOAP11_ENV);
- static final Name SOAP11_HEADER = new NameImpl("Header", PREFIX_ENV,
NS_SOAP11_ENV);
- static final Name SOAP11_BODY = new NameImpl("Body", PREFIX_ENV,
NS_SOAP11_ENV);
- static final Name SOAP11_FAULT = new NameImpl("Fault", PREFIX_ENV,
NS_SOAP11_ENV);
-
- /** SOAP-1.2 roles */
- static final String URI_SOAP12_ROLE_NONE =
"http://www.w3.org/2003/05/soap-envelope/role/none";
- static final String URI_SOAP12_ROLE_NEXT =
"http://www.w3.org/2003/05/soap-envelope/role/next";
- static final String URI_SOAP12_ROLE_ULTIMATE_RECEIVER =
"http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver";
-
- /** The default RPC return parameter name */
- static final String DEFAULT_RPC_RETURN_NAME = "result"; // FIXME: According
to JSR-181 this should be 'return'
-
- /** Standard Literal XML types */
- public static final QName TYPE_LITERAL_ANYSIMPLETYPE = new QName(NS_SCHEMA_XSD,
"anySimpleType", PREFIX_XSD);
- public static final QName TYPE_LITERAL_ANYTYPE = new QName(NS_SCHEMA_XSD,
"anyType", PREFIX_XSD);
- public static final QName TYPE_LITERAL_ANYURI = new QName(NS_SCHEMA_XSD,
"anyURI", PREFIX_XSD);
- public static final QName TYPE_LITERAL_BASE64BINARY = new QName(NS_SCHEMA_XSD,
"base64Binary", PREFIX_XSD);
- public static final QName TYPE_LITERAL_BOOLEAN = new QName(NS_SCHEMA_XSD,
"boolean", PREFIX_XSD);
- public static final QName TYPE_LITERAL_BYTE = new QName(NS_SCHEMA_XSD,
"byte", PREFIX_XSD);
- public static final QName TYPE_LITERAL_DATE = new QName(NS_SCHEMA_XSD,
"date", PREFIX_XSD);
- public static final QName TYPE_LITERAL_DATETIME = new QName(NS_SCHEMA_XSD,
"dateTime", PREFIX_XSD);
- public static final QName TYPE_LITERAL_DECIMAL = new QName(NS_SCHEMA_XSD,
"decimal", PREFIX_XSD);
- public static final QName TYPE_LITERAL_DOUBLE = new QName(NS_SCHEMA_XSD,
"double", PREFIX_XSD);
- public static final QName TYPE_LITERAL_DURATION = new QName(NS_SCHEMA_XSD,
"duration", PREFIX_XSD);
- public static final QName TYPE_LITERAL_FLOAT = new QName(NS_SCHEMA_XSD,
"float", PREFIX_XSD);
- public static final QName TYPE_LITERAL_GDAY = new QName(NS_SCHEMA_XSD,
"gDay", PREFIX_XSD);
- public static final QName TYPE_LITERAL_GMONTH = new QName(NS_SCHEMA_XSD,
"gMonth", PREFIX_XSD);
- public static final QName TYPE_LITERAL_GMONTHDAY = new QName(NS_SCHEMA_XSD,
"gMonthDay", PREFIX_XSD);
- public static final QName TYPE_LITERAL_GYEAR = new QName(NS_SCHEMA_XSD,
"gYear", PREFIX_XSD);
- public static final QName TYPE_LITERAL_GYEARMONTH = new QName(NS_SCHEMA_XSD,
"gYearMonth", PREFIX_XSD);
- public static final QName TYPE_LITERAL_HEXBINARY = new QName(NS_SCHEMA_XSD,
"hexBinary", PREFIX_XSD);
- public static final QName TYPE_LITERAL_ID = new QName(NS_SCHEMA_XSD, "ID",
PREFIX_XSD);
- public static final QName TYPE_LITERAL_INT = new QName(NS_SCHEMA_XSD, "int",
PREFIX_XSD);
- public static final QName TYPE_LITERAL_INTEGER = new QName(NS_SCHEMA_XSD,
"integer", PREFIX_XSD);
- public static final QName TYPE_LITERAL_LANGUAGE = new QName(NS_SCHEMA_XSD,
"language", PREFIX_XSD);
- public static final QName TYPE_LITERAL_LONG = new QName(NS_SCHEMA_XSD,
"long", PREFIX_XSD);
- public static final QName TYPE_LITERAL_NAME = new QName(NS_SCHEMA_XSD,
"Name", PREFIX_XSD);
- public static final QName TYPE_LITERAL_NCNAME = new QName(NS_SCHEMA_XSD,
"NCName", PREFIX_XSD);
- public static final QName TYPE_LITERAL_NEGATIVEINTEGER = new QName(NS_SCHEMA_XSD,
"negativeInteger", PREFIX_XSD);
- public static final QName TYPE_LITERAL_NMTOKEN = new QName(NS_SCHEMA_XSD,
"NMTOKEN", PREFIX_XSD);
- public static final QName TYPE_LITERAL_NMTOKENS = new QName(NS_SCHEMA_XSD,
"NMTOKENS", PREFIX_XSD);
- public static final QName TYPE_LITERAL_NONNEGATIVEINTEGER = new QName(NS_SCHEMA_XSD,
"nonNegativeInteger", PREFIX_XSD);
- public static final QName TYPE_LITERAL_NONPOSITIVEINTEGER = new QName(NS_SCHEMA_XSD,
"nonPositiveInteger", PREFIX_XSD);
- public static final QName TYPE_LITERAL_NORMALIZEDSTRING = new QName(NS_SCHEMA_XSD,
"normalizedString", PREFIX_XSD);
- public static final QName TYPE_LITERAL_POSITIVEINTEGER = new QName(NS_SCHEMA_XSD,
"positiveInteger", PREFIX_XSD);
- public static final QName TYPE_LITERAL_QNAME = new QName(NS_SCHEMA_XSD,
"QName", PREFIX_XSD);
- public static final QName TYPE_LITERAL_SHORT = new QName(NS_SCHEMA_XSD,
"short", PREFIX_XSD);
- public static final QName TYPE_LITERAL_STRING = new QName(NS_SCHEMA_XSD,
"string", PREFIX_XSD);
- public static final QName TYPE_LITERAL_TIME = new QName(NS_SCHEMA_XSD,
"time", PREFIX_XSD);
- public static final QName TYPE_LITERAL_TOKEN = new QName(NS_SCHEMA_XSD,
"token", PREFIX_XSD);
- public static final QName TYPE_LITERAL_UNSIGNEDBYTE = new QName(NS_SCHEMA_XSD,
"unsignedByte", PREFIX_XSD);
- public static final QName TYPE_LITERAL_UNSIGNEDINT = new QName(NS_SCHEMA_XSD,
"unsignedInt", PREFIX_XSD);
- public static final QName TYPE_LITERAL_UNSIGNEDLONG = new QName(NS_SCHEMA_XSD,
"unsignedLong", PREFIX_XSD);
- public static final QName TYPE_LITERAL_UNSIGNEDSHORT = new QName(NS_SCHEMA_XSD,
"unsignedShort", PREFIX_XSD);
-
- /** Standard SOAP-1.1 encoded XML types */
- public static final QName TYPE_SOAP11_ANYSIMPLETYPE = new QName(URI_SOAP11_ENC,
"anySimpleType", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_ANYTYPE = new QName(URI_SOAP11_ENC,
"anyType", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_ANYURI = new QName(URI_SOAP11_ENC,
"anyURI", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_BASE64 = new QName(URI_SOAP11_ENC,
"base64", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_BASE64BINARY = new QName(URI_SOAP11_ENC,
"base64Binary", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_BOOLEAN = new QName(URI_SOAP11_ENC,
"boolean", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_BYTE = new QName(URI_SOAP11_ENC,
"byte", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_DATE = new QName(URI_SOAP11_ENC,
"date", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_DATETIME = new QName(URI_SOAP11_ENC,
"dateTime", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_DECIMAL = new QName(URI_SOAP11_ENC,
"decimal", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_DOUBLE = new QName(URI_SOAP11_ENC,
"double", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_DURATION = new QName(URI_SOAP11_ENC,
"duration", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_FLOAT = new QName(URI_SOAP11_ENC,
"float", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_GDAY = new QName(URI_SOAP11_ENC,
"gDay", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_GMONTH = new QName(URI_SOAP11_ENC,
"gMonth", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_GMONTHDAY = new QName(URI_SOAP11_ENC,
"gMonthDay", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_GYEAR = new QName(URI_SOAP11_ENC,
"gYear", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_GYEARMONTH = new QName(URI_SOAP11_ENC,
"gYearMonth", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_HEXBINARY = new QName(URI_SOAP11_ENC,
"hexBinary", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_ID = new QName(URI_SOAP11_ENC, "ID",
PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_INT = new QName(URI_SOAP11_ENC, "int",
PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_INTEGER = new QName(URI_SOAP11_ENC,
"integer", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_LANGUAGE = new QName(URI_SOAP11_ENC,
"language", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_LONG = new QName(URI_SOAP11_ENC,
"long", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_NAME = new QName(URI_SOAP11_ENC,
"Name", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_NCNAME = new QName(URI_SOAP11_ENC,
"NCName", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_NEGATIVEINTEGER = new QName(URI_SOAP11_ENC,
"negativeInteger", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_NMTOKEN = new QName(URI_SOAP11_ENC,
"NMTOKEN", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_NMTOKENS = new QName(URI_SOAP11_ENC,
"NMTOKENS", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_NONNEGATIVEINTEGER = new QName(URI_SOAP11_ENC,
"nonNegativeInteger", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_NONPOSITIVEINTEGER = new QName(URI_SOAP11_ENC,
"nonPositiveInteger", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_NORMALIZEDSTRING = new QName(URI_SOAP11_ENC,
"normalizedString", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_POSITIVEINTEGER = new QName(URI_SOAP11_ENC,
"positiveInteger", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_QNAME = new QName(URI_SOAP11_ENC,
"QName", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_SHORT = new QName(URI_SOAP11_ENC,
"short", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_STRING = new QName(URI_SOAP11_ENC,
"string", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_TIME = new QName(URI_SOAP11_ENC,
"time", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_TOKEN = new QName(URI_SOAP11_ENC,
"token", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_UNSIGNEDBYTE = new QName(URI_SOAP11_ENC,
"unsignedByte", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_UNSIGNEDINT = new QName(URI_SOAP11_ENC,
"unsignedInt", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_UNSIGNEDLONG = new QName(URI_SOAP11_ENC,
"unsignedLong", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_UNSIGNEDSHORT = new QName(URI_SOAP11_ENC,
"unsignedShort", PREFIX_SOAP11_ENC);
-
- /** Encoded mime type namespace for internall and DII use */
- static final String NS_ATTACHMENT_MIME_TYPE =
"http://www.jboss.org/jbossws/attachment/mimetype";
-
- /** Attachment Types */
- static final QName TYPE_MIME_APPLICATION_XML = new QName(NS_ATTACHMENT_MIME_TYPE,
"application_xml");
- static final QName TYPE_MIME_IMAGE_JPEG = new QName(NS_ATTACHMENT_MIME_TYPE,
"image_jpeg");
- static final QName TYPE_MIME_IMAGE_GIF = new QName(NS_ATTACHMENT_MIME_TYPE,
"image_gif");
- static final QName TYPE_MIME_MULTIPART_MIXED = new QName(NS_ATTACHMENT_MIME_TYPE,
"multipart_mixed");
- static final QName TYPE_MIME_TEXT_PLAIN = new QName(NS_ATTACHMENT_MIME_TYPE,
"text_plain");
- static final QName TYPE_MIME_TEXT_XML = new QName(NS_ATTACHMENT_MIME_TYPE,
"text_xml");
-
- static final QName TYPE_XMIME_DEFAULT = new QName(NS_XML_MIME,
"base64Binary");
-
- /** For out of bound transport (i.e. in headers);
http://www.w3.org/2004/08/wsdl/feature/AD/data */
- static final String WSDL_PROPERTY_APPLICATION_DATA =
"http://www.w3.org/2004/08/wsdl/feature/AD/data";
- /** The key to the original message part name */
- static final String WSDL_PROPERTY_MESSAGE_NAME =
"http://www.jboss.org/jbossws/messagename";
- /** Key to the inbound message name */
- static final String WSDL_PROPERTY_MESSAGE_NAME_IN =
"http://www.jboss.org/jbossws/messagename/in";
- /** Key to the outbound message name */
- static final String WSDL_PROPERTY_MESSAGE_NAME_OUT =
"http://www.jboss.org/jbossws/messagename/out";
- /** Key to the inboudn wsa action */
- static final String WSDL_PROPERTY_ACTION_IN =
"http://www.jboss.org/jbossws/wsa/actionIn";
- /** Key to the outbound wsa action */
- static final String WSDL_PROPERTY_ACTION_OUT =
"http://www.jboss.org/jbossws/wsa/actionOut";
-
- static final String WSDL_PROPERTY_EVENTSOURCE =
"http://www.jboss.org/jbossws/wse/isEventSource";
-
- /** The key to the original message part name */
- static final String WSDL_PROPERTY_PART_NAME =
"http://www.jboss.org/jbossws/partname";
- /** The key to the message part type in case a part does not reference an element;
http://www.jboss.org/jbossws/rpc/xmltype */
- static final String WSDL_PROPERTY_RPC_XMLTYPE =
"http://www.jboss.org/jbossws/rpc/xmltype";
- /** Used as WSDL 2.0 property string to provide support for WSDL 1.1 mime types */
- static final String WSDL_PROPERTY_WSDL11_MIME_TYPE = NS_ATTACHMENT_MIME_TYPE;
- /** Indicate that the operation has zero arguments */
- static final String WSDL_PROPERTY_ZERO_ARGS =
"http://www.jboss.org/jbossws/zero-args";
- /** Indicate that the operation has a void return*/
- static final String WSDL_PROPERTY_VOID_RETURN =
"http://www.jboss.org/jbossws/void-return";
- /** Indicates that an output is a return parameter */
- static final String WSDL_PROPERTY_RETURN_PART =
"http://www.jboss.org/jbossws/return-part";
-
- static final QName WSDL_ATTRIBUTE_WSA_ACTION = new
QName("http://www.w3.org/2005/08/addressing", "Action");
-
- static final QName WSDL_ATTRIBUTE_WSE_EVENTSOURCE = new
QName("http://schemas.xmlsoap.org/ws/2004/08/eventing",
"EventSource");
-
- /** WSDL-2.0 exchange patterns */
- static final String WSDL20_PATTERN_IN_ONLY =
"http://www.w3.org/2004/08/wsdl/in-only";
- static final String WSDL20_PATTERN_ROUST_IN_ONLY =
"http://www.w3.org/2004/08/wsdl/robust-in-only";
- static final String WSDL20_PATTERN_IN_OUT =
"http://www.w3.org/2004/08/wsdl/in-out";
- static final String WSDL20_PATTERN_IN_OPTIONAL_OUT =
"http://www.w3.org/2004/08/wsdl/in-opt-out";
- static final String WSDL20_PATTERN_OUT_ONLY =
"http://www.w3.org/2004/08/wsdl/out-only";
- static final String WSDL20_PATTERN_ROBUST_OUT_ONLY =
"http://www.w3.org/2004/08/wsdl/robust-out-only";
- static final String WSDL20_PATTERN_OUT_IN =
"http://www.w3.org/2004/08/wsdl/out-in";
- static final String WSDL20_PATTERN_OUT_OPT_IN =
"http://www.w3.org/2004/08/wsdl/out-opt-in";
-
- static final String ASYNC_METHOD_SUFFIX = "Async";
-}
Copied: trunk/src/main/java/org/jboss/ws/Constants.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/Constants.java)
Copied: trunk/src/main/java/org/jboss/ws/core (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core)
Deleted: trunk/src/main/java/org/jboss/ws/core/CommonClient.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonClient.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/CommonClient.java 2006-12-07 10:43:36 UTC (rev
1600)
@@ -1,388 +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.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.core.jaxrpc.ParameterWrapping;
-import org.jboss.ws.core.jaxrpc.Style;
-import org.jboss.ws.core.jaxrpc.binding.CommonBinding;
-import org.jboss.ws.core.jaxrpc.binding.CommonBindingProvider;
-import org.jboss.ws.core.jaxrpc.handler.HandlerChainBaseImpl;
-import org.jboss.ws.core.soap.EndpointInfo;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.core.soap.SOAPBodyImpl;
-import org.jboss.ws.core.soap.SOAPConnectionImpl;
-import org.jboss.ws.core.soap.UnboundHeader;
-import org.jboss.ws.core.utils.HolderUtils;
-import org.jboss.ws.extensions.addressing.AddressingConstantsImpl;
-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;
-
-/**
- * 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: trunk/src/main/java/org/jboss/ws/core/CommonClient.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonClient.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/CommonContextServlet.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonContextServlet.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/CommonContextServlet.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,85 +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.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.core.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: trunk/src/main/java/org/jboss/ws/core/CommonContextServlet.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonContextServlet.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/CommonMessageContext.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonMessageContext.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/CommonMessageContext.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,157 +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.core;
-
-// $Id$
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.xml.soap.SOAPMessage;
-
-import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
-import org.jboss.ws.core.server.MessageContextPropertyHelper;
-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: trunk/src/main/java/org/jboss/ws/core/CommonMessageContext.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonMessageContext.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/EndpointInvocation.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/EndpointInvocation.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/EndpointInvocation.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,357 +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.core;
-
-// $Id$
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-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.SOAPException;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.jaxrpc.ParameterWrapping;
-import org.jboss.ws.core.soap.SOAPContentElement;
-import org.jboss.ws.core.utils.HolderUtils;
-import org.jboss.ws.core.utils.JavaUtils;
-import org.jboss.ws.core.utils.MimeUtils;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-import org.jboss.ws.metadata.umdm.ParameterMetaData;
-import org.jboss.ws.metadata.umdm.WrappedParameter;
-
-/** A web service invocation.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 16-Oct-2004
- */
-public class EndpointInvocation
-{
- // provide logging
- private static final Logger log = Logger.getLogger(EndpointInvocation.class);
-
- // The operation meta data for this invocation
- private OperationMetaData opMetaData;
- // Map the named endpoint parameters
- private Map<QName, Object> reqPayload = new LinkedHashMap<QName,
Object>();
- // Map the named endpoint parameters
- private Map<QName, Object> resPayload = new LinkedHashMap<QName,
Object>();
- // The return value
- private Object returnValue;
- // Map of output parameters, key being the parameter index in the method signature
- private Map<Integer, Object> outParameters = new HashMap<Integer,
Object>();
-
- public EndpointInvocation(OperationMetaData opMetaData)
- {
- this.opMetaData = opMetaData;
- }
-
- public OperationMetaData getOperationMetaData()
- {
- return opMetaData;
- }
-
- public Method getJavaMethod()
- {
- return opMetaData.getJavaMethod();
- }
-
- public Map<Integer, Object> getOutParameters()
- {
- return outParameters;
- }
-
- public List<QName> getRequestParamNames()
- {
- List<QName> xmlNames = new ArrayList<QName>();
- xmlNames.addAll(reqPayload.keySet());
- return xmlNames;
- }
-
- public void setRequestParamValue(QName xmlName, Object value)
- {
- log.debug("setRequestParamValue: [name=" + xmlName + ",value="
+ getTypeName(value) + "]");
- reqPayload.put(xmlName, value);
- }
-
- public Object getRequestParamValue(QName xmlName) throws SOAPException
- {
- log.debug("getRequestParamValue: " + xmlName);
- Object paramValue = reqPayload.get(xmlName);
- ParameterMetaData paramMetaData = opMetaData.getParameter(xmlName);
- paramValue = transformPayloadValue(paramMetaData, paramValue);
- return paramValue;
- }
-
- /** Returns the payload that can be passed on to the endpoint implementation
- */
- public Object[] getRequestPayload() throws SOAPException
- {
- log.debug("getRequestPayload");
- List<QName> xmlNames = getRequestParamNames();
-
- Object[] payload = new
Object[opMetaData.getJavaMethod().getParameterTypes().length];
- for (int i = 0; i < xmlNames.size(); i++)
- {
- QName xmlName = xmlNames.get(i);
- Object paramValue = getRequestParamValue(xmlName);
-
- ParameterMetaData paramMetaData = opMetaData.getParameter(xmlName);
- syncEndpointInputParam(paramMetaData, paramValue, payload);
- }
-
- return payload;
- }
-
- public List<QName> getResponseParamNames()
- {
- List<QName> xmlNames = new ArrayList<QName>();
- xmlNames.addAll(resPayload.keySet());
- return xmlNames;
- }
-
- public void setResponseParamValue(QName xmlName, Object value)
- {
- log.debug("setResponseParamValue: [name=" + xmlName + ",value="
+ getTypeName(value) + "]");
- resPayload.put(xmlName, value);
- }
-
- public Object getResponseParamValue(QName xmlName) throws SOAPException
- {
- log.debug("getResponseParamValue: " + xmlName);
- Object paramValue = resPayload.get(xmlName);
- ParameterMetaData paramMetaData = opMetaData.getParameter(xmlName);
- paramValue = transformPayloadValue(paramMetaData, paramValue);
- if (paramValue != null)
- {
- Class valueType = paramValue.getClass();
- if (HolderUtils.isHolderType(valueType))
- {
- paramValue = HolderUtils.getHolderValue(paramValue);
- }
- }
- return paramValue;
- }
-
- public void setReturnValue(Object value)
- {
- ParameterMetaData retMetaData = opMetaData.getReturnParameter();
- if (value != null && retMetaData == null)
- throw new WSException("Operation does not have a return value: " +
opMetaData.getQName());
-
- log.debug("setReturnValue: " + getTypeName(value));
- this.returnValue = value;
- }
-
- public Object getReturnValue() throws SOAPException
- {
- log.debug("getReturnValue");
- Object paramValue = returnValue;
- ParameterMetaData paramMetaData = opMetaData.getReturnParameter();
- if (paramMetaData != null)
- {
- paramValue = transformPayloadValue(paramMetaData, paramValue);
- }
- return paramValue;
- }
-
- private Object transformPayloadValue(ParameterMetaData paramMetaData, final Object
paramValue) throws SOAPException
- {
- QName xmlName = paramMetaData.getXmlName();
- QName xmlType = paramMetaData.getXmlType();
- Class javaType = paramMetaData.getJavaType();
- String javaName = paramMetaData.getJavaTypeName();
-
- if (xmlType == null)
- throw new IllegalStateException("Cannot obtain xml type for:
[xmlName=" + xmlName + ",javaName=" + javaName + "]");
-
- Object retValue = paramValue;
-
- // Handle attachment part
- if (paramValue instanceof AttachmentPart)
- {
- AttachmentPart part = (AttachmentPart)paramValue;
-
- Set mimeTypes = paramMetaData.getMimeTypes();
- if (DataHandler.class.isAssignableFrom(javaType) &&
!javaType.equals(Object.class))
- {
- DataHandler handler = part.getDataHandler();
- String mimeType = MimeUtils.getBaseMimeType(handler.getContentType());
-
- if (mimeTypes != null && !MimeUtils.isMemberOf(mimeType, mimeTypes))
- throw new SOAPException("Mime type " + mimeType + " not
allowed for parameter " + xmlName + " allowed types are " + mimeTypes);
-
- retValue = part.getDataHandler();
- }
- else
- {
- retValue = part.getContent();
- String mimeType = MimeUtils.getBaseMimeType(part.getContentType());
-
- if (mimeTypes != null && !MimeUtils.isMemberOf(mimeType, mimeTypes))
- throw new SOAPException("Mime type " + mimeType + " not
allowed for parameter " + xmlName + " allowed types are " + mimeTypes);
-
- if (retValue != null)
- {
- Class valueType = retValue.getClass();
- if (JavaUtils.isAssignableFrom(javaType, valueType) == false)
- throw new SOAPException("javaType [" + javaType.getName() +
"] is not assignable from attachment content: " + valueType.getName());
- }
- }
- }
- else if (paramValue instanceof SOAPContentElement)
- {
- // For type other than xsd:anyType we return the object value
- if (xmlType.getLocalPart().equals("anyType") == false)
- {
- SOAPContentElement soapElement = (SOAPContentElement)paramValue;
- retValue = soapElement.getObjectValue();
- }
- }
-
- log.debug("transformPayloadValue: " + getTypeName(paramValue) + "
-> " + getTypeName(retValue));
- return retValue;
- }
-
- /** Synchronize the operation IN, INOUT paramters with the call input parameters.
- * Essetially it unwrapps holders and converts primitives to wrapper types.
- */
- public void initInputParams(Object[] inputParams)
- {
- for (ParameterMetaData paramMetaData : opMetaData.getParameters())
- {
- QName xmlName = paramMetaData.getXmlName();
- Class javaType = paramMetaData.getJavaType();
-
- Object value;
- if (opMetaData.isDocumentWrapped() && paramMetaData.isInHeader() ==
false)
- {
- value = ParameterWrapping.wrapRequestParameters(paramMetaData, inputParams);
- }
- else
- {
- value = inputParams[paramMetaData.getIndex()];
- if (value != null)
- {
- Class inputType = value.getClass();
-
- if (HolderUtils.isHolderType(inputType))
- {
- // At runtime we lose the generic info for JAX-WS types,
- // So we use the actual instance type if possible
- value = HolderUtils.getHolderValue(value);
- inputType = (value == null) ? HolderUtils.getValueType(inputType) :
value.getClass();
- }
-
- // Verify that the java type matches a registered xmlType
- // Attachments are skipped because they don't use type mapping
- if (!paramMetaData.isSwA() && !paramMetaData.isXOP())
- {
- if (JavaUtils.isAssignableFrom(javaType, inputType) == false)
- throw new WSException("Parameter '" + javaType +
"' not assignable from: " + inputType);
- }
- }
- }
-
- setRequestParamValue(xmlName, value);
- }
- }
-
- /**
- * Synchronize the operation paramters with the endpoint method parameters
- */
- private void syncEndpointInputParam(ParameterMetaData paramMetaData, final Object
paramValue, Object[] payload)
- {
- Object retValue = paramValue;
- Method method = opMetaData.getJavaMethod();
- Class[] targetParameterTypes = method.getParameterTypes();
-
- if (opMetaData.isDocumentWrapped() && paramMetaData.isInHeader() == false
&& paramMetaData.isMessageType() == false)
- {
- outParameters = ParameterWrapping.unwrapRequestParameters(paramMetaData,
paramValue, payload);
- syncOutWrappedParameters(targetParameterTypes);
- }
- else
- {
- // Replace INOUT and OUT parameters by their respective holder values
- int index = paramMetaData.getIndex();
- Class targetParameterType = targetParameterTypes[index];
-
- if (paramMetaData.getMode() == ParameterMode.INOUT || paramMetaData.getMode() ==
ParameterMode.OUT)
- {
- retValue = HolderUtils.createHolderInstance(paramValue,
targetParameterType);
-
- QName xmlName = paramMetaData.getXmlName();
- setResponseParamValue(xmlName, retValue);
- }
-
- if (retValue != null)
- {
- Class valueType = retValue.getClass();
- if (JavaUtils.isAssignableFrom(targetParameterType, valueType) == false)
- throw new WSException("Parameter " +
targetParameterType.getName() + " is not assignable from: " +
getTypeName(retValue));
-
- if (valueType.isArray())
- retValue = JavaUtils.syncArray(retValue, targetParameterType);
- }
-
- log.debug("syncEndpointInputParam: " + getTypeName(paramValue) +
" -> " + getTypeName(retValue) + "(" + index + ")");
- payload[index] = retValue;
- }
- }
-
- private void syncOutWrappedParameters(Class[] targetParameterTypes)
- {
- ParameterMetaData returnMetaData = opMetaData.getReturnParameter();
- if (returnMetaData != null)
- {
- for (WrappedParameter param : returnMetaData.getWrappedParameters())
- {
- try
- {
- if (param.getIndex() >= 0)
- outParameters.put(param.getIndex(),
targetParameterTypes[param.getIndex()].newInstance());
- }
- catch (Exception e)
- {
- throw new WSException("Could not add output param: " +
param.getName(), e);
-
- }
- }
- }
- }
-
- private String getTypeName(Object value)
- {
- String valueType = (value != null ? value.getClass().getName() : null);
- return valueType;
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/core/EndpointInvocation.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/EndpointInvocation.java)
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/CallImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/CallImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/CallImpl.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,671 +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.core.jaxrpc;
-
-// $Id$
-
-import java.rmi.RemoteException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.Call;
-import javax.xml.rpc.JAXRPCException;
-import javax.xml.rpc.ParameterMode;
-import javax.xml.rpc.ServiceException;
-import javax.xml.rpc.Stub;
-import javax.xml.rpc.encoding.SerializerFactory;
-import javax.xml.rpc.soap.SOAPFaultException;
-import javax.xml.soap.SOAPException;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.jboss.ws.core.CommonClient;
-import org.jboss.ws.core.jaxrpc.binding.JBossXBDeserializerFactory;
-import org.jboss.ws.core.jaxrpc.binding.JBossXBSerializerFactory;
-import org.jboss.ws.core.jaxrpc.handler.HandlerChainBaseImpl;
-import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.core.soap.UnboundHeader;
-import org.jboss.ws.core.utils.JavaUtils;
-import org.jboss.ws.extensions.xop.XOPContext;
-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;
-
-/** 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.
- *
- * Once a Call instance is created, various setter and getter methods may be used to
configure this Call instance.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 10-Oct-2004
- */
-public class CallImpl extends CommonClient implements Call
-{
- // provide logging
- private static Logger log = Logger.getLogger(CallImpl.class);
-
- // The service that created this call
- private ServiceImpl jaxrpcService;
- // The port type name
- private QName portType;
- // A Map<QName,UnboundHeader> of header entries
- private Map<QName, UnboundHeader> unboundHeaders = new LinkedHashMap<QName,
UnboundHeader>();
- // A Map<String,Object> of Call properties
- private Map<String, Object> properties = new HashMap<String, Object>();
-
- // The set of supported properties
- private static final Set<String> standardProperties = new
HashSet<String>();
- static
- {
- standardProperties.add(Call.ENCODINGSTYLE_URI_PROPERTY);
- standardProperties.add(Call.OPERATION_STYLE_PROPERTY);
- standardProperties.add(Call.SESSION_MAINTAIN_PROPERTY);
- standardProperties.add(Call.SOAPACTION_URI_PROPERTY);
- standardProperties.add(Call.SOAPACTION_USE_PROPERTY);
- standardProperties.add(Call.USERNAME_PROPERTY);
- standardProperties.add(Call.PASSWORD_PROPERTY);
-
- standardProperties.add(Stub.ENDPOINT_ADDRESS_PROPERTY);
- standardProperties.add(Stub.SESSION_MAINTAIN_PROPERTY);
- standardProperties.add(Stub.USERNAME_PROPERTY);
- standardProperties.add(Stub.PASSWORD_PROPERTY);
- }
-
- /** Create a call that needs to be configured manually
- */
- CallImpl(ServiceImpl service)
- {
- super(service.getServiceMetaData());
- this.jaxrpcService = service;
-
- if (epMetaData != null)
- setTargetEndpointAddress(epMetaData.getEndpointAddress());
- }
-
- /** Create a call for a known WSDL endpoint.
- *
- * @param epMetaData A WSDLEndpoint
- */
- CallImpl(ServiceImpl service, EndpointMetaData epMetaData)
- {
- super(epMetaData);
- this.jaxrpcService = service;
-
- setTargetEndpointAddress(epMetaData.getEndpointAddress());
- }
-
- /** Create a call for a known WSDL endpoint.
- *
- * @param portName Qualified name for the target service endpoint
- * @throws ServiceException
- */
- CallImpl(ServiceImpl service, QName portName, QName opName) throws ServiceException
- {
- super(service.getServiceMetaData(), portName, opName);
- this.jaxrpcService = service;
-
- if (epMetaData != null)
- setTargetEndpointAddress(epMetaData.getEndpointAddress());
- }
-
- @Override
- protected Map<String, Object> getRequestContext()
- {
- return properties;
- }
-
- /**
- * Add a header that is not bound to an input parameter.
- * A propriatory extension, that is not part of JAXRPC.
- *
- * @param xmlName The XML name of the header element
- * @param xmlType The XML type of the header element
- */
- public void addUnboundHeader(QName xmlName, QName xmlType, Class javaType,
ParameterMode mode)
- {
- UnboundHeader unboundHeader = new UnboundHeader(xmlName, xmlType, javaType, mode);
- unboundHeaders.put(xmlName, unboundHeader);
- }
-
- /**
- * Get the header value for the given XML name.
- * A propriatory extension, that is not part of JAXRPC.
- *
- * @param xmlName The XML name of the header element
- * @return The header value, or null
- */
- public Object getUnboundHeaderValue(QName xmlName)
- {
- UnboundHeader unboundHeader = unboundHeaders.get(xmlName);
- return (unboundHeader != null ? unboundHeader.getHeaderValue() : null);
- }
-
- /**
- * Set the header value for the given XML name.
- * A propriatory extension, that is not part of JAXRPC.
- *
- * @param xmlName The XML name of the header element
- */
- public void setUnboundHeaderValue(QName xmlName, Object value)
- {
- UnboundHeader unboundHeader = unboundHeaders.get(xmlName);
- if (unboundHeader == null)
- throw new IllegalArgumentException("Cannot find unbound header: " +
xmlName);
-
- unboundHeader.setHeaderValue(value);
- }
-
- /**
- * Clear all registered headers.
- * A propriatory extension, that is not part of JAXRPC.
- */
- public void clearUnboundHeaders()
- {
- unboundHeaders.clear();
- }
-
- /**
- * Remove the header for the given XML name.
- * A propriatory extension, that is not part of JAXRPC.
- */
- public void removeUnboundHeader(QName xmlName)
- {
- unboundHeaders.remove(xmlName);
- }
-
- /**
- * Get an Iterator over the registered header XML names.
- * A propriatory extension, that is not part of JAXRPC.
- */
- public Iterator getUnboundHeaders()
- {
- return unboundHeaders.keySet().iterator();
- }
-
- /** Gets the address of a target service endpoint.
- */
- public String getTargetEndpointAddress()
- {
- return (String)properties.get(Stub.ENDPOINT_ADDRESS_PROPERTY);
- }
-
- /** Sets the address of the target service endpoint. This address must correspond to
the transport
- * specified in the binding for this Call instance.
- *
- * @param address Address of the target service endpoint; specified as an URI
- */
- public void setTargetEndpointAddress(String address)
- {
- this.properties.put(Stub.ENDPOINT_ADDRESS_PROPERTY, address);
- }
-
- /** Adds a parameter type and mode for a specific operation.
- */
- public void addParameter(String paramName, QName xmlType, ParameterMode
parameterMode)
- {
- TypeMappingImpl typeMapping =
getEndpointMetaData().getServiceMetaData().getTypeMapping();
- Class javaType = typeMapping.getJavaType(xmlType);
-
- // CTS
com/sun/ts/tests/jaxrpc/api/javax_xml_rpc/Call/AddGetRemoveAllParametersTest1
- // tests addParameter/getParameter without giving the javaType for a custom
parameter
- // IMHO, this flavour of addParameter should only be used for standard types,
where
- // the javaType can be derived from the xmlType
- if (javaType == null)
- {
- log.warn("Register unqualified call parameter for: " + xmlType);
- javaType = new UnqualifiedCallParameter(xmlType).getClass();
- typeMapping.register(javaType, xmlType, null, null);
- }
-
- addParameter(paramName, xmlType, javaType, parameterMode);
- }
-
- /** Adds a parameter type and mode for a specific operation.
- */
- public void addParameter(String paramName, QName xmlType, Class javaType,
ParameterMode mode)
- {
- QName xmlName = new QName(paramName);
- addParameter(xmlName, xmlType, javaType, mode, false);
- }
-
- /** Add a parameter to the current operation description.
- * This is a propriatary extension that gives full control over the parameter
configuration.
- */
- public void addParameter(QName xmlName, QName xmlType, Class javaType, ParameterMode
mode, boolean inHeader)
- {
- if (xmlType == null || javaType == null)
- throw new IllegalArgumentException("Invalid null parameter");
-
- OperationMetaData opMetaData = getOperationMetaData();
- ParameterMetaData paramMetaData = new ParameterMetaData(opMetaData, xmlName,
xmlType, javaType.getName());
- paramMetaData.setMode(mode);
- paramMetaData.setInHeader(inHeader);
- paramMetaData.setIndex(opMetaData.getParameters().size());
- opMetaData.addParameter(paramMetaData);
-
- registerParameterType(xmlType, javaType);
- }
-
- /** Removes all specified parameters from this Call instance. Note that this method
removes only the parameters and
- * not the return type. The setReturnType(null) is used to remove the return type.
- *
- * @throws javax.xml.rpc.JAXRPCException This exception may be thrown If this method
is called when the method isParameterAndReturnSpecRequired returns false for this
Call's operation.
- */
- public void removeAllParameters()
- {
- OperationMetaData opMetaData = getOperationMetaData();
- opMetaData.removeAllParameters();
- }
-
- /** Sets the return type for a specific operation. Invoking setReturnType(null)
removes the return type for this Call object.
- */
- public void setReturnType(QName xmlType)
- {
- Class javaType =
getEndpointMetaData().getServiceMetaData().getTypeMapping().getJavaType(xmlType);
- setReturnType(xmlType, javaType);
- }
-
- /** Sets the return type for a specific operation.
- */
- public void setReturnType(QName xmlType, Class javaType)
- {
- if (xmlType == null || javaType == null)
- throw new IllegalArgumentException("Invalid null parameter");
-
- OperationMetaData opMetaData = getOperationMetaData();
- QName xmlName = new QName(Constants.DEFAULT_RPC_RETURN_NAME);
- String javaTypeName = javaType.getName();
- ParameterMetaData retMetaData = new ParameterMetaData(opMetaData, xmlName, xmlType,
javaTypeName);
- opMetaData.setReturnParameter(retMetaData);
-
- registerParameterType(xmlType, javaType);
- }
-
- /** Invokes a remote method using the one-way interaction mode.
- */
- public void invokeOneWay(Object[] inputParams)
- {
- try
- {
- invokeInternal(operationName, inputParams, unboundHeaders, true);
- }
- catch (RemoteException ex)
- {
- throw new JAXRPCException(ex);
- }
- }
-
- /** Invokes a specific operation using a synchronous request-response interaction
mode.
- */
- public Object invoke(Object[] inputParams) throws RemoteException
- {
- return invokeInternal(operationName, inputParams, unboundHeaders, false);
- }
-
- /** Invokes a specific operation using a synchronous request-response interaction
mode.
- */
- public Object invoke(QName operationName, Object[] inputParams) throws
RemoteException
- {
- return invokeInternal(operationName, inputParams, unboundHeaders, false);
- }
-
- /** Returns a List values for the output parameters of the last invoked operation.
- *
- * @return java.util.List Values for the output parameters. An empty List is returned
if there are no output values.
- * @throws JAXRPCException If this method is invoked for a one-way operation or is
invoked before any invoke method has been called.
- */
- public List getOutputValues()
- {
- if (epInv == null)
- throw new JAXRPCException("Output params not available");
-
- try
- {
- OperationMetaData opMetaData = getOperationMetaData();
-
- List<Object> objPayload = new ArrayList<Object>();
- for (QName xmlName : epInv.getResponseParamNames())
- {
- Object paramValue = epInv.getResponseParamValue(xmlName);
- if (opMetaData.isDocumentWrapped())
- {
- objPayload = Arrays.asList((Object[])paramValue);
- break;
- }
- else
- {
- objPayload.add(paramValue);
- }
- }
- return objPayload;
- }
- catch (SOAPException ex)
- {
- throw new JAXRPCException("Cannot obtain response payload", ex);
- }
- }
-
- /** Returns a Map of {name, value} for the output parameters of the last invoked
operation.
- * The parameter names in the returned Map are of type java.lang.String.
- *
- * @return Map Output parameters for the last Call.invoke(). Empty Map is returned if
there are no output parameters.
- * @throws JAXRPCException If this method is invoked for a one-way operation or is
invoked before any invoke method has been called.
- */
- public Map getOutputParams()
- {
- if (epInv == null)
- throw new JAXRPCException("Output params not available");
-
- try
- {
- Map<String, Object> outMap = new LinkedHashMap<String, Object>();
- for (QName xmlName : epInv.getResponseParamNames())
- {
- Object value = epInv.getResponseParamValue(xmlName);
- outMap.put(xmlName.getLocalPart(), value);
- }
- return outMap;
- }
- catch (SOAPException ex)
- {
- throw new JAXRPCException("Cannot obtain response payload", ex);
- }
- }
-
- /**
- * Gets the qualified name of the port type.
- *
- * @return Qualified name of the port type
- */
- public QName getPortTypeName()
- {
- if (portType != null)
- {
- return portType;
- }
-
- /* This code could be used to derive the portType from the endpoint meta data.
- * However, it breaks CTS
com/sun/ts/tests/jaxrpc/api/javax_xml_rpc/Call/Client.java#SetGetPortTypeNameTest2
- if (epMetaData != null)
- {
- ServiceMetaData serviceMetaData = epMetaData.getServiceMetaData();
- WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
- WSDLService wsdlService = wsdlDefinitions.getService(new
NCName(serviceMetaData.getName().getLocalPart()));
- WSDLEndpoint wsdlEndpoint = wsdlService.getEndpoint(epMetaData.getName());
- WSDLInterface wsdlInterface = wsdlEndpoint.getInterface();
- return wsdlInterface.getQName();
- }
- */
-
- // CTS
com/sun/ts/tests/jaxrpc/api/javax_xml_rpc/Call/Client.java#SetGetPortTypeNameTest2
- return new QName("");
- }
-
- /**
- * Gets the return type for a specific operation
- *
- * @return Returns the XML type for the return value
- */
- public QName getReturnType()
- {
- QName retType = null;
- if (operationName != null)
- {
- OperationMetaData opDesc = getOperationMetaData();
- ParameterMetaData retMetaData = opDesc.getReturnParameter();
- if (retMetaData != null)
- retType = retMetaData.getXmlType();
- }
- return retType;
- }
-
- /**
- * Sets the qualified name of the interface.
- *
- * @param portType - Qualified name of the port type
- */
- public void setPortTypeName(QName portType)
- {
- this.portType = portType;
- }
-
- /**
- * Indicates whether addParameter and setReturnType methods are to be invoked to
specify the parameter and return
- * type specification for a specific operation.
- *
- * @param opName Qualified name of the operation
- * @return Returns true if the Call implementation class requires addParameter and
setReturnType to be invoked in the client code for the specified operation. This method
returns false otherwise.
- * @throws IllegalArgumentException If invalid operation name is specified
- */
- public boolean isParameterAndReturnSpecRequired(QName opName)
- {
- setOperationName(opName);
- OperationMetaData opMetaData = getOperationMetaData();
- return opMetaData.getParameters().size() == 0 &&
opMetaData.getReturnParameter() == null;
- }
-
- /** Gets the names of configurable properties supported by this Call object.
- * @return Iterator for the property names
- */
- public Iterator getPropertyNames()
- {
- return standardProperties.iterator();
- }
-
- /** Gets the value of a named property.
- */
- public Object getProperty(String name)
- {
- if (null == name)
- throw new JAXRPCException("Unsupported property: " + name);
- // CTS:
com/sun/ts/tests/jaxrpc/api/javax_xml_rpc/Call/Client.java#SetGetPropertyTest2
- if (name.startsWith("javax.xml.rpc") &&
standardProperties.contains(name) == false)
- throw new JAXRPCException("Unsupported property: " + name);
-
- return properties.get(name);
- }
-
- /** Sets the value for a named property.
- */
- public void setProperty(String name, Object value)
- {
- if (null == name)
- throw new JAXRPCException("Unsupported property: " + name);
- // CTS:
com/sun/ts/tests/jaxrpc/api/javax_xml_rpc/Call/Client.java#SetGetPropertyTest2
- if (name.startsWith("javax.xml.rpc") &&
standardProperties.contains(name) == false)
- throw new JAXRPCException("Unsupported property: " + name);
-
- properties.put(name, value);
- }
-
- /** Removes a named property.
- */
- public void removeProperty(String name)
- {
- properties.remove(name);
- }
-
- /** Gets the XML type of a parameter by name.
- */
- public QName getParameterTypeByName(String paramName)
- {
- OperationMetaData opMetaData = getOperationMetaData();
- ParameterMetaData paramMetaData = opMetaData.getParameter(new QName(paramName));
- if (paramMetaData != null)
- return paramMetaData.getXmlType();
- else return null;
- }
-
- @Override
- protected void setInboundContextProperties()
- {
- }
-
- @Override
- protected void setOutboundContextProperties()
- {
- }
-
- private Object invokeInternal(QName opName, Object[] inputParams, Map<QName,
UnboundHeader> unboundHeaders, boolean forceOneway) throws RemoteException
- {
- if (opName.equals(operationName) == false)
- setOperationName(opName);
-
- OperationMetaData opMetaData = getOperationMetaData();
-
- // Check or generate the the schema if this call is unconfigured
- generateOrUpdateSchemas(opMetaData);
-
- // Associate a message context with the current thread
- SOAPMessageContextJAXRPC msgContext = new SOAPMessageContextJAXRPC();
- MessageContextAssociation.pushMessageContext(msgContext);
- Object retObj = null;
- try
- {
- retObj = super.invoke(opName, inputParams, unboundHeaders, properties,
forceOneway);
- return retObj;
- }
- catch (SOAPFaultException ex)
- {
- log.error("Call invocation failed", ex);
- String faultCode = ex.getFaultCode().getLocalPart();
- throw new RemoteException("Call invocation failed with code [" +
faultCode + "] because of: " + ex.getFaultString(), ex);
- }
- catch (RemoteException rex)
- {
- throw rex;
- }
- catch (Exception ex)
- {
- throw new RemoteException("Call invocation failed", ex);
- }
- finally
- {
- // Reset the message context association
- MessageContextAssociation.popMessageContext();
- }
- }
-
- @Override
- protected boolean callRequestHandlerChain(QName portName, HandlerType type)
- {
- SOAPMessageContextJAXRPC msgContext =
(SOAPMessageContextJAXRPC)MessageContextAssociation.peekMessageContext();
- HandlerChainBaseImpl handlerChain =
(HandlerChainBaseImpl)jaxrpcService.getHandlerChain(portName);
- boolean status = (handlerChain != null ? handlerChain.handleRequest(msgContext,
type) : true);
-
- if (type == HandlerType.ENDPOINT)
- XOPContext.visitAndRestoreXOPData();
-
- return status;
- }
-
- @Override
- protected boolean callResponseHandlerChain(QName portName, HandlerType type)
- {
- SOAPMessageContextJAXRPC msgContext =
(SOAPMessageContextJAXRPC)MessageContextAssociation.peekMessageContext();
- HandlerChainBaseImpl handlerChain =
(HandlerChainBaseImpl)jaxrpcService.getHandlerChain(portName);
-
- boolean status = true;
- if (handlerChain != null)
- {
- status = handlerChain.handleResponse(msgContext, type);
- }
- return status;
- }
-
- /** Generate or update the XSD schema for all parameters and the return.
- * This should only be done when the Call is unconfigured, hence there is no WSDL
- */
- private void generateOrUpdateSchemas(OperationMetaData opMetaData)
- {
- ServiceMetaData serviceMetaData =
opMetaData.getEndpointMetaData().getServiceMetaData();
- if (serviceMetaData.getWsdlFile() == null)
- {
- TypesMetaData typesMetaData = serviceMetaData.getTypesMetaData();
- for (ParameterMetaData paramMetaData : opMetaData.getParameters())
- {
- generateOrUpdateParameterSchema(typesMetaData, paramMetaData);
- }
-
- ParameterMetaData retMetaData = opMetaData.getReturnParameter();
- if (retMetaData != null)
- {
- generateOrUpdateParameterSchema(typesMetaData, retMetaData);
- }
- }
- }
-
- /** Generate or update the XSD schema for a given parameter
- * This should only be done if the parameter is not an attachment
- */
- private void generateOrUpdateParameterSchema(TypesMetaData typesMetaData,
ParameterMetaData paramMetaData)
- {
- if (paramMetaData.isSwA() == false)
- {
- QName xmlType = paramMetaData.getXmlType();
- Class javaType = paramMetaData.getJavaType();
-
- ServiceMetaData serviceMetaData = getEndpointMetaData().getServiceMetaData();
- TypeMappingImpl typeMapping = serviceMetaData.getTypeMapping();
- SerializerFactory serFactory = typeMapping.getSerializer(javaType, xmlType);
- if (serFactory instanceof JBossXBSerializerFactory)
- {
- SchemaGenerator xsdGenerator = new SchemaGenerator();
- JBossXSModel model = xsdGenerator.generateXSDSchema(xmlType, javaType);
- typesMetaData.addSchemaModel(model);
- }
- }
- }
-
- private void registerParameterType(QName xmlType, Class javaType)
- {
- ServiceMetaData serviceMetaData = getEndpointMetaData().getServiceMetaData();
-
- String nsURI = xmlType.getNamespaceURI();
- if (Constants.NS_ATTACHMENT_MIME_TYPE.equals(nsURI) == false)
- {
- TypeMappingImpl typeMapping = serviceMetaData.getTypeMapping();
- Class regJavaType = typeMapping.getJavaType(xmlType);
- if (regJavaType == null)
- {
- typeMapping.register(javaType, xmlType, new JBossXBSerializerFactory(), new
JBossXBDeserializerFactory());
- }
- else if (regJavaType != null && JavaUtils.isAssignableFrom(regJavaType,
javaType) == false)
- {
- throw new IllegalArgumentException("Different java type already
registered: " + regJavaType.getName());
- }
- }
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/CallImpl.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/CallImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/CallProxy.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/CallProxy.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/CallProxy.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,207 +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.core.jaxrpc;
-
-// $Id$
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.rmi.RemoteException;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.rpc.JAXRPCException;
-import javax.xml.rpc.Stub;
-import javax.xml.rpc.soap.SOAPFaultException;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.utils.JavaUtils;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-
-/**
- * The dynamic proxy that delegates to the underlying Call implementation
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 07-Jan-2005
- */
-public class CallProxy implements InvocationHandler
-{
- // provide logging
- private static final Logger log = Logger.getLogger(CallProxy.class);
-
- // The underlying Call
- private CallImpl call;
- // List<Method> of the Stub methods
- private List stubMethods;
- // List<Method> of the Object methods
- private List objectMethods;
-
- // The set of standard properties
- private static final Set<String> standardProperties = new
HashSet<String>();
- static
- {
- standardProperties.add(Stub.ENDPOINT_ADDRESS_PROPERTY);
- standardProperties.add(Stub.SESSION_MAINTAIN_PROPERTY);
- standardProperties.add(Stub.USERNAME_PROPERTY);
- standardProperties.add(Stub.PASSWORD_PROPERTY);
- }
-
- // The map of jboss-ws4ee supported properties
- private static final Map<String,String> legacyPropertyMap = new
HashMap<String,String>();
- static
- {
- legacyPropertyMap.put("org.jboss.webservice.client.timeout",
StubExt.PROPERTY_CLIENT_TIMEOUT);
- legacyPropertyMap.put("org.jboss.webservice.keyStore",
StubExt.PROPERTY_KEY_STORE);
- legacyPropertyMap.put("org.jboss.webservice.keyStorePassword",
StubExt.PROPERTY_KEY_STORE_PASSWORD);
- legacyPropertyMap.put("org.jboss.webservice.keyStoreType",
StubExt.PROPERTY_KEY_STORE_TYPE);
- legacyPropertyMap.put("org.jboss.webservice.trustStore",
StubExt.PROPERTY_TRUST_STORE);
- legacyPropertyMap.put("org.jboss.webservice.trustStorePassword",
StubExt.PROPERTY_TRUST_STORE_PASSWORD);
- legacyPropertyMap.put("org.jboss.webservice.trustStoreType",
StubExt.PROPERTY_TRUST_STORE_TYPE);
- }
-
- public CallProxy(CallImpl call)
- {
- this.call = call;
- this.stubMethods = Arrays.asList(StubExt.class.getMethods());
- this.objectMethods = Arrays.asList(Object.class.getMethods());
- }
-
- /** Processes a method invocation on a proxy instance and returns the result.
- */
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
- {
- // An invocation on the Stub interface
- String methodName = method.getName();
- if (stubMethods.contains(method))
- {
- if (methodName.equals("_getPropertyNames"))
- {
- return call.getPropertyNames();
- }
- else if (methodName.equals("_getProperty"))
- {
- return getProperty((String)args[0]);
- }
- else if (methodName.equals("_setProperty"))
- {
- setProperty((String)args[0], args[1]);
- return null;
- }
- else
- {
- Method callMethod = CallImpl.class.getMethod(methodName,
method.getParameterTypes());
- return callMethod.invoke(call, args);
- }
- }
-
- // An invocation on proxy's Object class
- else if (objectMethods.contains(method))
- {
- Method callMethod = CallImpl.class.getMethod(methodName,
method.getParameterTypes());
- return callMethod.invoke(call, args);
- }
-
- // An invocation on the service endpoint interface
- else
- {
- EndpointMetaData epMetaData = call.getEndpointMetaData();
- OperationMetaData opMetaData = epMetaData.getOperation(method);
- if (opMetaData == null)
- throw new WSException("Cannot obtain operation meta data for: " +
methodName);
-
- call.setOperationName(opMetaData.getQName());
-
- try
- {
- if (opMetaData.isOneWay())
- {
- call.invokeOneWay(args);
- return null;
- }
- else
- {
- Object retObj = call.invoke(args);
- if (retObj != null)
- {
- Class retType = method.getReturnType();
- if (retType == null)
- throw new WSException("Return value not supported by: " +
opMetaData);
-
- if (JavaUtils.isPrimitive(retType))
- retObj = JavaUtils.getPrimitiveValueArray(retObj);
- }
- return retObj;
- }
- }
- catch (Exception ex)
- {
- handleException(ex);
- return null;
- }
- }
- }
-
- private Object getProperty(String name)
- {
- name = assertPropertyName(name);
- return call.getProperty(name);
- }
-
- private void setProperty(String name, Object value)
- {
- name = assertPropertyName(name);
- call.setProperty(name, value);
- }
-
- private String assertPropertyName(String name)
- {
- if (name != null && name.startsWith("javax.xml.rpc") &&
standardProperties.contains(name) == false)
- throw new JAXRPCException("Unsupported property: " + name);
-
- if (legacyPropertyMap.keySet().contains(name))
- {
- String jbosswsName = legacyPropertyMap.get(name);
- log.warn("Legacy propery '" + name + "' mapped to
'" + jbosswsName + "'");
- name = jbosswsName;
- }
-
- return name;
- }
-
- private void handleException(Exception ex) throws Throwable
- {
- Throwable th = ex;
- if (ex instanceof RemoteException && ex.getCause() instanceof
SOAPFaultException)
- {
- SOAPFaultException faultEx = (SOAPFaultException)ex.getCause();
- if (faultEx.getCause() != null)
- th = faultEx.getCause();
- }
- throw th;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/CallProxy.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/CallProxy.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/EncodedTypeMapping.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/EncodedTypeMapping.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/EncodedTypeMapping.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,182 +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.core.jaxrpc;
-
-// $Id$
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.net.URI;
-import java.util.Calendar;
-import java.util.Date;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPElement;
-
-import org.jboss.util.NotImplementedException;
-import org.jboss.ws.Constants;
-import org.jboss.ws.core.jaxrpc.binding.Base64DeserializerFactory;
-import org.jboss.ws.core.jaxrpc.binding.Base64SerializerFactory;
-import org.jboss.ws.core.jaxrpc.binding.CalendarDeserializerFactory;
-import org.jboss.ws.core.jaxrpc.binding.CalendarSerializerFactory;
-import org.jboss.ws.core.jaxrpc.binding.DateDeserializerFactory;
-import org.jboss.ws.core.jaxrpc.binding.DateSerializerFactory;
-import org.jboss.ws.core.jaxrpc.binding.ElementDeserializerFactory;
-import org.jboss.ws.core.jaxrpc.binding.ElementSerializerFactory;
-import org.jboss.ws.core.jaxrpc.binding.HexDeserializerFactory;
-import org.jboss.ws.core.jaxrpc.binding.HexSerializerFactory;
-import org.jboss.ws.core.jaxrpc.binding.QNameDeserializerFactory;
-import org.jboss.ws.core.jaxrpc.binding.QNameSerializerFactory;
-import org.jboss.ws.core.jaxrpc.binding.SOAPElementDeserializerFactory;
-import org.jboss.ws.core.jaxrpc.binding.SOAPElementSerializerFactory;
-import org.jboss.ws.core.jaxrpc.binding.SimpleDeserializerFactory;
-import org.jboss.ws.core.jaxrpc.binding.SimpleSerializerFactory;
-import org.w3c.dom.Element;
-
-/**
- * This is the representation of a type mapping.
- * This TypeMapping implementation supports the encoded encoding style.
- *
- * The TypeMapping instance maintains a tuple of the type
- * {XML typeQName, Java Class, SerializerFactory, DeserializerFactory}.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 10-Oct-2004
- */
-public class EncodedTypeMapping extends TypeMappingImpl
-{
-
- /**
- * Construct the default encoded type mapping.
- * Registers javaTypes for all standard XMLSchema types specified by JAXRPC.
- *
- * Note, the order of registered types is important
- * The last xmlType wins for a given javaType
- *
- */
- public EncodedTypeMapping()
- {
- registerStandardLiteralTypes();
- registerStandardSOAP11EncodedTypes();
-
- // register mapping for xsd:anyType
- registerInternal(SOAPElement.class, Constants.TYPE_SOAP11_ANYTYPE, new
SOAPElementSerializerFactory(), new SOAPElementDeserializerFactory());
- registerInternal(Element.class, Constants.TYPE_SOAP11_ANYTYPE, new
ElementSerializerFactory(), new ElementDeserializerFactory());
- }
-
- private void registerStandardSOAP11EncodedTypes()
- {
- registerInternal(BigDecimal.class, Constants.TYPE_SOAP11_DECIMAL, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
-
- registerInternal(BigInteger.class, Constants.TYPE_SOAP11_POSITIVEINTEGER, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(BigInteger.class, Constants.TYPE_SOAP11_NEGATIVEINTEGER, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(BigInteger.class, Constants.TYPE_SOAP11_NONPOSITIVEINTEGER, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(BigInteger.class, Constants.TYPE_SOAP11_NONNEGATIVEINTEGER, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(BigInteger.class, Constants.TYPE_SOAP11_UNSIGNEDLONG, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(BigInteger.class, Constants.TYPE_SOAP11_INTEGER, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
-
- registerInternal(Date.class, Constants.TYPE_SOAP11_DATETIME, new
DateSerializerFactory(), new DateDeserializerFactory());
-
- registerInternal(Calendar.class, Constants.TYPE_SOAP11_DATE, new
CalendarSerializerFactory(), new CalendarDeserializerFactory());
- registerInternal(Calendar.class, Constants.TYPE_SOAP11_TIME, new
CalendarSerializerFactory(), new CalendarDeserializerFactory());
- registerInternal(Calendar.class, Constants.TYPE_SOAP11_DATETIME, new
CalendarSerializerFactory(), new CalendarDeserializerFactory());
-
- registerInternal(QName.class, Constants.TYPE_SOAP11_QNAME, new
QNameSerializerFactory(), new QNameDeserializerFactory());
-
- registerInternal(String.class, Constants.TYPE_SOAP11_ANYSIMPLETYPE, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_SOAP11_DURATION, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_SOAP11_GDAY, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_SOAP11_GMONTH, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_SOAP11_GMONTHDAY, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_SOAP11_GYEAR, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_SOAP11_GYEARMONTH, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_SOAP11_ID, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_SOAP11_LANGUAGE, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_SOAP11_NAME, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_SOAP11_NCNAME, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_SOAP11_NMTOKEN, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_SOAP11_NORMALIZEDSTRING, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_SOAP11_TOKEN, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_SOAP11_STRING, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
-
- registerInternal(String[].class, Constants.TYPE_SOAP11_NMTOKENS, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
-
- registerInternal(URI.class, Constants.TYPE_SOAP11_ANYURI, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
-
- registerInternal(boolean.class, Constants.TYPE_SOAP11_BOOLEAN, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(Boolean.class, Constants.TYPE_SOAP11_BOOLEAN, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
-
- registerInternal(byte.class, Constants.TYPE_SOAP11_BYTE, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(Byte.class, Constants.TYPE_SOAP11_BYTE, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
-
- registerInternal(byte[].class, Constants.TYPE_SOAP11_HEXBINARY, new
HexSerializerFactory(), new HexDeserializerFactory());
- registerInternal(Byte[].class, Constants.TYPE_SOAP11_HEXBINARY, new
HexSerializerFactory(), new HexDeserializerFactory());
- registerInternal(byte[].class, Constants.TYPE_SOAP11_BASE64BINARY, new
Base64SerializerFactory(), new Base64DeserializerFactory());
- registerInternal(Byte[].class, Constants.TYPE_SOAP11_BASE64BINARY, new
Base64SerializerFactory(), new Base64DeserializerFactory());
- registerInternal(byte[].class, Constants.TYPE_SOAP11_BASE64, new
Base64SerializerFactory(), new Base64DeserializerFactory());
- registerInternal(Byte[].class, Constants.TYPE_SOAP11_BASE64, new
Base64SerializerFactory(), new Base64DeserializerFactory());
-
- registerInternal(double.class, Constants.TYPE_SOAP11_DOUBLE, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(Double.class, Constants.TYPE_SOAP11_DOUBLE, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
-
- registerInternal(float.class, Constants.TYPE_SOAP11_FLOAT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(Float.class, Constants.TYPE_SOAP11_FLOAT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
-
- registerInternal(int.class, Constants.TYPE_SOAP11_UNSIGNEDSHORT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(Integer.class, Constants.TYPE_SOAP11_UNSIGNEDSHORT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(int.class, Constants.TYPE_SOAP11_INT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(Integer.class, Constants.TYPE_SOAP11_INT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
-
- registerInternal(long.class, Constants.TYPE_SOAP11_UNSIGNEDINT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(Long.class, Constants.TYPE_SOAP11_UNSIGNEDINT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(long.class, Constants.TYPE_SOAP11_LONG, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(Long.class, Constants.TYPE_SOAP11_LONG, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
-
- registerInternal(short.class, Constants.TYPE_SOAP11_UNSIGNEDBYTE, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(Short.class, Constants.TYPE_SOAP11_UNSIGNEDBYTE, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(short.class, Constants.TYPE_SOAP11_SHORT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(Short.class, Constants.TYPE_SOAP11_SHORT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- }
-
- /**
- * Returns the encodingStyle URIs (as String[]) supported by this TypeMapping
instance.
- * A TypeMapping that contains only encoding style independent serializers and
deserializers
- * returns null from this method.
- *
- * @return Array of encodingStyle URIs for the supported encoding styles
- */
- public String[] getSupportedEncodings()
- {
- return new String[] { "encoded" };
- }
-
- /**
- * Sets the encodingStyle URIs supported by this TypeMapping instance. A TypeMapping
that contains only encoding
- * independent serializers and deserializers requires null as the parameter for this
method.
- *
- * @param encodingStyleURIs Array of encodingStyle URIs for the supported encoding
styles
- */
- public void setSupportedEncodings(String[] encodingStyleURIs)
- {
- throw new NotImplementedException();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/EncodedTypeMapping.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/EncodedTypeMapping.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/HandlerRegistryImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/HandlerRegistryImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/HandlerRegistryImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,120 +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.core.jaxrpc;
-
-// $Id$
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.handler.HandlerChain;
-import javax.xml.rpc.handler.HandlerInfo;
-import javax.xml.rpc.handler.HandlerRegistry;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.jaxrpc.handler.ClientHandlerChain;
-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
- * handlers in a HandlerRegistry.
- *
- * A handler chain is registered per service endpoint, as indicated by the
- * qualified name of a port. The getHandlerChain returns the handler chain
- * (as a java.util.List) for the specified service endpoint. The returned
- * handler chain is configured using the java.util.List interface. Each element
- * in this list is required to be of the Java type
- * javax.xml.rpc.handler.HandlerInfo.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 20-Jul-2005
- */
-public class HandlerRegistryImpl implements HandlerRegistry
-{
- // provide logging
- private static Logger log = Logger.getLogger(HandlerRegistryImpl.class);
-
- // Map<QName,HandlerChain> the endpoint name to a HandlerChain
- private Map<QName, HandlerChain> handlerChains = new HashMap<QName,
HandlerChain>();
- // Maps the port name to a list of HandlerInfo objects
- private Map<QName, List<HandlerInfo>> handlerInfos = new HashMap<QName,
List<HandlerInfo>>();
- // The service this registry is associated with
- private ServiceMetaData serviceMetaData;
-
- public HandlerRegistryImpl(ServiceMetaData serviceMetaData)
- {
- this.serviceMetaData = serviceMetaData;
- }
-
- public List getHandlerChain(QName portName)
- {
- List<HandlerInfo> list = handlerInfos.get(portName);
- if (list == null)
- list = new ArrayList<HandlerInfo>();
-
- return new ArrayList(list);
-
- }
-
- public void setHandlerChain(QName portName, List chain)
- {
- registerClientHandlerChain(portName, chain, null);
- }
-
- /** Get the handler chain for the given endpoint name, maybe null.
- */
- HandlerChain getHandlerChainInstance(QName portName)
- {
- HandlerChain handlerChain = handlerChains.get(portName);
- return handlerChain;
- }
-
- /** Register a handler chain for the given endpoint name
- */
- void registerClientHandlerChain(QName portName, List<HandlerInfo> infos,
Set<String> roles)
- {
- ClientHandlerChain chain = new ClientHandlerChain(infos, roles);
- handlerChains.put(portName, chain);
- handlerInfos.put(portName, infos);
-
- EndpointMetaData epMetaData = serviceMetaData.getEndpoint(portName);
- if (epMetaData == null)
- throw new IllegalStateException("Cannot obtain endpoint meta data for:
" + portName);
-
- epMetaData.clearHandlers();
- for (HandlerInfo info : infos)
- {
- HandlerMetaDataJAXRPC handler = new HandlerMetaDataJAXRPC(epMetaData,
HandlerType.ENDPOINT);
- handler.setHandlerClassName(info.getHandlerClass().getName());
- handler.setSoapRoles(roles);
- log.debug("Add handler to: " + portName + handler);
- epMetaData.addHandler(handler);
- }
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/HandlerRegistryImpl.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/HandlerRegistryImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/LiteralTypeMapping.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/LiteralTypeMapping.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/LiteralTypeMapping.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,118 +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.core.jaxrpc;
-
-// $Id$
-
-import java.awt.Image;
-
-import javax.activation.DataHandler;
-import javax.mail.internet.MimeMultipart;
-import javax.xml.soap.SOAPElement;
-import javax.xml.transform.Source;
-
-import org.jboss.util.NotImplementedException;
-import org.jboss.ws.Constants;
-import org.jboss.ws.core.jaxrpc.binding.ElementDeserializerFactory;
-import org.jboss.ws.core.jaxrpc.binding.ElementSerializerFactory;
-import org.jboss.ws.core.jaxrpc.binding.JBossXBDeserializerFactory;
-import org.jboss.ws.core.jaxrpc.binding.JBossXBSerializerFactory;
-import org.jboss.ws.core.jaxrpc.binding.SOAPElementDeserializerFactory;
-import org.jboss.ws.core.jaxrpc.binding.SOAPElementSerializerFactory;
-import org.w3c.dom.Element;
-
-/**
- * This is the representation of a type mapping.
- * This TypeMapping implementation supports the literal encoding style.
- *
- * The TypeMapping instance maintains a tuple of the type
- * {XML typeQName, Java Class, SerializerFactory, DeserializerFactory}.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 10-Oct-2004
- */
-public class LiteralTypeMapping extends TypeMappingImpl
-{
-
- /**
- * Construct the default literal type mapping.
- * Registers javaTypes for all standard XMLSchema types specified by JAXRPC.
- *
- * Note, the order of registered types is important
- * The last xmlType wins for a given javaType
- *
- */
- public LiteralTypeMapping()
- {
- // XOP default mapping
- JBossXBSerializerFactory jbxbSF = new JBossXBSerializerFactory();
- JBossXBDeserializerFactory jbxbDF = new JBossXBDeserializerFactory();
-
- registerInternal(DataHandler.class, Constants.TYPE_XMIME_DEFAULT, jbxbSF, jbxbDF);
- registerInternal(DataHandler.class, Constants.TYPE_XMIME_DEFAULT, jbxbSF, jbxbDF);
- registerInternal(DataHandler.class, Constants.TYPE_XMIME_DEFAULT, jbxbSF, jbxbDF);
- registerInternal(DataHandler.class, Constants.TYPE_XMIME_DEFAULT, jbxbSF, jbxbDF);
- registerInternal(DataHandler.class, Constants.TYPE_XMIME_DEFAULT, jbxbSF, jbxbDF);
-
- registerInternal(String.class, Constants.TYPE_XMIME_DEFAULT, jbxbSF, jbxbDF);
- registerInternal(Image.class, Constants.TYPE_XMIME_DEFAULT, jbxbSF, jbxbDF);
- registerInternal(Source.class, Constants.TYPE_XMIME_DEFAULT, jbxbSF, jbxbDF);
- registerInternal(MimeMultipart.class, Constants.TYPE_XMIME_DEFAULT, jbxbSF,
jbxbDF);
-
- registerStandardLiteralTypes();
-
- // register default mime mappings
- registerInternal(DataHandler.class, Constants.TYPE_MIME_APPLICATION_XML, null,
null);
- registerInternal(DataHandler.class, Constants.TYPE_MIME_IMAGE_GIF, null, null);
- registerInternal(DataHandler.class, Constants.TYPE_MIME_IMAGE_JPEG, null, null);
- registerInternal(DataHandler.class, Constants.TYPE_MIME_TEXT_PLAIN, null, null);
- registerInternal(DataHandler.class, Constants.TYPE_MIME_TEXT_XML, null, null);
- registerInternal(MimeMultipart.class, Constants.TYPE_MIME_MULTIPART_MIXED, null,
null);
-
- // register mapping for xsd:anyType
- registerInternal(SOAPElement.class, Constants.TYPE_LITERAL_ANYTYPE, new
SOAPElementSerializerFactory(), new SOAPElementDeserializerFactory());
- registerInternal(Element.class, Constants.TYPE_LITERAL_ANYTYPE, new
ElementSerializerFactory(), new ElementDeserializerFactory());
- }
-
- /**
- * Returns the encodingStyle URIs (as String[]) supported by this TypeMapping
instance.
- * A TypeMapping that contains only encoding style independent serializers and
deserializers
- * returns null from this method.
- *
- * @return Array of encodingStyle URIs for the supported encoding styles
- */
- public String[] getSupportedEncodings()
- {
- return new String[] { "" };
- }
-
- /**
- * Sets the encodingStyle URIs supported by this TypeMapping instance. A TypeMapping
that contains only encoding
- * independent serializers and deserializers requires null as the parameter for this
method.
- *
- * @param encodingStyleURIs Array of encodingStyle URIs for the supported encoding
styles
- */
- public void setSupportedEncodings(String[] encodingStyleURIs)
- {
- throw new NotImplementedException();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/LiteralTypeMapping.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/LiteralTypeMapping.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/ParameterWrapping.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ParameterWrapping.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/ParameterWrapping.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,329 +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.core.jaxrpc;
-
-// $Id$
-
-import java.beans.PropertyDescriptor;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javassist.ClassPool;
-import javassist.CtClass;
-import javassist.CtField;
-import javassist.CtNewMethod;
-import javassist.LoaderClassPath;
-import javassist.Modifier;
-
-import javax.jws.soap.SOAPBinding.ParameterStyle;
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.jaxrpc.binding.JBossXBDeserializerFactory;
-import org.jboss.ws.core.jaxrpc.binding.JBossXBSerializerFactory;
-import org.jboss.ws.core.utils.HolderUtils;
-import org.jboss.ws.core.utils.JavaUtils;
-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;
-
-/** A helper class to wrap/unwrap ducument style request/response structures.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @since 06-Jun-2005
- */
-public class ParameterWrapping
-{
- // provide logging
- private static Logger log = Logger.getLogger(ParameterWrapping.class);
-
- // This assertion should probably be moved somewhere earlier
- private static void assertOperationMetaData(OperationMetaData opMetaData)
- {
- if (opMetaData.getStyle() != Style.DOCUMENT)
- throw new WSException("Unexpected style: " + opMetaData.getStyle());
-
- if (opMetaData.getParameterStyle() != ParameterStyle.WRAPPED)
- throw new WSException("Unexpected parameter style: " +
opMetaData.getParameterStyle());
- }
-
- private static Object holderValue(Object holder)
- {
- if (holder == null)
- return null;
- if (! HolderUtils.isHolderType(holder.getClass()))
- return holder;
-
- return HolderUtils.getHolderValue(holder);
- }
-
- public static Class getWrappedType(String variable, Class wrapperType)
- {
- try
- {
- PropertyDescriptor pd = new PropertyDescriptor(variable, wrapperType);
- Method method = pd.getWriteMethod();
- return method.getParameterTypes()[0];
- }
- catch (Exception ex)
- {
- log.debug("Invalid request wrapper: " + ex);
- return null;
- }
- }
-
- public static Object wrapRequestParameters(ParameterMetaData request, Object[]
methodParams)
- {
- assertOperationMetaData(request.getOperationMetaData());
-
- Class reqStructType = request.getJavaType();
- log.debug("wrapRequestParameters: " + reqStructType.getName());
- List<WrappedParameter> wrappedParameters = request.getWrappedParameters();
- try
- {
- Object reqStruct = reqStructType.newInstance();
- for (WrappedParameter param : wrappedParameters)
- {
- Object value = holderValue(methodParams[param.getIndex()]);
- param.accessor().set(reqStruct, value);
- }
-
- return reqStruct;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception e)
- {
- throw new WSException("Cannot wrap request structure: " + e);
- }
- }
-
- public static Map<Integer, Object> unwrapRequestParameters(ParameterMetaData
request, Object reqStruct, Object[] methodParams)
- {
- OperationMetaData opMetaData = request.getOperationMetaData();
- assertOperationMetaData(opMetaData);
-
- if (reqStruct == null)
- throw new IllegalArgumentException("Request struct cannot be null");
-
- Class[] targetParameterTypes = opMetaData.getJavaMethod().getParameterTypes();
- Map<Integer, Object> outParameters = new HashMap<Integer,
Object>(targetParameterTypes.length);
- List<WrappedParameter> wrappedParameters = request.getWrappedParameters();
- Class reqStructType = reqStruct.getClass();
-
- log.debug("unwrapRequestParameters: " + reqStructType.getName());
- try
- {
- for (WrappedParameter param : wrappedParameters)
- {
- Class targetType = targetParameterTypes[param.getIndex()];
- Object value = param.accessor().get(reqStruct);
-
- // INOUT Parameter
- if (HolderUtils.isHolderType(targetType))
- {
- value = HolderUtils.createHolderInstance(value, targetType);
- outParameters.put(param.getIndex(), value);
- }
-
- methodParams[param.getIndex()] = value;
- }
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception e)
- {
- throw new IllegalArgumentException("Cannot unwrap request structure: "
+ e);
- }
-
- return outParameters;
- }
-
- public static Object wrapResponseParameters(ParameterMetaData returnMetaData, Object
returnValue, Map<Integer, Object> outParameters)
- {
- assertOperationMetaData(returnMetaData.getOperationMetaData());
-
- Class resStructType = returnMetaData.getJavaType();
- if (returnValue != null && returnValue.getClass() == resStructType)
- {
- log.debug("Response parameter already wrapped" +
resStructType.getName());
- return returnValue;
- }
-
- log.debug("wrapResponseParameter: " + resStructType.getName());
- List<WrappedParameter> wrappedParameters =
returnMetaData.getWrappedParameters();
- try
- {
- Object resStruct = resStructType.newInstance();
-
- for (WrappedParameter param : wrappedParameters)
- {
- Object value = (param.getIndex() < 0) ? returnValue :
holderValue(outParameters.get(param.getIndex()));
- param.accessor().set(resStruct, value);
- }
- return resStruct;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception e)
- {
- throw new WSException("Cannot wrap response structure: " + e);
- }
- }
-
- public static Object unwrapResponseParameters(ParameterMetaData retMetaData, Object
resStruct, Object methodParams[])
- {
- OperationMetaData operationMetaData = retMetaData.getOperationMetaData();
- assertOperationMetaData(operationMetaData);
-
- Object retValue = null;
- if (resStruct != null)
- {
- Class resStructType = resStruct.getClass();
-
- log.debug("unwrapResponseParameter: " + resStructType.getName());
- List<WrappedParameter> wrappedParameters =
retMetaData.getWrappedParameters();
- Class[] targetTypes = operationMetaData.getJavaMethod().getParameterTypes();
- try
- {
- for (WrappedParameter param : wrappedParameters)
- {
- Object value = param.accessor().get(resStruct);
- if (param.getIndex() < 0)
- {
- retValue = value;
- }
- else
- {
- Class targetType = targetTypes[param.getIndex()];
- if (HolderUtils.isHolderType(targetType))
- value = HolderUtils.createHolderInstance(value, targetType);
- methodParams[param.getIndex()] = value;
- }
- }
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception e)
- {
- throw new IllegalArgumentException("Cannot unwrap request structure:
" + e);
- }
- }
- return retValue;
- }
-
- /**
- * This is just a dummy marker class used to identify a generated
- * document/literal wrapped type
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
- public static class WrapperType
- {
- }
-
- /**
- * Generates a wrapper type and assigns it to the passed ParameterMetaData
- * object. This routine requires the pmd to contain completed wrappedTypes
- * and wrappedVariables properties of the passed ParameterMetaData object.
- *
- * @param pmd a document/literal wrapped parameter
- */
- public static void generateWrapper(ParameterMetaData pmd, boolean addTypeMapping)
- {
- List<WrappedParameter> wrappedParameters = pmd.getWrappedParameters();
- OperationMetaData operationMetaData = pmd.getOperationMetaData();
- EndpointMetaData endpointMetaData = operationMetaData.getEndpointMetaData();
- ServiceMetaData serviceMetaData = endpointMetaData.getServiceMetaData();
- ClassLoader loader = serviceMetaData.getUnifiedMetaData().getClassLoader();
-
- if (operationMetaData.isDocumentWrapped() == false)
- throw new WSException("Operation is not document/literal (wrapped)");
-
- if (wrappedParameters == null)
- throw new WSException("Cannot generate a type when their is no wrapped
parameters");
-
- String serviceName = serviceMetaData.getServiceName().getLocalPart();
- String parameterName = pmd.getXmlName().getLocalPart();
- String endpointName = endpointMetaData.getQName().getLocalPart();
- String packageName =
endpointMetaData.getServiceEndpointInterface().getPackage().getName();
-
- String wrapperName = packageName + "._JBossWS_" + serviceName +
"_" + endpointName + "_" + parameterName;
- log.debug("Generating wrapper: " + wrapperName);
-
- Class wrapperType;
- try
- {
- ClassPool pool = new ClassPool(true);
- pool.appendClassPath(new LoaderClassPath(loader));
- CtClass clazz = pool.makeClass(wrapperName);
- clazz.setSuperclass(pool.get(WrapperType.class.getName()));
-
- for (WrappedParameter param : wrappedParameters)
- {
- CtField field = new CtField(pool.get(param.getType()), param.getVariable(),
clazz);
- field.setModifiers(Modifier.PRIVATE);
- clazz.addField(field);
- clazz.addMethod(CtNewMethod.getter("get" +
JavaUtils.capitalize(param.getVariable()), field));
- clazz.addMethod(CtNewMethod.setter("set" +
JavaUtils.capitalize(param.getVariable()), field));
- }
-
- wrapperType = (Class)pool.toClass(clazz, loader);
- }
- catch (Exception e)
- {
- throw new WSException("Could not generate wrapper type: " +
wrapperName, e);
- }
-
- // Register type mapping if needed
- if (addTypeMapping)
- {
- QName xmlType = pmd.getXmlType();
-
- TypesMetaData typesMetaData = serviceMetaData.getTypesMetaData();
- TypeMappingMetaData tmMetaData = new TypeMappingMetaData(typesMetaData, xmlType,
wrapperName);
- typesMetaData.addTypeMapping(tmMetaData);
-
- TypeMappingImpl typeMapping = serviceMetaData.getTypeMapping();
- typeMapping.register(wrapperType, xmlType, new JBossXBSerializerFactory(), new
JBossXBDeserializerFactory());
- }
-
- pmd.setJavaTypeName(wrapperName);
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/ParameterWrapping.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ParameterWrapping.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAP11BindingJAXRPC.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAP11BindingJAXRPC.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAP11BindingJAXRPC.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,59 +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.core.jaxrpc;
-
-//$Id:SOAP11BindingJAXRPC.java 1054 2006-09-26 10:33:43Z thomas.diesler(a)jboss.com $
-
-import javax.xml.soap.SOAPMessage;
-
-import org.jboss.ws.core.jaxrpc.binding.CommonSOAP11Binding;
-import org.jboss.ws.core.soap.SOAPFaultImpl;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-
-/**
- * The JAXRPC SOAP11Binding
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 20-Sep-2006
- */
-public class SOAP11BindingJAXRPC extends CommonSOAP11Binding
-{
- // Delegate to JAXWS SOAP binding
- private SOAPBindingJAXRPC delegate = new SOAPBindingJAXRPC();
-
- public void setSOAPActionHeader(OperationMetaData opMetaData, SOAPMessage reqMessage)
- {
- delegate.setSOAPActionHeader(opMetaData, reqMessage);
- }
-
- @Override
- protected void throwFaultException(SOAPFaultImpl fault) throws Exception
- {
- throw SOAPFaultHelperJAXRPC.getSOAPFaultException(fault);
- }
-
- @Override
- public SOAPMessage exceptionToFaultMessage(Exception ex)
- {
- return SOAPFaultHelperJAXRPC.exceptionToFaultMessage(ex);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAP11BindingJAXRPC.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAP11BindingJAXRPC.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAP12BindingJAXRPC.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAP12BindingJAXRPC.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAP12BindingJAXRPC.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,59 +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.core.jaxrpc;
-
-//$Id:SOAP12BindingJAXRPC.java 1054 2006-09-26 10:33:43Z thomas.diesler(a)jboss.com $
-
-import javax.xml.soap.SOAPMessage;
-
-import org.jboss.ws.core.jaxrpc.binding.CommonSOAP12Binding;
-import org.jboss.ws.core.soap.SOAPFaultImpl;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-
-/**
- * The JAXRPC SOAP12Binding
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 20-Sep-2006
- */
-public class SOAP12BindingJAXRPC extends CommonSOAP12Binding
-{
- // Delegate to JAXWS SOAP binding
- private SOAPBindingJAXRPC delegate = new SOAPBindingJAXRPC();
-
- public void setSOAPActionHeader(OperationMetaData opMetaData, SOAPMessage reqMessage)
- {
- delegate.setSOAPActionHeader(opMetaData, reqMessage);
- }
-
- @Override
- protected void throwFaultException(SOAPFaultImpl fault) throws Exception
- {
- throw SOAPFaultHelperJAXRPC.getSOAPFaultException(fault);
- }
-
- @Override
- public SOAPMessage exceptionToFaultMessage(Exception ex)
- {
- return SOAPFaultHelperJAXRPC.exceptionToFaultMessage(ex);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAP12BindingJAXRPC.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAP12BindingJAXRPC.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAPBindingJAXRPC.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAPBindingJAXRPC.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAPBindingJAXRPC.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,70 +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.core.jaxrpc;
-
-// $Id$
-
-import javax.xml.rpc.Call;
-import javax.xml.soap.MimeHeaders;
-import javax.xml.soap.SOAPMessage;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-
-/**
- * The SOAPBinding interface is an abstraction for the SOAP binding.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 04-Jul-2006
- */
-class SOAPBindingJAXRPC
-{
- // provide logging
- private static Logger log = Logger.getLogger(SOAPBindingJAXRPC.class);
-
- public void setSOAPActionHeader(OperationMetaData opMetaData, SOAPMessage reqMessage)
- {
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- MimeHeaders mimeHeaders = reqMessage.getMimeHeaders();
- String soapAction = opMetaData.getSOAPAction();
-
- // R2744 A HTTP request MESSAGE MUST contain a SOAPAction HTTP header field
- // with a quoted value equal to the value of the soapAction attribute of
- // soapbind:operation, if present in the corresponding WSDL description.
-
- // R2745 A HTTP request MESSAGE MUST contain a SOAPAction HTTP header field
- // with a quoted empty string value, if in the corresponding WSDL description,
- // the soapAction attribute of soapbind:operation is either not present, or
- // present with an empty string as its value.
-
- if (msgContext.getProperty(Call.SOAPACTION_USE_PROPERTY) != null)
- log.info("Ignore Call.SOAPACTION_USE_PROPERTY because of BP-1.0 R2745,
R2745");
-
- String soapActionProperty =
(String)msgContext.getProperty(Call.SOAPACTION_URI_PROPERTY);
- if (soapActionProperty != null)
- soapAction = soapActionProperty;
-
- mimeHeaders.addHeader("SOAPAction", soapAction != null ? soapAction :
"");
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAPBindingJAXRPC.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAPBindingJAXRPC.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAPFaultHelperJAXRPC.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAPFaultHelperJAXRPC.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAPFaultHelperJAXRPC.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,317 +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.core.jaxrpc;
-
-// $Id$
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.JAXRPCException;
-import javax.xml.rpc.encoding.TypeMapping;
-import javax.xml.rpc.soap.SOAPFaultException;
-import javax.xml.soap.Detail;
-import javax.xml.soap.DetailEntry;
-import javax.xml.soap.MessageFactory;
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPFault;
-import javax.xml.soap.SOAPMessage;
-
-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.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.DeserializerFactoryBase;
-import org.jboss.ws.core.jaxrpc.binding.DeserializerSupport;
-import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
-import org.jboss.ws.core.jaxrpc.binding.SerializerFactoryBase;
-import org.jboss.ws.core.jaxrpc.binding.SerializerSupport;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.core.soap.MessageFactoryImpl;
-import org.jboss.ws.core.soap.NameImpl;
-import org.jboss.ws.core.soap.SOAPEnvelopeImpl;
-import org.jboss.ws.core.soap.SOAPFactoryImpl;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.core.utils.DOMWriter;
-import org.jboss.ws.metadata.umdm.FaultMetaData;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-import org.jboss.xb.binding.NamespaceRegistry;
-import org.w3c.dom.Element;
-
-/**
- * A Helper that translates between SOAPFaultException and SOAPFault.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 03-Feb-2005
- */
-public class SOAPFaultHelperJAXRPC
-{
- // provide logging
- private static Logger log = Logger.getLogger(SOAPFaultHelperJAXRPC.class);
-
- private static List<QName> allowedFaultCodes = new ArrayList<QName>();
- static
- {
- allowedFaultCodes.add(Constants.SOAP11_FAULT_CODE_CLIENT);
- allowedFaultCodes.add(Constants.SOAP11_FAULT_CODE_SERVER);
- allowedFaultCodes.add(Constants.SOAP11_FAULT_CODE_VERSION_MISMATCH);
- allowedFaultCodes.add(Constants.SOAP11_FAULT_CODE_MUST_UNDERSTAND);
- }
-
- /** Hide constructor */
- private SOAPFaultHelperJAXRPC()
- {
- }
-
- /** Factory method for FaultException for a given SOAPFault */
- public static SOAPFaultException getSOAPFaultException(SOAPFault soapFault)
- {
- QName faultCode = ((NameImpl)soapFault.getFaultCodeAsName()).toQName();
- String faultString = soapFault.getFaultString();
- String faultActor = soapFault.getFaultActor();
- Detail detail = soapFault.getDetail();
-
- SOAPFaultException faultEx = new SOAPFaultException(faultCode, faultString,
faultActor, detail);
-
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- if (detail != null && msgContext != null)
- {
- SerializationContext serContext = msgContext.getSerializationContext();
- TypeMapping typeMapping = serContext.getTypeMapping();
-
- Iterator it = detail.getDetailEntries();
- while (it.hasNext())
- {
- DetailEntry deElement = (DetailEntry)it.next();
- Name deName = deElement.getElementName();
- QName xmlName = new QName(deName.getURI(), deName.getLocalName());
-
- OperationMetaData opMetaData = msgContext.getOperationMetaData();
- FaultMetaData faultMetaData = opMetaData.getFault(xmlName);
- if (faultMetaData != null)
- {
- log.debug("Deserialize fault: " + faultMetaData);
- QName xmlType = faultMetaData.getXmlType();
- Class javaType = faultMetaData.getJavaType();
-
- // Get the deserializer from the type mapping
- DeserializerFactoryBase desFactory =
(DeserializerFactoryBase)typeMapping.getDeserializer(javaType, xmlType);
- if (desFactory == null)
- throw new JAXRPCException("Cannot obtain deserializer factory for:
" + xmlType);
-
- // Try jaxb deserialization
- try
- {
- //
http://jira.jboss.org/jira/browse/JBWS-955
- // Cannot deserialize fault detail
- String prefix = deName.getPrefix();
- if (prefix.length() > 0)
- {
- String nsURI = deName.getURI();
- String attrValue = deElement.getAttribute("xmlns:" +
prefix);
- if (nsURI.length() > 0 && attrValue.length() == 0)
- deElement.addNamespaceDeclaration(prefix, nsURI);
- }
-
- String xmlFragment = DOMWriter.printNode(deElement, false);
- DeserializerSupport des =
(DeserializerSupport)desFactory.getDeserializer();
- Object userEx = des.deserialize(xmlName, xmlType, xmlFragment,
serContext);
- if (userEx == null || (userEx instanceof Exception) == false)
- throw new WSException("Invalid deserialization result: " +
userEx);
-
- faultEx.initCause((Exception)userEx);
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- log.error("Cannot deserialize fault detail", ex);
- }
- }
- else
- {
- log.debug("Cannot find fault meta data for: " + xmlName);
- }
- }
- }
-
- return faultEx;
- }
-
- /** Translate the request exception into a SOAPFault message.
- */
- public static SOAPMessage exceptionToFaultMessage(Exception reqEx)
- {
- // Get or create the SOAPFaultException
- SOAPFaultException faultEx;
- if (reqEx instanceof SOAPFaultException)
- {
- faultEx = (SOAPFaultException)reqEx;
- }
- else
- {
- QName faultCode = Constants.SOAP11_FAULT_CODE_CLIENT;
- String faultString = (reqEx.getMessage() != null ? reqEx.getMessage() :
reqEx.toString());
- faultEx = new SOAPFaultException(faultCode, faultString, null, null);
- faultEx.initCause(reqEx);
- }
-
- Throwable faultCause = faultEx.getCause();
- log.error("SOAP request exception", faultCause != null ? faultCause :
faultEx);
-
- try
- {
- SOAPMessage faultMessage = toSOAPMessage(faultEx);
- return faultMessage;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- log.error("Error creating SOAPFault message", ex);
- throw new JAXRPCException("Cannot create SOAPFault message for: " +
faultEx);
- }
- }
-
- private static SOAPMessage toSOAPMessage(SOAPFaultException faultEx) throws
SOAPException
- {
- assertFaultCode(faultEx.getFaultCode());
-
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- SerializationContext serContext = (msgContext != null ?
msgContext.getSerializationContext() : new SerializationContextJAXRPC());
- NamespaceRegistry nsRegistry = serContext.getNamespaceRegistry();
-
- MessageFactory factory = new MessageFactoryImpl();
- SOAPMessage soapMessage = factory.createMessage();
-
- SOAPEnvelopeImpl soapEnvelope =
(SOAPEnvelopeImpl)soapMessage.getSOAPPart().getEnvelope();
- SOAPBody soapBody = soapEnvelope.getBody();
-
- QName faultCode = faultEx.getFaultCode();
- if (faultCode.getNamespaceURI().length() > 0)
- faultCode = nsRegistry.registerQName(faultCode);
-
- String faultString = getValidFaultString(faultEx);
- SOAPFault soapFault = soapBody.addFault(new NameImpl(faultCode), faultString);
-
- String faultActor = faultEx.getFaultActor();
- if (faultActor != null)
- {
- SOAPElement soapElement = soapFault.addChildElement("faultactor");
- soapElement.addTextNode(faultActor);
- }
-
- Exception faultCause = (Exception)faultEx.getCause();
- Detail detail = faultEx.getDetail();
- if (detail != null)
- {
- soapFault.addChildElement(detail);
- }
- else if (faultCause != null && (faultCause instanceof RuntimeException) ==
false)
- {
- Class javaType = faultCause.getClass();
-
- TypeMapping typeMapping = serContext.getTypeMapping();
-
- OperationMetaData opMetaData = msgContext.getOperationMetaData();
- if (opMetaData != null && opMetaData.getFault(javaType) != null)
- {
- FaultMetaData faultMetaData = opMetaData.getFault(javaType);
- QName xmlName = faultMetaData.getXmlName();
- QName xmlType = faultMetaData.getXmlType();
-
- xmlName = nsRegistry.registerQName(xmlName);
-
- // Get the serializer from the type mapping
- SerializerFactoryBase serFactory =
(SerializerFactoryBase)typeMapping.getSerializer(javaType, xmlType);
- if (serFactory == null)
- throw new JAXRPCException("Cannot obtain serializer factory for:
" + xmlType);
-
- try
- {
- SerializerSupport ser = (SerializerSupport)serFactory.getSerializer();
- String xmlFragment = ser.serialize(xmlName, xmlType, faultCause,
serContext, null);
-
- SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
- Element domElement = DOMUtils.parse(xmlFragment);
- SOAPElement soapElement = soapFactory.createElement(domElement, true);
-
- detail = soapFault.addDetail();
- detail.addChildElement(soapElement);
- }
- catch (BindingException e)
- {
- throw new JAXRPCException(e);
- }
- catch (IOException e)
- {
- throw new JAXRPCException(e);
- }
- }
- else
- {
- log.debug("Cannot obtain fault meta data for: " + javaType);
- }
- }
-
- return soapMessage;
- }
-
- private static String getValidFaultString(SOAPFaultException faultEx)
- {
- String faultString = faultEx.getFaultString();
- if (faultString == null || faultString.length() == 0)
- faultString = "Unqualified " + faultEx.getFaultCode() + "
fault";
-
- return faultString;
- }
-
- private static void assertFaultCode(QName faultCode)
- {
- if (faultCode == null)
- throw new IllegalArgumentException("faultcode cannot be null");
-
- // For lazy folkes like the CTS that don't bother to give
- // a namesapce URI, assume they use a standard code
- String nsURI = faultCode.getNamespaceURI();
- if ("".equals(nsURI))
- {
- log.warn("Empty namespace URI with fault code '" + faultCode +
"', assuming: " + Constants.NS_SOAP11_ENV);
- faultCode = new QName(Constants.NS_SOAP11_ENV, faultCode.getLocalPart());
- }
-
- // WS-I allows non custom faultcodes if you use a non soap namespace
- if (Constants.NS_SOAP11_ENV.equals(nsURI) &&
allowedFaultCodes.contains(faultCode) == false)
- throw new IllegalArgumentException("Illegal faultcode '" +
faultCode + "', allowed values are: " + allowedFaultCodes);
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAPFaultHelperJAXRPC.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAPFaultHelperJAXRPC.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/SchemaGenerator.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/SchemaGenerator.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/SchemaGenerator.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,106 +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.core.jaxrpc;
-
-// $Id$
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.JAXRPCException;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
-import org.jboss.ws.tools.JavaToXSD;
-
-/** A generator for XML schema that is used by unconfigured DII clients
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author Anil.Saldhana(a)jboss.org
- * @since 03-Jun-2005
- */
-public class SchemaGenerator
-{
- // provide logging
- private static final Logger log = Logger.getLogger(SchemaGenerator.class);
-
- private boolean restrictToTargetNamespace = true;
-
- public JBossXSModel generateXSDSchema(QName xmlType, Class javaType)
- {
- log.debug("generateXSDSchema: [xmlType=" + xmlType +
",javaType=" + javaType.getName() + "]");
- try
- {
- assertXmlType(xmlType);
- String nsuri = xmlType.getNamespaceURI();
- Class componentType = javaType;
- while (componentType.isArray())
- componentType = componentType.getComponentType();
-
- JavaToXSD javaToXSD = new JavaToXSD();
-
- // Force all DII arrays to use the same array namespace for the component
- if (! componentType.isPrimitive())
- {
- Map<String, String> namespaceMap = new HashMap<String,
String>();
- namespaceMap.put(componentType.getPackage().getName(), nsuri);
- javaToXSD.setPackageNamespaceMap(namespaceMap);
- }
-
- JBossXSModel xsModel = javaToXSD.generateForSingleType(xmlType, javaType);
- if (xsModel == null)
- throw new WSException("Cannot generate XSModel");
-
- log.debug("\n" + xsModel.serialize());
- return xsModel;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception e)
- {
- throw new JAXRPCException("Cannot generate xsdSchema for: " + xmlType,
e);
- }
- }
-
- /**
- * Flag that indicates that the types generated fall under the target namespace
- * default is false
- * @param restrictToTargetNamespace The restrictToTargetNamespace to set.
- */
- public void setRestrictToTargetNamespace(boolean restrictToTargetNamespace)
- {
- this.restrictToTargetNamespace = restrictToTargetNamespace;
- }
-
- /** Assert that the given namespace has a valid URI
- */
- private void assertXmlType(QName xmlType)
- {
- String nsURI = xmlType.getNamespaceURI();
- if (nsURI.length() == 0)
- throw new IllegalArgumentException("Invalid namespace for type: " +
xmlType);
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/SchemaGenerator.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/SchemaGenerator.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/SerializationContextJAXRPC.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/SerializationContextJAXRPC.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/SerializationContextJAXRPC.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,127 +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.core.jaxrpc;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-
-import org.apache.xerces.xs.XSModel;
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
-import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.core.utils.JavaUtils;
-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;
-
-/**
- * The serialization context for JAXRPC endpoints/clients
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class SerializationContextJAXRPC extends SerializationContext
-{
- // provide logging
- private static final Logger log = Logger.getLogger(SerializationContextJAXRPC.class);
-
- // XML mapping from jaxrpc-mapping.xml
- private JavaWsdlMapping jaxrpcMapping;
-
- public JavaWsdlMapping getJavaWsdlMapping()
- {
- if (jaxrpcMapping == null)
- {
- log.debug("Generate jaxrpcMapping from typeMapping");
-
- jaxrpcMapping = new JavaWsdlMapping();
- for (QName xmlType : getTypeMapping().getRegisteredXmlTypes())
- {
- String nsURI = xmlType.getNamespaceURI();
- if (!Constants.NS_SCHEMA_XSD.equals(nsURI) &&
!Constants.NS_ATTACHMENT_MIME_TYPE.equals(nsURI))
- {
- Class javaType = getTypeMapping().getJavaType(xmlType);
- String javaTypeName = javaType.getName();
-
- Class componentType = javaType;
- while (componentType.isArray())
- componentType = componentType.getComponentType();
-
- if (JavaUtils.isPrimitive(componentType))
- componentType = JavaUtils.getWrapperType(componentType);
-
- Package packageObject = componentType.getPackage();
- String packageName = (packageObject != null) ? packageObject.getName() :
"";
- String packageType = jaxrpcMapping.getPackageNameForNamespaceURI(nsURI);
- if (packageName.equals(packageType) == false)
- {
- PackageMapping packageMapping = new PackageMapping(jaxrpcMapping);
- packageMapping.setNamespaceURI(nsURI);
- packageMapping.setPackageType(packageName);
- jaxrpcMapping.addPackageMapping(packageMapping);
- log.debug("Add package mapping: " + packageMapping);
- }
-
- // Do not add mappings for array types
- if (javaType.isArray())
- continue;
-
- JavaXmlTypeMapping xmlTypeMapping =
jaxrpcMapping.getTypeMappingForQName(xmlType);
- if (xmlTypeMapping == null)
- {
- xmlTypeMapping = new JavaXmlTypeMapping(jaxrpcMapping);
- xmlTypeMapping.setQNameScope("complexType");
- xmlTypeMapping.setJavaType(javaTypeName);
- xmlTypeMapping.setRootTypeQName(xmlType);
- jaxrpcMapping.addJavaXmlTypeMappings(xmlTypeMapping);
- log.debug("Add type mapping: " + xmlTypeMapping);
- }
- }
- }
- }
- return jaxrpcMapping;
- }
-
- public void setJavaWsdlMapping(JavaWsdlMapping jaxrpcMapping)
- {
- this.jaxrpcMapping = jaxrpcMapping;
- }
-
- public XSModel getXsModel()
- {
- SOAPMessageContextJAXRPC msgContext =
(SOAPMessageContextJAXRPC)MessageContextAssociation.peekMessageContext();
- if (msgContext == null)
- throw new WSException("MessageContext not available");
-
- OperationMetaData opMetaData = msgContext.getOperationMetaData();
- ServiceMetaData serviceMetaData =
opMetaData.getEndpointMetaData().getServiceMetaData();
- TypesMetaData typesMetaData = serviceMetaData.getTypesMetaData();
- return typesMetaData.getSchemaModel();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/SerializationContextJAXRPC.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/SerializationContextJAXRPC.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceExt.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceExt.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceExt.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,42 +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.core.jaxrpc;
-
-//$Id$
-
-import javax.xml.rpc.Service;
-import javax.xml.rpc.handler.HandlerRegistry;
-
-/**
- * Extends the JAXRPC Service with JBoss propriatary behaviour
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 27-Jan-2005
- */
-public interface ServiceExt extends Service
-{
- /**
- * Get a HandlerRegistry that can be used to dynamically
- * change the client side handler chain
- */
- HandlerRegistry getDynamicHandlerRegistry();
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceExt.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceExt.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceFactoryImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceFactoryImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceFactoryImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,160 +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.core.jaxrpc;
-
-// $Id$
-
-import java.net.URL;
-import java.util.Properties;
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.Service;
-import javax.xml.rpc.ServiceException;
-import javax.xml.rpc.ServiceFactory;
-
-import org.jboss.logging.Logger;
-import org.jboss.util.NotImplementedException;
-
-/**
- * Service class acts as a factory for:
- * <ul>
- * <li>Dynamic proxy for the target service endpoint.
- * <li>Instance of the type javax.xml.rpc.Call for the dynamic invocation of a
remote operation on the target service endpoint.
- * <li>Instance of a generated stub class
- * </ul>
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 10-Oct-2004
- */
-public class ServiceFactoryImpl extends ServiceFactory
-{
- // provide logging
- private final Logger log = Logger.getLogger(ServiceFactoryImpl.class);
-
- /**
- * Create an instance of the generated service implementation class for a given
service interface, if available.
- *
- * @param serviceInterface Service interface
- * @return A Service
- * @throws ServiceException If there is any error while creating the specified
service, including the case where a
- * generated service implementation class cannot be located
- */
- public Service loadService(Class serviceInterface) throws ServiceException
- {
- throw new NotImplementedException();
- }
-
- /**
- * Create an instance of the generated service implementation class for a given
service interface, if available.
- * An implementation may use the provided wsdlDocumentLocation and properties to help
locate the generated implementation class.
- * If no such class is present, a ServiceException will be thrown.
- *
- * @param wsdlDocumentLocation URL for the WSDL document location for the service or
null
- * @param serviceInterface Service interface
- * @param props A set of implementation-specific properties to help
locate the generated service implementation class
- * @return A Service
- * @throws ServiceException If there is any error while creating the specified
service, including the case where a
- * generated service implementation class cannot be located
- */
- public Service loadService(URL wsdlDocumentLocation, Class serviceInterface,
Properties props) throws ServiceException
- {
- throw new NotImplementedException();
- }
-
- /**
- * Create an instance of the generated service implementation class for a given
service, if available.
- * The service is uniquely identified by the wsdlDocumentLocation and serviceName
arguments.
- * An implementation may use the provided properties to help locate the generated
implementation class.
- * If no such class is present, a ServiceException will be thrown.
- *
- * @param wsdlDocumentLocation URL for the WSDL document location for the service or
null
- * @param serviceName Qualified name for the service
- * @param props A set of implementation-specific properties to help
locate the generated service implementation class
- * @return A Service
- * @throws ServiceException If there is any error while creating the specified
service, including the case where a generated service implementation class cannot be
located
- */
- public Service loadService(URL wsdlDocumentLocation, QName serviceName, Properties
props) throws ServiceException
- {
- throw new NotImplementedException();
- }
-
- /**
- * Create a <code>Service</code> instance.
- *
- * @param serviceName QName for the service
- * @return Service.
- * @throws ServiceException If any error in creation of the specified service
- */
- public Service createService(QName serviceName) throws ServiceException
- {
- return new ServiceImpl(serviceName);
- }
-
- /**
- * Create a <code>Service</code> instance.
- *
- * @param wsdlURL URL for the WSDL document location
- * @param serviceName QName for the service.
- * @return Service.
- * @throws ServiceException If any error in creation of the specified service
- */
- public Service createService(URL wsdlURL, QName serviceName) throws ServiceException
- {
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
-
- URL mappingURL = cl.getResource("META-INF/jaxrpc-mapping.xml");
- if (mappingURL != null)
- log.info("Use jaxrpc-mapping from: " + mappingURL);
-
- return createService(wsdlURL, serviceName, mappingURL, null);
- }
-
- /**
- * Create a <code>Service</code> instance.
- *
- * @param wsdlURL URL for the WSDL document location
- * @param serviceName QName for the service.
- * @param mappingURL URL for the jaxrpc-mapping.xml document location
- * @return Service.
- * @throws ServiceException If any error in creation of the specified service
- */
- public Service createService(URL wsdlURL, QName serviceName, URL mappingURL) throws
ServiceException
- {
- return createService(wsdlURL, serviceName, mappingURL, null);
- }
-
- /**
- * Create a <code>Service</code> instance.
- *
- * @param wsdlURL URL for the WSDL document location
- * @param serviceName QName for the service.
- * @param mappingURL URL for the jaxrpc-mapping.xml document location
- * @param securityURL URL for the jboss-ws-security.xml file
- * @return Service.
- * @throws ServiceException If any error in creation of the specified service
- */
- public Service createService(URL wsdlURL, QName serviceName, URL mappingURL, URL
securityURL) throws ServiceException
- {
- ServiceImpl service = new ServiceImpl(serviceName, wsdlURL, mappingURL,
securityURL);
- return service;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceFactoryImpl.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceFactoryImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceImpl.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,404 +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.core.jaxrpc;
-
-// $Id$
-
-import java.lang.reflect.Proxy;
-import java.net.URL;
-import java.rmi.Remote;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.Call;
-import javax.xml.rpc.ServiceException;
-import javax.xml.rpc.encoding.TypeMappingRegistry;
-import javax.xml.rpc.handler.HandlerChain;
-import javax.xml.rpc.handler.HandlerRegistry;
-
-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;
-
-/**
- * Service class acts as a factory for:
- * <ul>
- * <li>Dynamic proxy for the target service endpoint.
- * <li>Instance of the type javax.xml.rpc.Call for the dynamic invocation of a
- * remote operation on the target service endpoint.
- * <li>Instance of a generated stub class
- * </ul>
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 10-Oct-2004
- */
-public class ServiceImpl implements ServiceExt
-{
- // The service meta data that is associated with this JAXRPC Service
- private ServiceMetaData serviceMetaData;
-
- // The optional WSDL location
- private URL wsdlLocation;
-
- // The handler registry
- private HandlerRegistryImpl handlerRegistry;
-
- /**
- * Construct a Service without WSDL meta data
- */
- ServiceImpl(QName serviceName)
- {
- UnifiedMetaData wsMetaData = new UnifiedMetaData();
- serviceMetaData = new ServiceMetaData(wsMetaData, serviceName);
- handlerRegistry = new HandlerRegistryImpl(serviceMetaData);
- }
-
- /**
- * Construct a Service that has access to some WSDL meta data
- */
- ServiceImpl(QName serviceName, URL wsdlURL, URL mappingURL, URL securityURL)
- {
- this.wsdlLocation = wsdlURL;
- JAXRPCClientMetaDataBuilder builder = new JAXRPCClientMetaDataBuilder();
-
- ClassLoader ctxClassLoader = Thread.currentThread().getContextClassLoader();
-
- serviceMetaData = builder.buildMetaData(serviceName, wsdlURL, mappingURL,
securityURL, null, ctxClassLoader);
- handlerRegistry = new HandlerRegistryImpl(serviceMetaData);
- }
-
- /**
- * Construct a Service that has access to some WSDL meta data
- */
- ServiceImpl(QName serviceName, URL wsdlURL, JavaWsdlMapping mappingURL,
WSSecurityConfiguration securityConfig, UnifiedServiceRefMetaData serviceRefMetaData)
- {
- this.wsdlLocation = wsdlURL;
- JAXRPCClientMetaDataBuilder builder = new JAXRPCClientMetaDataBuilder();
-
- ClassLoader ctxClassLoader = Thread.currentThread().getContextClassLoader();
-
- serviceMetaData = builder.buildMetaData(serviceName, wsdlURL, mappingURL,
securityConfig, serviceRefMetaData, ctxClassLoader);
- handlerRegistry = new HandlerRegistryImpl(serviceMetaData);
- }
-
- public ServiceMetaData getServiceMetaData()
- {
- return serviceMetaData;
- }
-
- /**
- * Gets the location of the WSDL document for this Service.
- *
- * @return URL for the location of the WSDL document for this service
- */
- public URL getWSDLDocumentLocation()
- {
- return wsdlLocation;
- }
-
- /**
- * Gets the name of this service.
- *
- * @return Qualified name of this service
- */
- public QName getServiceName()
- {
- return serviceMetaData.getServiceName();
- }
-
- /**
- * Creates a Call instance.
- *
- * @param portName
- * Qualified name for the target service endpoint
- * @return Call instance
- * @throws javax.xml.rpc.ServiceException
- * If any error in the creation of the Call object
- */
- public Call createCall(QName portName) throws ServiceException
- {
- String nsURI = portName.getNamespaceURI();
- serviceMetaData.assertTargetNamespace(nsURI);
- return new CallImpl(this, portName, null);
- }
-
- /**
- * Creates a Call instance.
- *
- * @param portName
- * Qualified name for the target service endpoint
- * @param operationName
- * Name of the operation for which this Call object is to be
- * created.
- * @return Call instance
- * @throws javax.xml.rpc.ServiceException
- * If any error in the creation of the Call object
- */
- public Call createCall(QName portName, String operationName) throws ServiceException
- {
- String nsURI = portName.getNamespaceURI();
- serviceMetaData.assertTargetNamespace(nsURI);
- QName opName = new QName(nsURI, operationName);
- return new CallImpl(this, portName, opName);
- }
-
- /**
- * Creates a Call instance.
- *
- * @param portName
- * Qualified name for the target service endpoint
- * @param opName
- * Qualified name of the operation for which this Call object is
- * to be created.
- * @return Call instance
- * @throws javax.xml.rpc.ServiceException
- * If any error in the creation of the Call object
- */
- public Call createCall(QName portName, QName opName) throws ServiceException
- {
- serviceMetaData.assertTargetNamespace(portName.getNamespaceURI());
- serviceMetaData.assertTargetNamespace(opName.getNamespaceURI());
- return new CallImpl(this, portName, opName);
- }
-
- /**
- * Creates a Call object not associated with specific operation or target
- * service endpoint. This Call object needs to be configured using the
- * setter methods on the Call interface.
- *
- * @return Call object
- * @throws javax.xml.rpc.ServiceException
- * If any error in the creation of the Call object
- */
- public Call createCall() throws ServiceException
- {
- return new CallImpl(this);
- }
-
- /**
- * Gets an array of preconfigured Call objects for invoking operations on
- * the specified port. There is one Call object per operation that can be
- * invoked on the specified port. Each Call object is pre-configured and
- * does not need to be configured using the setter methods on Call
- * interface. <p/> Each invocation of the getCalls method returns a new
- * array of preconfigured Call objects <p/> This method requires the Service
- * implementation class to have access to the WSDL related metadata.
- *
- * @param portName
- * Qualified name for the target service endpoint
- * @return Call[] Array of pre-configured Call objects
- * @throws javax.xml.rpc.ServiceException
- * If this Service class does not have access to the required
- * WSDL metadata or if an illegal endpointName is specified.
- */
- public Call[] getCalls(QName portName) throws ServiceException
- {
- EndpointMetaData epMetaData = serviceMetaData.getEndpoint(portName);
- if (epMetaData == null)
- throw new ServiceException("Cannot find endpoint for name: " +
portName);
-
- List<Call> calls = new ArrayList<Call>();
- for (OperationMetaData opMetaData : epMetaData.getOperations())
- {
- Call call = createCall(portName, opMetaData.getQName());
- calls.add(call);
- }
-
- Call[] callArr = new Call[calls.size()];
- calls.toArray(callArr);
-
- return callArr;
- }
-
- /**
- * J2EE components should not use the getHandlerRegistry() method. A
- * container provider must throw a java.lang.UnsupportedOperationException
- * from the getHandlerRegistry() method of the Service Interface. Handler
- * support is documented in Chapter 6 Handlers.
- */
- public HandlerRegistry getHandlerRegistry()
- {
- throw new UnsupportedOperationException("Components should not use the
getHandlerRegistry() method.");
- }
-
- /**
- * Get a HandlerRegistry that can be used to dynamically change the client
- * side handler chain associated with a given endpoint.
- */
- public HandlerRegistry getDynamicHandlerRegistry()
- {
- return handlerRegistry;
- }
-
- /**
- * J2EE components should not use the getTypeMappingRegistry() method. A
- * container provider must throw a java.lang.UnsupportedOperationException
- * from the getTypeMappingRegistry() method of the Service Interface.
- */
- public TypeMappingRegistry getTypeMappingRegistry()
- {
- throw new UnsupportedOperationException("Components should not use the
getTypeMappingRegistry() method.");
- }
-
- /**
- * Returns an Iterator for the list of QNames of service endpoints grouped
- * by this service
- *
- * @return Returns java.util.Iterator with elements of type
- * javax.xml.namespace.QName
- * @throws javax.xml.rpc.ServiceException
- * If this Service class does not have access to the required
- * WSDL metadata
- */
- public Iterator getPorts() throws ServiceException
- {
- ArrayList<QName> list = new ArrayList<QName>();
- if (serviceMetaData != null)
- {
- for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
- {
- list.add(epMetaData.getQName());
- }
- }
- return list.iterator();
- }
-
- /**
- * The getPort method returns either an instance of a generated stub
- * implementation class or a dynamic proxy. The parameter
- * serviceEndpointInterface specifies the service endpoint interface that is
- * supported by the returned stub or proxy. In the implementation of this
- * method, the JAX-RPC runtime system takes the responsibility of selecting
- * a protocol binding (and a port) and configuring the stub accordingly. The
- * returned Stub instance should not be reconfigured by the client.
- */
- public Remote getPort(Class seiClass) throws ServiceException
- {
- if (seiClass == null)
- throw new IllegalArgumentException("SEI class cannot be null");
-
- String seiName = seiClass.getName();
- if (Remote.class.isAssignableFrom(seiClass) == false)
- throw new ServiceException("SEI does not implement java.rmi.Remote: "
+ seiName);
-
- if (serviceMetaData == null)
- throw new ServiceException("Service meta data not available");
-
- try
- {
- EndpointMetaData epMetaData =
serviceMetaData.getEndpointByServiceEndpointInterface(seiName);
- if (epMetaData == null && serviceMetaData.getEndpoints().size() == 1)
- {
- epMetaData = serviceMetaData.getEndpoints().get(0);
- epMetaData.setServiceEndpointInterfaceName(seiName);
- }
-
- if (epMetaData == null)
- throw new ServiceException("Cannot find endpoint meta data for: " +
seiName);
-
- return createProxy(seiClass, epMetaData);
- }
- catch (ServiceException ex)
- {
- throw ex;
- }
- catch (Exception ex)
- {
- throw new ServiceException("Cannot create proxy", ex);
- }
- }
-
- /**
- * The getPort method returns either an instance of a generated stub
- * implementation class or a dynamic proxy. A service client uses this
- * dynamic proxy to invoke operations on the target service endpoint. The
- * serviceEndpointInterface specifies the service endpoint interface that is
- * supported by the created dynamic proxy or stub instance.
- */
- public Remote getPort(QName portName, Class seiClass) throws ServiceException
- {
- if (seiClass == null)
- throw new IllegalArgumentException("SEI class cannot be null");
-
- if (serviceMetaData == null)
- throw new ServiceException("Service meta data not available");
-
- String seiName = seiClass.getName();
- if (Remote.class.isAssignableFrom(seiClass) == false)
- throw new ServiceException("SEI does not implement java.rmi.Remote: "
+ seiName);
-
- EndpointMetaData epMetaData = serviceMetaData.getEndpoint(portName);
- if (epMetaData == null)
- throw new ServiceException("Cannot obtain endpoint meta data for: " +
portName);
-
- try
- {
- if (epMetaData.getServiceEndpointInterfaceName() == null)
- epMetaData.setServiceEndpointInterfaceName(seiName);
-
- return createProxy(seiClass, epMetaData);
- }
- catch (ServiceException ex)
- {
- throw ex;
- }
- catch (Exception ex)
- {
- throw new ServiceException("Cannot create proxy", ex);
- }
- }
-
- private Remote createProxy(Class seiClass, EndpointMetaData epMetaData) throws
Exception
- {
- CallImpl call = new CallImpl(this, epMetaData);
-
- CallProxy handler = new CallProxy(call);
- ClassLoader cl = epMetaData.getClassLoader();
- Remote proxy = (Remote)Proxy.newProxyInstance(cl, new Class[] { seiClass,
StubExt.class }, handler);
-
- return proxy;
- }
-
- /**
- * Get the handler chain for the given endpoint name, maybe null.
- */
- public HandlerChain getHandlerChain(QName portName)
- {
- return handlerRegistry.getHandlerChainInstance(portName);
- }
-
- /**
- * Register a handler chain for the given endpoint name
- */
- public void registerHandlerChain(QName portName, List infos, Set roles)
- {
- handlerRegistry.registerClientHandlerChain(portName, infos, roles);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceImpl.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceObjectFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceObjectFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceObjectFactory.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,317 +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.
- */
-// $Id$
-package org.jboss.ws.core.jaxrpc;
-
-// $Id$
-
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.ObjectInputStream;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Proxy;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.net.URLEncoder;
-import java.rmi.Remote;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Set;
-
-import javax.naming.Context;
-import javax.naming.Name;
-import javax.naming.NamingException;
-import javax.naming.RefAddr;
-import javax.naming.Reference;
-import javax.naming.spi.ObjectFactory;
-import javax.xml.namespace.QName;
-import javax.xml.rpc.JAXRPCException;
-import javax.xml.rpc.Service;
-import javax.xml.rpc.handler.HandlerInfo;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.server.ServiceEndpoint;
-import org.jboss.ws.core.server.ServiceEndpointManager;
-import org.jboss.ws.core.server.ServiceEndpointManagerFactory;
-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;
-
-/**
- * This ServiceObjectFactory reconstructs a javax.xml.rpc.Service
- * for a given WSDL when the webservice client does a JNDI lookup
- * <p/>
- * It uses the information provided by the service-ref element in application-client.xml
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 15-April-2004
- */
-public class ServiceObjectFactory implements ObjectFactory
-{
- // provide logging
- private static final Logger log = Logger.getLogger(ServiceObjectFactory.class);
-
- /**
- * Creates an object using the location or reference information specified.
- * <p/>
- *
- * @param obj The possibly null object containing location or reference
- * information that can be used in creating an object.
- * @param name The name of this object relative to
<code>nameCtx</code>,
- * or null if no name is specified.
- * @param nameCtx The context relative to which the <code>name</code>
- * parameter is specified, or null if <code>name</code>
is
- * relative to the default initial context.
- * @param environment The possibly null environment that is used in
- * creating the object.
- * @return The object created; null if an object cannot be created.
- * @throws Exception if this object factory encountered an exception
- * while attempting to create an object, and no other object
factories are
- * to be tried.
- * @see javax.naming.spi.NamingManager#getObjectInstance
- * @see javax.naming.spi.NamingManager#getURLContext
- */
- public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable
environment) throws Exception
- {
- try
- {
- Reference ref = (Reference)obj;
-
- // Unmarshall the ServiceRefMetaData
- UnifiedServiceRefMetaData serviceRefMetaData = null;
- RefAddr metaRefAddr = ref.get(ServiceReferenceable.SERVICE_REF_META_DATA);
- ByteArrayInputStream bais = new
ByteArrayInputStream((byte[])metaRefAddr.getContent());
- try
- {
- ObjectInputStream ois = new ObjectInputStream(bais);
- serviceRefMetaData = (UnifiedServiceRefMetaData)ois.readObject();
- ois.close();
- }
- catch (IOException e)
- {
- throw new NamingException("Cannot unmarshall service ref meta data,
cause: " + e.toString());
- }
-
- // reconstruct the resourceCl
- ClassLoader contextCL = Thread.currentThread().getContextClassLoader();
- URL url = new
URL((String)ref.get(ServiceReferenceable.DEPLOYMENT_URL).getContent());
- URLClassLoader resourceCL = new URLClassLoader(new URL[] { url }, contextCL);
- serviceRefMetaData.setResourceCL(resourceCL);
-
- // Rewrite the config-file content
- String configFile = serviceRefMetaData.getConfigFile();
- if (configFile != null)
- {
- try
- {
- new URL(configFile);
- }
- catch (MalformedURLException ex)
- {
- URL configURL = resourceCL.getResource(configFile);
- if (configURL != null)
- {
- configFile = configURL.toExternalForm();
- serviceRefMetaData.setConfigFile(configFile);
- }
- }
- }
-
- // Unmarshall the WSSecurityConfiguration
- WSSecurityConfiguration securityConfig = null;
- RefAddr wsseRefAddr = ref.get(ServiceReferenceable.SECURITY_CONFIG);
- if (wsseRefAddr != null)
- {
- bais = new ByteArrayInputStream((byte[])wsseRefAddr.getContent());
- try
- {
- ObjectInputStream ois = new ObjectInputStream(bais);
- securityConfig = (WSSecurityConfiguration)ois.readObject();
- ois.close();
- }
- catch (IOException e)
- {
- throw new NamingException("Cannot unmarshall security config, cause:
" + e.toString());
- }
- }
-
- ServiceImpl jaxrpcService = null;
- URL wsdlURL = serviceRefMetaData.getWsdlURL();
- if (wsdlURL != null)
- {
- log.debug("Create jaxrpc service from wsdl");
-
- // Create the actual service object
- QName serviceName = serviceRefMetaData.getServiceQName();
- JavaWsdlMapping javaWsdlMapping =
(JavaWsdlMapping)serviceRefMetaData.getJavaWsdlMapping();
- jaxrpcService = new ServiceImpl(serviceName, wsdlURL, javaWsdlMapping,
securityConfig, serviceRefMetaData);
- }
- else
- {
- log.debug("Create jaxrpc service with no wsdl");
- jaxrpcService = new ServiceImpl(new QName(Constants.NS_JBOSSWS_URI,
"AnonymousService"));
- }
-
- // Set any service level properties
- ServiceMetaData serviceMetaData = jaxrpcService.getServiceMetaData();
- serviceMetaData.setProperties(serviceRefMetaData.getCallProperties());
-
- // The web service client using a port-component-link, the contet is the URL to
- // the PortComponentLinkServlet that will return the actual endpoint address
- RefAddr pcLinkRef = ref.get(ServiceReferenceable.PORT_COMPONENT_LINK);
- if (pcLinkRef != null)
- {
- String pcLink = (String)pcLinkRef.getContent();
- log.debug("Resolving port-component-link: " + pcLink);
-
- // First try to obtain the endpoint address loacally
- String endpointAddress = null;
- try
- {
- ServiceEndpointManagerFactory factory =
ServiceEndpointManagerFactory.getInstance();
- ServiceEndpointManager epManager = factory.getServiceEndpointManager();
- ServiceEndpoint serviceEndpoint =
epManager.resolvePortComponentLink(pcLink);
- if (serviceEndpoint == null)
- throw new WSException("Cannot resolve port-component-link: "
+ pcLink);
-
- endpointAddress =
serviceEndpoint.getServiceEndpointInfo().getServerEndpointMetaData().getEndpointAddress();
- }
- catch (Exception ex)
- {
- // ignore, we are probably a remote client
- }
-
- // We may be remote in the esoteric case where an appclient uses the
port-comonent-link feature
- if (endpointAddress == null)
- {
- String servletPath =
(String)ref.get(ServiceReferenceable.PORT_COMPONENT_LINK_SERVLET).getContent();
- servletPath += "?pcLink=" + URLEncoder.encode(pcLink,
"UTF-8");
- InputStream is = new URL(servletPath).openStream();
- BufferedReader br = new BufferedReader(new InputStreamReader(is));
- endpointAddress = br.readLine();
- is.close();
- }
-
- log.debug("Resolved to: " + endpointAddress);
- if (serviceMetaData.getEndpoints().size() == 1)
- {
- EndpointMetaData epMetaData = serviceMetaData.getEndpoints().get(0);
- epMetaData.setEndpointAddress(endpointAddress);
- }
- else
- {
- log.warn("Cannot set endpoint address for port-component-link,
unsuported number of endpoints");
- }
- }
-
- /********************************************************
- * Setup the Proxy that implements the service-interface
- ********************************************************/
-
- // load the service interface class
- Class siClass = contextCL.loadClass(serviceRefMetaData.getServiceInterface());
- if (Service.class.isAssignableFrom(siClass) == false)
- throw new JAXRPCException("The service interface does not implement
javax.xml.rpc.Service: " + siClass.getName());
-
- // load all service endpoint interface classes
- UnifiedPortComponentRefMetaData[] pcrArray =
serviceRefMetaData.getPortComponentRefs();
- for (int i = 0; i < pcrArray.length; i++)
- {
- UnifiedPortComponentRefMetaData pcr = pcrArray[i];
- Class seiClass = contextCL.loadClass(pcr.getServiceEndpointInterface());
- if (Remote.class.isAssignableFrom(seiClass) == false)
- throw new IllegalArgumentException("The SEI does not implement
java.rmi.Remote: " + seiClass.getName());
- }
-
- // Setup the handler chain
- setupHandlerChain(jaxrpcService, serviceRefMetaData);
-
- InvocationHandler handler = new ServiceProxy(jaxrpcService, siClass);
- return Proxy.newProxyInstance(contextCL, new Class[] { siClass, ServiceExt.class
}, handler);
- }
- catch (Exception ex)
- {
- log.error("Cannot create service", ex);
- throw ex;
- }
- }
-
- /**
- * Setup the handler chain(s) for this service
- * <p/>
- * This registers a handler chain with the service for every endpoint
- * that has handlers configured in the <service-ref> element
- */
- private void setupHandlerChain(ServiceImpl jaxrpcService, UnifiedServiceRefMetaData
serviceRefMetaData) throws Exception
- {
- List<EndpointMetaData> endpoints =
jaxrpcService.getServiceMetaData().getEndpoints();
- for (EndpointMetaData epMetaData : endpoints)
- {
- QName portName = epMetaData.getQName();
-
- Set<String> handlerRoles = new HashSet<String>();
- ArrayList handlerInfos = new ArrayList();
- for (HandlerMetaData handlerMetaData :
epMetaData.getHandlerMetaData(HandlerType.ALL))
- {
- HandlerMetaDataJAXRPC jaxrpcMetaData =
(HandlerMetaDataJAXRPC)handlerMetaData;
- handlerRoles.addAll(jaxrpcMetaData.getSoapRoles());
-
- HashMap hConfig = new HashMap();
- for (HandlerInitParam param : jaxrpcMetaData.getInitParams())
- {
- hConfig.put(param.getParamName(), param.getParamValue());
- }
-
- Set<QName> headers = jaxrpcMetaData.getSoapHeaders();
- QName[] headerArr = new QName[headers.size()];
- headers.toArray(headerArr);
-
- Class hClass = jaxrpcMetaData.getHandlerClass();
- hConfig.put(HandlerType.class.getName(), jaxrpcMetaData.getHandlerType());
- HandlerInfo info = new HandlerInfo(hClass, hConfig, headerArr);
-
- log.debug("Adding client side handler to endpoint '" + portName
+ "': " + info);
- handlerInfos.add(info);
-
- // register the handlers with the client engine
- if (handlerInfos.size() > 0)
- jaxrpcService.registerHandlerChain(portName, handlerInfos, handlerRoles);
- }
- }
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceObjectFactory.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceObjectFactory.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceProxy.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceProxy.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceProxy.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,162 +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.
-*/
-// $Id$
-package org.jboss.ws.core.jaxrpc;
-
-// $Id$
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.rmi.Remote;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.xml.rpc.JAXRPCException;
-import javax.xml.rpc.Service;
-
-import org.jboss.logging.Logger;
-
-/**
- * This is the proxy that implements the service interface .
- * <p/>
- * Additionally it handles some ws4ee functionality that is not part of jaxrpc
behaviour.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 15-May-2004
- */
-public class ServiceProxy implements InvocationHandler
-{
- // provide logging
- private static final Logger log = Logger.getLogger(ServiceProxy.class);
-
- // The underlying jaxrpc service
- private ServiceImpl jaxrpcService;
-
- // The methods from java.lang.Object
- private List objectMethods = new ArrayList();
- // The methods from javax.xml.rpc.Service
- private List jaxrpcServiceMethods = new ArrayList();
- // The methods from the service interface, in case of javax.xml.rpc.Service it is
empty
- private List serviceInterfaceMethods = new ArrayList();
-
- // The cached getPort method
- private Method getPortMethod;
-
- /**
- * Construct a client side service proxy.
- * <p/>
- * This proxy implements the (generated) service interface.
- *
- * @param service The underlying {@link javax.xml.rpc.Service}
- * @param siClass The service interface, a subclass of {@link javax.xml.rpc.Service}
- */
- public ServiceProxy(ServiceImpl service, Class siClass)
- {
- this.jaxrpcService = service;
-
- // initialize java.lang.Object methods
- objectMethods.addAll(Arrays.asList(Object.class.getMethods()));
-
- // initialize javax.xml.rpc.Service methods
- jaxrpcServiceMethods.addAll(Arrays.asList(ServiceExt.class.getMethods()));
-
- // initialize SI methods
- if (siClass.getName().equals("javax.xml.rpc.Service") == false)
- serviceInterfaceMethods.addAll(Arrays.asList(siClass.getDeclaredMethods()));
-
- // initialize special ws4ee methods
- try
- {
- getPortMethod = Service.class.getMethod("getPort", new
Class[]{Class.class});
- }
- catch (NoSuchMethodException e)
- {
- throw new JAXRPCException(e.toString());
- }
- }
-
- /**
- * Processes a method invocation on a proxy instance and returns
- * the result.
- */
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
- {
- String methodName = method.getName();
-
- try
- {
- Object retObj = null;
- if (jaxrpcServiceMethods.contains(method))
- {
- log.debug("Invoke on jaxrpc service: " + methodName);
-
- if (method.getName().equals("getPort"))
- {
- Remote port = (Remote)method.invoke(jaxrpcService, args);
- return port;
- }
- else
- {
- retObj = method.invoke(jaxrpcService, args);
- return retObj;
- }
- }
- if (serviceInterfaceMethods.contains(method))
- {
- log.debug("Invoke on service interface: " + methodName);
-
- Class seiClass = method.getReturnType();
- retObj = getPortMethod.invoke(jaxrpcService, new Object[]{seiClass});
- return retObj;
- }
- if (objectMethods.contains(method))
- {
- log.debug("Invoke on object: " + methodName);
-
- retObj = method.invoke(jaxrpcService, args);
- return retObj;
- }
-
- throw new JAXRPCException("Don't know how to invoke: " + method);
- }
- catch (Exception e)
- {
- handleException(e);
- return null;
- }
- }
-
- /**
- * Log the client side exception
- */
- private void handleException(Exception ex) throws Throwable
- {
- Throwable th = ex;
- if (ex instanceof InvocationTargetException)
- th = ((InvocationTargetException)ex).getTargetException();
-
- log.error("Service error", th);
- throw th;
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceProxy.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceProxy.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceReferenceable.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceReferenceable.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceReferenceable.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,177 +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.
- */
-// $Id$
-package org.jboss.ws.core.jaxrpc;
-
-// $Id$
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-import java.net.URL;
-
-import javax.naming.BinaryRefAddr;
-import javax.naming.NamingException;
-import javax.naming.Reference;
-import javax.naming.Referenceable;
-import javax.naming.StringRefAddr;
-
-import org.jboss.ws.core.server.ServiceEndpointManager;
-import org.jboss.ws.core.server.ServiceEndpointManagerFactory;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.metadata.j2ee.UnifiedPortComponentRefMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedServiceRefMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedWebMetaData;
-import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
-import org.jboss.ws.metadata.wsse.WSSecurityConfigurationFactory;
-
-/**
- * A JNDI reference to a javax.xml.rpc.Service
- * <p/>
- * It holds the information to reconstrut the javax.xml.rpc.Service
- * when the client does a JNDI lookup.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 15-April-2004
- */
-public class ServiceReferenceable implements Referenceable
-{
- public static final String SERVICE_REF_META_DATA = "SERVICE_REF_META_DATA";
- public static final String DEPLOYMENT_URL = "DEPLOYMENT_URL";
- public static final String SECURITY_CONFIG = "SECURITY_CONFIG";
- public static final String DESCRIPTOR_LOC = "DESCRIPTOR_LOC";
- public static final String PORT_COMPONENT_LINK = "PORT_COMPONENT_LINK";
- public static final String PORT_COMPONENT_LINK_SERVLET =
"PORT_COMPONENT_LINK_SERVLET";
-
- private UnifiedServiceRefMetaData refMetaData;
- private UnifiedDeploymentInfo udi;
-
- /**
- * A service referenceable for a WSDL document that is part of the deployment
- *
- * @param refMetaData The service-ref meta data
- * @param udi The client DeploymentInfo
- */
- public ServiceReferenceable(UnifiedServiceRefMetaData refMetaData,
UnifiedDeploymentInfo udi)
- {
- this.refMetaData = refMetaData;
- this.udi = udi;
- }
-
- /**
- * Retrieves the Reference of this object.
- *
- * @return The non-null Reference of this object.
- * @throws javax.naming.NamingException If a naming exception was encountered while
retrieving the reference.
- */
- public Reference getReference() throws NamingException
- {
- Reference myRef = new Reference(ServiceReferenceable.class.getName(),
ServiceObjectFactory.class.getName(), null);
-
- // The deployment URL of the web service client deployment
- // Add a reference to the client deployment URL
- URL deploymentURL = udi.url;
- myRef.add(new StringRefAddr(DEPLOYMENT_URL, deploymentURL.toExternalForm()));
-
- // Add a reference to the ServiceRefMetaData and WSDLDefinitions
- myRef.add(new BinaryRefAddr(SERVICE_REF_META_DATA, marshallServiceRef()));
-
- if (getSecurityConfigURL() != null)
- myRef.add(new BinaryRefAddr(SECURITY_CONFIG, marshallSecurityConfig()));
-
- // Add references to port component links
- UnifiedPortComponentRefMetaData[] pcrArr = refMetaData.getPortComponentRefs();
- for (int i = 0; i < pcrArr.length; i++)
- {
- UnifiedPortComponentRefMetaData pcr = pcrArr[i];
- String pcLink = pcr.getPortComponentLink();
- if (pcLink != null)
- {
- myRef.add(new StringRefAddr(PORT_COMPONENT_LINK, pcLink));
- try
- {
- ServiceEndpointManagerFactory factory =
ServiceEndpointManagerFactory.getInstance();
- ServiceEndpointManager epManager = factory.getServiceEndpointManager();
- String host = epManager.getWebServiceHost();
- int port = epManager.getWebServicePort();
-
- String servletURL = "http://" + host + ":" + port +
"/jbossws/pclink";
- myRef.add(new StringRefAddr(PORT_COMPONENT_LINK_SERVLET, servletURL));
- }
- catch (Exception ex)
- {
- throw new NamingException("Cannot obtain path to
PortComponentLinkServlet: " + ex);
- }
- }
- }
-
- return myRef;
- }
-
- /** Marshall the ServiceRefMetaData to an byte array
- */
- private byte[] marshallServiceRef() throws NamingException
- {
- refMetaData.getJavaWsdlMapping();
-
- ByteArrayOutputStream baos = new ByteArrayOutputStream(512);
- try
- {
- ObjectOutputStream oos = new ObjectOutputStream(baos);
- oos.writeObject(refMetaData);
- oos.close();
- }
- catch (IOException e)
- {
- throw new NamingException("Cannot marshall service ref meta data, cause:
" + e.toString());
- }
- return baos.toByteArray();
- }
-
- /** Marshall the WSSecurityConfiguration to an byte array
- */
- private byte[] marshallSecurityConfig() throws NamingException
- {
- ByteArrayOutputStream baos = new ByteArrayOutputStream(512);
- try
- {
- ObjectOutputStream oos = new ObjectOutputStream(baos);
- URL securityURL = getSecurityConfigURL();
- WSSecurityConfiguration securityConfig =
WSSecurityConfigurationFactory.newInstance().parse(securityURL);
- oos.writeObject(securityConfig);
- oos.close();
- }
- catch (IOException e)
- {
- throw new NamingException("Cannot marshall security config, cause: " +
e.toString());
- }
- return baos.toByteArray();
- }
-
- private URL getSecurityConfigURL()
- {
- ClassLoader ctxClassLoader = refMetaData.getResourceCL();
- String descriptorLoc = udi.metaData instanceof UnifiedWebMetaData ?
"WEB-INF" : "META-INF";
- URL securityURL = ctxClassLoader.getResource(descriptorLoc + "/" +
WSSecurityConfigurationFactory.CLIENT_RESOURCE_NAME);
- return securityURL;
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceReferenceable.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceReferenceable.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServletEndpointContextImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServletEndpointContextImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServletEndpointContextImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,94 +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.core.jaxrpc;
-
-// $Id$
-
-import java.security.Principal;
-
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-import javax.xml.rpc.handler.MessageContext;
-import javax.xml.rpc.server.ServletEndpointContext;
-
-import org.jboss.ws.core.server.EndpointContext;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-
-/**
- * Implementation of <code>ServletEndpointContext</code>
- *
- * @author <a href="mailto:jason@stacksmash.com">Jason T.
Greene</a>
- */
-public class ServletEndpointContextImpl implements ServletEndpointContext
-{
- private ServletContext context;
- private HttpServletRequest request;
- private HttpServletResponse response;
-
- public ServletEndpointContextImpl(EndpointContext context)
- {
- this.context = context.getServletContext();
- this.request = context.getHttpServletRequest();
- this.response = context.getHttpServletResponse();
- }
-
- public HttpSession getHttpSession()
- {
- return request.getSession();
- }
-
- public MessageContext getMessageContext()
- {
- return (MessageContext)MessageContextAssociation.peekMessageContext();
- }
-
- public ServletContext getServletContext()
- {
- return context;
- }
-
- public Principal getUserPrincipal()
- {
- return request.getUserPrincipal();
- }
-
- public boolean isUserInRole(String role)
- {
- return request.isUserInRole(role);
- }
-
- // BEGIN non-standard access methods
-
- public HttpServletRequest getHttpServletRequest()
- {
- return request;
- }
-
- public HttpServletResponse getHttpServletResponse()
- {
- return response;
- }
-
- // END non-standard access methods
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServletEndpointContextImpl.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServletEndpointContextImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/StubExt.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/StubExt.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/StubExt.java 2006-12-07 10:43:36 UTC (rev
1600)
@@ -1,112 +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.core.jaxrpc;
-
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.ParameterMode;
-
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-
-// $Id$
-
-/**
- * An instance of a stub class represents a client side proxy or stub instance for the
target service endpoint.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 27-Jan-2005
- */
-public interface StubExt extends javax.xml.rpc.Stub
-{
- /** ClientTimeout property: org.jboss.ws.timeout */
- static final String PROPERTY_CLIENT_TIMEOUT = "org.jboss.ws.timeout";
- /** KeyStore property: org.jboss.ws.keyStore */
- static final String PROPERTY_KEY_STORE = "org.jboss.ws.keyStore";
- /** KeyStorePassword property: org.jboss.ws.keyStorePassword */
- static final String PROPERTY_KEY_STORE_PASSWORD =
"org.jboss.ws.keyStorePassword";
- /** KeyStoreType property: org.jboss.ws.keyStoreType */
- static final String PROPERTY_KEY_STORE_TYPE = "org.jboss.ws.keyStoreType";
- /** TrustStore property: org.jboss.ws.trustStore */
- static final String PROPERTY_TRUST_STORE = "org.jboss.ws.trustStore";
- /** TrustStorePassword property: org.jboss.ws.trustStorePassword */
- static final String PROPERTY_TRUST_STORE_PASSWORD =
"org.jboss.ws.trustStorePassword";
- /** TrustStoreType property: org.jboss.ws.trustStoreType */
- static final String PROPERTY_TRUST_STORE_TYPE =
"org.jboss.ws.trustStoreType";
- /** Authentication type, used to specify basic, etc) */
- static final String PROPERTY_AUTH_TYPE = "org.jboss.ws.authType";
- /** Authentication type, BASIC */
- static final String PROPERTY_AUTH_TYPE_BASIC =
"org.jboss.ws.authType.basic";
- /** Authentication type, WSEE */
- static final String PROPERTY_AUTH_TYPE_WSSE = "org.jboss.ws.authType.wsse";
- /** Enable MTOM on the stub */
- static final String PROPERTY_MTOM_ENABLED= "org.jboss.ws.mtom.enabled";
-
- /**
- * Get the endpoint meta data for this stub
- */
- EndpointMetaData getEndpointMetaData();
-
- /**
- * Add a header that is not bound to an input parameter.
- * A propriatory extension, that is not part of JAXRPC.
- *
- * @param xmlName The XML name of the header element
- * @param xmlType The XML type of the header element
- */
- void addUnboundHeader(QName xmlName, QName xmlType, Class javaType, ParameterMode
mode);
-
- /**
- * Get the header value for the given XML name.
- * A propriatory extension, that is not part of JAXRPC.
- *
- * @param xmlName The XML name of the header element
- * @return The header value, or null
- */
- Object getUnboundHeaderValue(QName xmlName);
-
- /**
- * Set the header value for the given XML name.
- * A propriatory extension, that is not part of JAXRPC.
- *
- * @param xmlName The XML name of the header element
- */
- void setUnboundHeaderValue(QName xmlName, Object value);
-
- /**
- * Clear all registered headers.
- * A propriatory extension, that is not part of JAXRPC.
- */
- void clearUnboundHeaders();
-
- /**
- * Remove the header for the given XML name.
- * A propriatory extension, that is not part of JAXRPC.
- */
- void removeUnboundHeader(QName xmlName);
-
- /**
- * Get an Iterator over the registered header XML names.
- * A propriatory extension, that is not part of JAXRPC.
- */
- Iterator getUnboundHeaders();
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/StubExt.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/StubExt.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/Style.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/Style.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/Style.java 2006-12-07 10:43:36 UTC (rev
1600)
@@ -1,62 +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.core.jaxrpc;
-
-// $Id$
-
-/** A type-safe enumeration for encoding style.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 14-Oct-2004
- */
-public class Style
-{
- private String style;
-
- public static final Style RPC = new Style("rpc");
- public static final Style DOCUMENT = new Style("document");
-
- private Style(String style)
- {
- this.style = style;
- }
-
- public static Style getDefaultStyle()
- {
- return DOCUMENT;
- }
-
- public static Style valueOf(String style)
- {
- if (RPC.style.equals(style))
- return RPC;
- if (DOCUMENT.style.equals(style))
- return DOCUMENT;
-
- throw new IllegalArgumentException("Unsupported style: " + style);
- }
-
- public String toString()
- {
- return style;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/Style.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/Style.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingImpl.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,624 +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.core.jaxrpc;
-
-// $Id$
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.encoding.DeserializerFactory;
-import javax.xml.rpc.encoding.SerializerFactory;
-import javax.xml.rpc.encoding.TypeMapping;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.jboss.ws.core.jaxrpc.binding.Base64DeserializerFactory;
-import org.jboss.ws.core.jaxrpc.binding.Base64SerializerFactory;
-import org.jboss.ws.core.jaxrpc.binding.CalendarDeserializerFactory;
-import org.jboss.ws.core.jaxrpc.binding.CalendarSerializerFactory;
-import org.jboss.ws.core.jaxrpc.binding.DateDeserializerFactory;
-import org.jboss.ws.core.jaxrpc.binding.DateSerializerFactory;
-import org.jboss.ws.core.jaxrpc.binding.HexDeserializerFactory;
-import org.jboss.ws.core.jaxrpc.binding.HexSerializerFactory;
-import org.jboss.ws.core.jaxrpc.binding.QNameDeserializerFactory;
-import org.jboss.ws.core.jaxrpc.binding.QNameSerializerFactory;
-import org.jboss.ws.core.jaxrpc.binding.SimpleDeserializerFactory;
-import org.jboss.ws.core.jaxrpc.binding.SimpleSerializerFactory;
-import org.jboss.ws.core.utils.JavaUtils;
-
-/**
- * This is the representation of a type mapping.
- * This TypeMapping implementation supports the literal encoding style.
- *
- * The TypeMapping instance maintains a tuple of the type
- * {XML typeQName, Java Class, SerializerFactory, DeserializerFactory}.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 10-Oct-2004
- */
-public abstract class TypeMappingImpl implements TypeMapping
-{
- // provide logging
- private static final Logger log = Logger.getLogger(TypeMappingImpl.class);
-
- // Map<KeyPair,FactoryPair>
- private Map<KeyPair, FactoryPair> tupleMap = new LinkedHashMap<KeyPair,
FactoryPair>();
-
- /**
- * Gets the DeserializerFactory registered for the specified pair of Java type and XML
data type.
- * @param javaType Class of the Java type
- * @param xmlType QName of the XML type
- * @return Registered DeserializerFactory or null if there is no registered factory
- */
- public DeserializerFactory getDeserializer(Class javaType, QName xmlType)
- {
- FactoryPair fPair = getFactoryPair(xmlType, javaType);
- return (fPair != null ? fPair.getDeserializerFactory() : null);
- }
-
- /**
- * Gets the SerializerFactory registered for the specified pair of Java type and XML
data type.
- * @param javaType Class of the Java type
- * @param xmlType QName of the XML type
- * @return Registered SerializerFactory or null if there is no registered factory
- */
- public SerializerFactory getSerializer(Class javaType, QName xmlType)
- {
- FactoryPair fPair = getFactoryPair(xmlType, javaType);
- return (fPair != null ? fPair.getSerializerFactory() : null);
- }
-
- /**
- * Returns the encodingStyle URIs (as String[]) supported by this TypeMapping
instance.
- * A TypeMapping that contains only encoding style independent serializers and
deserializers
- * returns null from this method.
- *
- * @return Array of encodingStyle URIs for the supported encoding styles
- */
- public abstract String[] getSupportedEncodings();
-
- /**
- * Sets the encodingStyle URIs supported by this TypeMapping instance. A TypeMapping
that contains only encoding
- * independent serializers and deserializers requires null as the parameter for this
method.
- *
- * @param encodingStyleURIs Array of encodingStyle URIs for the supported encoding
styles
- */
- public abstract void setSupportedEncodings(String[] encodingStyleURIs);
-
- /**
- * Checks whether or not type mapping between specified XML type and Java type is
registered.
- * @param javaType Class of the Java type
- * @param xmlType QName of the XML type
- * @return boolean; true if type mapping between the specified XML type and Java type
is registered; otherwise false
- */
- public boolean isRegistered(Class javaType, QName xmlType)
- {
- return getFactoryPair(xmlType, javaType) != null;
- }
-
- /**
- * Registers SerializerFactory and DeserializerFactory for a specific type mapping
between an XML type and Java type.
- * This method replaces any existing registered SerializerFactory DeserializerFactory
instances.
- * @param javaType Class of the Java type
- * @param xmlType QName of the XML type
- * @param sf SerializerFactory
- * @param df DeserializerFactory
- * @throws javax.xml.rpc.JAXRPCException If any error during the registration
- */
- public void register(Class javaType, QName xmlType, SerializerFactory sf,
DeserializerFactory df)
- {
- log.debug("register: TypeMappingImpl@" + hashCode() + "
[xmlType=" + xmlType + ",javaType=" + javaType.getName() + ",sf="
+ sf + ",df=" + df + "]");
- registerInternal(javaType, xmlType, sf, df);
- }
-
- void registerInternal(Class javaType, QName xmlType, SerializerFactory sf,
DeserializerFactory df)
- {
- if (javaType == null)
- throw new IllegalArgumentException("javaType cannot be null for: " +
xmlType);
- if (xmlType == null)
- throw new IllegalArgumentException("xmlType cannot be null for: " +
javaType);
-
- KeyPair kPair = new KeyPair(xmlType, javaType);
- FactoryPair fPair = new FactoryPair(sf, df);
- tupleMap.put(kPair, fPair);
- }
-
- /**
- * Removes the DeserializerFactory registered for the specified pair of Java type and
XML data type.
- * @param javaType Class of the Java type
- * @param xmlType QName of the XML type
- * @throws javax.xml.rpc.JAXRPCException If there is error in removing the registered
DeserializerFactory
- */
- public void removeDeserializer(Class javaType, QName xmlType)
- {
- FactoryPair fPair = getFactoryPair(xmlType, javaType);
- if (fPair != null)
- fPair.setDeserializerFactory(null);
- }
-
- /**
- * Removes the SerializerFactory registered for the specified pair of Java type and
XML data type.
- * @param javaType Class of the Java type
- * @param xmlType QName of the XML type
- * @throws javax.xml.rpc.JAXRPCException If there is error in removing the registered
SerializerFactory
- */
- public void removeSerializer(Class javaType, QName xmlType)
- {
- FactoryPair fPair = getFactoryPair(xmlType, javaType);
- if (fPair != null)
- fPair.setSerializerFactory(null);
- }
-
- /** Get the list of registered XML types */
- public List<QName> getRegisteredXmlTypes()
- {
- List<QName> types = new ArrayList<QName>();
- for (KeyPair keyPair : getKeyPairs(null, null))
- {
- types.add(keyPair.getXmlType());
- }
- return types;
- }
-
- /** Get the list of registered Java types */
- public List<Class> getRegisteredJavaTypes()
- {
- List<Class> types = new ArrayList<Class>();
- for (KeyPair keyPair : getKeyPairs(null, null))
- {
- types.add(keyPair.getJavaType());
- }
- return types;
- }
-
- /** Get the Class that was registered last for this xmlType */
- public Class getJavaType(QName xmlType)
- {
- Class javaType = null;
-
- List keyPairList = getKeyPairs(xmlType, null);
- int size = keyPairList.size();
- if (size > 0)
- {
- KeyPair kPair = (KeyPair)keyPairList.get(size - 1);
- javaType = kPair.getJavaType();
- }
-
- return javaType;
- }
-
- /**
- * Get all of the Classes registered for this xmlType.
- */
- public List<Class> getJavaTypes(QName xmlType)
- {
- List<KeyPair> keyPairList = getKeyPairs(xmlType, null);
- List<Class> classes = new ArrayList<Class>(keyPairList.size());
-
- for (KeyPair current : keyPairList)
- {
- classes.add(current.getJavaType());
- }
-
- return classes;
- }
-
- /**
- * Get the Class that was registered last for this xmlType
- * If there are two Java Types registered for the xmlType
- * return the primitive type rather than the wrapper,
- * if available
- */
- public Class getJavaType(QName xmlType,boolean getPrimitive)
- {
- //Lets get the primitive type if available
- Class javaType = null;
-
- List keyPairList = getKeyPairs(xmlType, null);
- int size = keyPairList.size();
- if (size == 2 && getPrimitive)
- {
- KeyPair kPair1 = (KeyPair)keyPairList.get(0);
- Class javaType1 = kPair1.getJavaType();
- KeyPair kPair2 = (KeyPair)keyPairList.get(1);
- Class javaType2 = kPair2.getJavaType();
- if(javaType2.isPrimitive() && !javaType1.isPrimitive())
- javaType = javaType2;
- else
- if(javaType1.isPrimitive() && !javaType2.isPrimitive())
- javaType = javaType1;
- else
- javaType = javaType2; //Fallback on the most latest
- }
- else
- return getJavaType(xmlType);
-
- return javaType;
- }
-
- /** Get the Class name that was registered last for this xmlType */
- public String getJavaTypeName(QName xmlType)
- {
- Class javaType = getJavaType(xmlType);
- return (javaType != null ? javaType.getName() : null);
- }
-
- /** Get the QName that was registered last for this javaType */
- public QName getXMLType(Class javaType)
- {
- QName xmlType = null;
-
- List keyPairList = getKeyPairs(null, javaType);
- int size = keyPairList.size();
- if (size > 0)
- {
- KeyPair kPair = (KeyPair)keyPairList.get(size - 1);
- xmlType = kPair.getXmlType();
- }
-
- return xmlType;
- }
-
- /**
- * Get the QName that was registered last for this javaType
- * @param javaType class for which XML Type is needed
- * @param tryAssignable If the xmlType is not registered for javaType
- * should a base class type be checked?
- *
- */
- public QName getXMLType(Class javaType, boolean tryAssignable)
- {
- if(tryAssignable) return getXMLType(javaType);
-
- QName xmlType = null;
-
- List keyPairList = getKeyPairs(null, javaType, tryAssignable);
- int size = keyPairList.size();
- if (size > 0)
- {
- KeyPair kPair = (KeyPair)keyPairList.get(size - 1);
- xmlType = kPair.getXmlType();
- }
-
- return xmlType;
- }
-
- /**
- * Get the serializer/deserializer factory pair for the given xmlType, javaType
- * Both xmlType, javaType may be null. In that case, this implementation still
- * returns a FactoryPair if there is only one possible match.
- */
- List<KeyPair> getKeyPairs(QName xmlType, Class javaType)
- {
- List<KeyPair> keyPairList = new ArrayList<KeyPair>();
-
- // Getting the exact matching pair
- if (xmlType != null && javaType != null)
- {
- for (KeyPair entry : tupleMap.keySet())
- {
- if (xmlType.equals(entry.getXmlType()) && entry.getJavaType() ==
javaType)
- {
- keyPairList.add(entry);
- }
- }
- // No exact match, try assignable
- if (keyPairList.size() == 0)
- {
- for (KeyPair entry : tupleMap.keySet())
- {
- if (xmlType.equals(entry.getXmlType()) &&
JavaUtils.isAssignableFrom(entry.getJavaType(), javaType))
- {
- keyPairList.add(entry);
- }
- }
- }
- }
-
- // Getting the pair for a given xmlType
- else if (xmlType != null && javaType == null)
- {
- for (KeyPair entry : tupleMap.keySet())
- {
- if (xmlType.equals(entry.getXmlType()))
- {
- keyPairList.add(entry);
- }
- }
- }
-
- // Getting the pair for a given javaType
- else if (xmlType == null && javaType != null)
- {
- for (KeyPair entry : tupleMap.keySet())
- {
- if (entry.getJavaType() == javaType)
- {
- keyPairList.add(entry);
- }
- }
- // No exact match, try assignable
- if (keyPairList.size() == 0)
- {
- for (KeyPair entry : tupleMap.keySet())
- {
- if (JavaUtils.isAssignableFrom(entry.getJavaType(), javaType))
- {
- keyPairList.add(entry);
- }
- }
- }
- }
-
- // Getting the all pairs
- else if (xmlType == null && javaType == null)
- {
- keyPairList.addAll(tupleMap.keySet());
- }
-
- return keyPairList;
- }
-
- /**
- * Get the serializer/deserializer factory pair for the given xmlType, javaType
- * Both xmlType, javaType may be null. In that case, this implementation still
- * returns a FactoryPair if there is only one possible match.
- * <br>Note: This method does not try for the base class, if no keypair exists
for the
- * javaType in question.
- */
- List<KeyPair> getKeyPairs(QName xmlType, Class javaType, boolean tryAssignable)
- {
- if(tryAssignable) return getKeyPairs( xmlType, javaType);
-
- List<KeyPair> keyPairList = new ArrayList<KeyPair>();
-
- // Getting the exact matching pair
- if (xmlType != null && javaType != null)
- {
- for (KeyPair entry : tupleMap.keySet())
- {
- if (xmlType.equals(entry.getXmlType()) && entry.getJavaType() ==
javaType)
- {
- keyPairList.add(entry);
- }
- }
- }
-
- // Getting the pair for a given xmlType
- else if (xmlType != null && javaType == null)
- {
- for (KeyPair entry : tupleMap.keySet())
- {
- if (xmlType.equals(entry.getXmlType()))
- {
- keyPairList.add(entry);
- }
- }
- }
-
- // Getting the pair for a given javaType
- else if (xmlType == null && javaType != null)
- {
- for (KeyPair entry : tupleMap.keySet())
- {
- if (entry.getJavaType() == javaType)
- {
- keyPairList.add(entry);
- }
- }
- }
-
- // Getting the all pairs
- else if (xmlType == null && javaType == null)
- {
- keyPairList.addAll(tupleMap.keySet());
- }
-
- return keyPairList;
- }
-
- /**
- * Get the serializer/deserializer factory pair for the given xmlType, javaType
- * Both xmlType, javaType may be null. In that case, this implementation still
- * returns a FactoryPair that was last registered
- */
- FactoryPair getFactoryPair(QName xmlType, Class javaType)
- {
- FactoryPair fPair = null;
-
- List<KeyPair> keyPairList = getKeyPairs(xmlType, javaType);
- int size = keyPairList.size();
- if (size > 0)
- {
- KeyPair kPair = keyPairList.get(size - 1);
- fPair = (FactoryPair)tupleMap.get(kPair);
- }
-
- return fPair;
- }
-
- protected void registerStandardLiteralTypes()
- {
- registerInternal(BigDecimal.class, Constants.TYPE_LITERAL_DECIMAL, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
-
- registerInternal(BigInteger.class, Constants.TYPE_LITERAL_POSITIVEINTEGER, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(BigInteger.class, Constants.TYPE_LITERAL_NEGATIVEINTEGER, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(BigInteger.class, Constants.TYPE_LITERAL_NONPOSITIVEINTEGER, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(BigInteger.class, Constants.TYPE_LITERAL_NONNEGATIVEINTEGER, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(BigInteger.class, Constants.TYPE_LITERAL_UNSIGNEDLONG, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(BigInteger.class, Constants.TYPE_LITERAL_INTEGER, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
-
- registerInternal(Date.class, Constants.TYPE_LITERAL_DATETIME, new
DateSerializerFactory(), new DateDeserializerFactory());
-
- registerInternal(Calendar.class, Constants.TYPE_LITERAL_DATE, new
CalendarSerializerFactory(), new CalendarDeserializerFactory());
- registerInternal(Calendar.class, Constants.TYPE_LITERAL_TIME, new
CalendarSerializerFactory(), new CalendarDeserializerFactory());
- registerInternal(Calendar.class, Constants.TYPE_LITERAL_DATETIME, new
CalendarSerializerFactory(), new CalendarDeserializerFactory());
-
- registerInternal(QName.class, Constants.TYPE_LITERAL_QNAME, new
QNameSerializerFactory(), new QNameDeserializerFactory());
-
- registerInternal(String.class, Constants.TYPE_LITERAL_ANYSIMPLETYPE, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_LITERAL_DURATION, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_LITERAL_GDAY, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_LITERAL_GMONTH, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_LITERAL_GMONTHDAY, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_LITERAL_GYEAR, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_LITERAL_GYEARMONTH, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_LITERAL_ID, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_LITERAL_LANGUAGE, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_LITERAL_NAME, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_LITERAL_NCNAME, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_LITERAL_NMTOKEN, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_LITERAL_NORMALIZEDSTRING, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_LITERAL_TOKEN, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_LITERAL_STRING, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
-
- registerInternal(String[].class, Constants.TYPE_LITERAL_NMTOKENS, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
-
- registerInternal(URI.class, Constants.TYPE_LITERAL_ANYURI, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
-
- registerInternal(boolean.class, Constants.TYPE_LITERAL_BOOLEAN, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(Boolean.class, Constants.TYPE_LITERAL_BOOLEAN, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
-
- registerInternal(byte.class, Constants.TYPE_LITERAL_BYTE, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(Byte.class, Constants.TYPE_LITERAL_BYTE, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
-
- registerInternal(Byte[].class, Constants.TYPE_LITERAL_HEXBINARY, new
HexSerializerFactory(), new HexDeserializerFactory());
- registerInternal(byte[].class, Constants.TYPE_LITERAL_HEXBINARY, new
HexSerializerFactory(), new HexDeserializerFactory());
-
- registerInternal(Byte[].class, Constants.TYPE_LITERAL_BASE64BINARY, new
Base64SerializerFactory(), new Base64DeserializerFactory());
- registerInternal(byte[].class, Constants.TYPE_LITERAL_BASE64BINARY, new
Base64SerializerFactory(), new Base64DeserializerFactory());
-
- registerInternal(double.class, Constants.TYPE_LITERAL_DOUBLE, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(Double.class, Constants.TYPE_LITERAL_DOUBLE, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
-
- registerInternal(float.class, Constants.TYPE_LITERAL_FLOAT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(Float.class, Constants.TYPE_LITERAL_FLOAT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
-
- registerInternal(int.class, Constants.TYPE_LITERAL_UNSIGNEDSHORT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(Integer.class, Constants.TYPE_LITERAL_UNSIGNEDSHORT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(int.class, Constants.TYPE_LITERAL_INT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(Integer.class, Constants.TYPE_LITERAL_INT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
-
- registerInternal(long.class, Constants.TYPE_LITERAL_UNSIGNEDINT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(Long.class, Constants.TYPE_LITERAL_UNSIGNEDINT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(long.class, Constants.TYPE_LITERAL_LONG, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(Long.class, Constants.TYPE_LITERAL_LONG, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
-
- registerInternal(short.class, Constants.TYPE_LITERAL_UNSIGNEDBYTE, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(Short.class, Constants.TYPE_LITERAL_UNSIGNEDBYTE, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(short.class, Constants.TYPE_LITERAL_SHORT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(Short.class, Constants.TYPE_LITERAL_SHORT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
- }
-
- /** A tuple of the type {XML typeQName, Java Class, SerializerFactory,
DeserializerFactory}.
- */
- public static class KeyPair
- {
- private QName xmlType;
- private Class javaType;
-
- public KeyPair(QName xmlType, Class javaType)
- {
- this.javaType = javaType;
- this.xmlType = xmlType;
- }
-
- public Class getJavaType()
- {
- return javaType;
- }
-
- public QName getXmlType()
- {
- return xmlType;
- }
-
- public boolean equals(Object o)
- {
- if (this == o) return true;
- if (!(o instanceof KeyPair)) return false;
-
- final KeyPair keyPair = (KeyPair)o;
-
- if (!javaType.equals(keyPair.javaType)) return false;
- if (!xmlType.equals(keyPair.xmlType)) return false;
-
- return true;
- }
-
- public int hashCode()
- {
- int result;
- result = xmlType.hashCode();
- result = 29 * result + javaType.hashCode();
- return result;
- }
-
- public String toString()
- {
- return "[xmlType=" + xmlType + ",javaType=" +
javaType.getName() + "]";
- }
- }
-
- /** A tuple of the type {XML typeQName, Java Class, SerializerFactory,
DeserializerFactory}.
- */
- public static class FactoryPair
- {
- private SerializerFactory serializerFactory;
- private DeserializerFactory deserializerFactory;
-
- FactoryPair(SerializerFactory sf, DeserializerFactory df)
- {
- this.deserializerFactory = df;
- this.serializerFactory = sf;
- }
-
- public DeserializerFactory getDeserializerFactory()
- {
- return deserializerFactory;
- }
-
- public SerializerFactory getSerializerFactory()
- {
- return serializerFactory;
- }
-
- public void setDeserializerFactory(DeserializerFactory df)
- {
- this.deserializerFactory = df;
- }
-
- public void setSerializerFactory(SerializerFactory sf)
- {
- this.serializerFactory = sf;
- }
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingImpl.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingRegistryImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingRegistryImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingRegistryImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,164 +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.core.jaxrpc;
-
-// $Id$
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.xml.rpc.JAXRPCException;
-import javax.xml.rpc.encoding.TypeMapping;
-import javax.xml.rpc.encoding.TypeMappingRegistry;
-
-import org.jboss.util.NotImplementedException;
-import org.jboss.ws.Constants;
-
-/**
- * This defines a registry of TypeMapping instances for encoding styles.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class TypeMappingRegistryImpl implements TypeMappingRegistry
-{
- // The registered typeMapping for the literal encoding style
- private Map<String, TypeMappingImpl> typeMappings = new HashMap<String,
TypeMappingImpl>();
-
- public TypeMappingRegistryImpl()
- {
- typeMappings.put(Constants.URI_LITERAL_ENC, new LiteralTypeMapping());
- typeMappings.put(Constants.URI_SOAP11_ENC, new EncodedTypeMapping());
- }
-
- /**
- * Removes all registered TypeMappings and encodingStyleURIs from this
TypeMappingRegistry.
- */
- public void clear()
- {
- typeMappings.clear();
- }
-
- /**
- * Gets the registered default TypeMapping instance.
- * This method returns null if there is no registered default TypeMapping in the
registry.
- * @return The registered default TypeMapping instance or null
- */
- public TypeMapping getDefaultTypeMapping()
- {
- return typeMappings.get(Constants.URI_LITERAL_ENC);
- }
-
- /**
- * Registers the TypeMapping instance that is default for all encoding styles
supported by the TypeMappingRegistry.
- * A default TypeMapping should include serializers and deserializers that are
independent of and usable with any
- * encoding style. Successive invocations of the registerDefault method replace any
existing default TypeMapping instance.
- *
- * If the default TypeMapping is registered, any other TypeMapping instances
registered through the
- * TypeMappingRegistry.register method (for a set of encodingStyle URIs) override the
default TypeMapping.
- *
- * @param mapping TypeMapping instance
- * @throws javax.xml.rpc.JAXRPCException If there is an error in the registration of
the default TypeMapping
- */
- public void registerDefault(TypeMapping mapping)
- {
- throw new NotImplementedException();
- }
-
- /**
- * Creates a new empty TypeMapping object.
- * @return TypeMapping instance
- */
- public TypeMapping createTypeMapping()
- {
- throw new NotImplementedException();
- }
-
- /**
- * Returns the registered TypeMapping for the specified encodingStyle URI. If there is
no registered TypeMapping for
- * the specified encodingStyleURI, this method returns null.
- * @param encodingStyleURI Encoding style specified as an URI
- * @return TypeMapping for the specified encodingStyleURI or null
- */
- public TypeMapping getTypeMapping(String encodingStyleURI)
- {
- assertEncodingStyle(encodingStyleURI);
- return typeMappings.get(encodingStyleURI);
- }
-
- /**
- * Returns a list of registered encodingStyle URIs in this TypeMappingRegistry
instance.
- * @return Array of the registered encodingStyle URIs
- */
- public String[] getRegisteredEncodingStyleURIs()
- {
- return new String[]{Constants.URI_LITERAL_ENC, Constants.URI_SOAP11_ENC};
- }
-
- /**
- * Registers a TypeMapping instance with the TypeMappingRegistry.
- * This method replaces any existing registered TypeMapping instance for the specified
encodingStyleURI.
- *
- * @param encodingStyleURI An encoding style specified as an URI.
- * @param mapping TypeMapping instance
- * @return Previous TypeMapping associated with the specified encodingStyleURI, or
null if there was no
- * TypeMapping associated with the specified encodingStyleURI
- * @throws javax.xml.rpc.JAXRPCException If there is an error in the registration of
the TypeMapping for the specified encodingStyleURI.
- */
- public TypeMapping register(String encodingStyleURI, TypeMapping mapping)
- {
- throw new NotImplementedException();
- }
-
- /**
- * Unregisters a TypeMapping instance, if present, from the specified
encodingStyleURI.
- * @param encodingStyleURI Encoding style specified as an URI
- * @return TypeMapping instance that has been unregistered or null if there was no
- * TypeMapping registered for the specified encodingStyleURI
- */
- public TypeMapping unregisterTypeMapping(String encodingStyleURI)
- {
- throw new NotImplementedException();
- }
-
- /**
- * Removes a TypeMapping from the TypeMappingRegistry.
- * A TypeMapping is associated with 1 or more encodingStyleURIs. This method
unregisters the specified
- * TypeMapping instance from all associated encodingStyleURIs and then removes this
TypeMapping
- * instance from the registry.
- *
- * @param mapping TypeMapping to be removed
- * @return true if specified TypeMapping is removed from the TypeMappingRegistry;
- * false if the specified TypeMapping was not in the TypeMappingRegistry
- */
- public boolean removeTypeMapping(TypeMapping mapping)
- {
- throw new NotImplementedException();
- }
-
- /** Assert the literal encoding style */
- private void assertEncodingStyle(String encURI)
- {
- if (Constants.URI_LITERAL_ENC.equals(encURI) == false &&
Constants.URI_SOAP11_ENC.equals(encURI) == false)
- throw new JAXRPCException("Unsupported encoding style: " + encURI);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingRegistryImpl.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingRegistryImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/UnqualifiedCallParameter.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/UnqualifiedCallParameter.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/UnqualifiedCallParameter.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,47 +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.core.jaxrpc;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-
-/**
- * This type is used in DII clients that do not qualify the call parameter with a java
type.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 02-Aug-2005
- */
-public class UnqualifiedCallParameter
-{
- private QName xmlType;
-
- public UnqualifiedCallParameter(QName xmlType)
- {
- this.xmlType = xmlType;
- }
-
- public String toString()
- {
- return getClass().getName() + "[xmlType=" + xmlType +"]";
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/UnqualifiedCallParameter.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/UnqualifiedCallParameter.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/UnqualifiedFaultException.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/UnqualifiedFaultException.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/UnqualifiedFaultException.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,47 +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.core.jaxrpc;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-
-/**
- * This type is used in when there is no XML/Java mapping available.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 02-Aug-2005
- */
-public class UnqualifiedFaultException extends Exception
-{
- private QName xmlType;
-
- public UnqualifiedFaultException(QName xmlType)
- {
- this.xmlType = xmlType;
- }
-
- public String toString()
- {
- return getClass().getName() + "[xmlType=" + xmlType +"]";
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/UnqualifiedFaultException.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/UnqualifiedFaultException.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/Use.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/Use.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/Use.java 2006-12-07 10:43:36 UTC (rev
1600)
@@ -1,74 +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.core.jaxrpc;
-
-import org.jboss.ws.Constants;
-
-// $Id$
-
-/** A type-safe enumeration for encoding use.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 16-Oct-2005
- */
-public class Use
-{
- private String use;
-
- public static final Use LITERAL = new Use("literal");
- public static final Use ENCODED = new Use("encoded");
-
- private Use(String use)
- {
- this.use = use;
- }
-
- public static Use getDefaultUse()
- {
- return LITERAL;
- }
-
- public static Use valueOf(String encodingStyle)
- {
- if (Constants.URI_LITERAL_ENC.equals(encodingStyle) ||
LITERAL.use.equals(encodingStyle))
- return LITERAL;
- if (Constants.URI_SOAP11_ENC.equals(encodingStyle) ||
ENCODED.use.equals(encodingStyle))
- return ENCODED;
-
- throw new IllegalArgumentException("Unsupported encoding style: " +
encodingStyle);
- }
-
- public String toURI()
- {
- String encURI = null;
- if (this == LITERAL)
- encURI = Constants.URI_LITERAL_ENC;
- else if (this == ENCODED)
- encURI = Constants.URI_SOAP11_ENC;
- return encURI;
- }
-
- public String toString()
- {
- return use;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/Use.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/Use.java)
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/Base64Deserializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/Base64Deserializer.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/Base64Deserializer.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,79 +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.core.jaxrpc.binding;
-
-// $Id$
-
-import java.io.IOException;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.DeserializerSupport;
-import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.extensions.xop.XOPContext;
-import org.jboss.ws.extensions.xop.jaxrpc.XOPUnmarshallerImpl;
-import org.jboss.xb.binding.SimpleTypeBindings;
-import org.jboss.xb.binding.sunday.xop.XOPUnmarshaller;
-import org.w3c.dom.Element;
-/**
- * Deserializer for Base64
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class Base64Deserializer extends DeserializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(Base64Deserializer.class);
-
- public Object deserialize(QName xmlName, QName xmlType, String xmlFragment,
SerializationContext serContext) throws BindingException
- {
- log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
-
- byte[] value = null;
-
- String valueStr = unwrapValueStr(xmlFragment);
- if(XOPContext.isXOPMessage())
- {
- try
- {
- Element xopInclude = DOMUtils.parse(valueStr);
- String cid = xopInclude.getAttribute("href");
- XOPUnmarshaller xopUnmarshaller = new XOPUnmarshallerImpl();
- value = xopUnmarshaller.getAttachmentAsByteArray(cid);
- }
- catch (IOException e)
- {
- throw new WSException("Failed to parse xopInclude element");
- }
- }
- else if (valueStr != null)
- {
- value = SimpleTypeBindings.unmarshalBase64(valueStr);
- }
- return value;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/Base64Deserializer.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/Base64Deserializer.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/Base64DeserializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/Base64DeserializerFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/Base64DeserializerFactory.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,41 +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.core.jaxrpc.binding;
-
-import org.jboss.ws.core.jaxrpc.binding.DeserializerSupport;
-
-// $Id$
-
-
-/**
- * DeserializerFactory for base64.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class Base64DeserializerFactory extends DeserializerFactoryBase
-{
- public DeserializerSupport getDeserializer()
- {
- return new Base64Deserializer();
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/Base64DeserializerFactory.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/Base64DeserializerFactory.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/Base64Serializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/Base64Serializer.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/Base64Serializer.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,76 +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.core.jaxrpc.binding;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
-import org.jboss.ws.core.jaxrpc.binding.SerializerSupport;
-import org.jboss.ws.core.utils.JavaUtils;
-import org.jboss.ws.extensions.xop.XOPContext;
-import org.jboss.ws.extensions.xop.jaxrpc.XOPMarshallerImpl;
-import org.jboss.xb.binding.NamespaceRegistry;
-import org.jboss.xb.binding.SimpleTypeBindings;
-import org.jboss.xb.binding.sunday.xop.XOPMarshaller;
-import org.jboss.xb.binding.sunday.xop.XOPObject;
-import org.w3c.dom.NamedNodeMap;
-
-/**
- * Serializer for base64
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class Base64Serializer extends SerializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(Base64Serializer.class);
-
- public String serialize(QName xmlName, QName xmlType, Object value,
SerializationContext serContext, NamedNodeMap attributes) throws BindingException
- {
- log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
-
- String xmlFragment = null;
- NamespaceRegistry nsRegistry = serContext.getNamespaceRegistry();
-
- if(XOPContext.isXOPMessage())
- {
- XOPMarshaller xopMarshaller = new XOPMarshallerImpl();
- XOPObject xopObject = new XOPObject(value);
- xopObject.setContentType("application/octet-stream");
- String cid = xopMarshaller.addMtomAttachment(xopObject,
xmlName.getNamespaceURI(), xmlType.getLocalPart() );
- String xopInclude = "<xop:Include
xmlns:xop='http://www.w3.org/2004/08/xop/include'
href='"+cid+"'/>";
- xmlFragment = wrapValueStr(xmlName, xopInclude, nsRegistry, attributes, false);
- }
- else
- {
- value = JavaUtils.getPrimitiveValueArray(value);
- String valueStr = SimpleTypeBindings.marshalBase64((byte[])value);
- xmlFragment = wrapValueStr(xmlName, valueStr, nsRegistry, attributes, true);
- }
- return xmlFragment;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/Base64Serializer.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/Base64Serializer.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/Base64SerializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/Base64SerializerFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/Base64SerializerFactory.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,41 +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.core.jaxrpc.binding;
-
-import org.jboss.ws.core.jaxrpc.binding.SerializerSupport;
-
-// $Id$
-
-
-/**
- * SerializerFactory for base64Binary.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class Base64SerializerFactory extends SerializerFactoryBase
-{
- public SerializerSupport getSerializer()
- {
- return new Base64Serializer();
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/Base64SerializerFactory.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/Base64SerializerFactory.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/BindingException.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/BindingException.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/BindingException.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,92 +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.core.jaxrpc.binding;
-
-// $Id$
-
-/** An exception that may occur during message binding
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 16-Oct-2004
- */
-public class BindingException extends Exception
-{
- /**
- * Constructs a new exception with <code>null</code> as its detail
message.
- * The cause is not initialized, and may subsequently be initialized by a
- * call to {@link #initCause}.
- */
- public BindingException()
- {
- }
-
- /**
- * Constructs a new exception with the specified detail message. The
- * cause is not initialized, and may subsequently be initialized by
- * a call to {@link #initCause}.
- *
- * @param message the detail message. The detail message is saved for
- * later retrieval by the {@link #getMessage()} method.
- */
- public BindingException(String message)
- {
- super(message);
- }
-
- /**
- * Constructs a new exception with the specified cause and a detail
- * message of <tt>(cause==null ? null : cause.toString())</tt> (which
- * typically contains the class and detail message of <tt>cause</tt>).
- * This constructor is useful for exceptions that are little more than
- * wrappers for other throwables (for example, {@link
- * java.security.PrivilegedActionException}).
- *
- * @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A <tt>null</tt> value is
- * permitted, and indicates that the cause is nonexistent or
- * unknown.)
- * @since 1.4
- */
- public BindingException(Throwable cause)
- {
- super(cause);
- }
-
- /**
- * Constructs a new exception with the specified detail message and
- * cause. <p>Note that the detail message associated with
- * <code>cause</code> is <i>not</i> automatically incorporated
in
- * this exception's detail message.
- *
- * @param message the detail message (which is saved for later retrieval
- * by the {@link #getMessage()} method).
- * @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A <tt>null</tt> value is
- * permitted, and indicates that the cause is nonexistent or
- * unknown.)
- * @since 1.4
- */
- public BindingException(String message, Throwable cause)
- {
- super(message, cause);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/BindingException.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/BindingException.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarDeserializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarDeserializer.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarDeserializer.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,60 +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.core.jaxrpc.binding;
-
-// $Id$
-
-import java.util.Calendar;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.DeserializerSupport;
-import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
-import org.jboss.xb.binding.SimpleTypeBindings;
-
-/**
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- * @see <a
href="http://www.w3.org/TR/xmlschema-2/#dateTime">XML Schema
3.2.16</a>
- */
-public class CalendarDeserializer extends DeserializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(CalendarDeserializer.class);
-
- public Object deserialize(QName xmlName, QName xmlType, String xmlFragment,
SerializationContext serContext) throws BindingException
- {
- log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
-
- Calendar value = null;
-
- String valueStr = unwrapValueStr(xmlFragment);
- if (valueStr != null)
- {
- value = SimpleTypeBindings.unmarshalDateTime(valueStr);
- }
-
- return value;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarDeserializer.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarDeserializer.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarDeserializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarDeserializerFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarDeserializerFactory.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,42 +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.core.jaxrpc.binding;
-
-import org.jboss.ws.core.jaxrpc.binding.DeserializerSupport;
-
-// $Id$
-
-
-/**
- * A CalendarDeserializer Factory
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class CalendarDeserializerFactory extends DeserializerFactoryBase
-{
-
- public DeserializerSupport getDeserializer()
- {
- return new CalendarDeserializer();
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarDeserializerFactory.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarDeserializerFactory.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarSerializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarSerializer.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarSerializer.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,58 +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.core.jaxrpc.binding;
-
-// $Id$
-
-import java.util.Calendar;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
-import org.jboss.ws.core.jaxrpc.binding.SerializerSupport;
-import org.jboss.xb.binding.NamespaceRegistry;
-import org.jboss.xb.binding.SimpleTypeBindings;
-import org.w3c.dom.NamedNodeMap;
-
-/**
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- * @see <a
href="http://www.w3.org/TR/xmlschema-2/#dateTime">XML Schema
3.2.16</a>
- */
-public class CalendarSerializer extends SerializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(CalendarSerializer.class);
-
- public String serialize(QName xmlName, QName xmlType, Object value,
SerializationContext serContext, NamedNodeMap attributes) throws BindingException
- {
- log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
-
- String valueStr = SimpleTypeBindings.marshalDateTime((Calendar)value);
-
- NamespaceRegistry nsRegistry = serContext.getNamespaceRegistry();
- String xmlFragment = wrapValueStr(xmlName, valueStr, nsRegistry, attributes,
true);
- return xmlFragment;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarSerializer.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarSerializer.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarSerializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarSerializerFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarSerializerFactory.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,39 +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.core.jaxrpc.binding;
-
-import org.jboss.ws.core.jaxrpc.binding.SerializerSupport;
-
-// $Id$
-
-
-/**
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class CalendarSerializerFactory extends SerializerFactoryBase
-{
- public SerializerSupport getSerializer()
- {
- return new CalendarSerializer();
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarSerializerFactory.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarSerializerFactory.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CommonBinding.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CommonBinding.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CommonBinding.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,53 +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.core.jaxrpc.binding;
-
-// $Id$
-
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.ws.core.EndpointInvocation;
-import org.jboss.ws.core.soap.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: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CommonBinding.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CommonBinding.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CommonBindingProvider.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CommonBindingProvider.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CommonBindingProvider.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,76 +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.core.jaxrpc.binding;
-
-// $Id$
-
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.jaxrpc.SOAP11BindingJAXRPC;
-import org.jboss.ws.core.jaxrpc.SOAP12BindingJAXRPC;
-import org.jboss.ws.core.jaxws.binding.SOAP11BindingJAXWS;
-import org.jboss.ws.core.jaxws.binding.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: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CommonBindingProvider.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CommonBindingProvider.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CommonSOAP11Binding.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CommonSOAP11Binding.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CommonSOAP11Binding.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,63 +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.core.jaxrpc.binding;
-
-// $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.core.jaxrpc.Use;
-import org.jboss.ws.core.soap.MessageFactoryImpl;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-
-/**
- * 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: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CommonSOAP11Binding.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CommonSOAP11Binding.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CommonSOAP12Binding.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CommonSOAP12Binding.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CommonSOAP12Binding.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,53 +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.core.jaxrpc.binding;
-
-// $Id$
-
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-
-import org.jboss.ws.Constants;
-import org.jboss.ws.core.soap.MessageFactoryImpl;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-
-/**
- * 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: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CommonSOAP12Binding.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CommonSOAP12Binding.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CommonSOAPBinding.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CommonSOAPBinding.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CommonSOAPBinding.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,907 +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.core.jaxrpc.binding;
-
-// $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.core.CommonMessageContext;
-import org.jboss.ws.core.EndpointInvocation;
-import org.jboss.ws.core.jaxrpc.ParameterWrapping;
-import org.jboss.ws.core.jaxrpc.StubExt;
-import org.jboss.ws.core.jaxrpc.Style;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.core.soap.MessageFactoryImpl;
-import org.jboss.ws.core.soap.NameImpl;
-import org.jboss.ws.core.soap.SOAPBodyElementDoc;
-import org.jboss.ws.core.soap.SOAPBodyElementRpc;
-import org.jboss.ws.core.soap.SOAPContentElement;
-import org.jboss.ws.core.soap.SOAPElementImpl;
-import org.jboss.ws.core.soap.SOAPFactoryImpl;
-import org.jboss.ws.core.soap.SOAPFaultImpl;
-import org.jboss.ws.core.soap.SOAPHeaderElementImpl;
-import org.jboss.ws.core.soap.SOAPMessageImpl;
-import org.jboss.ws.core.soap.UnboundHeader;
-import org.jboss.ws.core.soap.attachment.AttachmentPartImpl;
-import org.jboss.ws.core.soap.attachment.CIDGenerator;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.core.utils.JavaUtils;
-import org.jboss.ws.core.utils.MimeUtils;
-import org.jboss.ws.extensions.xop.XOPContext;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-import org.jboss.ws.metadata.umdm.ParameterMetaData;
-import org.jboss.ws.metadata.umdm.TypesMetaData;
-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: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CommonSOAPBinding.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/CommonSOAPBinding.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ComplexTypeDeserializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ComplexTypeDeserializer.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ComplexTypeDeserializer.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,36 +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.core.jaxrpc.binding;
-
-
-// $Id$
-
-/**
- * A Deserializer that can handle complex types by delegating to JAXB.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public abstract class ComplexTypeDeserializer extends DeserializerSupport
-{
-
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ComplexTypeDeserializer.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ComplexTypeDeserializer.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ComplexTypeSerializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ComplexTypeSerializer.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ComplexTypeSerializer.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,36 +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.core.jaxrpc.binding;
-
-
-// $Id$
-
-/**
- * A Serializer that can handle complex types by delegating to JAXB.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public abstract class ComplexTypeSerializer extends SerializerSupport
-{
-
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ComplexTypeSerializer.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ComplexTypeSerializer.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DateDeserializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DateDeserializer.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DateDeserializer.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,61 +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.core.jaxrpc.binding;
-
-// $Id$
-
-import java.util.Calendar;
-import java.util.Date;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.DeserializerSupport;
-import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
-import org.jboss.xb.binding.SimpleTypeBindings;
-
-/**
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class DateDeserializer extends DeserializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(DateDeserializer.class);
-
- public Object deserialize(QName xmlName, QName xmlType, String xmlFragment,
SerializationContext serContext) throws BindingException
- {
- log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
-
- Date value = null;
-
- String valueStr = unwrapValueStr(xmlFragment);
- if (valueStr != null)
- {
- Calendar cal = SimpleTypeBindings.unmarshalDateTime(valueStr);
- value = cal.getTime();
- }
-
- return value;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DateDeserializer.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DateDeserializer.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DateDeserializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DateDeserializerFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DateDeserializerFactory.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,41 +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.core.jaxrpc.binding;
-
-import org.jboss.ws.core.jaxrpc.binding.DeserializerSupport;
-
-// $Id$
-
-
-/**
- * A DateDeserializer Factory
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class DateDeserializerFactory extends DeserializerFactoryBase
-{
- public DeserializerSupport getDeserializer()
- {
- return new DateDeserializer();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DateDeserializerFactory.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DateDeserializerFactory.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DateSerializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DateSerializer.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DateSerializer.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,68 +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.core.jaxrpc.binding;
-
-// $Id$
-
-import java.util.Calendar;
-import java.util.Date;
-import java.util.GregorianCalendar;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
-import org.jboss.ws.core.jaxrpc.binding.SerializerSupport;
-import org.jboss.xb.binding.NamespaceRegistry;
-import org.jboss.xb.binding.SimpleTypeBindings;
-import org.w3c.dom.NamedNodeMap;
-
-/**
- * Serializer for Dates.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- * @see <a
href="http://www.w3.org/TR/xmlschema-2/#dateTime">XML Schema
3.2.16</a>
- */
-public class DateSerializer extends SerializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(DateSerializer.class);
-
- public String serialize(QName xmlName, QName xmlType, Object value,
SerializationContext serContext, NamedNodeMap attributes) throws BindingException
- {
- log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
- if (value != null)
- {
- Calendar cal = new GregorianCalendar();
- cal.setTime((Date)value);
- value = cal;
- }
-
- String valueStr = SimpleTypeBindings.marshalDateTime((Calendar)value);
-
- NamespaceRegistry nsRegistry = serContext.getNamespaceRegistry();
- String xmlFragment = wrapValueStr(xmlName, valueStr, nsRegistry, attributes,
true);
- return xmlFragment;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DateSerializer.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DateSerializer.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DateSerializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DateSerializerFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DateSerializerFactory.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,41 +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.core.jaxrpc.binding;
-
-import org.jboss.ws.core.jaxrpc.binding.SerializerSupport;
-
-// $Id$
-
-
-/**
- * SerializerFactory for Date primitives
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class DateSerializerFactory extends SerializerFactoryBase
-{
- public SerializerSupport getSerializer()
- {
- return new DateSerializer();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DateSerializerFactory.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DateSerializerFactory.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DeserializerFactoryBase.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DeserializerFactoryBase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DeserializerFactoryBase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,52 +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.core.jaxrpc.binding;
-
-// $Id$
-
-import java.util.Iterator;
-
-import javax.xml.rpc.encoding.Deserializer;
-import javax.xml.rpc.encoding.DeserializerFactory;
-
-import org.jboss.util.NotImplementedException;
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.DeserializerSupport;
-
-/**
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public abstract class DeserializerFactoryBase implements DeserializerFactory
-{
- public abstract DeserializerSupport getDeserializer() throws BindingException;
-
- public Deserializer getDeserializerAs(String mechanismType)
- {
- throw new NotImplementedException();
- }
-
- public Iterator getSupportedMechanismTypes()
- {
- throw new NotImplementedException();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DeserializerFactoryBase.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DeserializerFactoryBase.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DeserializerSupport.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DeserializerSupport.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DeserializerSupport.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -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.core.jaxrpc.binding;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.encoding.Deserializer;
-
-import org.jboss.util.NotImplementedException;
-import org.jboss.ws.core.utils.XMLPredefinedEntityReferenceResolver;
-
-/** The base class for all Deserializers.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public abstract class DeserializerSupport implements Deserializer
-{
-
- /** Deserialize an XML fragment to an object value
- *
- * @param xmlName The root element name of the resulting fragment
- * @param xmlType The associated schema type
- * @param xmlFragment The XML fragment to deserialize
- * @param serContext The serialization context
- */
- public abstract Object deserialize(QName xmlName, QName xmlType, String xmlFragment,
SerializationContext serContext) throws BindingException;
-
- /** Unwrap the value string from the XML fragment
- *
- * @return The value string or null if the startTag contains a xsi:nil='true'
attribute
- */
- protected String unwrapValueStr(String xmlFragment)
- {
- // We only scan for :nil if the xmlFragment is an empty element
- if (isEmptyElement(xmlFragment))
- {
- return (isNil(xmlFragment) ? null : "");
- }
-
- int endOfStartTag = xmlFragment.indexOf(">");
- int startOfEndTag = xmlFragment.lastIndexOf("</");
- if (endOfStartTag < 0 || startOfEndTag < 0)
- throw new IllegalArgumentException("Invalid XML fragment: " +
xmlFragment);
-
- String valueStr = xmlFragment.substring(endOfStartTag + 1, startOfEndTag);
-
- return XMLPredefinedEntityReferenceResolver.resolve(valueStr);
- }
-
- protected boolean isEmptyElement(String xmlFragment)
- {
- return xmlFragment.startsWith("<") &&
xmlFragment.endsWith("/>");
- }
-
- protected boolean isNil(String xmlFragment)
- {
- boolean isNil = false;
- if (isEmptyElement(xmlFragment))
- {
- int endOfStartTag = xmlFragment.indexOf(">");
- String startTag = xmlFragment.substring(0, endOfStartTag);
- isNil = startTag.indexOf(":nil='1'") > 0 ||
startTag.indexOf(":nil=\"1\"") > 0;
- isNil = isNil || startTag.indexOf(":nil='true'") > 0 ||
startTag.indexOf(":nil=\"true\"") > 0;
- }
- return isNil;
- }
-
- public String getMechanismType()
- {
- throw new NotImplementedException();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DeserializerSupport.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/DeserializerSupport.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementDeserializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementDeserializer.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementDeserializer.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,65 +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.core.jaxrpc.binding;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.DeserializerSupport;
-import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.w3c.dom.Element;
-
-/**
- * A deserializer that can handle xsd:anyType
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 23-Jun-2005
- */
-public class ElementDeserializer extends DeserializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(ElementDeserializer.class);
-
- /** Deserialize the given simple xmlString
- */
- public Object deserialize(QName xmlName, QName xmlType, String xmlFragment,
SerializationContext serContext) throws BindingException
- {
- log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
- try
- {
- Element domElement = DOMUtils.parse(xmlFragment);
- return domElement;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new BindingException();
- }
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementDeserializer.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementDeserializer.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementDeserializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementDeserializerFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementDeserializerFactory.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,41 +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.core.jaxrpc.binding;
-
-import org.jboss.ws.core.jaxrpc.binding.DeserializerSupport;
-
-// $Id$
-
-
-/**
- * A factory for a Deserializer that can handle XMLSchema simple types.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Oct-2004
- */
-public class ElementDeserializerFactory extends DeserializerFactoryBase
-{
- public DeserializerSupport getDeserializer()
- {
- return new ElementDeserializer();
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementDeserializerFactory.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementDeserializerFactory.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementSerializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementSerializer.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementSerializer.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,65 +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.core.jaxrpc.binding;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
-import org.jboss.ws.core.jaxrpc.binding.SerializerSupport;
-import org.jboss.ws.core.utils.DOMWriter;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-
-/**
- * A serializer that can handle xsd:anyType
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Oct-2004
- */
-public class ElementSerializer extends SerializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(ElementSerializer.class);
-
- /** Marshal the value for a given XMLSchema type
- * @param xmlType local part of the schema type
- * @param value the value to marshal
- * @param serContext
- * @return the string representation od the value
- */
- public String serialize(QName xmlName, QName xmlType, Object value,
SerializationContext serContext, NamedNodeMap attributes)
- throws BindingException
- {
- log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
- if (value == null)
- throw new IllegalArgumentException("Element value cannot be null");
- if ((value instanceof Element) == false)
- throw new IllegalArgumentException("Value is not a Element: " +
value.getClass().getName());
-
- String xmlFragment = DOMWriter.printNode((Element)value, false);
- return xmlFragment;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementSerializer.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementSerializer.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementSerializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementSerializerFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementSerializerFactory.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,40 +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.core.jaxrpc.binding;
-
-import org.jboss.ws.core.jaxrpc.binding.SerializerSupport;
-
-// $Id$
-
-/**
- * A factory for a Serializer that can handle xsd:anyType
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 23-Jun-2005
- */
-public class ElementSerializerFactory extends SerializerFactoryBase
-{
- public SerializerSupport getSerializer()
- {
- return new ElementSerializer();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementSerializerFactory.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementSerializerFactory.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/HexDeserializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/HexDeserializer.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/HexDeserializer.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,60 +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.core.jaxrpc.binding;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.DeserializerSupport;
-import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
-import org.jboss.xb.binding.SimpleTypeBindings;
-
-/**
- * Deserializer for hexBinary.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- * @see <a
href="http://www.w3.org/TR/xmlschema-2/#hexBinary">XML Schema
3.2.16</a>
- */
-public class HexDeserializer extends DeserializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(HexDeserializer.class);
-
- public Object deserialize(QName xmlName, QName xmlType, String xmlFragment,
SerializationContext serContext) throws BindingException
- {
- log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
-
- byte[] value = null;
-
- String valueStr = unwrapValueStr(xmlFragment);
- if (valueStr != null)
- {
- value = SimpleTypeBindings.unmarshalHexBinary(valueStr);
- }
-
- return value;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/HexDeserializer.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/HexDeserializer.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/HexDeserializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/HexDeserializerFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/HexDeserializerFactory.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,41 +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.core.jaxrpc.binding;
-
-import org.jboss.ws.core.jaxrpc.binding.DeserializerSupport;
-
-// $Id$
-
-
-/**
- * DeserializerFactory for hexBinary.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class HexDeserializerFactory extends DeserializerFactoryBase
-{
- public DeserializerSupport getDeserializer()
- {
- return new HexDeserializer();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/HexDeserializerFactory.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/HexDeserializerFactory.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/HexSerializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/HexSerializer.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/HexSerializer.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,60 +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.core.jaxrpc.binding;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
-import org.jboss.ws.core.jaxrpc.binding.SerializerSupport;
-import org.jboss.ws.core.utils.JavaUtils;
-import org.jboss.xb.binding.NamespaceRegistry;
-import org.jboss.xb.binding.SimpleTypeBindings;
-import org.w3c.dom.NamedNodeMap;
-
-/**
- * Serializer for hexBinary.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- * @see <a
href="http://www.w3.org/TR/xmlschema-2/#hexBinary">XML Schema
3.2.16</a>
- */
-public class HexSerializer extends SerializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(HexSerializer.class);
-
- public String serialize(QName xmlName, QName xmlType, Object value,
SerializationContext serContext, NamedNodeMap attributes) throws BindingException
- {
- log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
-
- value = JavaUtils.getPrimitiveValueArray(value);
- String valueStr = SimpleTypeBindings.marshalHexBinary((byte[])value);
-
- NamespaceRegistry nsRegistry = serContext.getNamespaceRegistry();
- String xmlFragment = wrapValueStr(xmlName, valueStr, nsRegistry, attributes,
true);
- return xmlFragment;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/HexSerializer.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/HexSerializer.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/HexSerializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/HexSerializerFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/HexSerializerFactory.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,41 +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.core.jaxrpc.binding;
-
-import org.jboss.ws.core.jaxrpc.binding.SerializerSupport;
-
-// $Id$
-
-
-/**
- * SerializerFactory for hexBinary.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class HexSerializerFactory extends SerializerFactoryBase
-{
- public SerializerSupport getSerializer()
- {
- return new HexSerializer();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/HexSerializerFactory.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/HexSerializerFactory.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/JBossXBDeserializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/JBossXBDeserializer.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/JBossXBDeserializer.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,113 +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.core.jaxrpc.binding;
-
-// $Id$
-
-import java.io.ByteArrayInputStream;
-
-import javax.xml.namespace.QName;
-
-import org.apache.xerces.xs.XSModel;
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.jaxrpc.SerializationContextJAXRPC;
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.ComplexTypeDeserializer;
-import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
-import org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBConstants;
-import org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBUnmarshaller;
-import org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBUnmarshallerImpl;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-
-/**
- * A Deserializer that can handle complex types by delegating to JAXB.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class JBossXBDeserializer extends ComplexTypeDeserializer
-{
- // provide logging
- private static final Logger log = Logger.getLogger(JBossXBDeserializer.class);
-
- private JBossXBUnmarshaller unmarshaller;
-
- public JBossXBDeserializer() throws BindingException
- {
- // Get the JAXB marshaller for complex objects
- unmarshaller = new JBossXBUnmarshallerImpl();
- }
-
- /**
- * For unmarshalling the WS layer passes to the JAXB layer
- *
- * - required self contained xml content
- * - required map of packaged or generated XSDSchema
- * - optional QName of the root complex type
- * - optional instance of JavaWsdlMapping
- *
- * The xmlType is redundant if the root element name corresponds to a global element
definition in schema.
- * If the java mapping is null, default mapping rules apply.
- *
- * The result is an object instance or null.
- * In case of an unmarshalling problem a descriptive exception is thrown.
- */
- public Object deserialize(QName xmlName, QName xmlType, String val,
SerializationContext serContext) throws BindingException
- {
- log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
-
- // Expect the specific JAXRPC serialization context
- SerializationContextJAXRPC jaxrpcContext = (SerializationContextJAXRPC)serContext;
-
- Object value = null;
- String typeName = xmlType.getLocalPart();
-
- try
- {
- // Get the parsed model
- XSModel model = jaxrpcContext.getXsModel();
-
- // Get the jaxrpc-mapping.xml meta data
- JavaWsdlMapping jaxrpcMapping = jaxrpcContext.getJavaWsdlMapping();
-
- unmarshaller.setProperty(JBossXBConstants.JBXB_XS_MODEL, model);
- unmarshaller.setProperty(JBossXBConstants.JBXB_ROOT_QNAME, xmlName);
- unmarshaller.setProperty(JBossXBConstants.JBXB_TYPE_QNAME, xmlType);
- unmarshaller.setProperty(JBossXBConstants.JBXB_JAVA_MAPPING, jaxrpcMapping);
-
- ByteArrayInputStream ins = new
ByteArrayInputStream(val.getBytes("UTF-8"));
- value = unmarshaller.unmarshal(ins);
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new BindingException(ex);
- }
-
- log.debug("deserialized: " + (value != null ? value.getClass().getName()
: null));
- return value;
-
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/JBossXBDeserializer.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/JBossXBDeserializer.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/JBossXBDeserializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/JBossXBDeserializerFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/JBossXBDeserializerFactory.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,42 +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.core.jaxrpc.binding;
-
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.DeserializerSupport;
-
-// $Id$
-
-/**
- * A factory for a Deserializer that can handle complex types
- * by delegating to JAXB.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class JBossXBDeserializerFactory extends DeserializerFactoryBase
-{
- public DeserializerSupport getDeserializer() throws BindingException
- {
- return new JBossXBDeserializer();
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/JBossXBDeserializerFactory.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/JBossXBDeserializerFactory.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/JBossXBSerializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/JBossXBSerializer.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/JBossXBSerializer.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,126 +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.core.jaxrpc.binding;
-
-// $Id$
-
-import java.io.StringWriter;
-
-import javax.xml.namespace.QName;
-
-import org.apache.xerces.xs.XSModel;
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.jaxrpc.SerializationContextJAXRPC;
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.ComplexTypeSerializer;
-import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
-import org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBConstants;
-import org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBMarshaller;
-import org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBMarshallerImpl;
-import org.jboss.ws.core.jaxrpc.binding.jbossxb.XercesXSMarshallerImpl;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.w3c.dom.NamedNodeMap;
-
-/**
- * A Serializer that can handle complex types by delegating to JAXB.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class JBossXBSerializer extends ComplexTypeSerializer
-{
- // provide logging
- private static final Logger log = Logger.getLogger(JBossXBSerializer.class);
-
- private JBossXBMarshaller marshaller;
-
- public JBossXBSerializer() throws BindingException
- {
- // Get the JAXB marshaller for complex objects
- marshaller = new JBossXBMarshallerImpl();
- }
-
- /**
- * For marshalling the WS layer passes to the JAXB layer
- *
- * - optional java object instance
- * - required map of packaged or generated XSDSchema
- * - required QName of the root element
- * - optional QName of the root complex type
- * - optional instance of JavaWsdlMapping
- *
- * If the object value is null, the corresponding XML representation of the nillable
element should be marshalled.
- * The xmlType is redundant if the xmlName corresponds to a global element definition
in schema.
- * If the java mapping is null, default mapping rules apply.
- *
- * The result is a self contained (i.e. contains all namespace definitions) XML
document without the XML declaration.
- * In case of an marshalling problem a descriptive exception is thrown.
- */
- public String serialize(QName xmlName, QName xmlType, Object value,
SerializationContext serContext, NamedNodeMap attributes) throws BindingException
- {
- log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
-
- // Expect the specific JAXRPC serialization context
- SerializationContextJAXRPC jaxrpcContext = (SerializationContextJAXRPC)serContext;
-
- try
- {
- // Get the parsed model
- XSModel model = jaxrpcContext.getXsModel();
-
- // Get the jaxrpc-mapping.xml object graph
- JavaWsdlMapping jaxrpcMapping = jaxrpcContext.getJavaWsdlMapping();
-
- // schemabinding marshaller is the default delegate
- JBossXBMarshaller delegate = marshaller;
-
- if(value instanceof Exception)
- {
- // todo: CTS workaround for custom exceptions, clarify when Alexey is back
- // causes NPE in MarshallerImpl:458
- delegate = new XercesXSMarshallerImpl();
- }
-
- // marshalling context
- delegate.setProperty(JBossXBConstants.JBXB_XS_MODEL, model);
- delegate.setProperty(JBossXBConstants.JBXB_TYPE_QNAME, xmlType);
- delegate.setProperty(JBossXBConstants.JBXB_ROOT_QNAME, xmlName);
- delegate.setProperty(JBossXBConstants.JBXB_JAVA_MAPPING, jaxrpcMapping);
-
- // marshall
- StringWriter strwr = new StringWriter();
- delegate.marshal(value, strwr);
- String xmlFragment = strwr.toString();
-
- log.debug("serialized: " + xmlFragment);
- return xmlFragment;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new BindingException(ex);
- }
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/JBossXBSerializer.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/JBossXBSerializer.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/JBossXBSerializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/JBossXBSerializerFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/JBossXBSerializerFactory.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,43 +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.core.jaxrpc.binding;
-
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.SerializerSupport;
-
-// $Id$
-
-
-/**
- * A factory for a Serializer that can handle complex types
- * by delegating to JAXB.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class JBossXBSerializerFactory extends SerializerFactoryBase
-{
- public SerializerSupport getSerializer() throws BindingException
- {
- return new JBossXBSerializer();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/JBossXBSerializerFactory.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/JBossXBSerializerFactory.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/NullValueSerializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/NullValueSerializer.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/NullValueSerializer.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,68 +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.core.jaxrpc.binding;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
-import org.jboss.ws.core.jaxrpc.binding.SerializerSupport;
-import org.jboss.xb.binding.NamespaceRegistry;
-import org.w3c.dom.NamedNodeMap;
-
-/**
- * Serializer for null values.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 24-Jun-2005
- */
-public class NullValueSerializer extends SerializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(NullValueSerializer.class);
-
- /**
- * Serializes an object null value.
- *
- * If a message part of an RPC parameter is defined like this
- *
- * <message name='SomeMessage'>
- * <part name='partName' element='someElement'/>
- * </message>
- *
- * it is possible that the element definition does not allow
- * null values. In that case an error should be generated.
- */
- public String serialize(QName xmlName, QName xmlType, Object value,
SerializationContext serContext, NamedNodeMap attributes) throws BindingException
- {
- log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
-
- NamespaceRegistry nsRegistry = serContext.getNamespaceRegistry();
- nsRegistry.registerURI(Constants.NS_SCHEMA_XSI, Constants.PREFIX_XSI);
- String xmlFragment = wrapValueStr(xmlName, null, nsRegistry, attributes, true);
- return xmlFragment;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/NullValueSerializer.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/NullValueSerializer.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/QNameDeserializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/QNameDeserializer.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/QNameDeserializer.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,98 +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.core.jaxrpc.binding;
-
-// $Id$
-
-import java.io.IOException;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.DeserializerSupport;
-import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.xb.binding.NamespaceRegistry;
-import org.jboss.xb.binding.SimpleTypeBindings;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class QNameDeserializer extends DeserializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(QNameDeserializer.class);
-
- public Object deserialize(QName xmlName, QName xmlType, String xmlFragment,
SerializationContext serContext) throws BindingException
- {
- log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
-
- QName value = null;
-
- NamespaceRegistry nsRegistry = serContext.getNamespaceRegistry();
- String valueStr = unwrapValueStr(xmlFragment, nsRegistry);
- if (valueStr != null)
- {
- value = SimpleTypeBindings.unmarshalQName(valueStr, nsRegistry);
- }
-
- return value;
- }
-
- /** Unwrap the value string from the XML fragment
- * @return The value string or null if the startTag contains a xsi:nil='true'
attribute
- */
- protected String unwrapValueStr(String xmlFragment, NamespaceRegistry nsRegistry)
- {
- if (isEmptyElement(xmlFragment) == false)
- {
- // Register namespace declarations
- try
- {
- Element el = DOMUtils.parse(xmlFragment);
- NamedNodeMap attribs = el.getAttributes();
- for (int i = 0; i < attribs.getLength(); i++)
- {
- Node attr = attribs.item(i);
- String nodeName = attr.getNodeName();
- if (nodeName.startsWith("xmlns:"))
- {
- String prefix = nodeName.substring(6);
- String nsURI = attr.getNodeValue();
- nsRegistry.registerURI(nsURI, prefix);
- }
- }
- }
- catch (IOException e)
- {
- throw new IllegalArgumentException("Cannot parse xmlFragment: " +
xmlFragment);
- }
- }
-
- return super.unwrapValueStr(xmlFragment);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/QNameDeserializer.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/QNameDeserializer.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/QNameDeserializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/QNameDeserializerFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/QNameDeserializerFactory.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,39 +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.core.jaxrpc.binding;
-
-import org.jboss.ws.core.jaxrpc.binding.DeserializerSupport;
-
-// $Id$
-
-
-/**
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class QNameDeserializerFactory extends DeserializerFactoryBase
-{
- public DeserializerSupport getDeserializer()
- {
- return new QNameDeserializer();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/QNameDeserializerFactory.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/QNameDeserializerFactory.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/QNameSerializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/QNameSerializer.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/QNameSerializer.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,78 +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.core.jaxrpc.binding;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
-import org.jboss.ws.core.jaxrpc.binding.SerializerSupport;
-import org.jboss.xb.binding.NamespaceRegistry;
-import org.jboss.xb.binding.SimpleTypeBindings;
-import org.w3c.dom.NamedNodeMap;
-
-/**
- * Serializer for QNames.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class QNameSerializer extends SerializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(QNameSerializer.class);
-
- public String serialize(QName xmlName, QName xmlType, Object value,
SerializationContext serContext, NamedNodeMap attributes) throws BindingException
- {
- log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
-
- QName qnameValue = (QName)value;
- String nsURI = qnameValue.getNamespaceURI();
-
- NamespaceRegistry nsRegistry = serContext.getNamespaceRegistry();
-
- // Remove prefix and register again
- if (nsURI.length() > 0)
- {
- qnameValue = new QName(qnameValue.getNamespaceURI(),
qnameValue.getLocalPart());
- qnameValue = nsRegistry.registerQName(qnameValue);
- }
-
- String valueStr = SimpleTypeBindings.marshalQName(qnameValue, nsRegistry);
- String xmlFragment = wrapValueStr(xmlName, valueStr, nsRegistry, attributes,
true);
-
- // Insert the NS declaration for the qnameValue
- if (nsURI.length() > 0)
- {
- StringBuilder buffer = new StringBuilder(xmlFragment);
- int indexGT = xmlFragment.indexOf(">");
- String prefix = qnameValue.getPrefix();
- buffer.insert(indexGT, " xmlns:" + prefix + "='" + nsURI
+ "'");
- xmlFragment = buffer.toString();
- }
-
- return xmlFragment;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/QNameSerializer.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/QNameSerializer.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/QNameSerializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/QNameSerializerFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/QNameSerializerFactory.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,41 +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.core.jaxrpc.binding;
-
-import org.jboss.ws.core.jaxrpc.binding.SerializerSupport;
-
-// $Id$
-
-
-/**
- * SerializerFactory for QName primitive
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class QNameSerializerFactory extends SerializerFactoryBase
-{
- public SerializerSupport getSerializer()
- {
- return new QNameSerializer();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/QNameSerializerFactory.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/QNameSerializerFactory.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArrayDeserializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArrayDeserializer.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArrayDeserializer.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,189 +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.core.jaxrpc.binding;
-
-// $Id$
-
-import java.lang.reflect.Array;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.StringTokenizer;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.jaxrpc.TypeMappingImpl;
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.DeserializerSupport;
-import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.core.utils.DOMWriter;
-import org.jboss.ws.core.utils.JavaUtils;
-import org.jboss.ws.metadata.umdm.ParameterMetaData;
-import org.w3c.dom.Element;
-
-/**
- * A Deserializer that can handle SOAP encoded arrays.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 31-Oct-2005
- */
-public class SOAPArrayDeserializer extends DeserializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(SOAPArrayDeserializer.class);
-
- private DeserializerSupport compDeserializer;
-
- public SOAPArrayDeserializer() throws BindingException
- {
- }
-
- /**
- */
- public Object deserialize(QName xmlName, QName xmlType, String xmlFragment,
SerializationContext serContext) throws BindingException
- {
- log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
- try
- {
- ParameterMetaData paramMetaData =
(ParameterMetaData)serContext.getProperty(ParameterMetaData.class.getName());
- QName compXmlType = paramMetaData.getSOAPArrayCompType();
- QName compXmlName = paramMetaData.getXmlName();
-
- Element arrayElement = DOMUtils.parse(xmlFragment);
- int[] arrDims = getDimensionsFromAttribute(arrayElement);
- Class compJavaType = getComponentTypeFromAttribute(arrayElement, serContext);
- Object[] retArray = (Object[])Array.newInstance(compJavaType, arrDims);
-
- TypeMappingImpl typeMapping = serContext.getTypeMapping();
- if (compXmlType == null)
- {
- compXmlType = typeMapping.getXMLType(compJavaType);
- paramMetaData.setSOAPArrayCompType(compXmlType);
- }
-
- if (compXmlType == null)
- throw new WSException("Cannot obtain component xmlType for: " +
compJavaType);
-
- // Get the component type deserializer factory
- log.debug("Get component deserializer for: [javaType=" +
compJavaType.getName() + ",xmlType=" + compXmlType + "]");
- DeserializerFactoryBase compDeserializerFactory =
(DeserializerFactoryBase)typeMapping.getDeserializer(compJavaType, compXmlType);
- if (compDeserializerFactory == null)
- {
- log.warn("Cannot obtain component deserializer for: [javaType=" +
compJavaType.getName() + ",xmlType=" + compXmlType + "]");
- compDeserializerFactory =
(DeserializerFactoryBase)typeMapping.getDeserializer(null, compXmlType);
- }
- if (compDeserializerFactory == null)
- throw new WSException("Cannot obtain component deserializer for: "
+ compXmlType);
-
- // Get the component type deserializer
- compDeserializer =
(DeserializerSupport)compDeserializerFactory.getDeserializer();
-
- if (arrDims.length < 1 || 2 < arrDims.length)
- throw new WSException("Unsupported array dimensions: " +
Arrays.asList(arrDims));
-
- Iterator it = DOMUtils.getChildElements(arrayElement);
- if (arrDims.length == 1)
- {
- Object[] subArr = retArray;
- deserializeMemberValues(compXmlName, compXmlType, serContext, it, subArr);
- }
- if (arrDims.length == 2)
- {
- for (int i = 0; i < arrDims[0]; i++)
- {
- Object[] subArr = (Object[])retArray[i];
- deserializeMemberValues(compXmlName, compXmlType, serContext, it,
subArr);
- }
- }
-
- log.debug("deserialized: " + retArray.getClass().getName());
- return retArray;
- }
- catch (RuntimeException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- throw new BindingException(e);
- }
- }
-
- private void deserializeMemberValues(QName compXmlName, QName compXmlType,
SerializationContext serContext, Iterator it, Object[] subArr) throws BindingException
- {
- int dim = subArr.length;
- for (int i = 0; i < dim; i++)
- {
- Object compValue = null;
- if (it.hasNext())
- {
- Element childElement = (Element)it.next();
- String compXMLFragment = DOMWriter.printNode(childElement, false);
- compValue = compDeserializer.deserialize(compXmlName, compXmlType,
compXMLFragment, serContext);
- compValue = JavaUtils.getWrapperValueArray(compValue);
- }
- subArr[i] = compValue;
- }
- }
-
- private int[] getDimensionsFromAttribute(Element arrayElement)
- {
- QName attrQName = new QName(Constants.URI_SOAP11_ENC, "arrayType");
- QName arrayType = DOMUtils.getAttributeValueAsQName(arrayElement, attrQName);
- if (arrayType == null)
- throw new WSException("Cannot obtain attribute: " + attrQName);
-
- String localPart = arrayType.getLocalPart();
- int dimIndex = localPart.indexOf("[");
-
- String dimStr = localPart.substring(dimIndex);
- StringTokenizer st = new StringTokenizer(dimStr, "[,]");
- int[] arrDims = new int[st.countTokens()];
- for (int i = 0; st.hasMoreTokens(); i++)
- arrDims[i] = new Integer(st.nextToken()).intValue();
-
- return arrDims;
- }
-
- private Class getComponentTypeFromAttribute(Element arrayElement, SerializationContext
serContext)
- {
- QName attrQName = new QName(Constants.URI_SOAP11_ENC, "arrayType");
- QName arrayType = DOMUtils.getAttributeValueAsQName(arrayElement, attrQName);
- if (arrayType == null)
- throw new WSException("Cannot obtain attribute: " + attrQName);
-
- String nsURI = arrayType.getNamespaceURI();
- String localPart = arrayType.getLocalPart();
- int dimIndex = localPart.indexOf("[");
- QName compXmlType = new QName(nsURI, localPart.substring(0, dimIndex));
-
- TypeMappingImpl typeMapping = serContext.getTypeMapping();
- Class javaType = typeMapping.getJavaType(compXmlType);
- if (javaType == null)
- throw new WSException("Cannot obtain javaType for: " + compXmlType);
-
- return JavaUtils.getWrapperType(javaType);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArrayDeserializer.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArrayDeserializer.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArrayDeserializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArrayDeserializerFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArrayDeserializerFactory.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,41 +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.core.jaxrpc.binding;
-
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.DeserializerSupport;
-
-// $Id$
-
-/**
- * A factory for a Deserializer that can handle SOAP encoded arrays.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 31-Oct-2005
- */
-public class SOAPArrayDeserializerFactory extends DeserializerFactoryBase
-{
- public DeserializerSupport getDeserializer() throws BindingException
- {
- return new SOAPArrayDeserializer();
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArrayDeserializerFactory.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArrayDeserializerFactory.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArraySerializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArraySerializer.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArraySerializer.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,208 +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.core.jaxrpc.binding;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.jaxrpc.TypeMappingImpl;
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
-import org.jboss.ws.core.jaxrpc.binding.SerializerSupport;
-import org.jboss.ws.core.utils.JavaUtils;
-import org.jboss.ws.metadata.umdm.ParameterMetaData;
-import org.w3c.dom.NamedNodeMap;
-
-/**
- * A Serializer that can handle SOAP encoded arrays.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 31-Oct-2005
- */
-public class SOAPArraySerializer extends SerializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(SOAPArraySerializer.class);
-
- private SerializerSupport compSerializer;
- private NullValueSerializer nullSerializer;
- private boolean isArrayComponentType;
- private boolean xsiNamespaceInserted;
- private StringBuilder xmlFragment;
-
- public SOAPArraySerializer() throws BindingException
- {
- nullSerializer = new NullValueSerializer();
- }
-
- /**
- */
- public String serialize(QName xmlName, QName xmlType, Object value,
SerializationContext serContext, NamedNodeMap attributes) throws BindingException
- {
- log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + ",valueType=" + value.getClass().getName() + "]");
- try
- {
- ParameterMetaData paramMetaData =
(ParameterMetaData)serContext.getProperty(ParameterMetaData.class.getName());
- QName compXmlType = paramMetaData.getSOAPArrayCompType();
- QName compXmlName = paramMetaData.getXmlName();
- Class javaType = paramMetaData.getJavaType();
-
- Class compJavaType = javaType.getComponentType();
- isArrayComponentType = isArrayJavaType(compJavaType) &&
isArrayXmlType(compXmlType);
- while (compJavaType.getComponentType() != null && isArrayComponentType
== false)
- {
- compJavaType = compJavaType.getComponentType();
- isArrayComponentType = isArrayJavaType(compJavaType) &&
isArrayXmlType(compXmlType);
- }
-
- TypeMappingImpl typeMapping = serContext.getTypeMapping();
- if (compXmlType == null)
- {
- compXmlType = typeMapping.getXMLType(compJavaType);
- paramMetaData.setSOAPArrayCompType(compXmlType);
- }
-
- if (compXmlType == null)
- throw new WSException("Cannot obtain component xmlType for: " +
compJavaType);
-
- // Get the component type serializer factory
- log.debug("Get component serializer for: [javaType=" +
compJavaType.getName() + ",xmlType=" + compXmlType + "]");
- SerializerFactoryBase compSerializerFactory =
(SerializerFactoryBase)typeMapping.getSerializer(compJavaType, compXmlType);
- if (compSerializerFactory == null)
- {
- log.warn("Cannot obtain component serializer for: [javaType=" +
compJavaType.getName() + ",xmlType=" + compXmlType + "]");
- compSerializerFactory =
(SerializerFactoryBase)typeMapping.getSerializer(null, compXmlType);
- }
- if (compSerializerFactory == null)
- throw new WSException("Cannot obtain component serializer for: " +
compXmlType);
-
- // Get the component type serializer
- compSerializer = (SerializerSupport)compSerializerFactory.getSerializer();
-
- // Get the corresponding wrapper type
- if (JavaUtils.isPrimitive(value.getClass()))
- value = JavaUtils.getWrapperValueArray(value);
-
- xmlFragment = new StringBuilder("<" + Constants.PREFIX_SOAP11_ENC +
":Array ");
- if (value instanceof Object[])
- {
- Object[] objArr = (Object[])value;
- String arrayDim = "" + objArr.length;
-
- // Get multiple array dimension
- Object[] subArr = (Object[])value;
- while (isArrayComponentType == false && subArr.length > 0
&& subArr[0] instanceof Object[])
- {
- subArr = (Object[])subArr[0];
- arrayDim += "," + subArr.length;
- }
-
- compXmlType = serContext.getNamespaceRegistry().registerQName(compXmlType);
- String arrayType = Constants.PREFIX_SOAP11_ENC + ":arrayType='"
+ compXmlType.getPrefix() + ":" + compXmlType.getLocalPart() + "[" +
arrayDim + "]'";
- String compns = " xmlns:" + compXmlType.getPrefix() +
"='" + compXmlType.getNamespaceURI() + "'";
- xmlFragment.append(arrayType + compns + ">");
-
- serializeArrayComponents(compXmlName, compXmlType, serContext, objArr);
- }
- else
- {
- throw new WSException("Unsupported array type: " + javaType);
- }
- xmlFragment.append("</" + Constants.PREFIX_SOAP11_ENC +
":Array>");
-
- log.debug("serialized: " + xmlFragment);
- return xmlFragment.toString();
- }
- catch (RuntimeException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- throw new BindingException(e);
- }
- }
-
- private void serializeArrayComponents(QName compXmlName, QName compXmlType,
SerializationContext serContext, Object[] objArr) throws BindingException
- {
- for (Object compValue : objArr)
- {
- if (isArrayComponentType == false && compValue instanceof Object[])
- {
- serializeArrayComponents(compXmlName, compXmlType, serContext,
(Object[])compValue);
- }
- else
- {
- SerializerSupport ser = compSerializer;
-
- // Null component value
- if (compValue == null)
- {
- ser = nullSerializer;
- if (xsiNamespaceInserted == false)
- {
- xsiNamespaceInserted = true;
- int insIndex = ("<" + Constants.PREFIX_SOAP11_ENC +
":Array ").length();
- xmlFragment.insert(insIndex, "xmlns:" + Constants.PREFIX_XSI
+ "='" + Constants.NS_SCHEMA_XSI + "' ");
- }
- }
-
- String compFragment = ser.serialize(compXmlName, compXmlType, compValue,
serContext, null);
- xmlFragment.append(compFragment);
- }
- }
- }
-
- /** True for all array xmlTypes, i.e. nmtokens, base64Binary, hexBinary
- *
- * FIXME: This method should be removed as soon as we can reliably get the SOAP
- * arrayType from wsdl + schema.
- */
- private boolean isArrayXmlType(QName xmlType)
- {
- boolean isArrayType = Constants.TYPE_SOAP11_BASE64.equals(xmlType);
- isArrayType = isArrayType || Constants.TYPE_SOAP11_BASE64.equals(xmlType);
- isArrayType = isArrayType || Constants.TYPE_SOAP11_BASE64BINARY.equals(xmlType);
- isArrayType = isArrayType || Constants.TYPE_SOAP11_HEXBINARY.equals(xmlType);
- isArrayType = isArrayType || Constants.TYPE_SOAP11_NMTOKENS.equals(xmlType);
- isArrayType = isArrayType || Constants.TYPE_LITERAL_BASE64BINARY.equals(xmlType);
- isArrayType = isArrayType || Constants.TYPE_LITERAL_HEXBINARY.equals(xmlType);
- isArrayType = isArrayType || Constants.TYPE_LITERAL_NMTOKENS.equals(xmlType);
- return isArrayType;
- }
-
- /** True for all array javaTypes, i.e. String[], Byte[], byte[]
- *
- * FIXME: This method should be removed as soon as we can reliably get the SOAP
- * arrayType from wsdl + schema.
- */
- private boolean isArrayJavaType(Class javaType)
- {
- boolean isBinaryType = String[].class.equals(javaType) ||
Byte[].class.equals(javaType) || byte[].class.equals(javaType);
- return isBinaryType;
- }
-
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArraySerializer.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArraySerializer.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArraySerializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArraySerializerFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArraySerializerFactory.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,42 +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.core.jaxrpc.binding;
-
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.SerializerSupport;
-
-// $Id$
-
-
-/**
- * A factory for a Serializer that can handle SOAP encoded arrays.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 31-Oct-2005
- */
-public class SOAPArraySerializerFactory extends SerializerFactoryBase
-{
- public SerializerSupport getSerializer() throws BindingException
- {
- return new SOAPArraySerializer();
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArraySerializerFactory.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArraySerializerFactory.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementDeserializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementDeserializer.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementDeserializer.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,121 +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.core.jaxrpc.binding;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPFactory;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.DeserializerSupport;
-import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * A deserializer that can handle xsd:anyType
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 23-Jun-2005
- */
-public class SOAPElementDeserializer extends DeserializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(SOAPElementDeserializer.class);
-
- public Object deserialize(QName xmlName, QName xmlType, String xmlFragment,
SerializationContext serContext) throws BindingException
- {
- log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
- try
- {
- Element domElement = DOMUtils.parse(xmlFragment);
- SOAPElement soapElement = createElement(domElement, true);
- return soapElement;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new BindingException();
- }
- }
-
- /**
- * Create a SOAPElement from a DOM Element.
- * This method is not part of the javax.xml.soap.SOAPFactory interface.
- */
- public SOAPElement createElement(Element domNode, boolean deep) throws SOAPException
- {
- if (domNode == null)
- throw new IllegalArgumentException("Source node cannot be null");
-
- String localName = domNode.getLocalName();
- String prefix = domNode.getPrefix() != null ? domNode.getPrefix() : "";
- String nsURI = domNode.getNamespaceURI() != null ? domNode.getNamespaceURI() :
"";
-
- SOAPFactory factory = SOAPFactory.newInstance();
- SOAPElement soapElement = factory.createElement(localName, prefix, nsURI);
-
- // Add the child elements as well
- if (deep)
- {
- if (domNode instanceof Element)
- DOMUtils.copyAttributes(soapElement, (Element)domNode);
-
- NodeList nlist = domNode.getChildNodes();
- for (int i = 0; i < nlist.getLength(); i++)
- {
- Node child = nlist.item(i);
- short nodeType = child.getNodeType();
- if (nodeType == Node.ELEMENT_NODE)
- {
- SOAPElement soapChild = createElement((Element)child, true);
- soapElement.addChildElement(soapChild);
- }
- else if (nodeType == Node.TEXT_NODE)
- {
- String nodeValue = child.getNodeValue();
- soapElement.addTextNode(nodeValue);
- }
- else if (nodeType == Node.CDATA_SECTION_NODE)
- {
- String nodeValue = child.getNodeValue();
- soapElement.addTextNode(nodeValue);
- }
- else
- {
- log.trace("Ignore child type: " + nodeType);
- }
- }
- }
-
- return soapElement;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementDeserializer.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementDeserializer.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementDeserializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementDeserializerFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementDeserializerFactory.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,41 +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.core.jaxrpc.binding;
-
-import org.jboss.ws.core.jaxrpc.binding.DeserializerSupport;
-
-// $Id$
-
-
-/**
- * A factory for a Deserializer that can handle XMLSchema simple types.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Oct-2004
- */
-public class SOAPElementDeserializerFactory extends DeserializerFactoryBase
-{
- public DeserializerSupport getDeserializer()
- {
- return new SOAPElementDeserializer();
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementDeserializerFactory.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementDeserializerFactory.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementSerializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementSerializer.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementSerializer.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,64 +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.core.jaxrpc.binding;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPElement;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
-import org.jboss.ws.core.jaxrpc.binding.SerializerSupport;
-import org.jboss.ws.core.utils.DOMWriter;
-import org.w3c.dom.NamedNodeMap;
-
-/**
- * A serializer that can handle xsd:anyType
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Oct-2004
- */
-public class SOAPElementSerializer extends SerializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(SOAPElementSerializer.class);
-
- /** Marshal the value for a given XMLSchema type
- * @param xmlType local part of the schema type
- * @param value the value to marshal
- * @param serContext
- * @return the string representation od the value
- */
- public String serialize(QName xmlName, QName xmlType, Object value,
SerializationContext serContext, NamedNodeMap attributes) throws BindingException
- {
- log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
- if (value == null)
- throw new IllegalArgumentException("SOAPElement value cannot be
null");
- if ((value instanceof SOAPElement) == false)
- throw new IllegalArgumentException("Value is not a SOAPElement: " +
value.getClass().getName());
-
- String xmlFragment = DOMWriter.printNode((SOAPElement)value, false);
- return xmlFragment;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementSerializer.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementSerializer.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementSerializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementSerializerFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementSerializerFactory.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,40 +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.core.jaxrpc.binding;
-
-import org.jboss.ws.core.jaxrpc.binding.SerializerSupport;
-
-// $Id$
-
-/**
- * A factory for a Serializer that can handle xsd:anyType
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 23-Jun-2005
- */
-public class SOAPElementSerializerFactory extends SerializerFactoryBase
-{
- public SerializerSupport getSerializer()
- {
- return new SOAPElementSerializer();
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementSerializerFactory.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementSerializerFactory.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SerializationContext.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SerializationContext.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SerializationContext.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,71 +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.core.jaxrpc.binding;
-
-// $Id$
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.jboss.ws.core.jaxrpc.TypeMappingImpl;
-import org.jboss.xb.binding.NamespaceRegistry;
-
-/**
- * An abstract serialization context
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public abstract class SerializationContext
-{
- // The type mapping that is valid for this serialization context
- private TypeMappingImpl typeMapping;
- // The namespace registry that is valid for this serialization context
- private NamespaceRegistry namespaceRegistry = new NamespaceRegistry();
- // An arbitrary property bag
- private Map<Object, Object> properties = new HashMap<Object, Object>();
-
- public Object getProperty(Object key)
- {
- return properties.get(key);
- }
-
- public void setProperty(Object key, Object value)
- {
- properties.put(key, value);
- }
-
- public TypeMappingImpl getTypeMapping()
- {
- return typeMapping;
- }
-
- public void setTypeMapping(TypeMappingImpl typeMapping)
- {
- this.typeMapping = typeMapping;
- }
-
- public NamespaceRegistry getNamespaceRegistry()
- {
- return namespaceRegistry;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SerializationContext.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SerializationContext.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SerializerFactoryBase.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SerializerFactoryBase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SerializerFactoryBase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,52 +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.core.jaxrpc.binding;
-
-// $Id$
-
-import java.util.Iterator;
-
-import javax.xml.rpc.encoding.Serializer;
-import javax.xml.rpc.encoding.SerializerFactory;
-
-import org.jboss.util.NotImplementedException;
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.SerializerSupport;
-
-/**
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public abstract class SerializerFactoryBase implements SerializerFactory
-{
- public abstract SerializerSupport getSerializer() throws BindingException;
-
- public Serializer getSerializerAs(String mechanismType)
- {
- throw new NotImplementedException();
- }
-
- public Iterator getSupportedMechanismTypes()
- {
- throw new NotImplementedException();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SerializerFactoryBase.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SerializerFactoryBase.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SerializerSupport.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SerializerSupport.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SerializerSupport.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,164 +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.core.jaxrpc.binding;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.encoding.Serializer;
-
-import org.jboss.util.NotImplementedException;
-import org.jboss.ws.Constants;
-import org.jboss.xb.binding.NamespaceRegistry;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * The base class for all Serializers.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @since 04-Dec-2004
- */
-public abstract class SerializerSupport implements Serializer
-{
- /** Serialize an object value to an XML fragment
- *
- * @param xmlName The root element name of the resulting fragment
- * @param xmlType The associated schema type
- * @param value The value to serialize
- * @param serContext The serialization context
- * @param attributes TODO
- * @param attributes The attributes on this element
- */
- public abstract String serialize(QName xmlName, QName xmlType, Object value,
SerializationContext serContext, NamedNodeMap attributes) throws BindingException;
-
- /** Wrap the value string in a XML fragment with the given name
- */
- protected String wrapValueStr(QName xmlName, String valueStr, NamespaceRegistry
nsRegistry, NamedNodeMap attributes, boolean normalize)
- {
- String nsURI = xmlName.getNamespaceURI();
- String localPart = xmlName.getLocalPart();
- String prefix = xmlName.getPrefix();
-
- StringBuilder nsAttr = new StringBuilder("");
- if (attributes != null)
- {
- for (int i = 0; i < attributes.getLength(); i++)
- {
- Node attr = attributes.item(i);
- String attrName = attr.getNodeName();
- String attrValue = attr.getNodeValue();
- nsAttr.append(" " + attrName + "='" + attrValue +
"'");
- }
- }
-
- String elName;
- if (nsURI.length() > 0)
- {
- xmlName = nsRegistry.registerQName(xmlName);
- prefix = xmlName.getPrefix();
- elName = prefix + ":" + localPart;
-
- String xmlns = " xmlns:" + prefix + "='" + nsURI +
"'";
- if (nsAttr.indexOf(xmlns) < 0)
- {
- nsAttr.append(xmlns);
- }
- }
- else
- {
- elName = localPart;
- }
-
- String xmlFragment;
- if (valueStr == null)
- {
- String xmlns = " xmlns:" + Constants.PREFIX_XSI + "='" +
Constants.NS_SCHEMA_XSI + "'";
- xmlFragment = "<" + elName + nsAttr + " " +
Constants.PREFIX_XSI + ":nil='1'" + xmlns + "/>";
- }
- else
- {
- if(normalize)
- valueStr = normalize(valueStr);
- xmlFragment = "<" + elName + nsAttr + ">" + valueStr +
"</" + elName + ">";
- }
-
- return xmlFragment;
- }
-
- public String getMechanismType()
- {
- throw new NotImplementedException();
- }
-
- private String normalize(String valueStr)
- {
- // We assume most strings will not contain characters that need
"escaping",
- // and optimize for this case.
- boolean found = false;
- int i = 0;
-
- outer: for (; i < valueStr.length(); i++)
- {
- switch (valueStr.charAt(i))
- {
- case '<':
- case '>':
- case '&':
- case '"':
- found = true;
- break outer;
- }
- }
-
- if (!found)
- return valueStr;
-
- // Resume where we left off
- StringBuilder builder = new StringBuilder();
- builder.append(valueStr.substring(0, i));
- for (; i < valueStr.length(); i++)
- {
- char c = valueStr.charAt(i);
- switch (c)
- {
- case '<':
- builder.append("<");
- break;
- case '>':
- builder.append(">");
- break;
- case '&':
- builder.append("&");
- break;
- case '"':
- builder.append(""");
- break;
- default:
- builder.append(c);
- }
- }
-
- return builder.toString();
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SerializerSupport.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SerializerSupport.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleDeserializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleDeserializer.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleDeserializer.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,59 +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.core.jaxrpc.binding;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.DeserializerSupport;
-import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
-import org.jboss.xb.binding.SimpleTypeBindings;
-
-/**
- * A deserializer that can handle XMLSchema simple types.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 22-Oct-2004
- */
-public class SimpleDeserializer extends DeserializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(SimpleDeserializer.class);
-
- public Object deserialize(QName xmlName, QName xmlType, String xmlFragment,
SerializationContext serContext) throws BindingException
- {
- log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
-
- Object value = null;
- String valueStr = unwrapValueStr(xmlFragment);
-
- if (valueStr != null)
- {
- value = SimpleTypeBindings.unmarshal(xmlType.getLocalPart(), valueStr,
serContext.getNamespaceRegistry());
- }
-
- return value;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleDeserializer.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleDeserializer.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleDeserializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleDeserializerFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleDeserializerFactory.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,41 +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.core.jaxrpc.binding;
-
-import org.jboss.ws.core.jaxrpc.binding.DeserializerSupport;
-
-// $Id$
-
-
-/**
- * A factory for a Deserializer that can handle XMLSchema simple types.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Oct-2004
- */
-public class SimpleDeserializerFactory extends DeserializerFactoryBase
-{
- public DeserializerSupport getDeserializer()
- {
- return new SimpleDeserializer();
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleDeserializerFactory.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleDeserializerFactory.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleSerializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleSerializer.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleSerializer.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,74 +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.core.jaxrpc.binding;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.util.NotImplementedException;
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
-import org.jboss.ws.core.jaxrpc.binding.SerializerSupport;
-import org.jboss.xb.binding.NamespaceRegistry;
-import org.jboss.xb.binding.SimpleTypeBindings;
-import org.w3c.dom.NamedNodeMap;
-
-/**
- * A serializer that can handle XMLSchema simple types.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Oct-2004
- */
-public class SimpleSerializer extends SerializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(SimpleSerializer.class);
-
- /** Marshal the value for a given XMLSchema type
- * @param xmlType local part of the schema type
- * @param value the value to marshal
- * @param serContext
- * @return the string representation od the value
- */
- public String serialize(QName xmlName, QName xmlType, Object value,
SerializationContext serContext, NamedNodeMap attributes) throws BindingException
- {
- log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
-
- String valueStr;
- String typeName = xmlType.getLocalPart();
- NamespaceRegistry nsRegistry = serContext.getNamespaceRegistry();
-
- if ("base64Binary".equals(typeName))
- {
- throw new NotImplementedException();
- }
- else
- {
- valueStr = SimpleTypeBindings.marshal(xmlType.getLocalPart(), value,
nsRegistry);
- }
-
- String xmlFragment = wrapValueStr(xmlName, valueStr, nsRegistry, attributes,
true);
- return xmlFragment;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleSerializer.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleSerializer.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleSerializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleSerializerFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleSerializerFactory.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,41 +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.core.jaxrpc.binding;
-
-import org.jboss.ws.core.jaxrpc.binding.SerializerSupport;
-
-// $Id$
-
-
-/**
- * A factory for a Serializer that can handle XMLSchema simple types.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Oct-2004
- */
-public class SimpleSerializerFactory extends SerializerFactoryBase
-{
- public SerializerSupport getSerializer()
- {
- return new SimpleSerializer();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleSerializerFactory.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleSerializerFactory.java)
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb)
Deleted:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBConstants.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBConstants.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBConstants.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,43 +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.core.jaxrpc.binding.jbossxb;
-
-// $Id$
-
-/** JBossXB Constants
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Oct-2004
- */
-public interface JBossXBConstants
-{
- /** Set this property with a Reader to the xsdSchema */
- String JBXB_SCHEMA_READER = "org.jboss.xb.xsd.reader";
- /** Set this property with a the QName of the root element */
- String JBXB_ROOT_QNAME = "org.jboss.xb.root.qname";
- /** Set this property with a the QName of the root type */
- String JBXB_TYPE_QNAME = "org.jboss.xb.type.qname";
- /** Set this property with an instance of JavaWsdlMapping */
- String JBXB_JAVA_MAPPING = "org.jboss.xb.java.mapping";
- /** Set this property to the XSModel to pull schema info from */
- String JBXB_XS_MODEL = "org.jboss.xb.xsd.xsmodel";
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBConstants.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBConstants.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBMarshaller.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBMarshaller.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBMarshaller.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,48 +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.core.jaxrpc.binding.jbossxb;
-
-import java.io.OutputStream;
-import java.io.Writer;
-
-import org.w3c.dom.Node;
-import org.xml.sax.ContentHandler;
-
-/**
- * @author Heiko Braun <heiko.braun(a)jboss.com>
- * @version $Id$
- * @since Jul 5, 2006
- */
-public interface JBossXBMarshaller {
-
- void marshal(Object obj, Writer writer) throws MarshalException;
-
- void marshal(Object obj, ContentHandler handler);
-
- void marshal(Object obj, Node node);
-
- void marshal(Object obj, OutputStream os) throws MarshalException;
-
- Object getProperty(String name);
-
- void setProperty(String name, Object value);
-}
Copied:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBMarshaller.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBMarshaller.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBMarshallerImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBMarshallerImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBMarshallerImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,233 +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.core.jaxrpc.binding.jbossxb;
-
-// $Id$
-
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.util.HashMap;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.util.NotImplementedException;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.utils.JavaUtils;
-import org.jboss.ws.extensions.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.xb.binding.Constants;
-import org.jboss.xb.binding.sunday.marshalling.MarshallerImpl;
-import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
-import org.w3c.dom.Node;
-import org.xml.sax.ContentHandler;
-
-/**
- * An implementation of a JAXB Marshaller that uses the JBossXB schema binding
marshaller.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author Heiko.Braun(a)jboss.org
- * @since 05-Jul-2006
- */
-public class JBossXBMarshallerImpl implements JBossXBMarshaller {
-
- // provide logging
- private static final Logger log = Logger.getLogger(JBossXBMarshallerImpl.class);
-
- // The marshaller properties
- private HashMap properties = new HashMap();
-
- private MarshallerImpl delegate;
-
- public JBossXBMarshallerImpl()
- {
-
- //ClassInfos.disableCache();
-
- delegate = new MarshallerImpl();
- delegate.setProperty(org.jboss.xb.binding.Marshaller.PROP_OUTPUT_XML_VERSION,
"false");
- delegate.setProperty(org.jboss.xb.binding.Marshaller.PROP_OUTPUT_INDENTATION,
"false");
- delegate.declareNamespace("xsi", Constants.NS_XML_SCHEMA_INSTANCE);
- delegate.setSupportNil(true);
- }
-
- /**
- * Marshal the content tree rooted at obj into a Writer.
- */
- public void marshal(Object obj, Writer writer) throws MarshalException
- {
- assertRequiredProperties();
-
- try
- {
- QName xmlName = (QName)getProperty(JBossXBConstants.JBXB_ROOT_QNAME);
- delegate.addRootElement(xmlName);
-
- QName xmlType = (QName)getProperty(JBossXBConstants.JBXB_TYPE_QNAME);
- boolean isAnonymousType = (xmlType != null &&
xmlType.getLocalPart().startsWith(">"));
- if (xmlType != null && !isAnonymousType)
- {
- delegate.setRootTypeQName(xmlType);
- }
-
- if (xmlName.getNamespaceURI().length() > 0)
- {
- String prefix = xmlName.getPrefix();
- String nsURI = xmlName.getNamespaceURI();
- delegate.declareNamespace(prefix, nsURI);
- }
-
- // wildcards still need to be mapped
- // todo: cleanup XB API
- JavaWsdlMapping wsdlMapping =
(JavaWsdlMapping)getProperty(JBossXBConstants.JBXB_JAVA_MAPPING);
- if (wsdlMapping != null)
- {
- JavaXmlTypeMapping[] javaXmlMappings = wsdlMapping.getJavaXmlTypeMappings();
- if (javaXmlMappings != null)
- {
- for (int i = 0; i < javaXmlMappings.length; ++i)
- {
- JavaXmlTypeMapping javaXmlMapping = javaXmlMappings[i];
- VariableMapping[] variableMappings =
javaXmlMapping.getVariableMappings();
-
- if (variableMappings != null)
- {
- String clsName = javaXmlMapping.getJavaType();
- Class cls = JavaUtils.loadJavaType(clsName,
Thread.currentThread().getContextClassLoader());
- QName clsQName = javaXmlMapping.getRootTypeQName();
-
- if (clsQName != null)
- {
- // TODO: legacy API usage, see JBWS-1091
- if
("complexType".equalsIgnoreCase(javaXmlMapping.getQnameScope()))
- {
- delegate.mapClassToXsiType(cls, clsQName.getNamespaceURI(),
clsQName.getLocalPart());
- }
- }
-
- for (int j = 0; j < variableMappings.length; ++j)
- {
- VariableMapping variableMapping = variableMappings[j];
- if (variableMapping.getXmlWildcard())
- {
- delegate.mapFieldToWildcard(cls, "_any",
JBossXBSupport.getWildcardMarshaller());
- }
- }
- }
- }
- }
- }
-
- // the actual marshalling
- SchemaBinding schemaBinding =
JBossXBSupport.getOrCreateSchemaBinding(properties);
- schemaBinding.setXopMarshaller(new XOPMarshallerImpl());
- delegate.marshal(schemaBinding, null, obj, writer);
- }
- catch (RuntimeException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- throw new MarshalException(e);
- }
- }
-
- /**
- * Marshal the content tree rooted at obj into SAX2 events.
- */
- public void marshal(Object obj, ContentHandler handler)
- {
- throw new NotImplementedException();
- }
-
- /**
- * Marshal the content tree rooted at obj into a DOM tree.
- */
- public void marshal(Object obj, Node node)
- {
- throw new NotImplementedException();
- }
-
- /**
- * Marshal the content tree rooted at obj into an output stream.
- */
- public void marshal(Object obj, OutputStream os) throws MarshalException
- {
- marshal(obj, new OutputStreamWriter(os));
- }
-
- /**
- * Get the particular property in the underlying implementation of
- * Marshaller.
- */
- public Object getProperty(String name)
- {
- if (name == null)
- throw new IllegalArgumentException("name parameter is null");
-
- return properties.get(name);
- }
-
- /**
- * Set the particular property in the underlying implementation of
- * Marshaller.
- *
- */
- public void setProperty(String name, Object value)
- {
- if (name == null)
- throw new IllegalArgumentException("name parameter is null");
-
- properties.put(name, value);
- }
-
- /**
- * Get a DOM tree view of the content tree(Optional).
- */
- public Node getNode(Object contentTree)
- {
- throw new NotImplementedException();
- }
-
- /**
- * Assert the required properties
- */
- private void assertRequiredProperties()
- {
- if (getProperty(JBossXBConstants.JBXB_SCHEMA_READER) == null &&
getProperty(JBossXBConstants.JBXB_XS_MODEL) == null)
- throw new WSException("Cannot find required property: " +
JBossXBConstants.JBXB_XS_MODEL);
-
- if (getProperty(JBossXBConstants.JBXB_JAVA_MAPPING) == null)
- throw new WSException("Cannot find required property: " +
JBossXBConstants.JBXB_JAVA_MAPPING);
-
- QName xmlName = (QName)getProperty(JBossXBConstants.JBXB_ROOT_QNAME);
- if (xmlName == null)
- throw new WSException("Cannot find required property: " +
JBossXBConstants.JBXB_ROOT_QNAME);
-
- if (xmlName.getNamespaceURI().length() > 0 &&
xmlName.getPrefix().length() == 0)
- throw new IllegalArgumentException("The given root element name must be
prefix qualified: " + xmlName);
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBMarshallerImpl.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBMarshallerImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBSupport.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBSupport.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBSupport.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,106 +0,0 @@
-package org.jboss.ws.core.jaxrpc.binding.jbossxb;
-
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-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.xb.binding.MarshallingContext;
-import org.jboss.xb.binding.ObjectLocalMarshaller;
-import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
-import org.jboss.xb.util.Dom2Sax;
-import org.w3c.dom.Element;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.SAXException;
-
-/**
- * @author Heiko Braun <heiko.braun(a)jboss.com>
- * @since May 31, 2006
- */
-public class JBossXBSupport {
-
- /**
- * Setup SchemaBinding associated with the ServiceMetaData.
- * In case of an unconfigured call it will be generated from JAXB properties.
- * <p>
- * The SchemaBinding expects to have an element binding for the
- * incomming xml element. Because the same element name can be reused
- * by various operations with different xml types, we have to add the
- * element binding on every invocation.
- *
- * @see JBossXBConstants#JBXB_ROOT_QNAME
- * @see JBossXBConstants#JBXB_TYPE_QNAME
- */
- public static SchemaBinding getOrCreateSchemaBinding(Map properties)
- {
- SchemaBinding schemaBinding = null;
- SchemaBindingBuilder bindingBuilder = new SchemaBindingBuilder();
-
- QName xmlName = (QName)properties.get(JBossXBConstants.JBXB_ROOT_QNAME);
- QName xmlType = (QName)properties.get(JBossXBConstants.JBXB_TYPE_QNAME);
-
- // Get the eagerly initialized SchemaBinding from the ServiceMetaData
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- if (msgContext != null)
- {
- OperationMetaData opMetaData = msgContext.getOperationMetaData();
- EndpointMetaData epMetaData = opMetaData.getEndpointMetaData();
- ServiceMetaData serviceMetaData = epMetaData.getServiceMetaData();
- schemaBinding = serviceMetaData.getSchemaBinding();
- }
-
- // In case of an unconfigured call generate the SchemaBinding from JAXB properties
- if (schemaBinding == null)
- {
- JBossXSModel xsModel =
(JBossXSModel)properties.get(JBossXBConstants.JBXB_XS_MODEL);
- JavaWsdlMapping wsdlMapping =
(JavaWsdlMapping)properties.get(JBossXBConstants.JBXB_JAVA_MAPPING);
- schemaBinding = bindingBuilder.buildSchemaBinding(xsModel, wsdlMapping);
- }
-
- // The SchemaBinding expects to have an element binding for the
- // incomming xml element. Because the same element name can be reused
- // by various operations with different xml types, we have to add the
- // element binding on every invocation.
- bindingBuilder.bindParameterToElement(schemaBinding, xmlName, xmlType);
-
- return schemaBinding;
- }
-
- /**
- * Create a Marshaller that serializes
- * <code>org.w3c.dom.Element</code>'s to a
<code>org.xml.sax.ContentHandler</code>
- *
- * @return ObjectLocalMarshaller
- *
- * @see org.jboss.xb.binding.MarshallingContext#getContentHandler()
- */
- public static ObjectLocalMarshaller getWildcardMarshaller()
- {
- return new ObjectLocalMarshaller() {
- public void marshal(MarshallingContext ctx, Object o)
- {
- if (o == null)
- {
- return;
- }
-
- Element e = (Element)o;
- ContentHandler ch = ctx.getContentHandler();
- try
- {
- Dom2Sax.dom2sax(e, ch);
- }
- catch (SAXException e1)
- {
- throw new IllegalStateException("Failed to marshal DOM element "
+ new QName(e.getNamespaceURI(), e.getLocalName()) + ": " + e1.getMessage());
- }
- }
- };
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBSupport.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBSupport.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBUnmarshaller.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBUnmarshaller.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBUnmarshaller.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,37 +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.core.jaxrpc.binding.jbossxb;
-
-import java.io.InputStream;
-
-/**
- * @author Heiko Braun <heiko.braun(a)jboss.com>
- * @version $Id$
- * @since Jul 5, 2006
- */
-public interface JBossXBUnmarshaller {
- Object unmarshal(InputStream is) throws UnmarshalException;
-
- Object getProperty(String name);
-
- void setProperty(String name, Object value);
-}
Copied:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBUnmarshaller.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBUnmarshaller.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBUnmarshallerImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBUnmarshallerImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBUnmarshallerImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,106 +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.core.jaxrpc.binding.jbossxb;
-
-// $Id$
-
-import java.io.InputStream;
-import java.util.HashMap;
-
-import org.jboss.ws.WSException;
-import org.jboss.ws.extensions.xop.jaxrpc.XOPUnmarshallerImpl;
-import org.jboss.xb.binding.JBossXBException;
-import org.jboss.xb.binding.UnmarshallerFactory;
-import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
-
-/**
- * An implementation of a JAXB Unmarshaller.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author Alexey.Loubyansky(a)jboss.org
- * @since 18-Oct-2004
- */
-public class JBossXBUnmarshallerImpl implements JBossXBUnmarshaller
-{
- // The marshaller properties
- private HashMap<String, Object> properties = new HashMap<String,
Object>();
-
- /**
- * Unmarshal XML data from the specified InputStream and return the resulting content
tree.
- */
- public Object unmarshal(InputStream is) throws UnmarshalException
- {
- assertRequiredProperties();
-
- org.jboss.xb.binding.Unmarshaller unm =
UnmarshallerFactory.newInstance().newUnmarshaller();
- SchemaBinding schemaBinding = JBossXBSupport.getOrCreateSchemaBinding(properties);
- XOPUnmarshallerImpl xopUnmarshaller = new XOPUnmarshallerImpl();
- schemaBinding.setXopUnmarshaller(xopUnmarshaller);
-
- try
- {
- return unm.unmarshal(is, schemaBinding);
- }
- catch (JBossXBException e)
- {
- throw new UnmarshalException(e.getMessage(), e);
- }
- }
-
- /**
- * Get the particular property in the underlying implementation of Unmarshaller.
- */
- public Object getProperty(String name)
- {
- if (name == null)
- throw new IllegalArgumentException("name parameter is null");
-
- return properties.get(name);
- }
-
- /**
- * Set the particular property in the underlying implementation of Unmarshaller.
- */
- public void setProperty(String name, Object value)
- {
- if (name == null)
- throw new IllegalArgumentException("name parameter is null");
-
- properties.put(name, value);
- }
-
-
- /** Assert the required properties
- */
- private void assertRequiredProperties()
- {
- if (getProperty(JBossXBConstants.JBXB_XS_MODEL) == null)
- {
- throw new WSException("Cannot find required property: " +
JBossXBConstants.JBXB_XS_MODEL);
- }
-
- if (getProperty(JBossXBConstants.JBXB_JAVA_MAPPING) == null)
- {
- throw new WSException("Cannot find required property: " +
JBossXBConstants.JBXB_JAVA_MAPPING);
- }
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBUnmarshallerImpl.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBUnmarshallerImpl.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/MarshalException.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/MarshalException.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/MarshalException.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,52 +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.core.jaxrpc.binding.jbossxb;
-
-/**
- * A marshal exception.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 06-Jun-2006
- */
-public class MarshalException extends Exception
-{
-
- public MarshalException()
- {
- super();
- }
-
- public MarshalException(String msg, Throwable th)
- {
- super(msg, th);
- }
-
- public MarshalException(String msg)
- {
- super(msg);
- }
-
- public MarshalException(Throwable th)
- {
- super(th);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/MarshalException.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/MarshalException.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/SchemaBindingBuilder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/SchemaBindingBuilder.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/SchemaBindingBuilder.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,630 +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.core.jaxrpc.binding.jbossxb;
-
-// $Id$
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPFactory;
-
-import org.apache.xerces.xs.XSModel;
-import org.jboss.logging.Logger;
-import org.jboss.util.xml.JBossEntityResolver;
-import org.jboss.ws.Constants;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.utils.JBossWSEntityResolver;
-import org.jboss.ws.extensions.xop.jaxrpc.JBossXBContentAdapter;
-import org.jboss.ws.metadata.jaxrpcmapping.ExceptionMapping;
-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.jaxrpcmapping.VariableMapping;
-import org.jboss.xb.binding.metadata.ClassMetaData;
-import org.jboss.xb.binding.metadata.PackageMetaData;
-import org.jboss.xb.binding.metadata.PropertyMetaData;
-import org.jboss.xb.binding.metadata.ValueMetaData;
-import org.jboss.xb.binding.sunday.unmarshalling.AttributeBinding;
-import org.jboss.xb.binding.sunday.unmarshalling.CharactersHandler;
-import org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver;
-import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
-import org.jboss.xb.binding.sunday.unmarshalling.ModelGroupBinding;
-import org.jboss.xb.binding.sunday.unmarshalling.ParticleBinding;
-import org.jboss.xb.binding.sunday.unmarshalling.ParticleHandler;
-import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
-import org.jboss.xb.binding.sunday.unmarshalling.SimpleTypeBinding;
-import org.jboss.xb.binding.sunday.unmarshalling.TermBinding;
-import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding;
-import org.jboss.xb.binding.sunday.unmarshalling.WildcardBinding;
-import org.jboss.xb.binding.sunday.unmarshalling.XsdBinder;
-import org.jboss.xb.binding.sunday.unmarshalling.impl.runtime.RtElementHandler;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-import org.xml.sax.Attributes;
-
-/**
- * Create SchemaBinding from XSModel and jaxrpc-mapping.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author Alexey.Loubyansky(a)jboss.org
- * @since 18-Oct-2004
- * @see XSModel
- * @see JavaWsdlMapping
- */
-public class SchemaBindingBuilder
-{
- // provide logging
- private static final Logger log = Logger.getLogger(SchemaBindingBuilder.class);
-
- /**
- * Creates and initializes an instance of SchemaBinding
- */
- public SchemaBinding buildSchemaBinding(XSModel model, JavaWsdlMapping wsdlMapping)
- {
- JBossEntityResolver resolver = new JBossWSEntityResolver();
- SchemaBinding schemaBinding = XsdBinder.bind(model, new
DefaultSchemaResolver(resolver));
-
- schemaBinding.setIgnoreLowLine(false);
- schemaBinding.setIgnoreUnresolvedFieldOrClass(false);
- schemaBinding.setUnmarshalListsToArrays(true); // note: default jaxb2.0 is false!
- schemaBinding.setSimpleContentProperty("_value");
- schemaBinding.setUseNoArgCtorIfFound(true);
- if (wsdlMapping != null)
- {
- bindSchemaToJava(schemaBinding, wsdlMapping);
- }
-
- // setup MTOM handler
- JBossXBContentAdapter.register(schemaBinding);
-
- return schemaBinding;
- }
-
- /** Merges JavaWsdlMapping into SchemaBinding
- */
- private void bindSchemaToJava(SchemaBinding schemaBinding, JavaWsdlMapping
wsdlMapping)
- {
- if (log.isTraceEnabled())
- log.trace("bindSchemaToJava: " + schemaBinding);
-
- for (PackageMapping packageMapping : wsdlMapping.getPackageMappings())
- {
- processPackageMapping(schemaBinding, packageMapping);
- }
-
- for (JavaXmlTypeMapping typeMapping : wsdlMapping.getJavaXmlTypeMappings())
- {
- processJavaXmlTypeMapping(schemaBinding, typeMapping);
- }
- }
-
- private void processPackageMapping(SchemaBinding schemaBinding, PackageMapping
packageMapping)
- {
- PackageMetaData packageMetaData = schemaBinding.getPackageMetaData();
- if (packageMetaData == null)
- {
- packageMetaData = new PackageMetaData();
- schemaBinding.setPackageMetaData(packageMetaData);
- }
-
- if (log.isTraceEnabled())
- log.trace("Bound namespace " + packageMapping.getNamespaceURI() +
" to package " + packageMapping.getPackageType());
-
- packageMetaData.setName(packageMapping.getPackageType());
- }
-
- private void processJavaXmlTypeMapping(SchemaBinding schemaBinding, JavaXmlTypeMapping
typeMapping)
- {
- String javaType = typeMapping.getJavaType();
- if (javaType.endsWith("[]"))
- {
- processArrayType(schemaBinding, typeMapping);
- }
- else
- {
- processNonArrayType(schemaBinding, typeMapping);
- }
- }
-
- private void processArrayType(SchemaBinding schemaBinding, JavaXmlTypeMapping
typeMapping)
- {
- QName xmlType = getXmlType(typeMapping);
- log.trace("Ignore array type: " + xmlType);
- }
-
- private void processNonArrayType(SchemaBinding schemaBinding, JavaXmlTypeMapping
typeMapping)
- {
- QName xmlType = getXmlType(typeMapping);
- String javaType = typeMapping.getJavaType();
- log.trace("processNonArrayType: [xmlType=" + xmlType +
",javaType=" + javaType + "]");
-
- TypeBinding typeBinding = getTypeBinding(schemaBinding, typeMapping);
- if (typeBinding != null)
- {
- // Set the java type, but skip SimpleTypes
- boolean isSimpleTypeBinding = (typeBinding instanceof SimpleTypeBinding);
- if(isSimpleTypeBinding == false)
- {
- ClassMetaData classMetaData = typeBinding.getClassMetaData();
- if (classMetaData == null)
- {
- classMetaData = new ClassMetaData();
- typeBinding.setClassMetaData(classMetaData);
- }
- classMetaData.setImpl(javaType);
-
- // exception mapping drives whether we should use the noarg ctor
- JavaWsdlMapping wsdlMapping = typeMapping.getJavaWsdlMapping();
- for (ExceptionMapping aux : wsdlMapping.getExceptionMappings())
- {
- if (javaType.equals(aux.getExceptionType()))
- {
- classMetaData.setUseNoArgCtor(false);
- break;
- }
- }
-
- if (log.isTraceEnabled())
- {
- QName typeQName = typeBinding.getQName();
- log.trace("Bound: [xmlType=" + typeQName + ",javaType=" +
javaType + "]");
- }
- }
-
- VariableMapping[] variableMappings = typeMapping.getVariableMappings();
- for (VariableMapping varMapping : variableMappings)
- {
- if (varMapping.getXmlElementName() != null)
- {
- processXmlElementName(typeBinding, varMapping);
- }
- else if (varMapping.getXmlAttributeName() != null)
- {
- processXmlAttributeName(typeBinding, varMapping);
- }
- else if (varMapping.getXmlWildcard())
- {
- processWildcard(typeBinding, varMapping);
- }
- }
- }
- else
- {
- log.warn("Cannot obtain type binding for: " + xmlType);
- }
- }
-
- private void processXmlAttributeName(TypeBinding typeBinding, VariableMapping
varMapping)
- {
- String xmlAttrName = varMapping.getXmlAttributeName();
- log.trace("processXmlAttributeName: " + xmlAttrName);
-
- QName xmlName = new QName(xmlAttrName);
- AttributeBinding attrBinding = typeBinding.getAttribute(xmlName);
- if (attrBinding == null)
- {
- Iterator i = typeBinding.getAttributes().iterator();
- while (i.hasNext())
- {
- AttributeBinding auxBinding = (AttributeBinding)i.next();
- if (auxBinding.getQName().getLocalPart().equals(xmlAttrName))
- {
- if (attrBinding != null)
- log.warn("Ambiguous binding for attribute: " + xmlAttrName);
-
- attrBinding = auxBinding;
- }
- }
- }
-
- if (attrBinding == null)
- {
- // attributeFormDefault="qualified"
- String nsURI = typeBinding.getQName().getNamespaceURI();
- if (Constants.SOAP11_ATTR_MUST_UNDERSTAND.equals(xmlAttrName) ||
Constants.SOAP11_ATTR_ACTOR.equals(xmlAttrName)
- || Constants.SOAP11_ATTR_ROLE.equals(xmlAttrName))
- {
- nsURI = Constants.NS_SOAP11_ENV;
- }
- QName auxName = new QName(nsURI, xmlAttrName);
- attrBinding = typeBinding.getAttribute(auxName);
- }
-
- if (attrBinding == null)
- {
- QName typeQName = typeBinding.getQName();
- throw new WSException("Attribute " + xmlName + " found in
jaxrpc-mapping but not in the schema: " + typeQName);
- }
-
- String javaVariableName = varMapping.getJavaVariableName();
- PropertyMetaData prop = new PropertyMetaData();
- prop.setName(javaVariableName);
- attrBinding.setPropertyMetaData(prop);
-
- if (log.isTraceEnabled())
- log.trace("Bound attribute " + xmlName + " to property " +
prop.getName());
- }
-
- private void processXmlElementName(TypeBinding typeBinding, VariableMapping
varMapping)
- {
- QName xmlName = new QName(varMapping.getXmlElementName());
- log.trace("processXmlElementName: " + xmlName);
-
- ElementBinding element = typeBinding.getElement(xmlName);
- QName typeQName = typeBinding.getQName();
- if (element == null && typeQName != null)
- {
- // elementFormDefault="qualified"
- String nsURI = typeQName.getNamespaceURI();
- QName auxName = new QName(nsURI, varMapping.getXmlElementName());
- element = typeBinding.getElement(auxName);
- }
-
- if (element == null)
- {
- // <element ref=
- ParticleBinding particle = typeBinding.getParticle();
- if (particle != null)
- {
- TermBinding term = particle.getTerm();
- if (term instanceof ModelGroupBinding)
- {
- Iterator iterator = ((ModelGroupBinding)term).getParticles().iterator();
- element = findLocalPathElement(iterator, new String[] {
varMapping.getXmlElementName() }, 0);
- }
- }
- }
-
- if (element == null)
- throw new WSException("Element " + xmlName + " found in
jaxrpc-mapping but not in the schema: " + typeQName);
-
- String javaVariableName = varMapping.getJavaVariableName();
- if (javaVariableName != null)
- {
- PropertyMetaData prop = new PropertyMetaData();
- prop.setName(javaVariableName);
- element.setPropertyMetaData(prop);
-
- if (log.isTraceEnabled())
- log.trace("Bound element " + xmlName + " to property " +
prop.getName());
- }
- }
-
- private void processWildcard(TypeBinding typeBinding, VariableMapping varMapping)
- {
- log.trace("processWildcard: " + typeBinding.getQName());
-
- PropertyMetaData prop = null;
- String javaVariableName = varMapping.getJavaVariableName();
- if (javaVariableName != null)
- {
- prop = new PropertyMetaData();
- prop.setName(javaVariableName);
- }
-
- if (prop == null)
- {
- prop = new PropertyMetaData();
- prop.setName("_any");
- }
-
- WildcardBinding wildcard = typeBinding.getWildcard();
- wildcard.setUnresolvedElementHandler(new SoapElementHandler());
- wildcard.setUnresolvedCharactersHandler(new SoapCharactersHandler());
- wildcard.setPropertyMetaData(prop);
-
- if (log.isTraceEnabled())
- log.trace("Bound wildcard of " + typeBinding.getQName() + " to
property " + prop.getName());
- }
-
- private TypeBinding getTypeBinding(SchemaBinding schemaBinding, JavaXmlTypeMapping
typeMapping)
- {
- String qnameScope = typeMapping.getQnameScope();
- QName anonymousTypeQName = typeMapping.getAnonymousTypeQName();
- if (anonymousTypeQName != null)
- {
- return getAnonymousTypeBinding(schemaBinding, anonymousTypeQName);
- }
-
- QName xmlType = typeMapping.getRootTypeQName();
-
- TypeBinding typeBinding = null;
- if ("complexType".equals(qnameScope) ||
"simpleType".equals(qnameScope))
- {
- typeBinding = schemaBinding.getType(xmlType);
- if (typeBinding == null)
- {
- log.warn("Type definition not found in schema: " + xmlType);
- }
- }
- else if ("element".equals(qnameScope))
- {
- ElementBinding element = schemaBinding.getElement(xmlType);
- if (element != null)
- {
- typeBinding = element.getType();
- }
- else
- {
- log.warn("Global element not found in schema: " + xmlType);
- }
- }
- else
- {
- throw new WSException("Unexpected qname-scope for " +
typeMapping.getJavaType() + ": " + qnameScope);
- }
- return typeBinding;
- }
-
- public TypeBinding getAnonymousTypeBinding(SchemaBinding schemaBinding, QName
typeQName)
- {
- String expression = typeQName.getLocalPart();
- if (log.isTraceEnabled())
- log.trace("Searching for anonymous expression: " + expression);
-
- ArrayList list = new ArrayList(10);
-
- for (int i = 0, begin = -1; i < expression.length(); i++)
- {
- if (expression.charAt(i) == '>')
- {
- if (begin != -1)
- {
- list.add(expression.substring(begin, i));
- begin = -1;
- }
- }
- else
- {
- if (begin == -1)
- begin = i;
- else if (i == expression.length() - 1)
- list.add(expression.substring(begin));
- }
- }
-
- ElementBinding element = findLocalPathElement(schemaBinding.getElements(),
((String[])list.toArray(new String[0])));
- if (element == null)
- element = findLocalPathElementInTypes(schemaBinding.getTypes(),
((String[])list.toArray(new String[0])));
-
- if (element == null)
- return null;
-
- return element.getType();
- }
-
- public void bindParameterToElement(SchemaBinding schemaBinding, QName xmlName, QName
xmlType)
- {
- TypeBinding typeBinding;
- boolean isAnonymousType = xmlType.getLocalPart().startsWith(">");
- if (isAnonymousType)
- {
- typeBinding = getAnonymousTypeBinding(schemaBinding, xmlType);
- }
- else
- {
- typeBinding = schemaBinding.getType(xmlType);
- }
-
- if (typeBinding != null)
- {
- if(!isAnonymousType)
- schemaBinding.addElement(xmlName, typeBinding);
- }
- else if (xmlType.equals(Constants.TYPE_LITERAL_ANYTYPE) == false)
- {
- throw new WSException("Root type " + xmlType + " not found in the
schema.");
- }
- }
-
- private ElementBinding findLocalPathElement(Iterator elements, String[] path)
- {
- while (elements.hasNext())
- {
- ElementBinding element = (ElementBinding)elements.next();
- element = findLocalPathElement(element, path, 0);
- if (element != null)
- return element;
- }
-
- return null;
- }
-
- private ElementBinding findLocalPathElementInTypes(Iterator types, String[] path)
- {
- while (types.hasNext())
- {
- TypeBinding type = (TypeBinding)types.next();
- if (type.getQName().getLocalPart().equals(path[0]))
- {
- ParticleBinding particle = type.getParticle();
- if (particle == null)
- continue;
-
- TermBinding term = particle.getTerm();
- if (!term.isModelGroup())
- continue;
-
- return
findLocalPathElement(((ModelGroupBinding)term).getParticles().iterator(), path, 1);
- }
- }
-
- return null;
- }
-
- private ElementBinding findLocalPathElement(ElementBinding element, String[] path, int
pos)
- {
- String name = path[pos];
- if (!name.equals(element.getQName().getLocalPart()))
- return null;
-
- // End of path
- if (path.length - 1 == pos)
- return element;
-
- ParticleBinding particle = element.getType().getParticle();
- if (particle == null)
- return null;
-
- TermBinding term = particle.getTerm();
- if (!term.isModelGroup())
- return null;
-
- ModelGroupBinding group = (ModelGroupBinding)term;
- Iterator i = group.getParticles().iterator();
-
- // Increase depth
- return findLocalPathElement(i, path, pos + 1);
- }
-
- private ElementBinding findLocalPathElement(Iterator particles, String[] path, int
pos)
- {
- while (particles.hasNext())
- {
- TermBinding term = ((ParticleBinding)particles.next()).getTerm();
- if (term instanceof ElementBinding)
- {
- ElementBinding element = (ElementBinding)term;
- element = findLocalPathElement(element, path, pos);
- if (element != null)
- return element;
-
- }
- else if (term instanceof ModelGroupBinding)
- {
- Iterator i = ((ModelGroupBinding)term).getParticles().iterator();
- ElementBinding element = findLocalPathElement(i, path, pos);
- if (element != null)
- return element;
- }
- }
-
- return null;
- }
-
- /** Get the <root-type-qname>, fall back to <anonymous-type-qname>
- */
- private QName getXmlType(JavaXmlTypeMapping typeMapping)
- {
- QName xmlType = typeMapping.getRootTypeQName();
- if (xmlType == null && typeMapping.getAnonymousTypeQName() != null)
- xmlType = typeMapping.getAnonymousTypeQName();
-
- return xmlType;
- }
-
- // Inner
-
- public static class SoapCharactersHandler extends CharactersHandler
- {
- public Object unmarshalEmpty(QName qName, TypeBinding typeBinding, NamespaceContext
nsCtx, ValueMetaData valueMetaData)
- {
- return "";
- }
-
- public Object unmarshal(QName qName, TypeBinding typeBinding, NamespaceContext
nsCtx, ValueMetaData valueMetaData, String value)
- {
- return value;
- }
-
- public void setValue(QName qName, ElementBinding element, Object owner, Object
value)
- {
- SOAPElement e = (SOAPElement)owner;
- Text textNode = e.getOwnerDocument().createTextNode((String)value);
- e.appendChild(textNode);
- }
- }
-
- public static class SoapElementHandler extends RtElementHandler implements
ParticleHandler
- {
- private SOAPFactory factory;
-
- public Object startParticle(Object parent, QName elementName, ParticleBinding
particle, Attributes attrs, NamespaceContext nsCtx)
- {
- SOAPFactory factory = getFactory();
- SOAPElement element = null;
- try
- {
- String prefix = elementName.getPrefix();
- String ns = elementName.getNamespaceURI();
- if (ns != null && ns.length() > 0)
- {
- prefix = nsCtx.getPrefix(ns);
- }
-
- element = factory.createElement(elementName.getLocalPart(), prefix, ns);
- }
- catch (SOAPException e)
- {
- throw new IllegalStateException("Failed to create SOAPElement",
e);
- }
-
- if (attrs != null)
- {
- for (int i = 0; i < attrs.getLength(); ++i)
- {
- element.setAttribute(attrs.getLocalName(i), attrs.getValue(i));
- }
- }
-
- return element;
- }
-
- public Object endParticle(Object o, QName elementName, ParticleBinding particle)
- {
- return o;
- }
-
- public void setParent(Object parent, Object o, QName elementName, ParticleBinding
particle, ParticleBinding parentParticle)
- {
- if (parent instanceof SOAPElement)
- {
- ((SOAPElement)parent).appendChild((Element)o);
- }
- else
- {
- super.setParent(parent, o, elementName, particle, parentParticle);
- }
- }
-
- private SOAPFactory getFactory()
- {
- if (factory == null)
- {
- try
- {
- factory = SOAPFactory.newInstance();
- }
- catch (SOAPException e)
- {
- throw new IllegalStateException("Failed to create soap element
factory", e);
- }
- }
- return factory;
- }
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/SchemaBindingBuilder.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/SchemaBindingBuilder.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/UnmarshalException.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/UnmarshalException.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/UnmarshalException.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,52 +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.core.jaxrpc.binding.jbossxb;
-
-/**
- * A marshal exception.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 06-Jun-2006
- */
-public class UnmarshalException extends Exception
-{
-
- public UnmarshalException()
- {
- super();
- }
-
- public UnmarshalException(String msg, Throwable th)
- {
- super(msg, th);
- }
-
- public UnmarshalException(String msg)
- {
- super(msg);
- }
-
- public UnmarshalException(Throwable th)
- {
- super(th);
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/UnmarshalException.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/UnmarshalException.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/XercesXSMarshallerImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/XercesXSMarshallerImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/XercesXSMarshallerImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,251 +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.core.jaxrpc.binding.jbossxb;
-
-// $Id$
-
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.util.HashMap;
-
-import javax.xml.namespace.QName;
-
-import org.apache.xerces.xs.XSModel;
-import org.jboss.logging.Logger;
-import org.jboss.util.NotImplementedException;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.utils.JavaUtils;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaXmlTypeMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.VariableMapping;
-import org.jboss.xb.binding.Constants;
-import org.jboss.xb.binding.MappingObjectModelProvider;
-import org.jboss.xb.binding.XercesXsMarshaller;
-import org.w3c.dom.Node;
-import org.xml.sax.ContentHandler;
-
-/**
- * An implementation of a JAXB Marshaller that user XercesXSMarshaller impl.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Oct-2004
- */
-public class XercesXSMarshallerImpl implements JBossXBMarshaller
-{
-
- // provide logging
- private static final Logger log = Logger.getLogger(XercesXSMarshallerImpl.class);
-
- // The marshaller properties
- private HashMap properties = new HashMap();
-
- private XercesXsMarshaller delegate;
-
- public XercesXSMarshallerImpl()
- {
- delegate = new XercesXsMarshaller();
- delegate.setProperty(XercesXsMarshaller.PROP_OUTPUT_XML_VERSION,
"false");
- delegate.setProperty(XercesXsMarshaller.PROP_OUTPUT_INDENTATION,
"false");
- delegate.declareNamespace("xsi", Constants.NS_XML_SCHEMA_INSTANCE);
- delegate.setSupportNil(true);
- delegate.setSimpleContentProperty("_value");
- }
-
- /**
- * Marshal the content tree rooted at obj into a Writer.
- */
- public void marshal(Object obj, Writer writer) throws MarshalException
- {
- assertRequiredProperties();
-
- try
- {
- QName xmlName = (QName)getProperty(JBossXBConstants.JBXB_ROOT_QNAME);
- delegate.addRootElement(xmlName);
-
- QName xmlType = (QName)getProperty(JBossXBConstants.JBXB_TYPE_QNAME);
- if (xmlType != null)
- {
- delegate.setRootTypeQName(xmlType);
- }
-
- if (xmlName.getNamespaceURI().length() > 0)
- {
- String prefix = xmlName.getPrefix();
- String nsURI = xmlName.getNamespaceURI();
- delegate.declareNamespace(prefix, nsURI);
- }
-
- MappingObjectModelProvider provider = new MappingObjectModelProvider();
- provider.setIgnoreLowLine(false);
- provider.setIgnoreNotFoundField(false);
-
- // todo complete wsdl mapping merge
- JavaWsdlMapping wsdlMapping =
(JavaWsdlMapping)getProperty(JBossXBConstants.JBXB_JAVA_MAPPING);
- if (wsdlMapping != null)
- {
- JavaXmlTypeMapping[] javaXmlMappings = wsdlMapping.getJavaXmlTypeMappings();
- if (javaXmlMappings != null)
- {
- for (int i = 0; i < javaXmlMappings.length; ++i)
- {
- JavaXmlTypeMapping javaXmlMapping = javaXmlMappings[i];
- VariableMapping[] variableMappings =
javaXmlMapping.getVariableMappings();
- if (variableMappings != null)
- {
- String clsName = javaXmlMapping.getJavaType();
- Class cls = JavaUtils.loadJavaType(clsName,
Thread.currentThread().getContextClassLoader());
- QName clsQName = javaXmlMapping.getRootTypeQName();
-
- if (clsQName != null)
- {
- if ("element".equals(javaXmlMapping.getQnameScope()))
- {
- delegate.mapClassToGlobalElement(cls, clsQName.getLocalPart(),
clsQName.getNamespaceURI(), null, provider);
- }
- else
- {
- delegate.mapClassToGlobalType(cls, clsQName.getLocalPart(),
clsQName.getNamespaceURI(), null, provider);
- delegate.mapClassToXsiType(cls, clsQName.getNamespaceURI(),
clsQName.getLocalPart());
- }
- }
-
- for (int j = 0; j < variableMappings.length; ++j)
- {
- VariableMapping variableMapping = variableMappings[j];
- String javaName = variableMapping.getJavaVariableName();
- if (variableMapping.getXmlElementName() != null)
- {
- String xmlElementName = variableMapping.getXmlElementName();
- provider.mapFieldToElement(cls, javaName, "",
xmlElementName, null);
- }
- else if (variableMapping.getXmlAttributeName() != null)
- {
- log.trace("Unmapped attribute: " + javaName);
- }
- else if (variableMapping.getXmlWildcard())
- {
- delegate.mapFieldToWildcard(cls, "_any",
JBossXBSupport.getWildcardMarshaller());
- }
- else
- {
- log.warn("Unmapped variable: " + javaName);
- }
- }
- }
- }
- }
- }
-
- if (getProperty(JBossXBConstants.JBXB_XS_MODEL) != null)
- {
- XSModel model = (XSModel)getProperty(JBossXBConstants.JBXB_XS_MODEL);
- delegate.marshal(model, provider, obj, writer);
- }
- }
- catch (RuntimeException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- throw new MarshalException(e);
- }
- }
-
- /**
- * Marshal the content tree rooted at obj into SAX2 events.
- */
- public void marshal(Object obj, ContentHandler handler)
- {
- throw new NotImplementedException();
- }
-
- /**
- * Marshal the content tree rooted at obj into a DOM tree.
- */
- public void marshal(Object obj, Node node)
- {
- throw new NotImplementedException();
- }
-
- /**
- * Marshal the content tree rooted at obj into an output stream.
- */
- public void marshal(Object obj, OutputStream os) throws MarshalException
- {
- marshal(obj, new OutputStreamWriter(os));
- }
-
- /**
- * Get the particular property in the underlying implementation of
- * Marshaller.
- */
- public Object getProperty(String name)
- {
- if (name == null)
- throw new IllegalArgumentException("name parameter is null");
-
- return properties.get(name);
- }
-
- /**
- * Set the particular property in the underlying implementation of
- * Marshaller.
- *
- */
- public void setProperty(String name, Object value)
- {
- if (name == null)
- throw new IllegalArgumentException("name parameter is null");
-
- properties.put(name, value);
- }
-
- /**
- * Get a DOM tree view of the content tree(Optional).
- */
- public Node getNode(Object contentTree)
- {
- throw new NotImplementedException();
- }
-
- /**
- * Assert the required properties
- */
- private void assertRequiredProperties()
- {
- if (getProperty(JBossXBConstants.JBXB_SCHEMA_READER) == null &&
getProperty(JBossXBConstants.JBXB_XS_MODEL) == null)
- throw new WSException("Cannot find required property: " +
JBossXBConstants.JBXB_XS_MODEL);
-
- if (getProperty(JBossXBConstants.JBXB_JAVA_MAPPING) == null)
- throw new WSException("Cannot find required property: " +
JBossXBConstants.JBXB_JAVA_MAPPING);
-
- QName xmlName = (QName)getProperty(JBossXBConstants.JBXB_ROOT_QNAME);
- if (xmlName == null)
- throw new WSException("Cannot find required property: " +
JBossXBConstants.JBXB_ROOT_QNAME);
-
- if (xmlName.getNamespaceURI().length() > 0 &&
xmlName.getPrefix().length() == 0)
- throw new IllegalArgumentException("The given root element name must be
prefix qualified: " + xmlName);
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/XercesXSMarshallerImpl.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/XercesXSMarshallerImpl.java)
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/ClientHandlerChain.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/ClientHandlerChain.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/ClientHandlerChain.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,43 +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.core.jaxrpc.handler;
-
-// $Id$
-
-import java.util.List;
-import java.util.Set;
-
-
-/**
- * Represents a list of handlers. All elements in the
- * HandlerChain are of the type javax.xml.rpc.handler.Handler.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 06-May-2004
- */
-public class ClientHandlerChain extends HandlerChainBaseImpl
-{
- public ClientHandlerChain(List infos, Set roles)
- {
- super(infos, roles);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/ClientHandlerChain.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/ClientHandlerChain.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerChainBaseImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerChainBaseImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerChainBaseImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,730 +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.core.jaxrpc.handler;
-
-// $Id$
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.JAXRPCException;
-import javax.xml.rpc.handler.Handler;
-import javax.xml.rpc.handler.HandlerChain;
-import javax.xml.rpc.handler.HandlerInfo;
-import javax.xml.rpc.handler.MessageContext;
-import javax.xml.rpc.soap.SOAPFaultException;
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPHeaderElement;
-import javax.xml.soap.SOAPPart;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.soap.SOAPElementImpl;
-import org.jboss.ws.core.soap.SOAPElementWriter;
-import org.jboss.ws.core.soap.SOAPEnvelopeImpl;
-import org.jboss.ws.core.soap.SOAPMessageImpl;
-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;
-
-/**
- * Represents a list of handlers. All elements in the
- * HandlerChain are of the type javax.xml.rpc.handler.Handler.
- * <p/>
- * Abstracts the policy and mechanism for the invocation of the registered handlers.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 06-May-2004
- */
-public abstract class HandlerChainBaseImpl implements HandlerChain
-{
- private static Logger log = Logger.getLogger(HandlerChainBaseImpl.class);
-
- public static final int STATE_DOES_NOT_EXIST = 0;
- public static final int STATE_CREATED = 1;
- public static final int STATE_READY = 2;
- public static final int STATE_DESTROYED = 3;
-
- // The List<Entry> objects
- protected List<HandlerEntry> handlers = new ArrayList<HandlerEntry>();
- // The roles associated with the handler chain
- protected Set<String> roles = new HashSet<String>();
- // The index of the first handler that returned false during processing
- protected int falseIndex = -1;
- // The state of this handler chain
- protected int state;
-
- /**
- * Constructs a handler chain with the given handlers infos
- */
- public HandlerChainBaseImpl(List<HandlerInfo> infos, Set<String> roles)
- {
- log.debug("Create a handler chain for roles: " + roles);
- addHandlersToChain(infos, roles);
- }
-
- /** Get the list of handler infos
- */
- public List<HandlerInfo> getHandlerInfos()
- {
- List<HandlerInfo> list = new ArrayList<HandlerInfo>();
- for (int i = 0; i < handlers.size(); i++)
- {
- HandlerEntry entry = (HandlerEntry)handlers.get(i);
- list.add(entry.info);
- }
- return list;
- }
-
- /**
- * Initialize the a handler chain with the given handlers infos
- *
- * @throws javax.xml.rpc.JAXRPCException If any error during initialization
- */
- private void addHandlersToChain(List<HandlerInfo> infos, Set<String>
roleSet)
- {
- try
- {
- if (infos != null)
- {
- for (HandlerInfo info : infos)
- {
- HandlerWrapper handler = new
HandlerWrapper((Handler)info.getHandlerClass().newInstance());
- HandlerType type =
(HandlerType)info.getHandlerConfig().get(HandlerType.class.getName());
- handlers.add(new HandlerEntry(handler, info, type));
- }
- }
- if (roleSet != null)
- {
- roles.addAll(roleSet);
- }
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new JAXRPCException("Cannot initialize handler chain", ex);
- }
-
- // set state to created
- state = STATE_CREATED;
- }
-
- /**
- * Get the state of this handler chain
- */
- public int getState()
- {
- return state;
- }
-
- /**
- * Initializes the configuration for a HandlerChain.
- *
- * @param config Configuration for the initialization of this handler chain
- * @throws javax.xml.rpc.JAXRPCException If any error during initialization
- */
- public void init(Map config)
- {
- log.debug("init: [config=" + config + "]");
- for (int i = 0; i < handlers.size(); i++)
- {
- HandlerEntry entry = (HandlerEntry)handlers.get(i);
- entry.handler.init(entry.info);
- }
-
- // set state to ready
- state = STATE_READY;
- }
-
- /**
- * Indicates the end of lifecycle for a HandlerChain.
- *
- * @throws javax.xml.rpc.JAXRPCException If any error during destroy
- */
- public void destroy()
- {
- log.debug("destroy");
- for (int i = 0; i < handlers.size(); i++)
- {
- HandlerEntry entry = (HandlerEntry)handlers.get(i);
- entry.handler.destroy();
- }
- handlers.clear();
-
- // set state to destroyed
- state = STATE_DESTROYED;
- }
-
- /**
- * Gets SOAP actor roles registered for this HandlerChain at this SOAP node. The
returned array includes the
- * special SOAP actor next.
- *
- * @return SOAP Actor roles as URIs
- */
- public String[] getRoles()
- {
- Set<String> auxlist = new HashSet<String>(roles);
- auxlist.add(Constants.URI_SOAP11_NEXT_ACTOR);
- String[] roleArr = new String[auxlist.size()];
- auxlist.toArray(roleArr);
- return roleArr;
- }
-
- /**
- * Sets SOAP Actor roles for this HandlerChain. This specifies the set of roles in
which this HandlerChain is to act
- * for the SOAP message processing at this SOAP node. These roles assumed by a
HandlerChain must be invariant during
- * the processing of an individual SOAP message through the HandlerChain.
- * <p/>
- * A HandlerChain always acts in the role of the special SOAP actor next. Refer to the
SOAP specification for the
- * URI name for this special SOAP actor. There is no need to set this special role
using this method.
- *
- * @param soapActorNames URIs for SOAP actor name
- */
- public void setRoles(String[] soapActorNames)
- {
- List<String> newRoles = Arrays.asList(soapActorNames);
- log.debug("setRoles: " + newRoles);
-
- roles.clear();
- roles.addAll(newRoles);
- }
-
- /**
- * Initiates the request processing for this handler chain.
- *
- * @param msgContext MessageContext parameter provides access to the request SOAP
message.
- * @return Returns true if all handlers in chain have been processed. Returns false if
a handler in the chain returned false from its handleRequest method.
- * @throws javax.xml.rpc.JAXRPCException if any processing error happens
- */
- public boolean handleRequest(MessageContext msgContext)
- {
- return handleRequestInternal(msgContext, HandlerType.ALL);
- }
-
- public boolean handleRequest(MessageContext msgContext, HandlerType type)
- {
- return handleRequestInternal(msgContext, type);
- }
-
- private boolean handleRequestInternal(MessageContext msgContext, HandlerType type)
- {
- boolean doNext = true;
-
- if (handlers.size() > 0)
- {
- log.debug("Enter: handleRequest");
-
- SOAPMessageContextJAXRPC jaxrpcContext = (SOAPMessageContextJAXRPC)msgContext;
- jaxrpcContext.setProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM,
Boolean.TRUE);
-
- // Replace handlers that did not survive the previous call
- replaceDirtyHandlers();
-
- int handlerIndex = 0;
- Handler currHandler = null;
- try
- {
- String lastMessageTrace = null;
- for (; doNext && handlerIndex < handlers.size(); handlerIndex++)
- {
- HandlerEntry handlerEntry = (HandlerEntry)handlers.get(handlerIndex);
- if (type == HandlerType.ALL || type == handlerEntry.getType())
- {
- currHandler = handlerEntry.getHandler();
-
- if (log.isTraceEnabled())
- {
- SOAPPart soapPart = jaxrpcContext.getMessage().getSOAPPart();
- lastMessageTrace = traceSOAPPart("BEFORE handleRequest - "
+ currHandler, soapPart, lastMessageTrace);
- }
-
- doNext = currHandler.handleRequest(msgContext);
-
- if (log.isTraceEnabled())
- {
- SOAPPart soapPart = jaxrpcContext.getMessage().getSOAPPart();
- lastMessageTrace = traceSOAPPart("AFTER handleRequest - "
+ currHandler, soapPart, lastMessageTrace);
- }
- }
- }
- }
- catch (RuntimeException e)
- {
- log.error("RuntimeException in request handler", e);
- doNext = false;
- throw e;
- }
- finally
- {
- // we start at this index in the response chain
- if (doNext == false)
- falseIndex = (handlerIndex - 1);
-
- jaxrpcContext.removeProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
- log.debug("Exit: handleRequest with status: " + doNext);
- }
- }
-
- return doNext;
- }
-
- /**
- * Initiates the response processing for this handler chain.
- * <p/>
- * In this implementation, the response handler chain starts processing from the same
Handler
- * instance (that returned false) and goes backward in the execution sequence.
- *
- * @return Returns true if all handlers in chain have been processed.
- * Returns false if a handler in the chain returned false from its
handleResponse method.
- * @throws javax.xml.rpc.JAXRPCException if any processing error happens
- */
- public boolean handleResponse(MessageContext msgContext)
- {
- return handleResponseInternal(msgContext, HandlerType.ALL);
- }
-
- public boolean handleResponse(MessageContext msgContext, HandlerType type)
- {
- return handleResponseInternal(msgContext, type);
- }
-
- private boolean handleResponseInternal(MessageContext msgContext, HandlerType type)
- {
- boolean doNext = true;
-
- if (handlers.size() > 0)
- {
- log.debug("Enter: handleResponse");
-
- SOAPMessageContextJAXRPC jaxrpcContext = (SOAPMessageContextJAXRPC)msgContext;
- jaxrpcContext.setProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM,
Boolean.TRUE);
-
- int handlerIndex = handlers.size() - 1;
- if (falseIndex != -1)
- handlerIndex = falseIndex;
-
- Handler currHandler = null;
- try
- {
- String lastMessageTrace = null;
- for (; doNext && handlerIndex >= 0; handlerIndex--)
- {
- HandlerEntry handlerEntry = (HandlerEntry)handlers.get(handlerIndex);
- if (type == HandlerType.ALL || type == handlerEntry.getType())
- {
- currHandler = handlerEntry.getHandler();
-
- if (log.isTraceEnabled())
- {
- SOAPPart soapPart = jaxrpcContext.getMessage().getSOAPPart();
- lastMessageTrace = traceSOAPPart("BEFORE handleResponse -
" + currHandler, soapPart, lastMessageTrace);
- }
-
- doNext = currHandler.handleResponse(msgContext);
-
- if (log.isTraceEnabled())
- {
- SOAPPart soapPart = jaxrpcContext.getMessage().getSOAPPart();
- lastMessageTrace = traceSOAPPart("AFTER handleResponse - "
+ currHandler, soapPart, lastMessageTrace);
- }
- }
- }
- }
- catch (RuntimeException rte)
- {
- log.error("RuntimeException in response handler", rte);
- doNext = false;
- throw rte;
- }
- finally
- {
- // we start at this index in the fault chain
- if (doNext == false)
- falseIndex = (handlerIndex - 1);
-
- jaxrpcContext.removeProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
- log.debug("Exit: handleResponse with status: " + doNext);
- }
- }
-
- return doNext;
- }
-
- /**
- * Initiates the SOAP fault processing for this handler chain.
- * <p/>
- * In this implementation, the fault handler chain starts processing from the same
Handler
- * instance (that returned false) and goes backward in the execution sequence.
- *
- * @return Returns true if all handlers in chain have been processed.
- * Returns false if a handler in the chain returned false from its handleFault
method.
- * @throws javax.xml.rpc.JAXRPCException if any processing error happens
- */
- public boolean handleFault(MessageContext msgContext)
- {
- boolean doNext = true;
-
- if (handlers.size() > 0)
- {
- log.debug("Enter: handleFault");
-
- SOAPMessageContextJAXRPC jaxrpcContext = (SOAPMessageContextJAXRPC)msgContext;
- jaxrpcContext.setProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM,
Boolean.TRUE);
-
- try
- {
- int handlerIndex = handlers.size() - 1;
- if (falseIndex != -1)
- handlerIndex = falseIndex;
-
- Handler currHandler = null;
- for (; doNext && handlerIndex >= 0; handlerIndex--)
- {
- currHandler = ((HandlerEntry)handlers.get(handlerIndex)).getHandler();
- log.debug("Handle fault: " + currHandler);
- doNext = currHandler.handleFault(msgContext);
- }
- }
- finally
- {
- jaxrpcContext.removeProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
- log.debug("Exit: handleFault with status: " + doNext);
- }
- }
-
- return doNext;
- }
-
- /** Trace the SOAPPart, do nothing if the String representation is equal to the last
one.
- */
- protected String traceSOAPPart(String logMsg, SOAPPart soapPart, String
lastMessageTrace)
- {
- try
- {
- SOAPEnvelopeImpl soapEnv = (SOAPEnvelopeImpl)soapPart.getEnvelope();
- String envStr = SOAPElementWriter.writeElement((SOAPElementImpl)soapEnv, true);
- if (envStr.equals(lastMessageTrace))
- {
- log.trace(logMsg + ": unchanged");
- }
- else
- {
- log.trace(logMsg + "\n" + envStr);
- lastMessageTrace = envStr;
- }
- return lastMessageTrace;
- }
- catch (Exception ex)
- {
- log.error("Cannot trace SOAP message", ex);
- return null;
- }
- }
-
- /**
- * Replace handlers that did not survive the previous call
- */
- protected void replaceDirtyHandlers()
- {
- for (int i = 0; i < handlers.size(); i++)
- {
- HandlerEntry entry = (HandlerEntry)handlers.get(i);
- if (entry.handler.getState() == HandlerWrapper.DOES_NOT_EXIST)
- {
- log.debug("Replacing dirty handler: " + entry.handler);
- try
- {
- HandlerWrapper handler = new
HandlerWrapper((Handler)entry.info.getHandlerClass().newInstance());
- entry.handler = handler;
- handler.init(entry.info);
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- log.error("Cannot create handler instance for: " + entry.info,
ex);
- }
- }
- }
- }
-
- /**
- * Get the handler at the requested position
- */
- protected Handler getHandlerAt(int pos)
- {
- if (pos < 0 || handlers.size() <= pos)
- throw new IllegalArgumentException("No handler at position: " + pos);
-
- HandlerEntry entry = (HandlerEntry)handlers.get(pos);
- return entry.handler;
- }
-
- /**
- * R1027 A RECEIVER MUST generate a "soap:MustUnderstand" fault when a
- * message contains a mandatory header block (i.e., one that has a
- * soap:mustUnderstand attribute with the value "1") targeted at the
- * receiver (via soap:actor) that the receiver does not understand.
- */
- public static void checkMustUnderstand(CommonMessageContext msgContext, String[]
roles)
- {
- SOAPHeaderElement mustUnderstandHeaderElement = null;
- List roleList = (roles != null ? Arrays.asList(roles) : new ArrayList());
- try
- {
- SOAPMessageImpl soapMessage = (SOAPMessageImpl)msgContext.getSOAPMessage();
-
- // A SOAPHeaderElement is possibly bound to the endpoint operation
- // in order to check that we need a the opMetaData
- OperationMetaData opMetaData = msgContext.getOperationMetaData();
- if (opMetaData == null)
- {
- // The security handler must have decrypted the incomming message
- // before the dispatch target operation can be known
- EndpointMetaData epMetaData = msgContext.getEndpointMetaData();
- opMetaData = soapMessage.getOperationMetaData(epMetaData);
- }
-
- SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
- if (soapEnvelope != null && soapEnvelope.getHeader() != null)
- {
- Iterator it = soapEnvelope.getHeader().examineAllHeaderElements();
- while (it.hasNext() && mustUnderstandHeaderElement == null)
- {
- SOAPHeaderElement soapHeaderElement = (SOAPHeaderElement)it.next();
- Name name = soapHeaderElement.getElementName();
- QName xmlName = new QName(name.getURI(), name.getLocalName());
-
- ParameterMetaData paramMetaData = (opMetaData != null ?
opMetaData.getParameter(xmlName) : null);
- boolean isBoundHeader = (paramMetaData != null &&
paramMetaData.isInHeader());
-
- if (soapHeaderElement.getMustUnderstand() && isBoundHeader ==
false)
- {
- String actor = soapHeaderElement.getActor();
- boolean noActor = (actor == null || actor.length() == 0);
- boolean nextActor = Constants.URI_SOAP11_NEXT_ACTOR.equals(actor);
- if (noActor || nextActor || roleList.contains(actor))
- {
- mustUnderstandHeaderElement = soapHeaderElement;
- }
- }
- }
- }
- }
- catch (SOAPException ex)
- {
- log.error("Cannot check mustUnderstand for headers", ex);
- }
-
- if (mustUnderstandHeaderElement != null)
- {
- QName faultCode = Constants.SOAP11_FAULT_CODE_MUST_UNDERSTAND;
- String faultString = "Unprocessed 'mustUnderstand' header element:
" + mustUnderstandHeaderElement.getElementName();
- throw new SOAPFaultException(faultCode, faultString, null, null);
- }
- }
-
- /**
- * An entry in the handler list
- */
- private class HandlerEntry
- {
- private HandlerWrapper handler;
- private HandlerInfo info;
- private HandlerType type;
-
- public HandlerEntry(HandlerWrapper handler, HandlerInfo info, HandlerType type)
- {
- if (handler == null || info == null)
- throw new IllegalStateException("Invalid handler entry");
-
- if (type == null)
- {
- log.debug("Using handler type default: " + HandlerType.ENDPOINT);
- type = HandlerType.ENDPOINT;
- }
-
- this.handler = handler;
- this.info = info;
- this.type = type;
- }
-
- public Handler getHandler()
- {
- return handler;
- }
-
- public HandlerInfo getInfo()
- {
- return info;
- }
-
- public HandlerType getType()
- {
- return type;
- }
- }
-
- // java.util.List interface
****************************************************************************************
-
- public boolean remove(Object o)
- {
- return handlers.remove(o);
- }
-
- public boolean containsAll(Collection c)
- {
- return handlers.containsAll(c);
- }
-
- public boolean removeAll(Collection c)
- {
- return handlers.removeAll(c);
- }
-
- public boolean retainAll(Collection c)
- {
- return handlers.retainAll(c);
- }
-
- public int hashCode()
- {
- return handlers.hashCode();
- }
-
- public boolean equals(Object o)
- {
- return handlers.equals(o);
- }
-
- public Iterator iterator()
- {
- return handlers.iterator();
- }
-
- public List subList(int fromIndex, int toIndex)
- {
- return handlers.subList(fromIndex, toIndex);
- }
-
- public ListIterator listIterator()
- {
- return handlers.listIterator();
- }
-
- public ListIterator listIterator(int index)
- {
- return handlers.listIterator(index);
- }
-
- public int size()
- {
- return handlers.size();
- }
-
- public void clear()
- {
- handlers.clear();
- }
-
- public boolean isEmpty()
- {
- return handlers.isEmpty();
- }
-
- public Object[] toArray()
- {
- return handlers.toArray();
- }
-
- public Object get(int index)
- {
- return handlers.get(index);
- }
-
- public Object remove(int index)
- {
- return handlers.remove(index);
- }
-
- public void add(int index, Object element)
- {
- handlers.add(index, (HandlerEntry)element);
- }
-
- public int indexOf(Object elem)
- {
- return handlers.indexOf(elem);
- }
-
- public int lastIndexOf(Object elem)
- {
- return handlers.lastIndexOf(elem);
- }
-
- public boolean add(Object o)
- {
- return handlers.add((HandlerEntry)o);
- }
-
- public boolean contains(Object elem)
- {
- return handlers.contains(elem);
- }
-
- public boolean addAll(int index, Collection c)
- {
- return handlers.addAll(index, c);
- }
-
- public boolean addAll(Collection c)
- {
- return handlers.addAll(c);
- }
-
- public Object set(int index, Object element)
- {
- return handlers.set(index, (HandlerEntry)element);
- }
-
- public Object[] toArray(Object[] a)
- {
- return handlers.toArray(a);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerChainBaseImpl.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerChainBaseImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,200 +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.core.jaxrpc.handler;
-
-// $Id$
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.handler.HandlerChain;
-import javax.xml.rpc.handler.HandlerInfo;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.server.HandlerDelegate;
-import org.jboss.ws.core.server.ServiceEndpointInfo;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.extensions.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;
-
-/** Delegates to JAXRPC handlers
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 19-Jan-2005
- */
-public class HandlerDelegateJAXRPC implements HandlerDelegate
-{
- // provide logging
- private static Logger log = Logger.getLogger(HandlerDelegateJAXRPC.class);
-
- // This endpoints handler chain
- private ServerHandlerChain preHandlerChain;
- // This endpoints handler chain
- private ServerHandlerChain jaxrpcHandlerChain;
- // This endpoints handler chain
- private ServerHandlerChain postHandlerChain;
-
- public HandlerDelegateJAXRPC()
- {
- }
-
- public boolean callRequestHandlerChain(ServiceEndpointInfo seInfo, HandlerType type)
- {
- SOAPMessageContextJAXRPC msgContext =
(SOAPMessageContextJAXRPC)MessageContextAssociation.peekMessageContext();
- ServerEndpointMetaData sepMetaData = seInfo.getServerEndpointMetaData();
-
- // Initialize the handler chain
- if (sepMetaData.isHandlersInitialized() == false)
- {
- initHandlerChain(seInfo, HandlerType.PRE);
- initHandlerChain(seInfo, HandlerType.ENDPOINT);
- initHandlerChain(seInfo, HandlerType.POST);
- sepMetaData.setHandlersInitialized(true);
- }
-
- boolean status = true;
- String[] roles = null;
-
- HandlerChain handlerChain = null;
- if (type == HandlerType.PRE)
- handlerChain = preHandlerChain;
- else if (type == HandlerType.ENDPOINT)
- handlerChain = jaxrpcHandlerChain;
- else if (type == HandlerType.POST)
- handlerChain = postHandlerChain;
-
- if (handlerChain != null)
- {
- roles = handlerChain.getRoles();
- status = handlerChain.handleRequest(msgContext);
- }
-
- // BP-1.0 R1027
- if (type == HandlerType.POST)
- HandlerChainBaseImpl.checkMustUnderstand(msgContext, roles);
-
- return status;
- }
-
- public boolean callResponseHandlerChain(ServiceEndpointInfo seInfo, HandlerType type)
- {
- SOAPMessageContextJAXRPC msgContext =
(SOAPMessageContextJAXRPC)MessageContextAssociation.peekMessageContext();
-
- HandlerChain handlerChain = null;
- if (type == HandlerType.PRE)
- handlerChain = preHandlerChain;
- else if (type == HandlerType.ENDPOINT)
- handlerChain = jaxrpcHandlerChain;
- else if (type == HandlerType.POST)
- handlerChain = postHandlerChain;
-
- boolean status = (handlerChain != null ? handlerChain.handleResponse(msgContext) :
true);
-
- if(type == HandlerType.ENDPOINT)
- XOPContext.visitAndRestoreXOPData();
-
- return status;
- }
-
- public boolean callFaultHandlerChain(ServiceEndpointInfo seInfo, HandlerType type,
Exception ex)
- {
- SOAPMessageContextJAXRPC msgContext =
(SOAPMessageContextJAXRPC)MessageContextAssociation.peekMessageContext();
-
- HandlerChain handlerChain = null;
- if (type == HandlerType.PRE)
- handlerChain = preHandlerChain;
- else if (type == HandlerType.ENDPOINT)
- handlerChain = jaxrpcHandlerChain;
- else if (type == HandlerType.POST)
- handlerChain = postHandlerChain;
-
- boolean status = (handlerChain != null ? handlerChain.handleFault(msgContext) :
true);
-
- if(type == HandlerType.ENDPOINT)
- XOPContext.visitAndRestoreXOPData();
-
- return status;
- }
-
- /**
- * Init the handler chain
- */
- private void initHandlerChain(ServiceEndpointInfo seInfo, HandlerType type)
- {
- Set<String> handlerRoles = new HashSet<String>();
- List<HandlerInfo> hInfos = new ArrayList<HandlerInfo>();
-
- ServerEndpointMetaData sepMetaData = seInfo.getServerEndpointMetaData();
- for (HandlerMetaData handlerMetaData : sepMetaData.getHandlerMetaData(type))
- {
- HandlerMetaDataJAXRPC jaxrpcMetaData = (HandlerMetaDataJAXRPC)handlerMetaData;
- handlerRoles.addAll(jaxrpcMetaData.getSoapRoles());
-
- HashMap<String, Object> hConfig = new HashMap<String, Object>();
- for (HandlerInitParam param : jaxrpcMetaData.getInitParams())
- {
- hConfig.put(param.getParamName(), param.getParamValue());
- }
-
- Set<QName> headers = jaxrpcMetaData.getSoapHeaders();
- QName[] headerArr = new QName[headers.size()];
- headers.toArray(headerArr);
-
- Class hClass = jaxrpcMetaData.getHandlerClass();
- hConfig.put(HandlerType.class.getName(), jaxrpcMetaData.getHandlerType());
- HandlerInfo info = new HandlerInfo(hClass, hConfig, headerArr);
-
- log.debug("Adding server side handler to service '" +
sepMetaData.getQName() + "': " + info);
- hInfos.add(info);
- }
-
- initHandlerChain(seInfo, hInfos, handlerRoles, type);
- }
-
- private void initHandlerChain(ServiceEndpointInfo seInfo, List<HandlerInfo>
hInfos, Set<String> handlerRoles, HandlerType type)
- {
- log.debug("Init handler chain with [" + hInfos.size() + "]
handlers");
-
- ServerHandlerChain handlerChain = new ServerHandlerChain(hInfos, handlerRoles,
type);
- if (type == HandlerType.PRE)
- preHandlerChain = handlerChain;
- else if (type == HandlerType.ENDPOINT)
- jaxrpcHandlerChain = handlerChain;
- else if (type == HandlerType.POST)
- postHandlerChain = handlerChain;
-
- if (handlerChain.getState() == ServerHandlerChain.STATE_CREATED)
- {
- // what is the config for a handler chain?
- handlerChain.init(null);
- }
- }
-
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerWrapper.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerWrapper.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerWrapper.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,201 +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.core.jaxrpc.handler;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.JAXRPCException;
-import javax.xml.rpc.handler.Handler;
-import javax.xml.rpc.handler.HandlerInfo;
-import javax.xml.rpc.handler.MessageContext;
-import javax.xml.rpc.soap.SOAPFaultException;
-
-import org.jboss.logging.Logger;
-
-/**
- * A wrapper arround a {@link javax.xml.rpc.handler.Handler} that takes care of its
lifecycle.
- *
- * @author thomas.diesler(a)jboss.org
- */
-public class HandlerWrapper implements Handler
-{
- private static Logger log = Logger.getLogger(HandlerWrapper.class);
-
- public final static int DOES_NOT_EXIST = 0;
- public final static int METHOD_READY = 1;
-
- // The states as string
- private static String[] stateNames = new String[]{"DOES_NOT_EXIST",
"METHOD_READY"};
-
- // The handler to delegate to
- private Handler delegate;
- // The handler state
- private int state;
-
- /**
- * Delegate to the given handler
- */
- public HandlerWrapper(Handler handler)
- {
- delegate = handler;
- state = DOES_NOT_EXIST; // this is somewhat a lie ;-)
- }
-
- /**
- * Get the current state
- */
- public int getState()
- {
- return state;
- }
-
- /**
- * Get the current state as string
- */
- public String getStateAsString()
- {
- return stateNames[state];
- }
-
- /**
- * Gets the header blocks processed by this Handler instance.
- */
- public QName[] getHeaders()
- {
- return delegate.getHeaders();
- }
-
- /**
- * The init method enables the Handler instance to initialize itself.
- */
- public void init(HandlerInfo config) throws JAXRPCException
- {
- log.debug("init: " + delegate);
- delegate.init(config);
- state = METHOD_READY;
- }
-
- /**
- * The destroy method indicates the end of lifecycle for a Handler instance.
- */
- public void destroy() throws JAXRPCException
- {
- log.debug("destroy: " + delegate);
- state = DOES_NOT_EXIST;
- delegate.destroy();
- }
-
- /**
- * The handleRequest method processes the request message.
- */
- public boolean handleRequest(MessageContext msgContext) throws JAXRPCException,
SOAPFaultException
- {
- if (state == DOES_NOT_EXIST)
- {
- log.warn("Handler is in state DOES_NOT_EXIST, skipping
Handler.handleRequest for: " + delegate);
- return true;
- }
-
- try
- {
- return delegate.handleRequest(msgContext);
- }
- catch (RuntimeException e)
- {
- return handleRuntimeException(e);
- }
- }
-
- /**
- * The handleResponse method processes the response SOAP message.
- */
- public boolean handleResponse(MessageContext msgContext)
- {
- if (state == DOES_NOT_EXIST)
- {
- log.warn("Handler is in state DOES_NOT_EXIST, skipping
Handler.handleResponse for: " + delegate);
- return true;
- }
-
- try
- {
- return delegate.handleResponse(msgContext);
- }
- catch (RuntimeException e)
- {
- return handleRuntimeException(e);
- }
- }
-
- /**
- * The handleFault method processes the SOAP faults based on the SOAP message
processing model.
- */
- public boolean handleFault(MessageContext msgContext)
- {
- if (state == DOES_NOT_EXIST)
- {
- log.warn("Handler is in state DOES_NOT_EXIST, skipping Handler.handleFault
for: " + delegate);
- return true;
- }
-
- try
- {
- return delegate.handleFault(msgContext);
- }
- catch (RuntimeException e)
- {
- return handleRuntimeException(e);
- }
- }
-
- /**
- * As defined by JAX-RPC, a RuntimeException(other than SOAPFaultException) thrown
from any method of
- * the Handler results in the destroymethod being invoked and transition to the �Does
Not Exist� state.
- */
- private boolean handleRuntimeException(RuntimeException e)
- {
- if ((e instanceof SOAPFaultException) == false)
- {
- log.warn("RuntimeException in handler method, transition to
DOES_NOT_EXIST");
- destroy();
- }
-
- throw e;
- }
-
- /**
- * Returns a hash code value for the object.
- */
- public int hashCode()
- {
- return delegate.hashCode();
- }
-
- /**
- * Returns a string representation of the object.
- */
- public String toString()
- {
- return "[state=" + getStateAsString() + ",handler=" + delegate
+ "]";
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerWrapper.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerWrapper.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/MessageContextJAXRPC.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/MessageContextJAXRPC.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/MessageContextJAXRPC.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,91 +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.core.jaxrpc.handler;
-
-// $Id$
-
-import javax.xml.rpc.handler.MessageContext;
-import javax.xml.soap.SOAPMessage;
-
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.jaxrpc.SerializationContextJAXRPC;
-import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.ServiceMetaData;
-import org.jboss.xb.binding.NamespaceRegistry;
-
-/**
- * The message context that is processed by a handler
- * in the handle method.
- * <p/>
- * Provides methods to manage a property set.
- * MessageContext properties enable handlers in a handler chain to share
- * processing related state.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 06-May-2004
- */
-public class MessageContextJAXRPC extends CommonMessageContext implements MessageContext
-{
- public static final String SERVLET_CONTEXT =
"javax.xml.ws.servlet.context";
- public static final String SERVLET_REQUEST =
"javax.xml.ws.servlet.request";
- public static final String SERVLET_RESPONSE =
"javax.xml.ws.servlet.response";
- public static final String SERVLET_SESSION =
"javax.xml.ws.servlet.session";
-
- // The SOAP message
- private SOAPMessage message;
- // The serialization context for this message ctx
- private SerializationContext serContext;
-
- public SOAPMessage getMessage()
- {
- return message;
- }
-
- public void setMessage(SOAPMessage message)
- {
- this.message = message;
- }
-
- /** Get or create the serialization context
- */
- public SerializationContext getSerializationContext()
- {
- if (serContext == null)
- {
- EndpointMetaData epMetaData = getEndpointMetaData();
- ServiceMetaData serviceMetaData = epMetaData.getServiceMetaData();
-
- SerializationContextJAXRPC jaxrpcContext = new SerializationContextJAXRPC();
- jaxrpcContext.setTypeMapping(serviceMetaData.getTypeMapping());
- jaxrpcContext.setJavaWsdlMapping(serviceMetaData.getJavaWsdlMapping());
- serContext = jaxrpcContext;
- }
- return serContext;
- }
-
- /** Gets the namespace registry for this message context */
- public NamespaceRegistry getNamespaceRegistry()
- {
- return getSerializationContext().getNamespaceRegistry();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/MessageContextJAXRPC.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/MessageContextJAXRPC.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/SOAPMessageContextJAXRPC.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/SOAPMessageContextJAXRPC.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/SOAPMessageContextJAXRPC.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,75 +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.core.jaxrpc.handler;
-
-// $Id$
-
-import javax.xml.rpc.handler.soap.SOAPMessageContext;
-import javax.xml.soap.SOAPMessage;
-
-/**
- * Provides access to the SOAP message for either RPC request or response.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 14-Dec-2004
- */
-public class SOAPMessageContextJAXRPC extends MessageContextJAXRPC implements
SOAPMessageContext
-{
- /** Default constuctor
- */
- public SOAPMessageContextJAXRPC()
- {
- }
-
- /** Gets the SOAPMessage from this message context
- *
- * @return Returns the SOAPMessage; returns null if no SOAPMessage is present in this
message context
- */
- public SOAPMessage getMessage()
- {
- return getSOAPMessage();
- }
-
- /** Sets the SOAPMessage in this message context
- *
- * @param message SOAP message
- * @throws javax.xml.rpc.JAXRPCException If any error during the setting of the
SOAPMessage in this message context
- * @throws UnsupportedOperationException - If this operation is not supported
- */
- public void setMessage(SOAPMessage message)
- {
- setSOAPMessage(message);
- }
-
- /**
- * Gets the SOAP actor roles associated with an execution of the HandlerChain and its
contained Handler instances.
- * Note that SOAP actor roles apply to the SOAP node and are managed using
HandlerChain.setRoles and HandlerChain.getRoles.
- * Handler instances in the HandlerChain use this information about the SOAP actor
roles to process the SOAP header blocks.
- * Note that the SOAP actor roles are invariant during the processing of SOAP message
through the HandlerChain.
- *
- * @return Array of URIs for SOAP actor roles
- */
- public String[] getRoles()
- {
- return new String[0];
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/SOAPMessageContextJAXRPC.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/SOAPMessageContextJAXRPC.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/ServerHandlerChain.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/ServerHandlerChain.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/ServerHandlerChain.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,62 +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.core.jaxrpc.handler;
-
-// $Id$
-
-import java.util.List;
-import java.util.Set;
-
-import javax.xml.rpc.handler.MessageContext;
-
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-
-/**
- * Represents a list of handlers. All elements in the
- * HandlerChain are of the type javax.xml.rpc.handler.Handler.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 06-May-2004
- */
-public class ServerHandlerChain extends HandlerChainBaseImpl
-{
- // The required type of the handler
- private HandlerType type;
-
- public ServerHandlerChain(List infos, Set roles, HandlerType type)
- {
- super(infos, roles);
- this.type = type;
- }
-
- public boolean handleRequest(MessageContext msgContext)
- {
- boolean doNext = super.handleRequest(msgContext);
- return doNext;
- }
-
- public boolean handleResponse(MessageContext msgContext)
- {
- boolean doNext = super.handleResponse(msgContext);
- return doNext;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/ServerHandlerChain.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/ServerHandlerChain.java)
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/DynamicWrapperGenerator.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/DynamicWrapperGenerator.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/DynamicWrapperGenerator.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,244 +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.core.jaxws;
-
-import java.util.List;
-import java.util.SortedMap;
-
-import javassist.CannotCompileException;
-import javassist.ClassPool;
-import javassist.CtClass;
-import javassist.CtField;
-import javassist.CtMethod;
-import javassist.CtNewMethod;
-import javassist.LoaderClassPath;
-import javassist.Modifier;
-import javassist.NotFoundException;
-import javassist.bytecode.ConstPool;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.utils.JavaUtils;
-import org.jboss.ws.core.utils.JavassistUtils;
-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;
-
-public class DynamicWrapperGenerator extends WrapperGenerator
-{
- private static Logger log = Logger.getLogger(DynamicWrapperGenerator.class);
-
- private ClassPool pool;
-
- public DynamicWrapperGenerator(ClassLoader loader)
- {
- super(loader);
- pool = new ClassPool(true);
- pool.appendClassPath(new LoaderClassPath(loader));
- }
-
- /**
- * Generates a wrapper type and assigns it to the passed ParameterMetaData
- * object. This routine requires the pmd to contain completed wrappedTypes
- * and wrappedVariables properties of the passed ParameterMetaData object.
- *
- * @param pmd a document/literal wrapped parameter
- */
- public void generate(ParameterMetaData pmd)
- {
- // If a wrapper already present, no need to generate one
- String wrapperName = pmd.getJavaTypeName();
- if (JavaUtils.isLoaded(wrapperName, loader))
- return;
-
- List<WrappedParameter> wrappedParameters = pmd.getWrappedParameters();
- OperationMetaData opMetaData = pmd.getOperationMetaData();
-
- if (opMetaData.isDocumentWrapped() == false)
- throw new WSException("Operation is not document/literal (wrapped)");
-
- if (wrappedParameters == null)
- throw new WSException("Cannot generate a type when their is no wrapper
parameters");
-
- log.debug("Generating wrapper: " + wrapperName);
-
- QName xmlName = pmd.getXmlName();
- QName xmlType = pmd.getXmlType();
-
- try
- {
- CtClass clazz = pool.makeClass(wrapperName);
- clazz.getClassFile().setVersionToJava5();
- addClassAnnotations(clazz, xmlName, xmlType, null);
-
- for (WrappedParameter parameter : wrappedParameters)
- {
- addProperty(clazz, parameter.getType(), parameter.getName(),
parameter.getVariable(), parameter.getTypeArguments());
- }
- pool.toClass(clazz, loader);
- JavaUtils.clearBlacklists(loader);
- }
- catch (Exception e)
- {
- throw new WSException("Could not generate wrapper type: " +
wrapperName, e);
- }
-
- // Add the generated type to the types meta data
- TypesMetaData types =
opMetaData.getEndpointMetaData().getServiceMetaData().getTypesMetaData();
- types.addTypeMapping(new TypeMappingMetaData(types, xmlType, wrapperName));
- }
-
- public void generate(FaultMetaData fmd)
- {
- // If a wrapper already present, no need to generate one
- String faultBeanName = fmd.getFaultBeanName();
- if (faultBeanName == null || JavaUtils.isLoaded(faultBeanName, loader))
- return;
-
- log.debug("Generating fault bean: " + faultBeanName);
-
- QName xmlType = fmd.getXmlType();
-
- Class exception = fmd.getJavaType();
- try
- {
- SortedMap<String, Class<?>> properties =
getExceptionProperties(exception);
- String[] propertyOrder = properties.keySet().toArray(new String[0]);
-
- CtClass clazz = pool.makeClass(faultBeanName);
- clazz.getClassFile().setVersionToJava5();
- addClassAnnotations(clazz, fmd.getXmlName(), fmd.getXmlType(), propertyOrder);
-
- for (String property : propertyOrder)
- addProperty(clazz, properties.get(property).getName(), new QName(property),
property, null);
-
- pool.toClass(clazz, loader);
- JavaUtils.clearBlacklists(loader);
- }
- catch (Exception e)
- {
- throw new WSException("Could not generate fault wrapper bean: " +
faultBeanName, e);
- }
-
- // Add the generated type to the types meta data
- TypesMetaData types =
fmd.getOperationMetaData().getEndpointMetaData().getServiceMetaData().getTypesMetaData();
- types.addTypeMapping(new TypeMappingMetaData(types, xmlType, faultBeanName));
- }
-
- private static String getterPrefix(CtClass type)
- {
- return type == CtClass.booleanType ||
"java.lang.Boolean".equals(type.getName()) ? "is" : "get";
- }
-
- private String typeSignature(String type, String[] arguments)
- {
- StringBuilder ret = new StringBuilder(JavaUtils.toSignature(type));
- ret.deleteCharAt(ret.length() - 1).append('<');
-
- for (String arg : arguments)
- ret.append(JavaUtils.toSignature(arg));
-
- return ret.append(">;").toString();
- }
-
- private String getterSignature(String type)
- {
- return "()" + type;
- }
-
- private String setterSignature(String type)
- {
- return "(" + type + ")V";
- }
-
- private void addProperty(CtClass clazz, String typeName, QName name, String variable,
String[] typeArguments)
- throws CannotCompileException, NotFoundException
- {
- ConstPool constPool = clazz.getClassFile().getConstPool();
- String fieldName = JavaUtils.isReservedKeyword(variable) ? "_" +
variable : variable;
- CtField field = new CtField(pool.get(typeName), fieldName, clazz);
- field.setModifiers(Modifier.PRIVATE);
-
- // Add generics attributes
- String typeSignature = null;
- if (typeArguments != null)
- {
- typeSignature = typeSignature(typeName, typeArguments);
- JavassistUtils.addSignature(field, typeSignature);
- }
-
- // Add @XmlElement
- JavassistUtils.Annotation annotation =
JavassistUtils.createAnnotation(XmlElement.class, constPool);
- if (name.getNamespaceURI() != null)
- annotation.addParameter("namespace", name.getNamespaceURI());
- annotation.addParameter("name", name.getLocalPart());
- annotation.markField(field);
- clazz.addField(field);
-
- // Add accessor methods
- CtMethod getter = CtNewMethod.getter(getterPrefix(field.getType()) +
JavaUtils.capitalize(variable), field);
- CtMethod setter = CtNewMethod.setter("set" +
JavaUtils.capitalize(variable), field);
- if (typeSignature != null)
- {
- JavassistUtils.addSignature(getter, getterSignature(typeSignature));
- JavassistUtils.addSignature(setter, setterSignature(typeSignature));
- }
- clazz.addMethod(getter);
- clazz.addMethod(setter);
- }
-
- private static void addClassAnnotations(CtClass clazz, QName xmlName, QName xmlType,
String[] propertyOrder)
- {
- ConstPool constPool = clazz.getClassFile().getConstPool();
-
- // Add @XmlRootElement
- JavassistUtils.Annotation annotation =
JavassistUtils.createAnnotation(XmlRootElement.class, constPool);
- if (xmlName.getNamespaceURI() != null && xmlName.getNamespaceURI().length()
> 0)
- annotation.addParameter("namespace", xmlName.getNamespaceURI());
- annotation.addParameter("name", xmlName.getLocalPart());
- annotation.markClass(clazz);
-
- // Add @XmlType;
- annotation = JavassistUtils.createAnnotation(XmlType.class, constPool);
- if (xmlType.getNamespaceURI() != null & xmlType.getNamespaceURI().length() >
0)
- annotation.addParameter("namespace", xmlType.getNamespaceURI());
- annotation.addParameter("name", xmlType.getLocalPart());
- if (propertyOrder != null)
- annotation.addParameter("propOrder", propertyOrder);
- annotation.markClass(clazz);
-
- // Add @XmlAccessorType
- annotation = JavassistUtils.createAnnotation(XmlAccessorType.class, constPool);
- annotation.addParameter("value", XmlAccessType.FIELD);
- annotation.markClass(clazz);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/DynamicWrapperGenerator.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/DynamicWrapperGenerator.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,95 +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.core.jaxws;
-
-// $Id$
-
-import java.io.ByteArrayInputStream;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.namespace.QName;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.ws.WebServiceException;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.jaxrpc.TypeMappingImpl;
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.ComplexTypeDeserializer;
-import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
-import org.jboss.ws.extensions.xop.jaxws.AttachmentUnmarshallerImpl;
-
-/**
- * A Deserializer that can handle complex types by delegating to JAXB.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class JAXBDeserializer extends ComplexTypeDeserializer
-{
- // provide logging
- private static final Logger log = Logger.getLogger(JAXBDeserializer.class);
-
- public JAXBDeserializer() throws BindingException
- {
- }
-
- @Override
- public Object deserialize(QName xmlName, QName xmlType, String val,
SerializationContext serContext)
- {
- log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
-
- Object value = null;
- try
- {
- TypeMappingImpl typeMapping = serContext.getTypeMapping();
- Class javaType = typeMapping.getJavaType(xmlType);
- JAXBContext jaxbContext = JAXBContext.newInstance(javaType);
- Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
- unmarshaller.setAttachmentUnmarshaller( new AttachmentUnmarshallerImpl());
-
- ByteArrayInputStream ins = new
ByteArrayInputStream(val.getBytes("UTF-8"));
- JAXBElement jbe = unmarshaller.unmarshal(new StreamSource(ins), javaType);
- value = jbe.getValue();
-
- log.debug("deserialized: " + (value != null ?
value.getClass().getName() : null));
- }
- catch (Exception ex)
- {
- handleUnmarshallException(ex);
- }
- return value;
-
- }
-
- // 4.21 Conformance (Marshalling failure): If an error occurs when using the supplied
JAXBContext to marshall
- // a request or unmarshall a response, an implementation MUST throw a
WebServiceException whose
- // cause is set to the original JAXBException.
- private void handleUnmarshallException(Exception ex)
- {
- if (ex instanceof WebServiceException)
- throw (WebServiceException)ex;
-
- throw new WebServiceException(ex);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializerFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializerFactory.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,43 +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.core.jaxws;
-
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.DeserializerFactoryBase;
-import org.jboss.ws.core.jaxrpc.binding.DeserializerSupport;
-
-// $Id$
-
-/**
- * A factory for a Deserializer that can handle complex types
- * by delegating to JAXB.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class JAXBDeserializerFactory extends DeserializerFactoryBase
-{
- public DeserializerSupport getDeserializer() throws BindingException
- {
- return new JAXBDeserializer();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializerFactory.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializerFactory.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,96 +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.core.jaxws;
-
-// $Id$
-
-import java.io.StringWriter;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.Marshaller;
-import javax.xml.namespace.QName;
-import javax.xml.ws.WebServiceException;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.jaxrpc.TypeMappingImpl;
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.ComplexTypeSerializer;
-import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
-import org.jboss.ws.extensions.xop.jaxws.AttachmentMarshallerImpl;
-import org.w3c.dom.NamedNodeMap;
-
-/**
- * A Serializer that can handle complex types by delegating to JAXB.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class JAXBSerializer extends ComplexTypeSerializer
-{
- // provide logging
- private static final Logger log = Logger.getLogger(JAXBSerializer.class);
-
- public JAXBSerializer() throws BindingException
- {
- }
-
- @Override
- public String serialize(QName xmlName, QName xmlType, Object value,
SerializationContext serContext, NamedNodeMap attributes) throws BindingException
- {
- log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
-
- String xmlFragment = null;
- try
- {
- TypeMappingImpl typeMapping = serContext.getTypeMapping();
- Class javaType = typeMapping.getJavaType(xmlType);
- JAXBContext jaxbContext = JAXBContext.newInstance(javaType);
- Marshaller marshaller = jaxbContext.createMarshaller();
-
- marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);
- marshaller.setAttachmentMarshaller(new AttachmentMarshallerImpl());
-
- StringWriter strwr = new StringWriter();
- marshaller.marshal(new JAXBElement(xmlName, javaType, value), strwr);
- xmlFragment = strwr.toString();
-
- log.debug("serialized: " + xmlFragment);
- }
- catch (Exception ex)
- {
- handleMarshallException(ex);
- }
- return xmlFragment;
- }
-
- // 4.21 Conformance (Marshalling failure): If an error occurs when using the supplied
JAXBContext to marshall
- // a request or unmarshall a response, an implementation MUST throw a
WebServiceException whose
- // cause is set to the original JAXBException.
- private void handleMarshallException(Exception ex)
- {
- if (ex instanceof WebServiceException)
- throw (WebServiceException)ex;
-
- throw new WebServiceException(ex);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializerFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializerFactory.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,44 +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.core.jaxws;
-
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.SerializerFactoryBase;
-import org.jboss.ws.core.jaxrpc.binding.SerializerSupport;
-
-// $Id$
-
-
-/**
- * A factory for a Serializer that can handle complex types
- * by delegating to JAXB.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class JAXBSerializerFactory extends SerializerFactoryBase
-{
- public SerializerSupport getSerializer() throws BindingException
- {
- return new JAXBSerializer();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializerFactory.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializerFactory.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/SOAPFaultHelperJAXWS.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/SOAPFaultHelperJAXWS.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/SOAPFaultHelperJAXWS.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,503 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the JBPM BPEL PUBLIC LICENSE AGREEMENT as
- * published by JBoss Inc.; either version 1.0 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.
- */
-package org.jboss.ws.core.jaxws;
-
-import java.io.IOException;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.namespace.QName;
-import javax.xml.rpc.encoding.TypeMapping;
-import javax.xml.soap.Detail;
-import javax.xml.soap.DetailEntry;
-import javax.xml.soap.MessageFactory;
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPFault;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.soap.SOAPFaultException;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.jaxrpc.SOAPFaultHelperJAXRPC;
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.DeserializerFactoryBase;
-import org.jboss.ws.core.jaxrpc.binding.DeserializerSupport;
-import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
-import org.jboss.ws.core.jaxrpc.binding.SerializerFactoryBase;
-import org.jboss.ws.core.jaxrpc.binding.SerializerSupport;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.core.soap.NameImpl;
-import org.jboss.ws.core.soap.SOAPFactoryImpl;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.core.utils.DOMWriter;
-import org.jboss.ws.metadata.umdm.FaultMetaData;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-import org.w3c.dom.Element;
-
-/**
- * @author <a href="mailto:alex.guizar@jboss.com">Alejandro
Guizar</a>
- * @version $Revision$
- */
-public class SOAPFaultHelperJAXWS
-{
- // provide logging
- private static Logger log = Logger.getLogger(SOAPFaultHelperJAXWS.class);
-
- private static final Collection<String> excludedGetters = Arrays.asList(new
String[] { "getCause", "getLocalizedMessage",
"getStackTrace", "getClass" });
-
- /** Factory method for FaultException for a given SOAPFault */
- public static SOAPFaultException getSOAPFaultException(SOAPFault soapFault)
- {
- SOAPFaultException faultEx = new SOAPFaultException(soapFault);
- Detail detail = soapFault.getDetail();
-
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- if (detail != null && msgContext != null)
- {
- SerializationContext serContext = msgContext.getSerializationContext();
- TypeMapping typeMapping = serContext.getTypeMapping();
-
- Iterator it = detail.getDetailEntries();
- while (it.hasNext())
- {
- DetailEntry deElement = (DetailEntry)it.next();
- QName xmlName = new QName(deElement.getNamespaceURI(),
deElement.getLocalName());
-
- OperationMetaData opMetaData = msgContext.getOperationMetaData();
- FaultMetaData faultMetaData = opMetaData.getFault(xmlName);
- if (faultMetaData != null)
- {
- log.debug("Deserialize fault: " + faultMetaData);
- QName xmlType = faultMetaData.getXmlType();
- Class<?> faultBeanClass = faultMetaData.getFaultBean();
-
- // Get the deserializer from the type mapping
- DeserializerFactoryBase desFactory =
(DeserializerFactoryBase)typeMapping.getDeserializer(faultBeanClass, xmlType);
- if (desFactory == null)
- throw new WebServiceException("Cannot obtain deserializer factory:
xmlType=" + xmlType + ", javaType=" + faultBeanClass);
-
- //
http://jira.jboss.org/jira/browse/JBWS-955
- // Cannot deserialize fault detail
- String prefix = deElement.getPrefix();
- if (prefix.length() > 0)
- {
- String nsURI = deElement.getNamespaceURI();
- String attrValue = deElement.getAttribute("xmlns:" +
prefix);
- if (nsURI.length() > 0 && attrValue.length() == 0)
- {
- try
- {
- deElement.addNamespaceDeclaration(prefix, nsURI);
- }
- catch (SOAPException e)
- {
- log.warn("Declaration of detail entry namespace
failed", e);
- }
- }
- }
-
- // Try jaxb deserialization
- try
- {
- String xmlFragment = DOMWriter.printNode(deElement, false);
- DeserializerSupport des =
(DeserializerSupport)desFactory.getDeserializer();
- Object faultBean = des.deserialize(xmlName, xmlType, xmlFragment,
serContext);
-
- /* JAX-WS 2.5: A wsdl:fault element refers to a wsdl:message that
contains
- * a single part. The global element declaration referred to by that
part
- * is mapped to a Java bean. A wrapper exception class contains the
- * following methods:
- * - WrapperException(String message, FaultBean faultInfo)
- * - WrapperException(String message, FaultBean faultInfo, Throwable
cause)
- * - FaultBean getFaultInfo() */
- Class<?> serviceExGenericClass = faultMetaData.getJavaType();
- Class<? extends Exception> serviceExClass =
serviceExGenericClass.asSubclass(Exception.class);
-
- Exception serviceEx;
- try
- {
- Constructor<? extends Exception> serviceExCtor =
serviceExClass.getConstructor(String.class, faultBeanClass);
- serviceEx = serviceExCtor.newInstance(soapFault.getFaultString(),
faultBean);
- }
- catch (NoSuchMethodException e)
- {
- serviceEx = toServiceException(faultBean, serviceExClass);
- }
- catch (InstantiationException e)
- {
- throw new WebServiceException("Service specific exception class
is not instantiable", e);
- }
-
- faultEx.initCause(serviceEx);
- }
- catch (BindingException e)
- {
- throw new WebServiceException(e);
- }
- catch (IllegalAccessException e)
- {
- throw new WebServiceException(e);
- }
- catch (InvocationTargetException e)
- {
- throw new WebServiceException(e.getTargetException());
- }
- }
- else
- {
- log.debug("Cannot find fault meta data for: " + xmlName);
- }
- }
- }
-
- return faultEx;
- }
-
- private static Exception toServiceException(Object faultBean, Class<? extends
Exception> serviceExClass) throws IllegalAccessException, InvocationTargetException
- {
- Class<?> faultBeanClass = faultBean.getClass();
- XmlType xmlType = faultBeanClass.getAnnotation(XmlType.class);
-
- if (xmlType == null)
- throw new WebServiceException("@XmlType annotation missing from fault bean
class: " + faultBeanClass.getName());
-
- String[] propertyNames = xmlType.propOrder();
- Class<?>[] propertyTypes = new Class<?>[propertyNames.length];
- Object[] propertyValues = new Object[propertyNames.length];
-
- for (int i = 0; i < propertyNames.length; i++)
- {
- String propertyName = propertyNames[i];
- propertyName = Character.toUpperCase(propertyName.charAt(0)) +
propertyName.substring(1);
-
- Method propertyGetter;
- try
- {
- propertyGetter = faultBeanClass.getMethod("get" + propertyName);
- }
- catch (NoSuchMethodException e)
- {
- try
- {
- propertyGetter = faultBeanClass.getMethod("is" + propertyName);
- }
- catch (NoSuchMethodException ee)
- {
- throw new WebServiceException("Fault bean has no getter for property:
" + propertyName, ee);
- }
- }
- propertyValues[i] = propertyGetter.invoke(faultBean);
- propertyTypes[i] = propertyGetter.getReturnType();
- }
-
- try
- {
- Constructor<? extends Exception> serviceExCtor =
serviceExClass.getConstructor(propertyTypes);
- return serviceExCtor.newInstance(propertyValues);
- }
- catch (NoSuchMethodException e)
- {
- throw new WebServiceException("Service exception has no constructor for
parameter types: " + Arrays.toString(propertyTypes));
- }
- catch (InstantiationException e)
- {
- throw new WebServiceException("Service exception is not instantiable",
e);
- }
- }
-
- /** Translate the request exception into a SOAPFault message. */
- public static SOAPMessage exceptionToFaultMessage(Exception reqEx)
- {
- log.error("SOAP request exception", reqEx);
-
- try
- {
- SOAPMessage faultMessage;
- if (reqEx instanceof SOAPFaultException)
- {
- faultMessage = toSOAPMessage((SOAPFaultException)reqEx);
- }
- else if (reqEx instanceof javax.xml.rpc.soap.SOAPFaultException)
- {
- /* this exception should not occur in JAX-WS endpoints, but JBossWS
- * throws it to signal internal error conditions */
- faultMessage = SOAPFaultHelperJAXRPC.exceptionToFaultMessage(reqEx);
- }
- else
- {
- faultMessage = toSOAPMessage(reqEx);
- }
-
- return faultMessage;
- }
- catch (SOAPException ex)
- {
- log.error("Error creating SOAPFault message", ex);
- throw new WebServiceException("Cannot create SOAPFault message for: "
+ reqEx);
- }
- }
-
- private static SOAPMessage toSOAPMessage(SOAPFaultException faultEx) throws
SOAPException
- {
- MessageFactory factory = MessageFactory.newInstance();
- SOAPMessage soapMessage = factory.createMessage();
-
- SOAPBody soapBody = soapMessage.getSOAPBody();
- populateSOAPFault(soapBody, faultEx);
-
- /* detail
- * X. Serialized service specific exception
- * 2. SOAPFaultException.getFault().getDetail() */
- Detail detail = faultEx.getFault().getDetail();
- if (detail != null)
- soapBody.getFault().addChildElement(detail);
-
- return soapMessage;
- }
-
- private static void populateSOAPFault(SOAPBody soapBody, SOAPFaultException faultEx)
throws SOAPException
- {
- SOAPFault sourceFault = faultEx.getFault();
-
- /* JAX-WS 10.2.2.3: the fields of the fault message are populated according to the
- * following rules of precedence: */
-
- /* faultcode
- * 1. SOAPFaultException.getFault().getFaultCodeAsQName()
- * X. env:Server (Subcode omitted for SOAP 1.2) */
- Name faultCode = sourceFault.getFaultCodeAsName();
- if (faultCode != null)
- {
- faultCode = new NameImpl(faultCode.getLocalName(), "codeNS",
faultCode.getURI());
- }
- else
- {
- faultCode = getFallbackFaultCode();
- }
-
- /* faultstring
- * 1. SOAPFaultException.getFault().getFaultString()
- * X. Exception.getMessage()
- * X. Exception.toString() */
- String faultString = sourceFault.getFaultString();
- if (faultString == null)
- faultString = getFallbackFaultString(faultEx);
-
- SOAPFault targetFault = soapBody.addFault(faultCode, faultString);
-
- /* faultactor
- * 1. SOAPFaultException.getFault().getFaultActor()
- * 2. Empty */
- String faultActor = sourceFault.getFaultActor();
- if (faultActor != null)
- targetFault.setFaultActor(faultActor);
- }
-
- private static SOAPMessage toSOAPMessage(Exception ex) throws SOAPException
- {
- MessageFactory factory = MessageFactory.newInstance();
- SOAPMessage soapMessage = factory.createMessage();
-
- SOAPBody soapBody = soapMessage.getSOAPBody();
- SOAPFault soapFault;
-
- /* JAX-WS 6.4.1: When an implementation catches an exception thrown by a
- * service endpoint implementation and the cause of that exception is an
- * instance of the appropriate ProtocolException subclass for the protocol
- * in use, an implementation MUST reflect the information contained in the
- * ProtocolException subclass within the generated protocol level fault. */
- Throwable cause = ex.getCause();
- if (cause instanceof SOAPFaultException)
- {
- populateSOAPFault(soapBody, (SOAPFaultException)cause);
- soapFault = soapBody.getFault();
- }
- else
- {
- soapFault = soapBody.addFault(getFallbackFaultCode(),
getFallbackFaultString(ex));
- }
-
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- SerializationContext serContext = msgContext.getSerializationContext();
-
- NameImpl faultCode = (NameImpl)soapFault.getFaultCodeAsName();
- if (faultCode.getURI().length() > 0)
- serContext.getNamespaceRegistry().registerQName(faultCode.toQName());
-
- OperationMetaData opMetaData = msgContext.getOperationMetaData();
- Class<? extends Exception> exClass = ex.getClass();
- if (opMetaData != null && opMetaData.getFault(exClass) != null)
- {
- FaultMetaData faultMetaData = opMetaData.getFault(exClass);
- Class faultBeanClass = faultMetaData.getFaultBean();
- Object faultBean;
- try
- {
- try
- {
- /* JAX-WS 3.7: For exceptions that match the pattern described in section
- * 2.5 (i.e. exceptions that have a getFaultInfo method), the FaultBean
- * is used as input to JAXB */
- Method getFaultInfo = exClass.getMethod("getFaultInfo");
- faultBean = getFaultInfo.invoke(ex);
- }
- catch (NoSuchMethodException e)
- {
- /* JAX-WS 3.7: For exceptions that do not match the pattern described in
- * section 2.5, JAX-WS maps those exceptions to Java beans and then uses
- * those Java beans as input to the JAXB mapping. */
- faultBean = toFaultBean(ex, faultBeanClass);
- }
- }
- catch (IllegalAccessException e)
- {
- throw new WebServiceException(e);
- }
- catch (InvocationTargetException e)
- {
- throw new WebServiceException(e.getTargetException());
- }
-
- Detail detail = soapFault.addDetail();
- SOAPElement detailEntry = toDetailEntry(faultBean, serContext, faultMetaData);
- detail.addChildElement(detailEntry);
- }
- else
- {
- log.debug("Cannot obtain fault meta data for: " + exClass);
- }
-
- return soapMessage;
- }
-
- private static Name getFallbackFaultCode()
- {
- /* faultcode
- * X. SOAPFaultException.getFault().getFaultCodeAsQName()
- * 2. env:Server (Subcode omitted for SOAP 1.2) */
- return new NameImpl(Constants.SOAP11_FAULT_CODE_SERVER);
- }
-
- private static String getFallbackFaultString(Exception ex)
- {
- /* faultstring
- * X. SOAPFaultException.getFault().getFaultString()
- * 2. Exception.getMessage()
- * 3. Exception.toString() */
- String faultString = ex.getMessage();
-
- if (faultString == null)
- faultString = ex.toString();
-
- return faultString;
- }
-
- private static Object toFaultBean(Exception userEx, Class faultBeanClass) throws
IllegalAccessException, InvocationTargetException
- {
- Object faultBean;
- try
- {
- faultBean = faultBeanClass.newInstance();
- }
- catch (InstantiationException e)
- {
- throw new WebServiceException("Fault bean class is not instantiable",
e);
- }
-
- /* For each getter in the exception and its superclasses, a property of
- * the same type and name is added to the bean. The getCause, getLocalizedMessage
- * and getStackTrace getters from java.lang.Throwable and the getClass getter
- * from java.lang.Object are excluded from the list of getters to be mapped. */
- for (Method exMethod : userEx.getClass().getMethods())
- {
- if (exMethod.getParameterTypes().length > 0)
- continue;
-
- String exMethodName = exMethod.getName();
-
- if (excludedGetters.contains(exMethodName))
- continue;
-
- String propertyName;
- if (exMethodName.startsWith("get"))
- {
- propertyName = exMethodName.substring(3);
- }
- else if (exMethodName.startsWith("is"))
- {
- propertyName = exMethodName.substring(2);
- }
- else continue;
-
- // get the property value from the exception
- Object propertyValue = exMethod.invoke(userEx);
- Class propertyClass = exMethod.getReturnType();
-
- try
- {
- // set the value to the bean
- Method beanSetter = faultBeanClass.getMethod("set" + propertyName,
propertyClass);
- beanSetter.invoke(faultBean, propertyValue);
- }
- catch (NoSuchMethodException e)
- {
- throw new WebServiceException("Fault bean has no setter for property:
" + propertyName, e);
- }
- }
-
- return faultBean;
- }
-
- private static SOAPElement toDetailEntry(Object faultObject, SerializationContext
serContext, FaultMetaData faultMetaData) throws SOAPException
- {
- QName xmlName = faultMetaData.getXmlName();
- xmlName = serContext.getNamespaceRegistry().registerQName(xmlName);
-
- // Get the serializer from the type mapping
- QName xmlType = faultMetaData.getXmlType();
- Class javaType = faultMetaData.getFaultBean() != null ?
faultMetaData.getFaultBean() : faultMetaData.getJavaType();
- SerializerFactoryBase serFactory =
(SerializerFactoryBase)serContext.getTypeMapping().getSerializer(javaType, xmlType);
- if (serFactory == null)
- throw new WebServiceException("Cannot obtain serializer factory:
xmlType=" + xmlType + ", javaType=" + javaType);
-
- try
- {
- SerializerSupport ser = serFactory.getSerializer();
- String xmlFragment = ser.serialize(xmlName, xmlType, faultObject, serContext,
null);
-
- SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
- Element domElement = DOMUtils.parse(xmlFragment);
- return soapFactory.createElement(domElement, true);
- }
- catch (BindingException e)
- {
- throw new WebServiceException(e);
- }
- catch (IOException e)
- {
- throw new WebServiceException(e);
- }
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/SOAPFaultHelperJAXWS.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/SOAPFaultHelperJAXWS.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/SerializationContextJAXWS.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/SerializationContextJAXWS.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/SerializationContextJAXWS.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,40 +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.core.jaxws;
-
-// $Id$
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
-
-/**
- * The serialization context for JAXWS endpoints/clients
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 03-Jul-2006
- */
-public class SerializationContextJAXWS extends SerializationContext
-{
- // provide logging
- private static final Logger log = Logger.getLogger(SerializationContextJAXWS.class);
-
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/SerializationContextJAXWS.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/SerializationContextJAXWS.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/WebServiceContextImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/WebServiceContextImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/WebServiceContextImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,64 +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.core.jaxws;
-
-import java.security.Principal;
-
-import javax.xml.ws.WebServiceContext;
-import javax.xml.ws.handler.MessageContext;
-
-import org.jboss.util.NotImplementedException;
-
-/**
- * A WebServiceContext makes it possible for a web service endpoint implementation
- * class to access message context and security information relative to a request
- * being served. Typically a WebServiceContext is injected into an endpoint
implementation
- * class using the Resource annotation.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 03-May-2006
- */
-public class WebServiceContextImpl implements WebServiceContext
-{
- private MessageContext messageContext;
-
-
- public WebServiceContextImpl(MessageContext messageContext)
- {
- this.messageContext = messageContext;
- }
-
- public MessageContext getMessageContext()
- {
- return messageContext;
- }
-
- public Principal getUserPrincipal()
- {
- throw new NotImplementedException();
- }
-
- public boolean isUserInRole(String role)
- {
- throw new NotImplementedException();
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/WebServiceContextImpl.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/WebServiceContextImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/WrapperGenerator.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/WrapperGenerator.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/WrapperGenerator.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,99 +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.core.jaxws;
-
-import java.beans.Introspector;
-import java.lang.reflect.Method;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.SortedMap;
-import java.util.TreeMap;
-
-import org.jboss.ws.metadata.umdm.FaultMetaData;
-import org.jboss.ws.metadata.umdm.ParameterMetaData;
-
-
-/**
- * Base class for JAX-WS wrapper generation.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public abstract class WrapperGenerator
-{
- private static Set<String> excludedGetters;
- protected ClassLoader loader;
-
- public WrapperGenerator(ClassLoader loader)
- {
- this.loader = loader;
- }
-
- static
- {
- excludedGetters = new HashSet<String>(4);
- excludedGetters.add("getCause");
- excludedGetters.add("getClass");
- excludedGetters.add("getLocalizedMessage");
- excludedGetters.add("getStackTrace");
- }
-
- protected SortedMap<String, Class<?>>
getExceptionProperties(Class<?> exception)
- {
- if (! Exception.class.isAssignableFrom(exception))
- throw new IllegalArgumentException("Not an exception");
-
- TreeMap<String, Class<?>> sortedGetters = new TreeMap<String,
Class<?>>();
-
- for (Method method : exception.getMethods())
- {
- if (java.lang.reflect.Modifier.isStatic(method.getModifiers()))
- continue;
-
- Class<?> returnType = method.getReturnType();
- if (returnType == void.class)
- continue;
-
- String name = method.getName();
- if (excludedGetters.contains(name))
- continue;
-
- int offset;
- if (name.startsWith("get"))
- offset = 3;
- else if (name.startsWith("is"))
- offset = 2;
- else
- continue;
-
- name = Introspector.decapitalize(name.substring(offset));
- sortedGetters.put(name, returnType);
- }
-
- return sortedGetters;
- }
-
-
-
- public abstract void generate(ParameterMetaData pmd);
- public abstract void generate(FaultMetaData fmd);
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/WrapperGenerator.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/WrapperGenerator.java)
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/binding (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/binding)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/binding/BindingExt.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/binding/BindingExt.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/binding/BindingExt.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,42 +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.core.jaxws.binding;
-
-import java.util.List;
-
-import javax.xml.ws.Binding;
-import javax.xml.ws.handler.Handler;
-
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-
-// $Id$
-
-/**
- * Extension to JAXWS protocol bindings.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 04-Jul-2006
- */
-public interface BindingExt extends Binding
-{
- public List<Handler> getHandlerChain(HandlerType handlerType);
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/binding/BindingExt.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/binding/BindingExt.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/binding/BindingImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/binding/BindingImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/binding/BindingImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,77 +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.core.jaxws.binding;
-
-// $Id: $
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import javax.xml.ws.handler.Handler;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-
-/**
- * The Binding interface is the base interface for JAXWS protocol bindings.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 04-Jul-2006
- */
-public class BindingImpl implements BindingExt
-{
- // provide logging
- private static Logger log = Logger.getLogger(BindingImpl.class);
-
- private List<Handler> preHandlerChain = new ArrayList<Handler>();
- private List<Handler> jaxwsHandlerChain = new ArrayList<Handler>();
- private List<Handler> postHandlerChain = new ArrayList<Handler>();
-
- public List<Handler> getHandlerChain(HandlerType handlerType)
- {
- List<Handler> handlerChain = new ArrayList<Handler>();
-
- if (handlerType == HandlerType.PRE || handlerType == HandlerType.ALL)
- handlerChain.addAll(preHandlerChain);
-
- if (handlerType == HandlerType.ENDPOINT || handlerType == HandlerType.ALL)
- handlerChain.addAll(jaxwsHandlerChain);
-
- if (handlerType == HandlerType.POST || handlerType == HandlerType.ALL)
- handlerChain.addAll(postHandlerChain);
-
- return Collections.unmodifiableList(handlerChain);
- }
-
- public List<Handler> getHandlerChain()
- {
- log.debug("getHandlerChain: " + jaxwsHandlerChain);
- return jaxwsHandlerChain;
- }
-
- public void setHandlerChain(List<Handler> handlerChain)
- {
- log.debug("setHandlerChain: " + handlerChain);
- this.jaxwsHandlerChain = handlerChain;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/binding/BindingImpl.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/binding/BindingImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/binding/BindingProviderImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/binding/BindingProviderImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxws/binding/BindingProviderImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,105 +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.core.jaxws.binding;
-
-// $Id$
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.xml.ws.Binding;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.Service.Mode;
-import javax.xml.ws.http.HTTPBinding;
-import javax.xml.ws.soap.SOAPBinding;
-
-import org.jboss.ws.core.jaxrpc.binding.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
- * for request and response message processing.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 04-Jul-2006
- */
-public class BindingProviderImpl extends CommonBindingProvider implements
BindingProvider
-{
- private Map<String, Object> requestContext = new HashMap<String,
Object>();
- private Map<String, Object> responseContext = new HashMap<String,
Object>();
-
- public BindingProviderImpl(EndpointMetaData epMetaData)
- {
- super(epMetaData);
- }
-
- public BindingProviderImpl(String bindingId)
- {
- super(bindingId, Type.JAXWS);
- }
-
- @Override
- protected void initBinding(String bindingId, Type type)
- {
- if (epMetaData != null && epMetaData.getServiceMode() == Mode.MESSAGE)
- {
- binding = new MessageBinding();
- }
- else if (epMetaData != null && epMetaData.getServiceMode() ==
Mode.PAYLOAD)
- {
- binding = new PayloadBinding();
- }
- else if (SOAPBinding.SOAP11HTTP_BINDING.equals(bindingId))
- {
- binding = new SOAP11BindingJAXWS();
- }
- else if (SOAPBinding.SOAP12HTTP_BINDING.equals(bindingId))
- {
- binding = new SOAP12BindingJAXWS();
- }
- else if (HTTPBinding.HTTP_BINDING.equals(bindingId))
- {
- binding = new HTTPBindingJAXWS();
- }
- else
- {
- throw new WebServiceException("Unsupported binding: " + bindingId);
- }
- }
-
- public Map<String, Object> getRequestContext()
- {
- return requestContext;
- }
-
- public Map<String, Object> getResponseContext()
- {
- return responseContext;
- }
-
- public Binding getBinding()
- {
- return (Binding)binding;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/binding/BindingProviderImpl.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/binding/BindingProviderImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/binding/HTTPBindingJAXWS.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/binding/HTTPBindingJAXWS.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/binding/HTTPBindingJAXWS.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,85 +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.core.jaxws.binding;
-
-// $Id$
-
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.handler.Handler;
-import javax.xml.ws.http.HTTPBinding;
-
-import org.jboss.util.NotImplementedException;
-import org.jboss.ws.core.EndpointInvocation;
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.CommonBinding;
-import org.jboss.ws.core.soap.UnboundHeader;
-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.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 04-Jul-2006
- */
-public class HTTPBindingJAXWS implements CommonBinding, BindingExt, HTTPBinding
-{
- private BindingImpl delegate = new BindingImpl();
-
- public Object bindRequestMessage(OperationMetaData opMetaData, EndpointInvocation
epInv, Map<QName, UnboundHeader> unboundHeaders) throws BindingException
- {
- throw new NotImplementedException();
- }
-
- public Object bindResponseMessage(OperationMetaData opMetaData, EndpointInvocation
epInv) throws BindingException
- {
- throw new NotImplementedException();
- }
-
- public EndpointInvocation unbindRequestMessage(OperationMetaData opMetaData, Object
reqMessage) throws BindingException
- {
- throw new NotImplementedException();
- }
-
- public void unbindResponseMessage(OperationMetaData opMetaData, Object resMessage,
EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders) throws
BindingException
- {
- throw new NotImplementedException();
- }
-
- public List<Handler> getHandlerChain()
- {
- return delegate.getHandlerChain();
- }
-
- public List<Handler> getHandlerChain(HandlerType handlerType)
- {
- return delegate.getHandlerChain(handlerType);
- }
-
- public void setHandlerChain(List<Handler> handlerChain)
- {
- delegate.setHandlerChain(handlerChain);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/binding/HTTPBindingJAXWS.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/binding/HTTPBindingJAXWS.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/binding/MessageBinding.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/binding/MessageBinding.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/binding/MessageBinding.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,149 +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.core.jaxws.binding;
-
-// $Id$
-
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.handler.Handler;
-
-import org.jboss.logging.Logger;
-import org.jboss.util.NotImplementedException;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.EndpointInvocation;
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.CommonBinding;
-import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.core.soap.UnboundHeader;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-import org.jboss.ws.metadata.umdm.ParameterMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-
-/** A binding for unprocessed SOAP Messages
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 27-Jun-2006
- */
-public class MessageBinding implements CommonBinding, BindingExt
-{
- // provide logging
- private static final Logger log = Logger.getLogger(MessageBinding.class);
-
- // Delegate to JAXWS binding
- private BindingImpl delegate = new BindingImpl();
-
- /** On the client side, generate the payload from IN parameters. */
- public SOAPMessage bindRequestMessage(OperationMetaData opMetaData, EndpointInvocation
epInv, Map<QName, UnboundHeader> unboundHeaders) throws BindingException
- {
- throw new NotImplementedException();
- }
-
- /** On the server side, extract the IN parameters from the payload and populate an
Invocation object */
- public EndpointInvocation unbindRequestMessage(OperationMetaData opMetaData, Object
reqMessage) throws BindingException
- {
- log.debug("unbindRequestMessage: " + opMetaData.getQName());
-
- try
- {
- // Construct the endpoint invocation object
- EndpointInvocation epInv = new EndpointInvocation(opMetaData);
-
- SOAPMessageContextJAXWS msgContext =
(SOAPMessageContextJAXWS)MessageContextAssociation.peekMessageContext();
- if (msgContext == null)
- throw new WSException("MessageContext not available");
-
- ParameterMetaData paramMetaData = opMetaData.getParameters().get(0);
- QName xmlName = paramMetaData.getXmlName();
- epInv.setRequestParamValue(xmlName, reqMessage);
-
- 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
- {
- SOAPMessageContextJAXWS msgContext =
(SOAPMessageContextJAXWS)MessageContextAssociation.peekMessageContext();
- if (msgContext == null)
- throw new WSException("MessageContext not available");
-
- // Associate current message with message context
- SOAPMessage resMessage = (SOAPMessage)epInv.getReturnValue();
- msgContext.setMessage(resMessage);
-
- 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 resMessage,
EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders)
- throws BindingException
- {
- throw new NotImplementedException();
- }
-
- public List<Handler> getHandlerChain()
- {
- return delegate.getHandlerChain();
- }
-
- public List<Handler> getHandlerChain(HandlerType handlerType)
- {
- return delegate.getHandlerChain(handlerType);
- }
-
- public void setHandlerChain(List<Handler> handlerChain)
- {
- delegate.setHandlerChain(handlerChain);
- }
-
- 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: trunk/src/main/java/org/jboss/ws/core/jaxws/binding/MessageBinding.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/binding/MessageBinding.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/binding/PayloadBinding.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/binding/PayloadBinding.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/binding/PayloadBinding.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,163 +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.core.jaxws.binding;
-
-// $Id$
-
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.transform.Source;
-import javax.xml.ws.handler.Handler;
-
-import org.jboss.logging.Logger;
-import org.jboss.util.NotImplementedException;
-import org.jboss.ws.Constants;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.EndpointInvocation;
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.CommonBinding;
-import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.core.soap.MessageFactoryImpl;
-import org.jboss.ws.core.soap.SOAPBodyImpl;
-import org.jboss.ws.core.soap.SOAPMessageImpl;
-import org.jboss.ws.core.soap.UnboundHeader;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-import org.jboss.ws.metadata.umdm.ParameterMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-
-/** A BindingProvider for a JAXWS payload
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 27-Jun-2006
- */
-public class PayloadBinding implements CommonBinding, BindingExt
-{
- // provide logging
- private static final Logger log = Logger.getLogger(PayloadBinding.class);
-
- // Delegate to JAXWS binding
- private BindingImpl delegate = new BindingImpl();
-
- /** On the client side, generate the payload from IN parameters. */
- public Object bindRequestMessage(OperationMetaData opMetaData, EndpointInvocation
epInv, Map<QName, UnboundHeader> unboundHeaders) throws BindingException
- {
- throw new NotImplementedException();
- }
-
- /** 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
- {
- // Construct the endpoint invocation object
- EndpointInvocation epInv = new EndpointInvocation(opMetaData);
-
- SOAPMessageContextJAXWS msgContext =
(SOAPMessageContextJAXWS)MessageContextAssociation.peekMessageContext();
- if (msgContext == null)
- throw new WSException("MessageContext not available");
-
- ParameterMetaData paramMetaData = opMetaData.getParameters().get(0);
- QName xmlName = paramMetaData.getXmlName();
-
- SOAPMessage reqMessage = (SOAPMessage)payload;
- SOAPBodyImpl soapBody = (SOAPBodyImpl)reqMessage.getSOAPBody();
- Source source = soapBody.getPayload();
- epInv.setRequestParamValue(xmlName, source);
-
- 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
- {
- SOAPMessageContextJAXWS msgContext =
(SOAPMessageContextJAXWS)MessageContextAssociation.peekMessageContext();
- if (msgContext == null)
- throw new WSException("MessageContext not available");
-
- // Associate current message with message context
- MessageFactoryImpl factory = new MessageFactoryImpl();
- factory.setEnvelopeURI(Constants.NS_SOAP11_ENV);
- SOAPMessageImpl resMessage = (SOAPMessageImpl)factory.createMessage();
- msgContext.setMessage(resMessage);
-
- Source payload = (Source)epInv.getReturnValue();
- SOAPBodyImpl soapBody = (SOAPBodyImpl)resMessage.getSOAPBody();
- soapBody.setPayload(payload);
-
- 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 resMessage,
EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders)
- throws BindingException
- {
- throw new NotImplementedException();
- }
-
- public List<Handler> getHandlerChain()
- {
- return delegate.getHandlerChain();
- }
-
- public List<Handler> getHandlerChain(HandlerType handlerType)
- {
- return delegate.getHandlerChain(handlerType);
- }
-
- public void setHandlerChain(List<Handler> handlerChain)
- {
- delegate.setHandlerChain(handlerChain);
- }
-
- 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: trunk/src/main/java/org/jboss/ws/core/jaxws/binding/PayloadBinding.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/binding/PayloadBinding.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAP11BindingJAXWS.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAP11BindingJAXWS.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAP11BindingJAXWS.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,103 +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.core.jaxws.binding;
-
-// $Id: SOAPBindingImpl.java 716 2006-08-09 16:42:10Z thomas.diesler(a)jboss.com $
-
-import java.net.URI;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.handler.Handler;
-import javax.xml.ws.soap.SOAPBinding;
-
-import org.jboss.ws.Constants;
-import org.jboss.ws.core.jaxrpc.binding.CommonSOAP11Binding;
-import org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS;
-import org.jboss.ws.core.soap.SOAPFaultImpl;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-
-/**
- * The JAXWS SOAP11Binding
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 04-Jul-2006
- */
-public class SOAP11BindingJAXWS extends CommonSOAP11Binding implements BindingExt,
SOAPBinding
-{
- // Delegate to JAXWS SOAP binding
- private SOAPBindingJAXWS delegate = new SOAPBindingJAXWS();
-
- public SOAP11BindingJAXWS()
- {
- }
-
- public void setSOAPActionHeader(OperationMetaData opMetaData, SOAPMessage reqMessage)
- {
- delegate.setSOAPActionHeader(opMetaData, reqMessage);
- }
-
- public Set<URI> getRoles()
- {
- // 10.3 Conformance (Default role visibility): An implementation MUST include the
required next and ultimate
- // receiver roles in the Set returned from SOAPBinding.getRoles.
- // In SOAP 1.1 the ultimate receiver role is identified by omission of the actor
attribute from a SOAP header.
- Set<URI> soap11Roles = new HashSet<URI>(delegate.getRoles());
- soap11Roles.add(URI.create(Constants.URI_SOAP11_NEXT_ACTOR));
- return soap11Roles;
- }
-
- public void setRoles(Set<URI> roles)
- {
- delegate.setRoles(roles);
- }
-
- public List<Handler> getHandlerChain()
- {
- return delegate.getHandlerChain();
- }
-
- public List<Handler> getHandlerChain(HandlerType handlerType)
- {
- return delegate.getHandlerChain(handlerType);
- }
-
- public void setHandlerChain(List<Handler> handlerChain)
- {
- delegate.setHandlerChain(handlerChain);
- }
-
- @Override
- protected void throwFaultException(SOAPFaultImpl fault) throws Exception
- {
- throw SOAPFaultHelperJAXWS.getSOAPFaultException(fault);
- }
-
- @Override
- public SOAPMessage exceptionToFaultMessage(Exception ex)
- {
- return SOAPFaultHelperJAXWS.exceptionToFaultMessage(ex);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAP11BindingJAXWS.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAP11BindingJAXWS.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAP12BindingJAXWS.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAP12BindingJAXWS.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAP12BindingJAXWS.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,111 +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.core.jaxws.binding;
-
-// $Id: SOAPBindingImpl.java 716 2006-08-09 16:42:10Z thomas.diesler(a)jboss.com $
-
-import java.net.URI;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.handler.Handler;
-import javax.xml.ws.soap.SOAPBinding;
-
-import org.jboss.ws.Constants;
-import org.jboss.ws.core.jaxrpc.binding.CommonSOAP12Binding;
-import org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS;
-import org.jboss.ws.core.soap.SOAPFaultImpl;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-
-/**
- * The SOAP11Binding
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 04-Jul-2006
- */
-public class SOAP12BindingJAXWS extends CommonSOAP12Binding implements BindingExt,
SOAPBinding
-{
- // Delegate to JAXWS SOAP binding
- private SOAPBindingJAXWS delegate = new SOAPBindingJAXWS();
-
- public SOAP12BindingJAXWS()
- {
- }
-
- public void setSOAPActionHeader(OperationMetaData opMetaData, SOAPMessage reqMessage)
- {
- delegate.setSOAPActionHeader(opMetaData, reqMessage);
- }
-
- public Set<URI> getRoles()
- {
- // 10.3 Conformance (Default role visibility): An implementation MUST include the
required next and ultimate
- // receiver roles in the Set returned from SOAPBinding.getRoles.
- Set<URI> soap12Roles = new HashSet<URI>(delegate.getRoles());
- soap12Roles.add(URI.create(Constants.URI_SOAP12_ROLE_NEXT));
- soap12Roles.add(URI.create(Constants.URI_SOAP12_ROLE_ULTIMATE_RECEIVER));
- return soap12Roles;
- }
-
- public void setRoles(Set<URI> roles)
- {
- // 10.5 Conformance (None role error): An implementation MUST throw
WebServiceException if a client
- // attempts to configure the binding to play the none role via
SOAPBinding.setRoles.
- for (URI role : roles)
- {
- if (role.equals(Constants.URI_SOAP12_ROLE_NONE))
- throw new WebServiceException("Attempt to configure the binding to play
the none role");
- }
- delegate.setRoles(roles);
- }
-
- public List<Handler> getHandlerChain()
- {
- return delegate.getHandlerChain();
- }
-
- public List<Handler> getHandlerChain(HandlerType handlerType)
- {
- return delegate.getHandlerChain(handlerType);
- }
-
- public void setHandlerChain(List<Handler> handlerChain)
- {
- delegate.setHandlerChain(handlerChain);
- }
-
- @Override
- protected void throwFaultException(SOAPFaultImpl fault) throws Exception
- {
- throw SOAPFaultHelperJAXWS.getSOAPFaultException(fault);
- }
-
- @Override
- public SOAPMessage exceptionToFaultMessage(Exception ex)
- {
- return SOAPFaultHelperJAXWS.exceptionToFaultMessage(ex);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAP12BindingJAXWS.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAP12BindingJAXWS.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAPBindingJAXWS.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAPBindingJAXWS.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAPBindingJAXWS.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,86 +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.core.jaxws.binding;
-
-// $Id$
-
-import java.net.URI;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.xml.soap.MimeHeaders;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.BindingProvider;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-
-/**
- * The SOAPBinding interface is an abstraction for the SOAP binding.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 04-Jul-2006
- */
-class SOAPBindingJAXWS extends BindingImpl
-{
- // provide logging
- private static Logger log = Logger.getLogger(SOAPBindingJAXWS.class);
-
- private Set<URI> roles = new HashSet<URI>();
-
- public Set<URI> getRoles()
- {
- return roles;
- }
-
- public void setRoles(Set<URI> roles)
- {
- this.roles = roles;
- }
-
- public void setSOAPActionHeader(OperationMetaData opMetaData, SOAPMessage reqMessage)
- {
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- MimeHeaders mimeHeaders = reqMessage.getMimeHeaders();
- String soapAction = opMetaData.getSOAPAction();
-
- // R2744 A HTTP request MESSAGE MUST contain a SOAPAction HTTP header field
- // with a quoted value equal to the value of the soapAction attribute of
- // soapbind:operation, if present in the corresponding WSDL description.
-
- // R2745 A HTTP request MESSAGE MUST contain a SOAPAction HTTP header field
- // with a quoted empty string value, if in the corresponding WSDL description,
- // the soapAction attribute of soapbind:operation is either not present, or
- // present with an empty string as its value.
-
- if (msgContext.getProperty(BindingProvider.SOAPACTION_USE_PROPERTY) != null)
- log.info("Ignore BindingProvider.SOAPACTION_USE_PROPERTY because of BP-1.0
R2745, R2745");
-
- String soapActionProperty =
(String)msgContext.getProperty(BindingProvider.SOAPACTION_URI_PROPERTY);
- if (soapActionProperty != null)
- soapAction = soapActionProperty;
-
- mimeHeaders.addHeader("SOAPAction", soapAction != null ? soapAction :
"");
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAPBindingJAXWS.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAPBindingJAXWS.java)
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/client (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/client)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,250 +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.core.jaxws.client;
-
-// $Id$
-
-import java.rmi.RemoteException;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.Binding;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.handler.Handler;
-import javax.xml.ws.handler.HandlerResolver;
-import javax.xml.ws.handler.MessageContext;
-import javax.xml.ws.http.HTTPBinding;
-import javax.xml.ws.http.HTTPException;
-import javax.xml.ws.soap.SOAPBinding;
-import javax.xml.ws.soap.SOAPFaultException;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.CommonClient;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.jaxrpc.binding.CommonBindingProvider;
-import org.jboss.ws.core.jaxws.binding.BindingExt;
-import org.jboss.ws.core.jaxws.binding.BindingProviderImpl;
-import org.jboss.ws.core.jaxws.handler.HandlerChainExecutor;
-import org.jboss.ws.core.jaxws.handler.MessageContextJAXWS;
-import org.jboss.ws.core.jaxws.handler.PortInfoImpl;
-import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-
-/**
- * Provides support for the dynamic invocation of a service endpoint.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Jul-2006
- */
-public class ClientImpl extends CommonClient implements BindingProvider
-{
- // provide logging
- private static Logger log = Logger.getLogger(ClientImpl.class);
-
- public ClientImpl(EndpointMetaData epMetaData, HandlerResolver handlerResolver)
- {
- super(epMetaData);
- setTargetEndpointAddress(epMetaData.getEndpointAddress());
- initBindingHandlerChain(epMetaData, handlerResolver);
- }
-
- // Init the cilent handler chain in the binding
- private void initBindingHandlerChain(EndpointMetaData epMetaData, HandlerResolver
handlerResolver)
- {
- Binding binding = getBindingProvider().getBinding();
- if (handlerResolver != null)
- {
- PortInfoImpl portInfo = new PortInfoImpl(epMetaData);
- List<Handler> handlerChain = binding.getHandlerChain();
- for (Handler handler : handlerResolver.getHandlerChain(portInfo))
- {
- handlerChain.add(handler);
- }
- }
- }
-
- @Override
- protected boolean callRequestHandlerChain(QName portName, HandlerType type)
- {
- BindingExt binding = (BindingExt)getBindingProvider().getBinding();
- HandlerChainExecutor executor = new HandlerChainExecutor(epMetaData,
binding.getHandlerChain(type));
- MessageContext msgContext =
(MessageContext)MessageContextAssociation.peekMessageContext();
- return executor.handleRequest(msgContext);
- }
-
- @Override
- protected boolean callResponseHandlerChain(QName portName, HandlerType type)
- {
- BindingExt binding = (BindingExt)getBindingProvider().getBinding();
- HandlerChainExecutor executor = new HandlerChainExecutor(epMetaData,
binding.getHandlerChain(type));
- MessageContext msgContext =
(MessageContext)MessageContextAssociation.peekMessageContext();
- return executor.handleResponse(msgContext);
- }
-
- @Override
- protected void setInboundContextProperties()
- {
- // Mark the message context as outbound
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- msgContext.setProperty(MessageContextJAXWS.MESSAGE_OUTBOUND_PROPERTY, new
Boolean(false));
- }
-
- @Override
- protected void setOutboundContextProperties()
- {
- // Mark the message context as outbound
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- msgContext.setProperty(MessageContextJAXWS.MESSAGE_OUTBOUND_PROPERTY, new
Boolean(true));
- }
-
- // Invoked by the proxy invokation handler
- public Object invoke(QName opName, Object[] args, Map<String, Object>
resContext) throws RemoteException
- {
- // Associate a message context with the current thread
- SOAPMessageContextJAXWS msgContext = new SOAPMessageContextJAXWS();
- MessageContextAssociation.pushMessageContext(msgContext);
-
- // The contents of the request context are used to initialize the message context
(see section 9.4.1)
- // prior to invoking any handlers (see chapter 9) for the outbound message. Each
property within the
- // request context is copied to the message context with a scope of HANDLER.
- Map<String, Object> reqContext = getBindingProvider().getRequestContext();
- msgContext.putAll(reqContext);
-
- try
- {
- Object retObj = invoke(opName, args, null, resContext, false);
- return retObj;
- }
- catch (Exception ex)
- {
- OperationMetaData opMetaData = getOperationMetaData();
- if (opMetaData.isOneWay())
- {
- handleOneWayException(opMetaData, ex);
- }
- else
- {
- handleRemoteException(opMetaData, ex);
- }
- return null;
- }
- finally
- {
- // Reset the message context association
- MessageContextAssociation.popMessageContext();
- }
- }
-
- /**
- * 6.7 Conformance (One-way operations): When sending a one-way message,
implementations
- * a WebServiceException if any error is detected when sending the message.
- */
- private void handleOneWayException(OperationMetaData opMetaData, Exception ex)
- {
- if (ex instanceof WebServiceException)
- {
- throw (WebServiceException)ex;
- }
- else
- {
- throw new WebServiceException(ex);
- }
- }
-
- /**
- * 4.2.4 Conformance (Remote Exceptions): If an error occurs during a remote
operation invocation, an implemention
- * MUST throw a service specific exception if possible. If the error cannot be mapped
to a service
- * specific exception, an implementation MUST throw a ProtocolException or one of its
subclasses, as
- * appropriate for the binding in use. See section 6.4.1 for more details.
- */
- private void handleRemoteException(OperationMetaData opMetaData, Exception ex)
- {
- String bindingId = opMetaData.getEndpointMetaData().getBindingId();
- if (SOAPBinding.SOAP11HTTP_BINDING.equals(bindingId) ||
SOAPBinding.SOAP12HTTP_BINDING.equals(bindingId))
- {
- if (ex instanceof SOAPFaultException)
- {
- throw (SOAPFaultException)ex;
- }
- else
- {
- throw new SOAPFaultException(ex);
- }
- }
- else if (HTTPBinding.HTTP_BINDING.equals(bindingId))
- {
- // FIXME: provide actual status code
- throw new HTTPException(-1);
- }
- else
- {
- throw new WebServiceException("Unsuported binding: " + bindingId);
- }
- }
-
- @Override
- public void setTargetEndpointAddress(String endpointAddress)
- {
- getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
endpointAddress);
- }
-
- @Override
- public String getTargetEndpointAddress()
- {
- return (String)getRequestContext().get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
- }
-
- @Override
- protected CommonBindingProvider getCommonBindingProvider()
- {
- if (bindingProvider == null)
- {
- bindingProvider = new BindingProviderImpl(getEndpointMetaData());
- }
- return bindingProvider;
- }
-
- public Map<String, Object> getRequestContext()
- {
- return getBindingProvider().getRequestContext();
- }
-
- public Map<String, Object> getResponseContext()
- {
- return getBindingProvider().getResponseContext();
- }
-
- public Binding getBinding()
- {
- return getBindingProvider().getBinding();
- }
-
- public BindingProvider getBindingProvider()
- {
- return (BindingProvider)getCommonBindingProvider();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientProxy.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientProxy.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientProxy.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,278 +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.core.jaxws.client;
-
-// $Id:ClientProxy.java 1054 2006-09-26 10:33:43Z thomas.diesler(a)jboss.com $
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.rmi.RemoteException;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.UUID;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Future;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.AsyncHandler;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.Response;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.soap.SOAPFaultException;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.utils.JavaUtils;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-
-/**
- * The dynamic proxy that delegates to the underlying client implementation
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Jul-2006
- */
-public class ClientProxy implements InvocationHandler
-{
- // provide logging
- private static final Logger log = Logger.getLogger(ClientProxy.class);
-
- // The underlying Call
- private ClientImpl client;
- // List<Method> of the Stub methods
- private List stubMethods;
- // List<Method> of the Object methods
- private List objectMethods;
- // The service configured executor
- private ExecutorService executor;
-
- // The set of standard properties
- private static final Set<String> standardProperties = new
HashSet<String>();
- static
- {
- standardProperties.add(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
- standardProperties.add(BindingProvider.SESSION_MAINTAIN_PROPERTY);
- standardProperties.add(BindingProvider.USERNAME_PROPERTY);
- standardProperties.add(BindingProvider.PASSWORD_PROPERTY);
- standardProperties.add(BindingProvider.SOAPACTION_USE_PROPERTY);
- standardProperties.add(BindingProvider.SOAPACTION_URI_PROPERTY);
- }
-
- public ClientProxy(ExecutorService executor, ClientImpl client)
- {
- this.client = client;
- this.executor = executor;
- this.stubMethods = Arrays.asList(BindingProvider.class.getMethods());
- this.objectMethods = Arrays.asList(Object.class.getMethods());
- }
-
- /** Processes a method invocation on a proxy instance and returns the result.
- */
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
- {
- // An invocation on the Stub interface
- String methodName = method.getName();
- if (stubMethods.contains(method))
- {
- Method stubMethod = ClientImpl.class.getMethod(methodName,
method.getParameterTypes());
- return stubMethod.invoke(client, args);
- }
-
- // An invocation on proxy's Object class
- else if (objectMethods.contains(method))
- {
- Method objMethod = ClientImpl.class.getMethod(methodName,
method.getParameterTypes());
- return objMethod.invoke(client, args);
- }
-
- // An invocation on the service endpoint interface
- else
- {
- EndpointMetaData epMetaData = client.getEndpointMetaData();
- OperationMetaData opMetaData = epMetaData.getOperation(method);
- if (opMetaData == null)
- throw new WSException("Cannot obtain operation meta data for: " +
methodName);
-
- QName opName = opMetaData.getQName();
-
- if (log.isTraceEnabled())
- log.trace("Invoke method: " + method + opMetaData);
-
- try
- {
- Object retObj;
- Class retType = method.getReturnType();
- boolean isAsync = methodName.endsWith(Constants.ASYNC_METHOD_SUFFIX);
-
- // Invoke asynchronously
- if (isAsync && JavaUtils.isAssignableFrom(Response.class, retType))
- {
- retObj = invokeAsync(opName, args, retType);
- }
- // Invoke asynchronously with handler
- else if (isAsync && JavaUtils.isAssignableFrom(Future.class, retType)
&& args.length > 1)
- {
- Object handler = args[args.length - 1];
- retObj = invokeAsync(opName, args, retType, (AsyncHandler)handler);
- }
- // Invoke synchronously
- else
- {
- Map<String, Object> resContext =
client.getBindingProvider().getResponseContext();
- retObj = invoke(opName, args, retType, resContext);
- }
- return retObj;
- }
- catch (Exception ex)
- {
- handleException(ex);
- return null;
- }
- }
- }
-
- private Object invoke(QName opName, Object[] args, Class retType, Map<String,
Object> resContext) throws RemoteException
- {
- Object retObj = client.invoke(opName, args, resContext);
- if (retObj != null)
- {
- if (retType == null)
- throw new WSException("Return value not supported by: " + opName);
-
- if (JavaUtils.isPrimitive(retType))
- retObj = JavaUtils.getPrimitiveValueArray(retObj);
- }
- return retObj;
- }
-
- private Response invokeAsync(QName opName, Object[] args, Class retType)
- {
- ResponseImpl response = new ResponseImpl();
- Runnable task = new AsyncRunnable(response, null, opName, args, retType);
-
- log.debug("Schedule task " +
((AsyncRunnable)task).getTaskID().toString());
-
- Future future = executor.submit(task);
- response.setFuture(future);
- return response;
- }
-
- private Future invokeAsync(QName opName, Object[] args, Class retType, AsyncHandler
handler)
- {
- ResponseImpl response = new ResponseImpl();
- Runnable task = new AsyncRunnable(response, handler, opName, args, retType);
- Future future = executor.submit(task);
- response.setFuture(future);
- return response;
- }
-
- /**
- * 4.2.4 Conformance (Remote Exceptions): If an error occurs during a remote
operation invocation, an implemention
- * MUST throw a service specific exception if possible. If the error cannot be mapped
to a service
- * specific exception, an implementation MUST throw a ProtocolException or one of its
subclasses, as
- * appropriate for the binding in use. See section 6.4.1 for more details.
- */
- private void handleException(Exception ex) throws Throwable
- {
- Throwable th = ex;
- if (ex instanceof SOAPFaultException)
- {
- // The cause of a SOAPFaultException, if any, is the service specific exception
- Throwable cause = ex.getCause();
- if (cause != null)
- {
- th = cause;
- }
- }
- throw th;
- }
-
- class AsyncRunnable implements Runnable
- {
- private ResponseImpl response;
- private AsyncHandler handler;
- private QName opName;
- private Object[] args;
- private Class retType;
- private UUID uuid;
-
- public AsyncRunnable(ResponseImpl response, AsyncHandler handler, QName opName,
Object[] args, Class retType)
- {
- this.response = response;
- this.handler = handler;
- this.opName = opName;
- this.args = args;
- this.retType = retType;
- this.uuid = UUID.randomUUID();
- }
-
- public void run()
- {
- try
- {
- Map<String, Object> resContext = response.getContext();
- Object result = invoke(opName, args, retType, resContext);
-
- log.debug("Finished task " + getTaskID().toString()+": "
+ result);
-
- response.set(result);
-
- // Call the handler if available
- if (handler != null)
- handler.handleResponse(response);
- }
- catch (Exception ex)
- {
- handleAsynInvokeException(ex);
- }
- }
-
- // 4.18 Conformance (Failed Dispatch.invokeAsync): When an operation is invoked
using an invokeAsync
- // method, an implementation MUST throw a WebServiceException if there is any error
in the configuration
- // of the Dispatch instance. Errors that occur during the invocation are reported
when the client
- // attempts to retrieve the results of the operation.
- private void handleAsynInvokeException(Exception ex)
- {
- String msg = "Cannot dispatch message";
- log.error(msg, ex);
-
- WebServiceException wsex;
- if (ex instanceof WebServiceException)
- {
- wsex = (WebServiceException)ex;
- }
- else
- {
- wsex = new WebServiceException(msg, ex);
- }
- response.setException(wsex);
- }
-
- public UUID getTaskID() {
- return uuid;
- }
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientProxy.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientProxy.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,361 +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.core.jaxws.client;
-
-// $Id$
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.StringReader;
-import java.util.Map;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Future;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.soap.MessageFactory;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.transform.Source;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.ws.AsyncHandler;
-import javax.xml.ws.Binding;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.Dispatch;
-import javax.xml.ws.Response;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.Service.Mode;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.jaxws.binding.BindingProviderImpl;
-import org.jboss.ws.core.soap.SOAPBodyImpl;
-import org.jboss.ws.core.soap.SOAPConnectionImpl;
-import org.jboss.ws.core.utils.DOMWriter;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-
-/**
- * The Dispatch interface provides support for the dynamic invocation of a service
endpoint operations.
- * The javax.xml.ws.Service interface acts as a factory for the creation of Dispatch
instances.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 04-Jul-2006
- */
-public class DispatchImpl<T> implements Dispatch<T>
-{
- // provide logging
- private final Logger log = Logger.getLogger(DispatchImpl.class);
-
- private BindingProvider bindingProvider;
- private EndpointMetaData epMetaData;
- private JAXBContext jaxbContext;
- private ExecutorService executor;
- private Class type;
- private Mode mode;
-
- public DispatchImpl(ExecutorService executor, EndpointMetaData epMetaData,
Class<T> type, Mode mode)
- {
- this.bindingProvider = new BindingProviderImpl(epMetaData.getBindingId());
- this.epMetaData = epMetaData;
- this.executor = executor;
- this.type = type;
- this.mode = mode;
- initDispatch();
- }
-
- public DispatchImpl(ExecutorService executor, EndpointMetaData epMetaData, JAXBContext
jbc, Mode mode)
- {
- this.bindingProvider = new BindingProviderImpl(epMetaData.getBindingId());
- this.epMetaData = epMetaData;
- this.executor = executor;
- this.type = Object.class;
- this.jaxbContext = jbc;
- this.mode = mode;
- initDispatch();
- }
-
- public T invoke(T obj)
- {
- T retObj = null;
- try
- {
- retObj = (T)invokeInternal(obj, getResponseContext());
- }
- catch (Exception ex)
- {
- handleInvokeException(ex);
- }
- return retObj;
- }
-
- private Object invokeInternal(Object obj, Map<String, Object> resContext) throws
SOAPException
- {
- SOAPMessage reqMsg = getRequestMessage(obj);
- String targetAddress = epMetaData.getEndpointAddress();
- SOAPMessage resMsg = new SOAPConnectionImpl().call(reqMsg, targetAddress);
- Object retObj = getReturnObject(resMsg);
- return retObj;
- }
-
- public Response invokeAsync(Object obj)
- {
- ResponseImpl response = new ResponseImpl();
- Runnable task = new AsyncRunnable(response, null, obj);
- Future future = executor.submit(task);
- response.setFuture(future);
- return response;
- }
-
- public Future invokeAsync(T obj, AsyncHandler<T> handler)
- {
- ResponseImpl response = new ResponseImpl();
- Runnable task = new AsyncRunnable(response, handler, obj);
- Future future = executor.submit(task);
- response.setFuture(future);
- return response;
- }
-
- public void invokeOneWay(Object obj)
- {
- SOAPMessage reqMsg = getRequestMessage(obj);
- try
- {
- String targetAddress = epMetaData.getEndpointAddress();
- new SOAPConnectionImpl().callOneWay(reqMsg, targetAddress);
- }
- catch (Exception ex)
- {
- handleInvokeException(ex);
- }
- }
-
- // 4.17. Conformance (Failed Dispatch.invoke): When an operation is invoked using an
invoke method, an
- // implementation MUST throw a WebServiceException if there is any error in the
configuration of the
- // Dispatch instance or a ProtocolException if an error occurs during the remote
operation invocation.
- //
- // 4.19 Conformance (Failed Dispatch.invokeOneWay): When an operation is invoked
using an invoke-
- // OneWay method, an implementation MUST throw a WebServiceException if there is any
error in the
- // configuration of the Dispatch instance or if an error is detected1 during the
remote operation invocation.
- private void handleInvokeException(Exception ex)
- {
- if (ex instanceof WebServiceException)
- {
- throw (WebServiceException)ex;
- }
-
- String msg = "Cannot dispatch message";
- log.error(msg, ex);
- throw new WebServiceException(msg, ex);
- }
-
- public Map<String, Object> getRequestContext()
- {
- return bindingProvider.getRequestContext();
- }
-
- public Map<String, Object> getResponseContext()
- {
- return bindingProvider.getResponseContext();
- }
-
- public Binding getBinding()
- {
- return bindingProvider.getBinding();
- }
-
- private void initDispatch()
- {
- if (SOAPMessage.class.isAssignableFrom(type) && mode == Mode.MESSAGE)
- {
- // accepted
- }
- else if (Source.class.isAssignableFrom(type))
- {
- // accepted
- }
- else if (jaxbContext != null && mode == Mode.PAYLOAD)
- {
- // accepted
- }
- else
- {
- throw new WebServiceException("Illegal argument combination [type=" +
(type != null ? type.getName() : null) + ",mode=" + mode + "]");
- }
- }
-
- private SOAPMessage getRequestMessage(Object obj)
- {
- SOAPMessage reqMsg = null;
- try
- {
- MessageFactory factory = MessageFactory.newInstance();
- if (SOAPMessage.class.isAssignableFrom(type))
- {
- reqMsg = (SOAPMessage)obj;
- }
- else if (Source.class.isAssignableFrom(type))
- {
- Source source = (Source)obj;
- if (mode == Mode.PAYLOAD)
- {
- reqMsg = factory.createMessage();
- SOAPBodyImpl soapBody = (SOAPBodyImpl)reqMsg.getSOAPBody();
- soapBody.setPayload(source);
- }
- if (mode == Mode.MESSAGE)
- {
- TransformerFactory tf = TransformerFactory.newInstance();
- ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
- tf.newTransformer().transform(source, new StreamResult(baos));
- reqMsg = factory.createMessage(null, new
ByteArrayInputStream(baos.toByteArray()));
- }
- }
- else if (jaxbContext != null)
- {
- Marshaller marshaller = jaxbContext.createMarshaller();
- marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);
- ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
- marshaller.marshal(obj, baos);
-
- reqMsg = factory.createMessage();
- SOAPBodyImpl soapBody = (SOAPBodyImpl)reqMsg.getSOAPBody();
- StreamSource source = new StreamSource(new
ByteArrayInputStream(baos.toByteArray()));
- soapBody.setPayload(source);
- }
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WebServiceException("Cannot create request message", ex);
- }
-
- if (reqMsg == null)
- throw new WebServiceException("Cannot create request message for: " +
obj);
-
- return reqMsg;
- }
-
- private Object getReturnObject(SOAPMessage resMsg)
- {
- Object retObj = null;
- try
- {
- if (SOAPMessage.class.isAssignableFrom(type))
- {
- retObj = resMsg;
- }
- else if (Source.class.isAssignableFrom(type))
- {
- if (mode == Mode.PAYLOAD)
- {
- SOAPBodyImpl soapBody = (SOAPBodyImpl)resMsg.getSOAPBody();
- SOAPElement soapElement =
(SOAPElement)soapBody.getChildElements().next();
- String xmlPayload = DOMWriter.printNode(soapElement, false);
- retObj = new StreamSource(new StringReader(xmlPayload));
- }
- if (mode == Mode.MESSAGE)
- {
- SOAPEnvelope soapEnvelope = resMsg.getSOAPPart().getEnvelope();
- String xmlMessage = DOMWriter.printNode(soapEnvelope, false);
- retObj = new StreamSource(new StringReader(xmlMessage));
- }
- }
- else if (jaxbContext != null)
- {
- SOAPBodyImpl soapBody = (SOAPBodyImpl)resMsg.getSOAPBody();
- SOAPElement soapElement = (SOAPElement)soapBody.getChildElements().next();
-
- Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
- retObj = unmarshaller.unmarshal(soapElement);
- }
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WebServiceException("Cannot create request message", ex);
- }
- return retObj;
- }
-
- class AsyncRunnable implements Runnable
- {
- private ResponseImpl response;
- private AsyncHandler handler;
- private Object payload;
-
- public AsyncRunnable(ResponseImpl response, AsyncHandler handler, Object payload)
- {
- this.response = response;
- this.handler = handler;
- this.payload = payload;
- }
-
- public void run()
- {
- try
- {
- Map<String, Object> resContext = response.getContext();
- Object result = invokeInternal(payload, resContext);
- response.set(result);
-
- // Call the handler if available
- if (handler != null)
- handler.handleResponse(response);
- }
- catch (Exception ex)
- {
- handleAsynInvokeException(ex);
- }
- }
-
- // 4.18 Conformance (Failed Dispatch.invokeAsync): When an operation is invoked
using an invokeAsync
- // method, an implementation MUST throw a WebServiceException if there is any error
in the configuration
- // of the Dispatch instance. Errors that occur during the invocation are reported
when the client
- // attempts to retrieve the results of the operation.
- private void handleAsynInvokeException(Exception ex)
- {
- String msg = "Cannot dispatch message";
- log.error(msg, ex);
-
- WebServiceException wsex;
- if (ex instanceof WebServiceException)
- {
- wsex = (WebServiceException)ex;
- }
- else
- {
- wsex = new WebServiceException(msg, ex);
- }
- response.setException(wsex);
- }
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/client/ResponseImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ResponseImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/client/ResponseImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,119 +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.core.jaxws.client;
-
-// $Id$
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-
-import javax.xml.ws.Response;
-import javax.xml.ws.WebServiceException;
-
-/**
- * The Response interface provides methods used to obtain the payload and context of a
- * message sent in response to an operation invocation.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 15-Sep-2006
- */
-public class ResponseImpl implements Response
-{
- private Future delegate;
- private Object result;
- private WebServiceException exception;
- private Map<String, Object> context = new HashMap<String, Object>();
-
-
- public void setException(WebServiceException ex)
- {
- this.exception = ex;
- }
-
- public Future getFuture()
- {
- if (delegate == null)
- throw new IllegalStateException("Future not available");
-
- return delegate;
- }
-
- public void setFuture(Future delegate)
- {
- this.delegate = delegate;
- }
-
- public Map<String, Object> getContext()
- {
- return context;
- }
-
- void set(Object result)
- {
- this.result = result;
- }
-
- public boolean cancel(boolean mayInterruptIfRunning)
- {
- return getFuture().cancel(mayInterruptIfRunning);
- }
-
- public Object get() throws InterruptedException, ExecutionException
- {
- if (result == null)
- {
- getFuture().get();
- }
-
- if (exception != null)
- throw new ExecutionException(exception);
-
- return result;
- }
-
- public Object get(long timeout, TimeUnit unit) throws InterruptedException,
ExecutionException, TimeoutException
- {
- if (result == null)
- {
- getFuture().get(timeout, unit);
- }
-
- if (exception != null)
- throw new ExecutionException(exception);
-
- return result;
- }
-
- public boolean isCancelled()
- {
- return getFuture().isCancelled();
- }
-
- public boolean isDone()
- {
- return getFuture().isDone();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/client/ResponseImpl.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ResponseImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/client/ServiceObjectFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ServiceObjectFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxws/client/ServiceObjectFactory.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,221 +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.
- */
-// $Id$
-package org.jboss.ws.core.jaxws.client;
-
-// $Id$
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Hashtable;
-
-import javax.naming.Context;
-import javax.naming.Name;
-import javax.naming.NamingException;
-import javax.naming.RefAddr;
-import javax.naming.Reference;
-import javax.naming.spi.ObjectFactory;
-import javax.xml.namespace.QName;
-import javax.xml.ws.Service;
-import javax.xml.ws.WebServiceException;
-
-import org.jboss.logging.Logger;
-
-/**
- * This ServiceObjectFactory reconstructs a javax.xml.ws.Service
- * for a given WSDL when the webservice client does a JNDI lookup
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 24-Oct-2004
- */
-public class ServiceObjectFactory implements ObjectFactory
-{
- // provide logging
- private static final Logger log = Logger.getLogger(ServiceObjectFactory.class);
-
- /**
- * Creates an object using the location or reference information specified.
- * <p/>
- *
- * @param obj The possibly null object containing location or reference
- * information that can be used in creating an object.
- * @param name The name of this object relative to
<code>nameCtx</code>,
- * or null if no name is specified.
- * @param nameCtx The context relative to which the <code>name</code>
- * parameter is specified, or null if <code>name</code>
is
- * relative to the default initial context.
- * @param environment The possibly null environment that is used in
- * creating the object.
- * @return The object created; null if an object cannot be created.
- * @throws Exception if this object factory encountered an exception
- * while attempting to create an object, and no other object
factories are
- * to be tried.
- * @see javax.naming.spi.NamingManager#getObjectInstance
- * @see javax.naming.spi.NamingManager#getURLContext
- */
- public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable
environment) throws Exception
- {
- try
- {
- Reference ref = (Reference)obj;
-
- String serviceTypeName =
(String)ref.get(ServiceReferenceable.SERVICE_TYPE).getContent();
- String portTypeName =
(String)ref.get(ServiceReferenceable.PORT_TYPE).getContent();
- UnifiedServiceRef serviceRef = unmarshallServiceRef(ref);
-
- ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
- Class serviceType = ctxLoader.loadClass(serviceTypeName);
- Class portType = (portTypeName != null ? ctxLoader.loadClass(portTypeName) :
null);
-
- if (Service.class.isAssignableFrom(serviceType) == false)
- throw new IllegalArgumentException("WebServiceRef type '" +
serviceType + "' is not assignable to javax.xml.ws.Service");
-
- Object target;
-
- URL wsdlURL = getWsdlLocationURL(serviceType, serviceRef.getWsdlLocation());
-
- // Generic javax.xml.ws.Service
- if (serviceType == Service.class)
- {
- if (wsdlURL != null)
- {
- target = Service.create(wsdlURL, null);
- }
- else
- {
- throw new IllegalArgumentException("Cannot create generic
javax.xml.ws.Service without wsdlLocation");
- }
- }
- // Generated javax.xml.ws.Service subclass
- else
- {
- if (wsdlURL != null)
- {
- Constructor ctor = serviceType.getConstructor(new Class[] { URL.class,
QName.class });
- target = (Service)ctor.newInstance(new Object[] { wsdlURL, null });
- }
- else
- {
- target = (Service)serviceType.newInstance();
- }
- }
-
- if (portTypeName != null && portTypeName.equals(serviceTypeName) ==
false)
- {
- Object port = null;
- for (Method method : serviceType.getMethods())
- {
- String methodName = method.getName();
- Class retType = method.getReturnType();
- if (methodName.startsWith("get") &&
portType.isAssignableFrom(retType))
- {
- port = method.invoke(target, new Object[0]);
- target = port;
- break;
- }
- }
-
- if (port == null)
- throw new WebServiceException("Cannot find getter for port type:
" + portTypeName);
- }
-
- return target;
- }
- catch (Exception ex)
- {
- log.error("Cannot create service", ex);
- throw ex;
- }
- }
-
- private UnifiedServiceRef unmarshallServiceRef(Reference ref) throws
ClassNotFoundException, NamingException
- {
- UnifiedServiceRef sref;
- RefAddr refAddr = ref.get(ServiceReferenceable.SERVICE_REF);
- ByteArrayInputStream bais = new
ByteArrayInputStream((byte[])refAddr.getContent());
- try
- {
- ObjectInputStream ois = new ObjectInputStream(bais);
- sref = (UnifiedServiceRef)ois.readObject();
- ois.close();
- }
- catch (IOException e)
- {
- throw new NamingException("Cannot unmarshall service ref meta data, cause:
" + e.toString());
- }
- return sref;
- }
-
- private URL getWsdlLocationURL(Class type, String wsdlLocation)
- {
- URL wsdlURL = null;
- if (wsdlLocation != null && wsdlLocation.length() > 0)
- {
- // Try the wsdlLocation as URL
- try
- {
- wsdlURL = new URL(wsdlLocation);
- }
- catch (MalformedURLException ex)
- {
- // ignore
- }
-
- // Try the filename as File
- if (wsdlURL == null)
- {
- try
- {
- File file = new File(wsdlLocation);
- if (file.exists())
- wsdlURL = file.toURL();
- }
- catch (MalformedURLException e)
- {
- // ignore
- }
- }
-
- // Try the filename as Resource
- if (wsdlURL == null)
- {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- wsdlURL = loader.getResource(wsdlLocation);
- }
-
- // Try the filename relative to class
- if (wsdlURL == null)
- {
- String packagePath = type.getPackage().getName().replace('.',
'/');
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- wsdlURL = loader.getResource(packagePath + "/" + wsdlLocation);
- }
- }
- return wsdlURL;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/client/ServiceObjectFactory.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ServiceObjectFactory.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/client/ServiceReferenceable.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ServiceReferenceable.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxws/client/ServiceReferenceable.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,97 +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.
- */
-// $Id$
-package org.jboss.ws.core.jaxws.client;
-
-// $Id$
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-
-import javax.naming.BinaryRefAddr;
-import javax.naming.NamingException;
-import javax.naming.Reference;
-import javax.naming.Referenceable;
-import javax.naming.StringRefAddr;
-
-
-
-/**
- * A JNDI reference to a javax.xml.ws.Service
- *
- * It holds the information to reconstrut the javax.xml.ws.Service
- * when the client does a JNDI lookup.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 24-Oct-2006
- */
-public class ServiceReferenceable implements Referenceable
-{
- public static final String SERVICE_REF = "SERVICE_REF";
- public static final String SERVICE_TYPE = "SERVICE_TYPE";
- public static final String PORT_TYPE = "PORT_TYPE";
-
- private String serviceType;
- private String portType;
- private UnifiedServiceRef sref;
-
- public ServiceReferenceable(String serviceType, String portType, UnifiedServiceRef
sref)
- {
- this.serviceType = serviceType;
- this.portType = portType;
- this.sref = sref;
- }
-
- /**
- * Retrieves the Reference of this object.
- *
- * @return The non-null Reference of this object.
- * @throws javax.naming.NamingException If a naming exception was encountered while
retrieving the reference.
- */
- public Reference getReference() throws NamingException
- {
- Reference myRef = new Reference(ServiceReferenceable.class.getName(),
ServiceObjectFactory.class.getName(), null);
-
- myRef.add(new StringRefAddr(SERVICE_TYPE, serviceType));
- myRef.add(new StringRefAddr(PORT_TYPE, portType));
- myRef.add(new BinaryRefAddr(SERVICE_REF, marshallServiceRef()));
-
- return myRef;
- }
-
- private byte[] marshallServiceRef() throws NamingException
- {
- ByteArrayOutputStream baos = new ByteArrayOutputStream(512);
- try
- {
- ObjectOutputStream oos = new ObjectOutputStream(baos);
- oos.writeObject(sref);
- oos.close();
- }
- catch (IOException e)
- {
- throw new NamingException("Cannot marshall service ref, cause: " +
e.toString());
- }
- return baos.toByteArray();
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/client/ServiceReferenceable.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ServiceReferenceable.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/client/UnifiedServiceRef.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/client/UnifiedServiceRef.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/client/UnifiedServiceRef.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,103 +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.core.jaxws.client;
-
-//$Id$
-
-import java.io.Serializable;
-
-/**
- * Represents a <service-ref> element of the jboss.xml, jboss-web.xml,
jboss-client.xml deployment descriptor
- * for the 5.0 schema
- *
- * @author Thomas.Diesler(a)jboss.com
- */
-public class UnifiedServiceRef implements Serializable
-{
- private static final long serialVersionUID = 223039007880052172L;
-
- private String encName;
- private String wsdlLocation;
- private String configName;
- private String configFile;
-
- public UnifiedServiceRef()
- {
- }
-
- public UnifiedServiceRef(String name)
- {
- this.encName = name;
- }
-
- public String getEncName()
- {
- return encName;
- }
-
- public void setEncName(String name)
- {
- this.encName = name;
- }
-
- public String getWsdlLocation()
- {
- return wsdlLocation;
- }
-
- public void setWsdlLocation(String wsdlLocation)
- {
- this.wsdlLocation = wsdlLocation;
- }
-
- public String getConfigFile()
- {
- return configFile;
- }
-
- public void setConfigFile(String configFile)
- {
- this.configFile = configFile;
- }
-
- public String getConfigName()
- {
- return configName;
- }
-
- public void setConfigName(String configName)
- {
- this.configName = configName;
- }
-
- public String toString()
- {
- StringBuilder sb = new StringBuilder();
- sb.append("[");
- sb.append("name=").append(encName);
- sb.append(",config-name=").append(configName);
- sb.append(",config-file=").append(configFile);
- sb.append(",wsdl=").append(wsdlLocation);
- sb.append("]");
- return sb.toString();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/client/UnifiedServiceRef.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/client/UnifiedServiceRef.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/client/WebServiceRefDeployer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/client/WebServiceRefDeployer.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxws/client/WebServiceRefDeployer.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,85 +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.core.jaxws.client;
-
-// $Id$
-
-import javax.naming.Context;
-import javax.xml.ws.Service;
-import javax.xml.ws.WebServiceRef;
-
-import org.jboss.logging.Logger;
-import org.jboss.util.naming.Util;
-
-/**
- * Binds a JAXWS Service object into JNDI
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 24-Oct-2006
- */
-public class WebServiceRefDeployer
-{
- // provide logging
- private static Logger log = Logger.getLogger(WebServiceRefDeployer.class);
-
- private WebServiceRefDeployer()
- {
- // Hide ctor
- }
-
- public static void setupWebServiceRef(Context ctx, String jndiName, Class refType,
WebServiceRef wsref, UnifiedServiceRef sref) throws Exception
- {
- String externalName = ctx.getNameInNamespace() + "/" + jndiName;
- String refTypeName = (refType != null ? refType.getName() : null);
- String wsrefString = "[name=" + wsref.name() + ",value=" +
wsref.value() + ",type=" + wsref.type() + ",wsdl=" +
wsref.wsdlLocation() + ",mapped=" + wsref.mappedName() + "]";
- log.debug("setupWebServiceRef [jndi=" + externalName +
",refType=" + refTypeName + ",wsref=" + wsrefString +
",sref=" + sref + "]");
-
- String serviceTypeName = null;
- String portTypeName = null;
-
- // #1 Use the explicit @WebServiceRef.value
- if (wsref.value() != Object.class)
- serviceTypeName = wsref.value().getName();
-
- // #2 Use the target ref type
- if (serviceTypeName == null && refType != null &&
Service.class.isAssignableFrom(refType))
- serviceTypeName = refType.getName();
-
- // #3 Use javax.xml.ws.Service
- if (serviceTypeName == null)
- serviceTypeName = Service.class.getName();
-
- // #1 Use the explicit @WebServiceRef.type
- if (wsref.type() != Object.class)
- portTypeName = wsref.type().getName();
-
- // #2 Use the target ref type
- if (portTypeName == null && refType != null &&
Service.class.isAssignableFrom(refType) == false)
- portTypeName = refType.getName();
-
- // Set the wsdlLocation if there is no override already
- if (sref.getWsdlLocation() == null && wsref.wsdlLocation().length() >
0)
- sref.setWsdlLocation(wsref.wsdlLocation());
-
- Util.bind(ctx, jndiName, new ServiceReferenceable(serviceTypeName, portTypeName,
sref));
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/client/WebServiceRefDeployer.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/client/WebServiceRefDeployer.java)
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/handler (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/handler)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/handler/GenericHandler.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/handler/GenericHandler.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/handler/GenericHandler.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,81 +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.core.jaxws.handler;
-
-// $Id: $
-
-import javax.xml.ws.handler.Handler;
-import javax.xml.ws.handler.MessageContext;
-
-/**
- * A generic jaxws handler
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 13-Aug-2006
- */
-public abstract class GenericHandler implements Handler
-{
- private String handlerName;
-
- public String getHandlerName()
- {
- return handlerName;
- }
-
- public void setHandlerName(String handlerName)
- {
- this.handlerName = handlerName;
- }
-
- public boolean handleMessage(MessageContext msgContext)
- {
- Boolean outbound =
(Boolean)msgContext.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
- if (outbound == null)
- throw new IllegalStateException("Cannot obtain required property: " +
MessageContext.MESSAGE_OUTBOUND_PROPERTY);
-
- return outbound ? handleOutbound(msgContext) : handleInbound(msgContext);
- }
-
- protected boolean handleOutbound(MessageContext msgContext)
- {
- return true;
- }
-
- protected boolean handleInbound(MessageContext msgContext)
- {
- return true;
- }
-
- public boolean handleFault(MessageContext messagecontext)
- {
- return true;
- }
-
- public void close(MessageContext messageContext)
- {
- }
-
- public String toString()
- {
- return (handlerName != null ? handlerName : super.toString());
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/handler/GenericHandler.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/handler/GenericHandler.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/handler/GenericLogicalHandler.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/handler/GenericLogicalHandler.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxws/handler/GenericLogicalHandler.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,37 +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.core.jaxws.handler;
-
-// $Id$
-
-import javax.xml.ws.handler.LogicalHandler;
-import javax.xml.ws.handler.LogicalMessageContext;
-
-/**
- * A generic jaxws logical handler
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 13-Aug-2006
- */
-public class GenericLogicalHandler<C extends LogicalMessageContext> extends
GenericHandler implements LogicalHandler
-{
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/handler/GenericLogicalHandler.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/handler/GenericLogicalHandler.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/handler/GenericSOAPHandler.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/handler/GenericSOAPHandler.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/handler/GenericSOAPHandler.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,57 +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.core.jaxws.handler;
-
-// $Id: $
-
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.handler.LogicalMessageContext;
-import javax.xml.ws.handler.soap.SOAPHandler;
-
-/**
- * A generic jaxws soap handler
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 13-Aug-2006
- */
-public abstract class GenericSOAPHandler<C extends LogicalMessageContext> extends
GenericHandler implements SOAPHandler
-{
- // The header blocks that can be processed by this Handler instance
- private Set<QName> headers = new HashSet<QName>();
-
- /** Gets the header blocks that can be processed by this Handler instance.
- */
- public Set<QName> getHeaders()
- {
- return headers;
- }
-
- /** Sets the header blocks that can be processed by this Handler instance.
- */
- public void setHeaders(Set<QName> headers)
- {
- this.headers = headers;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/handler/GenericSOAPHandler.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/handler/GenericSOAPHandler.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,321 +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.core.jaxws.handler;
-
-// $Id:HandlerChainExecutor.java 710 2006-08-08 20:19:52Z thomas.diesler(a)jboss.com $
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPPart;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.handler.Handler;
-import javax.xml.ws.handler.LogicalHandler;
-import javax.xml.ws.handler.MessageContext;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.jaxrpc.Style;
-import org.jboss.ws.core.soap.SOAPEnvelopeImpl;
-import org.jboss.ws.core.utils.DOMWriter;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-
-/**
- * Executes a list of JAXWS handlers.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 06-May-2004
- */
-public class HandlerChainExecutor
-{
- private static Logger log = Logger.getLogger(HandlerChainExecutor.class);
-
- // The endpoint meta data
- private EndpointMetaData epMetaData;
- // The List<Entry> objects
- protected List<Handler> handlers = new ArrayList<Handler>();
- // The index of the first handler that returned false during processing
- protected int falseIndex = -1;
-
- /**
- * Constructs a handler chain with the given handlers
- */
- public HandlerChainExecutor(EndpointMetaData epMetaData, List<Handler>
handlerList)
- {
- this.epMetaData = epMetaData;
-
- log.debug("Create a handler executor: " + handlerList);
- for (Handler handler : handlerList)
- {
- handlers.add(handler);
- }
- }
-
- /**
- * Indicates the end of lifecycle for a HandlerChain.
- */
- public void close()
- {
- log.debug("close");
- for (Handler handler : handlers)
- {
- handler.close(null);
- }
- }
-
- public boolean handleRequest(MessageContext msgContext)
- {
- boolean doNext = true;
-
- if (handlers.size() > 0)
- {
- log.debug("Enter: handleRequest");
-
- SOAPMessageContextJAXWS soapContext = (SOAPMessageContextJAXWS)msgContext;
- soapContext.setProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM,
Boolean.TRUE);
-
- int handlerIndex = 0;
- Handler currHandler = null;
- try
- {
- String lastMessageTrace = null;
- for (; doNext && handlerIndex < handlers.size(); handlerIndex++)
- {
- currHandler = handlers.get(handlerIndex);
-
- if (log.isTraceEnabled())
- {
- SOAPPart soapPart = soapContext.getMessage().getSOAPPart();
- lastMessageTrace = traceSOAPPart("BEFORE handleRequest - " +
currHandler, soapPart, lastMessageTrace);
- }
-
- doNext = handleMessage(currHandler, soapContext);
-
- if (log.isTraceEnabled())
- {
- SOAPPart soapPart = soapContext.getMessage().getSOAPPart();
- lastMessageTrace = traceSOAPPart("AFTER handleRequest - " +
currHandler, soapPart, lastMessageTrace);
- }
- }
- }
- catch (Exception ex)
- {
- doNext = false;
- processHandlerFailure(ex);
- }
- finally
- {
- // we start at this index in the response chain
- if (doNext == false)
- falseIndex = (handlerIndex - 1);
-
- soapContext.removeProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
- log.debug("Exit: handleRequest with status: " + doNext);
- }
- }
-
- return doNext;
- }
-
- public boolean handleResponse(MessageContext msgContext)
- {
- boolean doNext = true;
-
- SOAPMessageContextJAXWS soapContext = (SOAPMessageContextJAXWS)msgContext;
- soapContext.setProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
-
- if (handlers.size() > 0)
- {
- log.debug("Enter: handleResponse");
-
- int handlerIndex = handlers.size() - 1;
- if (falseIndex != -1)
- handlerIndex = falseIndex;
-
- Handler currHandler = null;
- try
- {
- String lastMessageTrace = null;
- for (; doNext && handlerIndex >= 0; handlerIndex--)
- {
- currHandler = handlers.get(handlerIndex);
-
- if (log.isTraceEnabled())
- {
- SOAPPart soapPart = soapContext.getMessage().getSOAPPart();
- lastMessageTrace = traceSOAPPart("BEFORE handleResponse - " +
currHandler, soapPart, lastMessageTrace);
- }
-
- doNext = handleMessage(currHandler, soapContext);
-
- if (log.isTraceEnabled())
- {
- SOAPPart soapPart = soapContext.getMessage().getSOAPPart();
- lastMessageTrace = traceSOAPPart("AFTER handleResponse - " +
currHandler, soapPart, lastMessageTrace);
- }
- }
- }
- catch (Exception ex)
- {
- doNext = false;
- processHandlerFailure(ex);
- }
- finally
- {
- // we start at this index in the fault chain
- if (doNext == false)
- falseIndex = (handlerIndex - 1);
-
- soapContext.removeProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
- log.debug("Exit: handleResponse with status: " + doNext);
- }
- }
-
- return doNext;
- }
-
- public boolean handleFault(MessageContext msgContext)
- {
- boolean doNext = true;
-
- if (handlers.size() > 0)
- {
- log.debug("Enter: handleFault");
-
- SOAPMessageContextJAXWS soapContext = (SOAPMessageContextJAXWS)msgContext;
- soapContext.setProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM,
Boolean.TRUE);
-
- int handlerIndex = 0;
- Handler currHandler = null;
- try
- {
- String lastMessageTrace = null;
- for (; doNext && handlerIndex < handlers.size(); handlerIndex++)
- {
- currHandler = handlers.get(handlerIndex);
-
- if (log.isTraceEnabled())
- {
- SOAPPart soapPart = soapContext.getMessage().getSOAPPart();
- lastMessageTrace = traceSOAPPart("BEFORE handleFault - " +
currHandler, soapPart, lastMessageTrace);
- }
-
- doNext = handleFault(currHandler, soapContext);
-
- if (log.isTraceEnabled())
- {
- SOAPPart soapPart = soapContext.getMessage().getSOAPPart();
- lastMessageTrace = traceSOAPPart("AFTER handleFault - " +
currHandler, soapPart, lastMessageTrace);
- }
- }
- }
- catch (Exception ex)
- {
- doNext = false;
- processHandlerFailure(ex);
- }
- finally
- {
- // we start at this index in the response chain
- if (doNext == false)
- falseIndex = (handlerIndex - 1);
-
- soapContext.removeProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
- log.debug("Exit: handleFault with status: " + doNext);
- }
- }
-
- return doNext;
- }
-
- // 4.14 Conformance (Exceptions During Handler Processing): Exceptions thrown during
handler processing on
- // the client MUST be passed on to the application. If the exception in question is a
subclass of WebService-
- // Exception then an implementation MUST rethrow it as-is, without any additional
wrapping, otherwise it
- // MUST throw a WebServiceException whose cause is set to the exception that was
thrown during handler processing.
- private void processHandlerFailure(Exception ex)
- {
- log.error("Exception during handler processing", ex);
- if (ex instanceof WebServiceException)
- {
- throw (WebServiceException)ex;
- }
- throw new WebServiceException(ex);
- }
-
- private boolean handleMessage(Handler currHandler, SOAPMessageContextJAXWS
soapContext)
- {
- MessageContext handlerContext = soapContext;
- if (currHandler instanceof LogicalHandler)
- {
- if (epMetaData.getStyle() == Style.RPC)
- throw new WebServiceException("Cannot use logical handler with
RPC");
-
- handlerContext = new LogicalMessageContextImpl(soapContext);
- }
-
- boolean doNext = currHandler.handleMessage(handlerContext);
-
- return doNext;
- }
-
- private boolean handleFault(Handler currHandler, SOAPMessageContextJAXWS soapContext)
- {
- MessageContext handlerContext = soapContext;
- if (currHandler instanceof LogicalHandler)
- {
- handlerContext = new LogicalMessageContextImpl(soapContext);
- }
-
- boolean doNext = currHandler.handleFault(handlerContext);
-
- return doNext;
- }
-
- /**
- * Trace the SOAPPart, do nothing if the String representation is equal to the last
one.
- * @param logMsg TODO
- */
- protected String traceSOAPPart(String logMsg, SOAPPart soapPart, String
lastMessageTrace)
- {
- try
- {
- SOAPEnvelopeImpl soapEnv = (SOAPEnvelopeImpl)soapPart.getEnvelope();
- String envString = DOMWriter.printNode(soapEnv, true);
- if (envString.equals(lastMessageTrace))
- {
- log.trace(logMsg + ": unchanged");
- }
- else
- {
- log.trace(logMsg + "\n" + envString);
- lastMessageTrace = envString;
- }
- return lastMessageTrace;
- }
- catch (SOAPException e)
- {
- log.error("Cannot get SOAPEnvelope", e);
- return null;
- }
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,144 +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.core.jaxws.handler;
-
-// $Id:HandlerDelegateJAXWS.java 710 2006-08-08 20:19:52Z thomas.diesler(a)jboss.com $
-
-import java.util.List;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.Binding;
-import javax.xml.ws.handler.Handler;
-import javax.xml.ws.handler.PortInfo;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.server.HandlerDelegate;
-import org.jboss.ws.core.server.ServiceEndpointInfo;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-
-/** Delegates to JAXWS handlers
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 19-Jan-2005
- */
-public class HandlerDelegateJAXWS implements HandlerDelegate
-{
- // provide logging
- private static Logger log = Logger.getLogger(HandlerDelegateJAXWS.class);
-
- private HandlerResolverImpl preHandlers = new HandlerResolverImpl();
- private HandlerResolverImpl endpointHandlers = new HandlerResolverImpl();
- private HandlerResolverImpl postHandlers = new HandlerResolverImpl();
-
- public HandlerDelegateJAXWS(Binding binding)
- {
- }
-
- public boolean callRequestHandlerChain(ServiceEndpointInfo seInfo, HandlerType type)
- {
- log.debug("callRequestHandlerChain: " + type);
- SOAPMessageContextJAXWS msgContext =
(SOAPMessageContextJAXWS)MessageContextAssociation.peekMessageContext();
- EndpointMetaData epMetaData = seInfo.getServerEndpointMetaData();
-
- // Initialize the handler chain
- if (epMetaData.isHandlersInitialized() == false)
- {
- initHandlerChain(epMetaData, HandlerType.PRE);
- initHandlerChain(epMetaData, HandlerType.ENDPOINT);
- initHandlerChain(epMetaData, HandlerType.POST);
- epMetaData.setHandlersInitialized(true);
- }
-
- List<Handler> handlerChain = getHandlerChain(epMetaData, type);
- boolean status = new HandlerChainExecutor(epMetaData,
handlerChain).handleRequest(msgContext);
- return status;
- }
-
- public boolean callResponseHandlerChain(ServiceEndpointInfo seInfo, HandlerType type)
- {
- log.debug("callResponseHandlerChain: " + type);
- SOAPMessageContextJAXWS msgContext =
(SOAPMessageContextJAXWS)MessageContextAssociation.peekMessageContext();
- ServerEndpointMetaData epMetaData = seInfo.getServerEndpointMetaData();
- List<Handler> handlerChain = getHandlerChain(epMetaData, type);
- boolean status = new HandlerChainExecutor(epMetaData,
handlerChain).handleResponse(msgContext);
- return status;
- }
-
- public boolean callFaultHandlerChain(ServiceEndpointInfo seInfo, HandlerType type,
Exception ex)
- {
- log.debug("callFaultHandlerChain: " + type);
- SOAPMessageContextJAXWS msgContext =
(SOAPMessageContextJAXWS)MessageContextAssociation.peekMessageContext();
- ServerEndpointMetaData epMetaData = seInfo.getServerEndpointMetaData();
- List<Handler> handlerChain = getHandlerChain(epMetaData, type);
- boolean status = new HandlerChainExecutor(epMetaData,
handlerChain).handleFault(msgContext);
- return status;
- }
-
- private List<Handler> getHandlerChain(EndpointMetaData epMetaData, HandlerType
type)
- {
- PortInfo info = getPortInfo(epMetaData);
-
- List<Handler> handlerChain = null;
- if (type == HandlerType.PRE)
- {
- handlerChain = preHandlers.getHandlerChain(info);
- }
- else if (type == HandlerType.ENDPOINT)
- {
- handlerChain = endpointHandlers.getHandlerChain(info);
- }
- else if (type == HandlerType.POST)
- {
- handlerChain = postHandlers.getHandlerChain(info);
- }
- return handlerChain;
- }
-
- private void initHandlerChain(EndpointMetaData epMetaData, HandlerType type)
- {
- if (type == HandlerType.PRE)
- {
- preHandlers.initHandlerChain(epMetaData, type);
- }
- else if (type == HandlerType.ENDPOINT)
- {
- endpointHandlers.initHandlerChain(epMetaData, type);
- }
- else if (type == HandlerType.POST)
- {
- postHandlers.initHandlerChain(epMetaData, type);
- }
-
- }
-
- private PortInfo getPortInfo(EndpointMetaData epMetaData)
- {
- QName serviceName = epMetaData.getServiceMetaData().getServiceName();
- QName portName = epMetaData.getQName();
- String bindingId = epMetaData.getBindingId();
- PortInfo info = new PortInfoImpl(serviceName, portName, bindingId);
- return info;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerResolverImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerResolverImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerResolverImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,285 +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.core.jaxws.handler;
-
-// $Id$
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.handler.Handler;
-import javax.xml.ws.handler.HandlerResolver;
-import javax.xml.ws.handler.LogicalHandler;
-import javax.xml.ws.handler.PortInfo;
-import javax.xml.ws.http.HTTPBinding;
-import javax.xml.ws.soap.SOAPBinding;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-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
- * the handler chain set on proxy/dispatch objects at the time of their creation.
- *
- * A HandlerResolver may be set on a Service using the setHandlerResolver method.
- *
- * When the runtime invokes a HandlerResolver, it will pass it a PortInfo object
- * containing information about the port that the proxy/dispatch object will be
accessing.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 08-Aug-2006
- */
-public class HandlerResolverImpl implements HandlerResolver
-{
- private static Logger log = Logger.getLogger(HandlerResolverImpl.class);
-
- private Map<PortInfo, List<Handler>> handlerMap = new HashMap<PortInfo,
List<Handler>>();
-
- public List<Handler> getHandlerChain(PortInfo info)
- {
- log.debug("getHandlerChain: " + info);
-
- List<Handler> unsortedChain = new ArrayList<Handler>();
-
- String bindingID = info.getBindingID();
- QName serviceName = info.getServiceName();
- QName portName = info.getPortName();
-
- if (bindingID != null)
- {
- List<Handler> list = handlerMap.get(new PortInfoImpl(null, null,
bindingID));
- if (list != null)
- {
- log.debug("add protocol handlers: " + list);
- unsortedChain.addAll(list);
- }
- }
-
- if (serviceName != null)
- {
- List<Handler> list = handlerMap.get(new PortInfoImpl(serviceName, null,
null));
- if (list != null)
- {
- log.debug("add service handlers: " + list);
- unsortedChain.addAll(list);
- }
- }
-
- if (portName != null)
- {
- List<Handler> list = handlerMap.get(new PortInfoImpl(null, portName,
null));
- if (list != null)
- {
- log.debug("add port handlers: " + list);
- unsortedChain.addAll(list);
- }
- }
-
- List<Handler> list = handlerMap.get(new PortInfoImpl(null, null, null));
- if (list != null)
- {
- log.debug("add general handlers: " + list);
- unsortedChain.addAll(list);
- }
-
- // Sort handler logical handlers first
- List<Handler> sortedChain = new ArrayList<Handler>();
- for (Handler handler : unsortedChain)
- {
- if (handler instanceof LogicalHandler)
- sortedChain.add(handler);
- }
- for (Handler handler : unsortedChain)
- {
- if ((handler instanceof LogicalHandler) == false)
- sortedChain.add(handler);
- }
-
- return Collections.unmodifiableList(sortedChain);
- }
-
- public void initHandlerChain(EndpointMetaData epMetaData, HandlerType type)
- {
- log.debug("initHandlerChain: " + type);
- for (HandlerMetaData handlerMetaData : epMetaData.getHandlerMetaData(type))
- {
- HandlerMetaDataJAXWS jaxwsMetaData = (HandlerMetaDataJAXWS)handlerMetaData;
- String handlerName = jaxwsMetaData.getHandlerName();
- String className = jaxwsMetaData.getHandlerClassName();
- Set<QName> soapHeaders = jaxwsMetaData.getSoapHeaders();
-
- try
- {
- // Load the handler class using the deployments top level CL
- ClassLoader classLoader = epMetaData.getClassLoader();
- Class hClass = classLoader.loadClass(className);
- Handler handler = (Handler)hClass.newInstance();
-
- if (handler instanceof GenericHandler)
- ((GenericHandler)handler).setHandlerName(handlerName);
-
- if (handler instanceof GenericSOAPHandler)
- ((GenericSOAPHandler)handler).setHeaders(soapHeaders);
-
- List<PortInfo> infos = getPortInfo(epMetaData, jaxwsMetaData);
- for (PortInfo info : infos)
- {
- addHandler(info, handler);
- }
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WSException("Cannot load handler: " + className, ex);
- }
- }
- }
-
- private List<PortInfo> getPortInfo(EndpointMetaData epMetaData,
HandlerMetaDataJAXWS handlerMetaData)
- {
- String protocols = handlerMetaData.getProtocolBindings();
- QName services = handlerMetaData.getServiceNamePattern();
- QName ports = handlerMetaData.getPortNamePattern();
-
- List<PortInfo> infos = new ArrayList<PortInfo>();
- if (protocols != null)
- {
- for (String protocol : protocols.split("\\s"))
- {
- Map<String, String> protocolMap = new HashMap<String, String>();
- protocolMap.put("##SOAP11_HTTP", SOAPBinding.SOAP11HTTP_BINDING);
- protocolMap.put("##SOAP12_HTTP", SOAPBinding.SOAP12HTTP_BINDING);
- protocolMap.put("##XML_HTTP", HTTPBinding.HTTP_BINDING);
-
- String bindingId = protocolMap.get(protocol);
- if (bindingId != null)
- {
- if (bindingId.equals(epMetaData.getBindingId()))
- infos.add(new PortInfoImpl(null, null, bindingId));
- }
- else
- {
- log.warn("Unsuported protocol binding: " + protocol);
- }
- }
- }
- else if (services != null)
- {
- String namespaceURI = services.getNamespaceURI();
- String localPattern = services.getLocalPart();
- if (localPattern.endsWith("*"))
- {
- localPattern = localPattern.substring(0, localPattern.length() - 1);
- UnifiedMetaData wsMetaData =
epMetaData.getServiceMetaData().getUnifiedMetaData();
- for (ServiceMetaData smd : wsMetaData.getServices())
- {
- QName qname = smd.getServiceName();
- String nsURI = qname.getNamespaceURI();
- String localPart = qname.getLocalPart();
- if (nsURI.equals(namespaceURI) &&
localPart.startsWith(localPattern))
- {
- infos.add(new PortInfoImpl(qname, null, null));
- }
- }
- }
- else
- {
- UnifiedMetaData wsMetaData =
epMetaData.getServiceMetaData().getUnifiedMetaData();
- for (ServiceMetaData smd : wsMetaData.getServices())
- {
- QName qname = smd.getServiceName();
- if (services.equals(qname))
- {
- infos.add(new PortInfoImpl(qname, null, null));
- }
- }
- }
- }
- else if (ports != null)
- {
- String namespaceURI = ports.getNamespaceURI();
- String localPattern = ports.getLocalPart();
- if (localPattern.endsWith("*"))
- {
- localPattern = localPattern.substring(0, localPattern.length() - 1);
- ServiceMetaData serviceMetaData = epMetaData.getServiceMetaData();
- for (EndpointMetaData epmd : serviceMetaData.getEndpoints())
- {
- QName qname = epmd.getQName();
- String nsURI = qname.getNamespaceURI();
- String localPart = qname.getLocalPart();
- if (nsURI.equals(namespaceURI) &&
localPart.startsWith(localPattern))
- {
- infos.add(new PortInfoImpl(null, qname, null));
- }
- }
- }
- else
- {
- ServiceMetaData serviceMetaData = epMetaData.getServiceMetaData();
- for (EndpointMetaData epmd : serviceMetaData.getEndpoints())
- {
- QName qname = epmd.getQName();
- if (ports.equals(qname))
- {
- infos.add(new PortInfoImpl(null, qname, null));
- }
- }
- }
- }
- else
- {
- // add a general handler that is not scoped
- infos.add(new PortInfoImpl());
- }
-
- return infos;
- }
-
- public boolean addHandler(PortInfo info, Handler handler)
- {
- log.debug("addHandler: " + info + ":" + handler);
-
- List<Handler> handlerList = handlerMap.get(info);
- if (handlerList == null)
- {
- handlerMap.put(info, handlerList = new ArrayList<Handler>());
- }
- handlerList.add(handler);
-
- return true;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerResolverImpl.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerResolverImpl.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/jaxws/handler/LogicalMessageContextImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/handler/LogicalMessageContextImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxws/handler/LogicalMessageContextImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,60 +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.core.jaxws.handler;
-
-// $Id:LogicalMessageContextImpl.java 888 2006-09-02 00:37:13Z thomas.diesler(a)jboss.com
$
-
-import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.LogicalMessage;
-import javax.xml.ws.handler.LogicalMessageContext;
-
-/**
- * The LogicalMessageContext interface extends MessageContext to provide access to a the
- * contained message as a protocol neutral LogicalMessage.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 31-Aug-2006
- */
-public class LogicalMessageContextImpl extends MessageContextJAXWS implements
LogicalMessageContext
-{
- // The LogicalMessage in this message context
- private LogicalMessage logicalMessage;
-
- /** Default ctor */
- public LogicalMessageContextImpl(SOAPMessageContextJAXWS soapContext)
- {
- SOAPMessage soapMessage = soapContext.getMessage();
- logicalMessage = new LogicalMessageImpl(soapMessage);
-
- // Copy the context properties
- setProperties(soapContext.getProperties());
- }
-
- /**
- * Gets the message from this message context
- * @return The contained message; returns null if no message is present in this
message context
- */
- public LogicalMessage getMessage()
- {
- return logicalMessage;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/handler/LogicalMessageContextImpl.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/handler/LogicalMessageContextImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -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.core.jaxws.handler;
-
-// $Id$
-
-import java.io.StringReader;
-import java.util.Iterator;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.transform.Source;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.ws.LogicalMessage;
-import javax.xml.ws.WebServiceException;
-
-import org.jboss.ws.core.soap.SOAPBodyImpl;
-import org.jboss.ws.core.soap.SOAPContentElement;
-
-/**
- * The LogicalMessageContext interface extends MessageContext to provide access to a the
- * contained message as a protocol neutral LogicalMessage.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 31-Aug-2006
- */
-public class LogicalMessageImpl implements LogicalMessage
-{
- private SOAPBodyImpl soapBody;
-
- public LogicalMessageImpl(SOAPMessage soapMessage)
- {
- try
- {
- soapBody = (SOAPBodyImpl)soapMessage.getSOAPBody();
- }
- catch (SOAPException ex)
- {
- throw new WebServiceException("Cannot obtain xml payload", ex);
- }
- }
-
- public Source getPayload()
- {
- Source source = soapBody.getPayload();
- if (source == null)
- {
- SOAPContentElement soapElement =
(SOAPContentElement)soapBody.getChildElements().next();
- if (soapElement.isDOMValid())
- {
- source = new DOMSource(soapElement);
- }
- else
- {
- String xmlPayload = soapElement.getXMLFragment();
- source = new StreamSource(new StringReader(xmlPayload));
- }
- }
- return source;
- }
-
- public void setPayload(Source source)
- {
- soapBody.setPayload(source);
- }
-
- public Object getPayload(JAXBContext jaxbContext)
- {
- Object payload = null;
- Iterator it = soapBody.getChildElements();
- if (it.hasNext())
- {
- SOAPContentElement bodyElement = (SOAPContentElement)it.next();
- payload = bodyElement.getObjectValue();
- }
- return payload;
- }
-
- public void setPayload(Object payload, JAXBContext jaxbContext)
- {
- Iterator it = soapBody.getChildElements();
- if (it.hasNext())
- {
- SOAPContentElement bodyElement = (SOAPContentElement)it.next();
- bodyElement.setObjectValue(payload);
- }
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,150 +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.core.jaxws.handler;
-
-// $Id: MessageContextImpl.java 275 2006-05-04 21:36:29Z jason.greene(a)jboss.com $
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.ws.handler.MessageContext;
-
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
-import org.jboss.ws.core.jaxws.SerializationContextJAXWS;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.ServiceMetaData;
-import org.jboss.xb.binding.NamespaceRegistry;
-
-
-/**
- * The interface MessageContext abstracts the message context that is processed by a
handler in the handle method.
- *
- * The MessageContext interface provides methods to manage a property set.
- * MessageContext properties enable handlers in a handler chain to share processing
related state.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 25-Jul-2006
- */
-public class MessageContextJAXWS extends CommonMessageContext implements MessageContext
-{
- // The serialization context for this message ctx
- private SerializationContext serContext;
- // The map of property scopes
- private HashMap<String, Scope> scopes = new HashMap<String, Scope>();
-
- /** Get or create the serialization context
- */
- public SerializationContext getSerializationContext()
- {
- if (serContext == null)
- {
- EndpointMetaData epMetaData = getEndpointMetaData();
- ServiceMetaData serviceMetaData = epMetaData.getServiceMetaData();
-
- SerializationContextJAXWS jaxwsContext = new SerializationContextJAXWS();
- jaxwsContext.setTypeMapping(serviceMetaData.getTypeMapping());
- serContext = jaxwsContext;
- }
- return serContext;
- }
-
- /** Gets the namespace registry for this message context */
- public NamespaceRegistry getNamespaceRegistry()
- {
- return getSerializationContext().getNamespaceRegistry();
- }
-
- /** Sets the scope of a property. */
- public void setScope(String key, Scope scope)
- {
- scopes.put(key, scope);
- }
-
- /** Gets the scope of a property. */
- public Scope getScope(String key)
- {
- return scopes.get(key);
- }
-
- public int size()
- {
- return props.size();
- }
-
- public boolean isEmpty()
- {
- return props.isEmpty();
- }
-
- public boolean containsKey(Object key)
- {
- return props.containsKey(key);
- }
-
- public boolean containsValue(Object value)
- {
- return props.containsValue(value);
- }
-
- public Object get(Object key)
- {
- return props.get(key);
- }
-
- public Object put(String key, Object value)
- {
- return props.put(key, value);
- }
-
- public Object remove(Object key)
- {
- return props.remove(key);
- }
-
- public void putAll(Map<? extends String, ? extends Object> srcMap)
- {
- props.putAll(srcMap);
- }
-
- public void clear()
- {
- props.clear();
- }
-
- public Set<String> keySet()
- {
- return props.keySet();
- }
-
- public Collection<Object> values()
- {
- return props.values();
- }
-
- public Set<Entry<String, Object>> entrySet()
- {
- return props.entrySet();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/handler/PortInfoImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/handler/PortInfoImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/handler/PortInfoImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,90 +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.core.jaxws.handler;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.handler.PortInfo;
-
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-
-/**
- * The PortInfo interface is used by a HandlerResolver to query information about the
- * port it is being asked to create a handler chain for.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 03-May-2006
- */
-public class PortInfoImpl implements PortInfo
-{
- private QName serviceName;
- private QName portName;
- private String bindingID;
-
- public PortInfoImpl()
- {
- }
-
- public PortInfoImpl(EndpointMetaData epMetaData)
- {
- this.serviceName = epMetaData.getServiceMetaData().getServiceName();
- this.portName = epMetaData.getQName();
- this.bindingID = epMetaData.getBindingId();
- }
-
- public PortInfoImpl(QName serviceName, QName portName, String bindingID)
- {
- this.serviceName = serviceName;
- this.portName = portName;
- this.bindingID = bindingID;
- }
-
- public String getBindingID()
- {
- return bindingID;
- }
-
- public QName getPortName()
- {
- return portName;
- }
-
- public QName getServiceName()
- {
- return serviceName;
- }
-
- public int hashCode()
- {
- return toString().hashCode();
- }
-
- public boolean equals(Object obj)
- {
- if (!(obj instanceof PortInfoImpl)) return false;
- return (obj != null ? toString().equals(obj.toString()) : false);
- }
-
- public String toString()
- {
- return "[service=" + serviceName + ",port=" + portName +
",binding=" + bindingID + "]";
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/handler/PortInfoImpl.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/handler/PortInfoImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/handler/SOAPMessageContextJAXWS.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/handler/SOAPMessageContextJAXWS.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/jaxws/handler/SOAPMessageContextJAXWS.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,158 +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.core.jaxws.handler;
-
-// $Id: MessageContextImpl.java 275 2006-05-04 21:36:29Z jason.greene(a)jboss.com $
-
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.namespace.QName;
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPHeader;
-import javax.xml.soap.SOAPHeaderElement;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.handler.soap.SOAPMessageContext;
-
-/**
- * The interface SOAPMessageContext provides access to the SOAP message for either RPC
request or response.
- * The javax.xml.soap.SOAPMessage specifies the standard Java API for the representation
of a SOAP 1.1 message with attachments.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 25-Jul-2006
- */
-public class SOAPMessageContextJAXWS extends MessageContextJAXWS implements
SOAPMessageContext
-{
- // The SOAP actor roles
- private Set<URI> roles = new HashSet<URI>();
-
- /** Default ctor */
- public SOAPMessageContextJAXWS()
- {
- }
-
- /**
- * Gets the SOAPMessage from this message context.
- * Modifications to the returned SOAPMessage change the message in-place, there is no
need to susequently call setMessage.
- */
- public SOAPMessage getMessage()
- {
- return getSOAPMessage();
- }
-
- /**
- * Sets the SOAPMessage in this message context
- */
- public void setMessage(SOAPMessage soapMessage)
- {
- setSOAPMessage(soapMessage);
- }
-
- /**
- * Gets headers that have a particular qualified name from the message in the message
context.
- * Note that a SOAP message can contain multiple headers with the same qualified
name.
- */
- public Object[] getHeaders(QName qname, JAXBContext context, boolean allRoles)
- {
- List<Object> headers = new ArrayList<Object>();
-
- if (getSOAPMessage() != null)
- {
- try
- {
- SOAPHeader soapHeader = getSOAPMessage().getSOAPHeader();
- Iterator<SOAPHeaderElement> headerElements =
soapHeader.examineAllHeaderElements();
- while (headerElements.hasNext())
- {
- SOAPHeaderElement hElement = headerElements.next();
- Name hName = hElement.getElementName();
- if (qname.equals(new QName(hName.getURI(), hName.getLocalName())))
- {
- URI actor = new URI(hElement.getActor());
- if (roles.contains(actor) || allRoles)
- {
- headers.add(hElement);
-
- // FIXME
- // SOAPMessageContext.getHeaders should return unmarshalled objects
- //
http://jira.jboss.org/jira/browse/JBWS-1105
- }
- }
- }
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WebServiceException("Cannot get headers", ex);
- }
- }
-
- Object[] arr = new Object[headers.size()];
- headers.toArray(arr);
- return arr;
- }
-
- /**
- * Gets the SOAP actor roles associated with an execution of the handler chain.
- * Note that SOAP actor roles apply to the SOAP node and are managed using
SOAPBinding.setRoles and SOAPBinding.getRoles.
- * Handler instances in the handler chain use this information about the SOAP actor
roles to process the SOAP header blocks.
- * Note that the SOAP actor roles are invariant during the processing of SOAP message
through the handler chain.
- */
- public Set<URI> getRoles()
- {
- return roles;
- }
-
- public boolean containsProperty(String name)
- {
- return containsKey(name);
- }
-
- public Object getProperty(String name)
- {
- return get(name);
- }
-
- public Iterator getPropertyNames()
- {
- return keySet().iterator();
- }
-
- public void removeProperty(String name)
- {
- remove(name);
- }
-
- public void setProperty(String name, Object value)
- {
- put(name, value);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/handler/SOAPMessageContextJAXWS.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/handler/SOAPMessageContextJAXWS.java)
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/spi (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/spi)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,229 +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.core.jaxws.spi;
-
-// $Id$
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
-import java.util.concurrent.Executor;
-
-import javax.xml.transform.Source;
-import javax.xml.ws.Binding;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.Endpoint;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.WebServicePermission;
-
-import org.jboss.logging.Logger;
-import org.jboss.util.NotImplementedException;
-import org.jboss.ws.core.jaxws.binding.BindingProviderImpl;
-import org.jboss.ws.core.server.HttpContext;
-import org.jboss.ws.core.server.HttpServer;
-
-/**
- * A Web service endpoint implementation.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 07-Jul-2006
- */
-public class EndpointImpl extends Endpoint
-{
- // provide logging
- private final Logger log = Logger.getLogger(EndpointImpl.class);
-
- // The permission to publish an endpoint
- private static final WebServicePermission ENDPOINT_PUBLISH_PERMISSION = new
WebServicePermission("publishEndpoint");
-
- private Object implementor;
- private BindingProvider bindingProvider;
- private Map<String, Object> properties = new HashMap<String, Object>();
- private HttpContext serverContext;
- private boolean isPublished;
- private boolean isDestroyed;
-
- public EndpointImpl(String bindingId, Object implementor)
- {
- this.implementor = implementor;
- this.bindingProvider = new BindingProviderImpl(bindingId);
-
- if (implementor == null)
- throw new WebServiceException("Implementor cannot be null");
- }
-
- @Override
- public Binding getBinding()
- {
- return bindingProvider.getBinding();
- }
-
- @Override
- public Object getImplementor()
- {
- return implementor;
- }
-
- /**
- * Publishes this endpoint at the given address. The necessary server infrastructure
will be created and configured by the JAX-WS
- * implementation using some default configuration. In order to get more control over
the server configuration,
- * please use the javax.xml.ws.Endpoint#publish(Object) method instead.
- *
- * @param A URI specifying the address to use. The address must be compatible with the
binding specified at the time the endpoint was created.
- */
- @Override
- public void publish(String address)
- {
- URI addrURI;
- try
- {
- addrURI = new URI(address);
- }
- catch (URISyntaxException e)
- {
- throw new IllegalArgumentException("Invalid address: " + address);
- }
-
- // Check with the security manger
- checkPublishEndpointPermission();
-
- // Create and start the HTTP server
- HttpServer httpServer = HttpServer.create();
- httpServer.setProperties(properties);
- httpServer.start();
-
- String path = addrURI.getPath();
- String contextRoot = "/" + new StringTokenizer(path,
"/").nextToken();
- HttpContext context = httpServer.createContext(contextRoot);
-
- publish(context);
- }
-
- /**
- * Publishes this endpoint at the provided server context.
- * A server context encapsulates the server infrastructure and addressing information
for a particular transport.
- * For a call to this method to succeed, the server context passed as an argument to
it must be compatible with the endpoint's binding.
- *
- * @param serverContext An object representing a server context to be used for
publishing the endpoint.
- */
- @Override
- public void publish(Object context)
- {
- if (isDestroyed)
- throw new IllegalStateException("Endpoint already destroyed");
-
- // Check with the security manger
- checkPublishEndpointPermission();
-
- if (context instanceof HttpContext)
- {
- serverContext = (HttpContext)context;
- HttpServer httpServer = serverContext.getHttpServer();
- httpServer.publish(serverContext, this);
- isPublished = true;
- }
- }
-
- @Override
- public void stop()
- {
- if (serverContext == null || isPublished == false)
- log.error("Endpoint not published");
-
- try
- {
- if (serverContext != null)
- {
- HttpServer httpServer = serverContext.getHttpServer();
- httpServer.destroy(serverContext, this);
- }
- }
- catch (Exception ex)
- {
- log.error("Cannot stop endpoint", ex);
- }
-
- isPublished = false;
- isDestroyed = true;
- }
-
- @Override
- public boolean isPublished()
- {
- return isPublished;
- }
-
- @Override
- public List<Source> getMetadata()
- {
- throw new NotImplementedException();
- }
-
- @Override
- public void setMetadata(List<Source> list)
- {
- throw new NotImplementedException();
- }
-
- @Override
- public Executor getExecutor()
- {
- throw new NotImplementedException();
- }
-
- @Override
- public void setExecutor(Executor executor)
- {
- throw new NotImplementedException();
- }
-
- @Override
- public Map<String, Object> getProperties()
- {
- return properties;
- }
-
- @Override
- public void setProperties(Map<String, Object> map)
- {
- properties = map;
- }
-
-
- private void checkPublishEndpointPermission()
- {
- // 5.10 Conformance (Checking publishEndpoint Permission): When any of the publish
methods defined
- // by the Endpoint class are invoked, an implementation MUST check whether a
SecurityManager is
- // installed with the application. If it is, implementations MUST verify that the
application has the
- // WebServicePermission identified by the target name publishEndpoint before
proceeding. If the permission
- // is not granted, implementations MUST NOT publish the endpoint and they MUST
throw a
- // java.lang.SecurityException.
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- {
- sm.checkPermission(ENDPOINT_PUBLISH_PERMISSION);
- }
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,75 +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.core.jaxws.spi;
-
-// $Id$
-
-import java.net.URL;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.Endpoint;
-import javax.xml.ws.spi.Provider;
-import javax.xml.ws.spi.ServiceDelegate;
-
-/**
- * Service provider for ServiceDelegate and Endpoint objects.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 03-May-2006
- */
-public class ProviderImpl extends Provider
-{
- // 6.2 Conformance (Concrete javax.xml.ws.spi.Provider required): An implementation
MUST provide
- // a concrete class that extends javax.xml.ws.spi.Provider. Such a class MUST have a
public constructor
- // which takes no arguments.
- public ProviderImpl()
- {
- }
-
- @Override
- public ServiceDelegate createServiceDelegate(URL wsdlLocation, QName serviceName,
Class serviceClass)
- {
- ServiceDelegateImpl delegate = new ServiceDelegateImpl(wsdlLocation, serviceName);
- return delegate;
- }
-
- @Override
- public Endpoint createEndpoint(String bindingId, Object implementor)
- {
- EndpointImpl endpoint = new EndpointImpl(bindingId, implementor);
- return endpoint;
- }
-
- @Override
- public Endpoint createAndPublishEndpoint(String address, Object implementor)
- {
- // 6.3 Conformance (Provider createAndPublishEndpoint Method): The effect of
invoking the createAnd-
- // PublishEndpoint method on a Provider MUST be the same as first invoking the
createEndpoint
- // method with the binding ID appropriate to the URL scheme used by the address,
then invoking the
- // publish(String address) method on the resulting endpoint.
-
- String bindingId = Endpoint.getBindingFromAddress(address);
- EndpointImpl endpoint = (EndpointImpl)createEndpoint(bindingId, implementor);
- endpoint.publish(address);
- return endpoint;
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,335 +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.core.jaxws.spi;
-
-// $Id$
-
-import java.lang.reflect.Proxy;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.concurrent.Executor;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-import javax.jws.WebService;
-import javax.xml.bind.JAXBContext;
-import javax.xml.namespace.QName;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.Dispatch;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.Service.Mode;
-import javax.xml.ws.handler.HandlerResolver;
-import javax.xml.ws.spi.ServiceDelegate;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.jboss.ws.core.jaxws.client.ClientImpl;
-import org.jboss.ws.core.jaxws.client.ClientProxy;
-import org.jboss.ws.core.jaxws.client.DispatchImpl;
-import org.jboss.ws.core.jaxws.handler.HandlerResolverImpl;
-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.
- *
- * Every Service object has its own delegate, created using the
javax.xml.ws.Provider#createServiceDelegate method.
- * A Service object delegates all of its instance methods to its delegate.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 03-May-2006
- */
-public class ServiceDelegateImpl extends ServiceDelegate
-{
- // provide logging
- private final Logger log = Logger.getLogger(ServiceDelegateImpl.class);
-
- // The executor service
- private static ExecutorService defaultExecutor = Executors.newCachedThreadPool();
-
- // The service meta data that is associated with this JAXWS Service
- private ServiceMetaData serviceMetaData;
- // The ports known by this service
- private HashMap<QName, Port> ports = new HashMap<QName,Port>();
- // The handler resolver
- private HandlerResolver handlerResolver = new HandlerResolverImpl();
- // The executor service
- private ExecutorService executor;
-
- // A list of annotated ports
- private List<QName> annotatedPorts = new ArrayList<QName>();
-
- public ServiceDelegateImpl(URL wsdlURL, QName serviceName)
- {
- JAXWSClientMetaDataBuilder builder = new JAXWSClientMetaDataBuilder();
-
- ClassLoader ctxClassLoader = Thread.currentThread().getContextClassLoader();
- serviceMetaData = builder.buildMetaData(serviceName, wsdlURL, ctxClassLoader);
-
- for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
- {
- QName portName = epMetaData.getQName();
- String bindingId = epMetaData.getBindingId();
- String epAddress = epMetaData.getEndpointAddress();
- Port port = new Port (portName, bindingId, epAddress);
- ports.put(portName, port);
- }
- }
-
- /**
- * The getPort method returns a stub. A service client uses this stub to invoke
operations on the target service endpoint.
- * The serviceEndpointInterface specifies the service endpoint interface that is
supported by the created dynamic proxy or stub instance.
- */
- @Override
- public <T> T getPort(QName portName, Class<T> seiClass)
- {
- if (serviceMetaData == null)
- throw new WebServiceException("Service meta data not available");
-
- EndpointMetaData epMetaData = serviceMetaData.getEndpoint(portName);
- if (epMetaData == null)
- throw new WebServiceException("Cannot get port meta data for: " +
portName);
-
- String seiClassName = seiClass.getName();
- epMetaData.setServiceEndpointInterfaceName(seiClassName);
-
- return getPortInternal(epMetaData, seiClass);
- }
-
- @Override
- /**
- * The getPort method returns a stub. A service client uses this stub to invoke
operations on the target service endpoint.
- * The serviceEndpointInterface specifies the service endpoint interface that is
supported by the created dynamic proxy or stub instance.
- */
- public <T> T getPort(Class<T> seiClass)
- {
- if (seiClass == null)
- throw new IllegalArgumentException("service endpoint interface cannot be
null");
-
- if (serviceMetaData == null)
- throw new WebServiceException("Service meta data not available");
-
- String seiClassName = seiClass.getName();
- EndpointMetaData epMetaData =
serviceMetaData.getEndpointByServiceEndpointInterface(seiClassName);
-
- if (epMetaData == null && serviceMetaData.getEndpoints().size() == 1)
- {
- epMetaData = serviceMetaData.getEndpoints().get(0);
- epMetaData.setServiceEndpointInterfaceName(seiClassName);
- }
-
- if (epMetaData == null)
- throw new WebServiceException("Cannot get port meta data for: " +
seiClassName);
-
- return getPortInternal(epMetaData, seiClass);
- }
-
- private <T> T getPortInternal(EndpointMetaData epMetaData, Class<T>
seiClass)
- {
- QName portName = epMetaData.getQName();
- if (seiClass.isAnnotationPresent(WebService.class))
- {
- // Adjust the endpoint meta data according to the annotations
- if (annotatedPorts.contains(portName) == false)
- {
- JAXWSClientEndpointMetaDataBuilder metaDataBuilder = new
JAXWSClientEndpointMetaDataBuilder();
- metaDataBuilder.rebuildEndpointMetaData(epMetaData, seiClass);
- }
- }
- else
- {
- // TODO: should'nt this throw an exception?
- log.warn("SEI is missing @WebService annotation: " + seiClass);
- }
-
- return (T)createProxy(seiClass, epMetaData);
- }
-
- @Override
- /**
- * Creates a new port for the service.
- * Ports created in this way contain no WSDL port type information
- * and can only be used for creating Dispatchinstances.
- */
-
- public void addPort(QName portName, String bindingId, String epAddress)
- {
- Port port = new Port (portName, bindingId, epAddress);
- ports.put(portName, port);
- }
-
- @Override
- public <T> Dispatch<T> createDispatch(QName portName, Class<T> type,
Mode mode)
- {
- ExecutorService executor = (ExecutorService)getExecutor();
- EndpointMetaData epMetaData = getEndpointMetaData(portName);
- DispatchImpl dispatch = new DispatchImpl(executor, epMetaData, type, mode);
- return dispatch;
- }
-
- @Override
- public Dispatch<Object> createDispatch(QName portName, JAXBContext jbc, Mode
mode)
- {
- ExecutorService executor = (ExecutorService)getExecutor();
- EndpointMetaData epMetaData = getEndpointMetaData(portName);
- DispatchImpl dispatch = new DispatchImpl(executor, epMetaData, jbc, mode);
- return dispatch;
- }
-
- private EndpointMetaData getEndpointMetaData(QName portName)
- {
- Port port = ports.get(portName);
- if (port == null)
- throw new WebServiceException("Cannot find port: " + portName);
-
- // Create an anonymous endpoint
- EndpointMetaData epMetaData = serviceMetaData.getEndpoint(portName);
- if (epMetaData == null)
- {
- epMetaData = new ClientEndpointMetaData(serviceMetaData, new
QName(Constants.NS_JBOSSWS_URI, "AnonymousPort"), new
QName(Constants.NS_JBOSSWS_URI, "Anonymous"), Type.JAXWS);
- epMetaData.setEndpointAddress(port.getEndpointAddress());
- epMetaData.setBindingId(port.getBindingId());
- }
- return epMetaData;
- }
-
- /** Gets the name of this service. */
- @Override
- public QName getServiceName()
- {
- return serviceMetaData.getServiceName();
- }
-
- /** Returns an Iterator for the list of QNames of service endpoints grouped by this
service */
- @Override
- public Iterator<QName> getPorts()
- {
- ArrayList<QName> portNames = new ArrayList<QName>();
- for (Port port : ports.values())
- {
- portNames.add(port.getQName());
- }
- return portNames.iterator();
- }
-
- @Override
- public URL getWSDLDocumentLocation()
- {
- return serviceMetaData.getWsdlLocation();
- }
-
- @Override
- public HandlerResolver getHandlerResolver()
- {
- return handlerResolver;
- }
-
- @Override
- public void setHandlerResolver(HandlerResolver handlerResolver)
- {
- this.handlerResolver = handlerResolver;
- }
-
- @Override
- public Executor getExecutor()
- {
- if (executor == null)
- {
- executor = defaultExecutor;
- }
- return executor;
- }
-
- @Override
- public void setExecutor(Executor executor)
- {
- if ((executor instanceof ExecutorService) == false)
- throw new IllegalArgumentException("Supported executors must implement
" + ExecutorService.class.getName());
-
- this.executor = (ExecutorService)executor;
- }
-
- private <T> T createProxy(Class<T> seiClass, EndpointMetaData epMetaData)
throws WebServiceException
- {
- try
- {
- if (handlerResolver instanceof HandlerResolverImpl)
- {
- HandlerResolverImpl impl = ((HandlerResolverImpl)handlerResolver);
- impl.initHandlerChain(epMetaData, HandlerType.PRE);
- impl.initHandlerChain(epMetaData, HandlerType.ENDPOINT);
- impl.initHandlerChain(epMetaData, HandlerType.POST);
- }
-
- ExecutorService executor = (ExecutorService)getExecutor();
- ClientProxy handler = new ClientProxy(executor, new ClientImpl(epMetaData,
handlerResolver));
- ClassLoader cl = epMetaData.getClassLoader();
- T proxy = (T)Proxy.newProxyInstance(cl, new Class[] { seiClass,
BindingProvider.class }, handler);
- return proxy;
- }
- catch (WebServiceException ex)
- {
- throw ex;
- }
- catch (Exception ex)
- {
- throw new WebServiceException("Cannot create proxy", ex);
- }
- }
-
- private static class Port
- {
- private QName qname;
- private String bindingId;
- private String endpointAddress;
-
- public Port(QName qname, String bindingId, String endpointAddress)
- {
- this.qname = qname;
- this.bindingId = bindingId;
- this.endpointAddress = endpointAddress;
- }
-
- public String getBindingId()
- {
- return bindingId;
- }
-
- public String getEndpointAddress()
- {
- return endpointAddress;
- }
-
- public QName getQName()
- {
- return qname;
- }
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java)
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/util (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/util)
Deleted: trunk/src/main/java/org/jboss/ws/core/jaxws/util/FactoryFinder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/util/FactoryFinder.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/util/FactoryFinder.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,118 +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.core.jaxws.util;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.Properties;
-
-import org.jboss.logging.Logger;
-
-// $Id$
-
-/**
- * A general factory finder util
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 04-Jul-2006
- */
-public class FactoryFinder
-{
- // provide logging
- private static Logger log = Logger.getLogger(FactoryFinder.class);
-
- /**
- * The algorithm used to locate the provider subclass to use consists of the following
steps:
- *
- * - If a resource with the name of META-INF/services/javax.xml.ws.spi.Provider
exists, then its first line, if present, is used as the UTF-8 encoded name of the
implementation class.
- * - If the $java.home/lib/jaxws.properties file exists and it is readable by the
java.util.Properties.load(InputStream) method and it contains an entry whose key is
javax.xml.ws.spi.Provider, then the value of that entry is used as the name of the
implementation class.
- * - If a system property with the name javax.xml.ws.spi.Provider is defined, then its
value is used as the name of the implementation class.
- *
- * Finally, a default implementation class name is used.
- */
- public static Object find(String propName, String defaultImpl)
- {
- Object factory = null;
- String implName = null;
- ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
-
- // resource with the name of META-INF/services/propName
- URL url = ctxLoader.getResource("META-INF/services/" + propName);
- if (url != null)
- {
- try
- {
- BufferedReader br = new BufferedReader(new
InputStreamReader(url.openStream(), "UTF-8"));
- implName = br.readLine();
- }
- catch (IOException ex)
- {
- log.warn(ex.toString());
- }
- }
-
- // $java.home/lib/jaxws.properties file exists
- if (implName == null)
- {
- String javaHome = System.getProperty("java.home");
- File jaxwsFile = new File(javaHome + "/lib/jaxws.properties");
- if (jaxwsFile.exists())
- {
- try
- {
- Properties props = new Properties();
- props.load(new FileInputStream(jaxwsFile));
- implName = props.getProperty(propName);
- }
- catch (IOException ex)
- {
- log.warn(ex.toString());
- }
- }
- }
-
- // $java.home/lib/jaxws.properties file exists
- if (implName == null)
- {
- implName = System.getProperty(propName, defaultImpl);
- }
-
- // load the factory
- if (implName != null)
- {
- try
- {
- factory = ctxLoader.loadClass(implName).newInstance();
- }
- catch (Exception ex)
- {
- log.warn(ex.toString());
- }
- }
-
- return factory;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/jaxws/util/FactoryFinder.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/util/FactoryFinder.java)
Copied: trunk/src/main/java/org/jboss/ws/core/server (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server)
Deleted: trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,316 +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.core.server;
-
-// $Id$
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.UndeclaredThrowableException;
-
-import javax.management.MBeanException;
-import javax.xml.namespace.QName;
-import javax.xml.rpc.soap.SOAPFaultException;
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPBodyElement;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPHeader;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.Binding;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.handler.MessageContext;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.EndpointInvocation;
-import org.jboss.ws.core.jaxrpc.binding.CommonBinding;
-import org.jboss.ws.core.jaxrpc.binding.CommonBindingProvider;
-import org.jboss.ws.core.jaxrpc.binding.CommonSOAPBinding;
-import org.jboss.ws.core.jaxrpc.handler.HandlerDelegateJAXRPC;
-import org.jboss.ws.core.jaxws.binding.BindingProviderImpl;
-import org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.core.soap.SOAPBodyImpl;
-import org.jboss.ws.core.soap.SOAPMessageImpl;
-import org.jboss.ws.core.utils.JavaUtils;
-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;
-
-/** An implementation handles invocations on the endpoint
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 19-Jan-2005
- */
-public abstract class AbstractServiceEndpointInvoker implements ServiceEndpointInvoker,
HandlerDelegate
-{
- // provide logging
- private static Logger log = Logger.getLogger(AbstractServiceEndpointInvoker.class);
-
- protected CommonBindingProvider bindingProvider;
- protected HandlerDelegate handlerDelegate;
-
- /** Initialize the service endpoint */
- public void initServiceEndpoint(ServiceEndpointInfo seInfo)
- {
- ServerEndpointMetaData sepMetaData = seInfo.getServerEndpointMetaData();
-
- if (sepMetaData.getType() == EndpointMetaData.Type.JAXRPC)
- {
- bindingProvider = new CommonBindingProvider(sepMetaData);
- handlerDelegate = new HandlerDelegateJAXRPC();
- }
- else
- {
- bindingProvider = new BindingProviderImpl(sepMetaData);
- Binding binding = ((BindingProvider)bindingProvider).getBinding();
- handlerDelegate = new HandlerDelegateJAXWS(binding);
- }
- }
-
- /** Load the SEI implementation bean if necessary */
- protected abstract Class loadServiceEndpoint(ServiceEndpointInfo seInfo) throws
ClassNotFoundException;
-
- /** Create the instance of the SEI implementation bean if necessary */
- protected abstract Object createServiceEndpoint(ServiceEndpointInfo seInfo, Object
context, Class seiImplClass) throws IllegalAccessException,
- InstantiationException;
-
- /** Invoke the instance of the SEI implementation bean */
- protected abstract void invokeServiceEndpoint(ServiceEndpointInfo seInfo, Object
seiImpl, EndpointInvocation epInv) throws Exception;
-
- /** Destroy the instance of the SEI implementation bean if necessary */
- protected abstract void destroyServiceEndpoint(ServiceEndpointInfo seInfo, Object
seiImpl);
-
- public boolean callRequestHandlerChain(ServiceEndpointInfo seInfo, HandlerType type)
- {
- return handlerDelegate.callRequestHandlerChain(seInfo, type);
- }
-
- public boolean callResponseHandlerChain(ServiceEndpointInfo seInfo, HandlerType type)
- {
- return handlerDelegate.callResponseHandlerChain(seInfo, type);
- }
-
- public boolean callFaultHandlerChain(ServiceEndpointInfo seInfo, HandlerType type,
Exception ex)
- {
- return handlerDelegate.callFaultHandlerChain(seInfo, type, ex);
- }
-
- /** Invoke the the service endpoint */
- public SOAPMessage invoke(ServiceEndpointInfo seInfo, Object context) throws
Exception
- {
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- EndpointMetaData epMetaData = msgContext.getEndpointMetaData();
- SOAPMessageImpl reqMessage = (SOAPMessageImpl)msgContext.getSOAPMessage();
-
- // Load the endpoint implementation bean
- Class seImpl = loadServiceEndpoint(seInfo);
-
- // Create an instance of the endpoint implementation bean
- Object seInstance = createServiceEndpoint(seInfo, context, seImpl);
-
- try
- {
- boolean oneway = false;
- CommonBinding binding = null;
- EndpointInvocation epInv = null;
- OperationMetaData opMetaData = null;
-
- // call the handler chain
- boolean handlersPass = callRequestHandlerChain(seInfo, HandlerType.PRE);
-
- // Unbind the request message
- if (handlersPass)
- {
- // Get the binding from the provideer
- binding = bindingProvider.getCommonBinding();
-
- // Get the operation meta data from the SOAP message
- opMetaData = getDispatchDestination(epMetaData, reqMessage);
- msgContext.setOperationMetaData(opMetaData);
- oneway = opMetaData.isOneWay();
-
- // Unbind the request message
- epInv = binding.unbindRequestMessage(opMetaData, reqMessage);
- }
-
- handlersPass = handlersPass && callRequestHandlerChain(seInfo,
HandlerType.ENDPOINT);
- handlersPass = handlersPass && callRequestHandlerChain(seInfo,
HandlerType.POST);
-
- // Check if protocol handlers modified the payload
- if (((SOAPBodyImpl)reqMessage.getSOAPBody()).isModifiedFromSource())
- {
- log.debug("Handler modified body payload, unbind message again");
- epInv = binding.unbindRequestMessage(opMetaData, reqMessage);
- }
-
- if (handlersPass)
- {
- // Invoke the service endpoint
- msgContext.setProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM,
Boolean.TRUE);
- try
- {
- invokeServiceEndpoint(seInfo, seInstance, epInv);
- }
- finally
- {
- msgContext.removeProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
- }
-
- // Set the outbound property
- if (epMetaData.getType() == EndpointMetaData.Type.JAXWS)
- msgContext.setProperty(MessageContext.MESSAGE_OUTBOUND_PROPERTY, new
Boolean(true));
-
- // Bind the response message
- SOAPMessage resMessage = (SOAPMessage)binding.bindResponseMessage(opMetaData,
epInv);
- msgContext.setSOAPMessage(resMessage);
- }
-
- // call the handler chain
- if (oneway == false)
- {
- handlersPass = callResponseHandlerChain(seInfo, HandlerType.POST);
- handlersPass = handlersPass && callResponseHandlerChain(seInfo,
HandlerType.ENDPOINT);
- handlersPass = handlersPass && callResponseHandlerChain(seInfo,
HandlerType.PRE);
- }
-
- SOAPMessage resMessage = msgContext.getSOAPMessage();
- return resMessage;
- }
- catch (Exception ex)
- {
- try
- {
- CommonSOAPBinding soapBinding =
(CommonSOAPBinding)bindingProvider.getCommonBinding();
- SOAPMessage faultMessage = soapBinding.exceptionToFaultMessage(ex);
- msgContext.setSOAPMessage(faultMessage);
-
- // call the handler chain
- boolean handlersPass = callFaultHandlerChain(seInfo, HandlerType.POST, ex);
- handlersPass = handlersPass && callFaultHandlerChain(seInfo,
HandlerType.ENDPOINT, ex);
- handlersPass = handlersPass && callFaultHandlerChain(seInfo,
HandlerType.PRE, ex);
- }
- catch (Exception subEx)
- {
- log.warn("Cannot process handlerChain.handleFault, ignoring: ",
subEx);
- }
- throw ex;
- }
- finally
- {
- destroyServiceEndpoint(seInfo, seInstance);
- }
- }
-
- private OperationMetaData getDispatchDestination(EndpointMetaData epMetaData,
SOAPMessageImpl reqMessage) throws SOAPException
- {
- OperationMetaData opMetaData = reqMessage.getOperationMetaData(epMetaData);
- SOAPHeader soapHeader = reqMessage.getSOAPHeader();
-
- // Report a MustUnderstand fault
- if (opMetaData == null)
- {
- String faultString;
- SOAPBody soapBody = reqMessage.getSOAPBody();
- if (soapBody.getChildElements().hasNext())
- {
- SOAPBodyElement soapBodyElement =
(SOAPBodyElement)soapBody.getChildElements().next();
- Name soapName = soapBodyElement.getElementName();
- faultString = "Endpoint " + epMetaData.getQName() + " does not
contain operation meta data for: " + soapName;
- }
- else
- {
- faultString = "Endpoint " + epMetaData.getQName() + " does not
contain operation meta data for empty soap body";
- }
-
- // R2724 If an INSTANCE receives a message that is inconsistent with its WSDL
description, it SHOULD generate a soap:Fault
- // with a faultcode of "Client", unless a "MustUnderstand"
or "VersionMismatch" fault is generated.
- if (soapHeader != null &&
soapHeader.examineMustUnderstandHeaderElements(Constants.URI_SOAP11_NEXT_ACTOR).hasNext())
- {
- QName faultCode = Constants.SOAP11_FAULT_CODE_MUST_UNDERSTAND;
- throw new SOAPFaultException(faultCode, faultString, null, null);
- }
- else
- {
- QName faultCode = Constants.SOAP11_FAULT_CODE_CLIENT;
- throw new SOAPFaultException(faultCode, faultString, null, null);
- }
- }
- return opMetaData;
- }
-
- protected Method getImplMethod(Class implClass, Method seiMethod) throws
ClassNotFoundException, NoSuchMethodException
- {
- String methodName = seiMethod.getName();
- Class[] paramTypes = seiMethod.getParameterTypes();
- for (int i = 0; i < paramTypes.length; i++)
- {
- Class paramType = paramTypes[i];
- if (JavaUtils.isPrimitive(paramType) == false)
- {
- String paramTypeName = paramType.getName();
- paramType = JavaUtils.loadJavaType(paramTypeName);
- paramTypes[i] = paramType;
- }
- }
-
- Method implMethod = implClass.getMethod(methodName, paramTypes);
- return implMethod;
- }
-
- /** handle invocation exceptions */
- public void handleInvocationException(Throwable th) throws Exception
- {
- if (th instanceof InvocationTargetException)
- {
- // unwrap the throwable raised by the service endpoint implementation
- Throwable targetEx = ((InvocationTargetException)th).getTargetException();
- handleInvocationThrowable(targetEx);
- }
-
- if (th instanceof MBeanException)
- {
- throw ((MBeanException)th).getTargetException();
- }
-
- handleInvocationThrowable(th);
- }
-
- private void handleInvocationThrowable(Throwable th) throws Exception
- {
- if (th instanceof Exception)
- {
- throw (Exception)th;
- }
- else if (th instanceof Error)
- {
- throw (Error)th;
- }
- else
- {
- throw new UndeclaredThrowableException(th);
- }
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointPublisher.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointPublisher.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointPublisher.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,250 +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.core.server;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.Servlet;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.core.utils.DOMWriter;
-import org.jboss.ws.core.utils.IOUtils;
-import org.jboss.ws.core.utils.JavaUtils;
-import org.w3c.dom.Element;
-
-/**
- * The publisher for web service endpoints
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-May-2006
- */
-public abstract class AbstractServiceEndpointPublisher
-{
- // default bean name
- public static final String BEAN_NAME = "ServiceEndpointPublisher";
-
- // The servlet init param in web.xml that is the service endpoint class
- public static final String INIT_PARAM_SERVICE_ENDPOINT_IMPL =
"ServiceEndpointImpl";
-
- // logging support
- private static Logger log = Logger.getLogger(AbstractServiceEndpointPublisher.class);
-
- // The configured service endpoint servlet
- protected String servletName;
-
- public String getServiceEndpointServlet()
- {
- return servletName;
- }
-
- public void setServiceEndpointServlet(String servletName)
- {
- this.servletName = servletName;
- }
-
- public abstract String publishServiceEndpoint(URL warURL) throws Exception;
-
- public abstract String destroyServiceEndpoint(URL warURL) throws Exception;
-
- public URL rewriteWarWebXml(URL warURL)
- {
- File warFile = new File(warURL.getFile());
- if (warFile.isDirectory() == false)
- throw new WSException("Expected a war directory: " + warURL);
-
- File webXML = new File(warURL.getFile() + "/WEB-INF/web.xml");
- if (webXML.isFile() == false)
- throw new WSException("Cannot find web.xml: " + webXML);
-
- try
- {
- // After redeployment there might be a stale copy of the original
web.xml.org,
we delete it
- File orgWebXML = new File(webXML.getCanonicalPath() + ".org");
- orgWebXML.delete();
-
- // Rename the web.xml
- if (webXML.renameTo(orgWebXML) == false)
- throw new WSException("Cannot rename web.xml: " + orgWebXML);
-
- FileInputStream stream = new FileInputStream(orgWebXML);
- return rewriteWebXml(stream, webXML, null).toURL();
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception e)
- {
- throw new WSException(e);
- }
- }
-
- public File rewriteWebXml(InputStream source, File dest, ClassLoader loader) throws
Exception
- {
- if (dest == null)
- {
- dest = File.createTempFile("jbossws-alt-web", "xml",
IOUtils.createTempDirectory());
- dest.deleteOnExit();
- }
-
- Element root = DOMUtils.parse(source);
- modifyServletConfig(root, loader);
-
- FileOutputStream fos = new FileOutputStream(dest);
- new DOMWriter(fos).setPrettyprint(true).print(root);
- fos.flush();
- fos.close();
-
- return dest;
- }
-
- private Map<String, String> modifyServletConfig(Element root, ClassLoader
loader) throws ClassNotFoundException
- {
- Map<String, String> sepTargetMap = new HashMap<String, String>();
-
- Iterator itServlets = DOMUtils.getChildElements(root, "servlet");
- while (itServlets.hasNext())
- {
- Element servletElement = (Element)itServlets.next();
- String linkName =
DOMUtils.getTextContent(DOMUtils.getFirstChildElement(servletElement,
"servlet-name"));
-
- // find the servlet-class
- Element classElement = DOMUtils.getFirstChildElement(servletElement,
"servlet-class");
-
- // JSP
- if (classElement == null)
- continue;
-
- // Get the servlet class
- String servletClassName = DOMUtils.getTextContent(classElement).trim();
- Class servletClass = (loader != null ? loader.loadClass(servletClassName) :
null);
-
- String targetBeanName = null;
-
- // Nothing to do if we have an <init-param>
- if (isAlreadyModified(servletElement) == false)
- {
- // Check if it is a real servlet that we can ignore
- if (servletClass != null && JavaUtils.isAssignableFrom(Servlet.class,
servletClass))
- {
- log.info("Ignore servlet: " + servletClassName);
- continue;
- }
- else if (servletClassName.endsWith("Servlet"))
- {
- log.info("Ignore <servlet-class> that ends with
'Servlet': " + servletClassName);
- continue;
- }
-
- // build a list of detached elements that come after <servlet-class>
- boolean startDetach = false;
- List<Element> detachedElements = new ArrayList<Element>();
- Iterator itDetached = DOMUtils.getChildElements(servletElement);
- while (itDetached.hasNext())
- {
- Element el = (Element)itDetached.next();
- if (startDetach == true)
- {
- detachedElements.add(el);
- servletElement.removeChild(el);
- }
- if (el.equals(classElement))
- {
- servletElement.removeChild(el);
- startDetach = true;
- }
- }
-
- // replace the class name
- classElement = (Element)DOMUtils.createElement("servlet-class");
- classElement.appendChild(DOMUtils.createTextNode(servletName));
- classElement =
(Element)servletElement.getOwnerDocument().importNode(classElement, true);
- servletElement.appendChild(classElement);
-
- // add additional init params
- if (servletClassName.equals(servletName) == false)
- {
- Element paramElement = DOMUtils.createElement("init-param");
-
paramElement.appendChild(DOMUtils.createElement("param-name")).appendChild(DOMUtils.createTextNode(INIT_PARAM_SERVICE_ENDPOINT_IMPL));
-
paramElement.appendChild(DOMUtils.createElement("param-value")).appendChild(DOMUtils.createTextNode(servletClassName));
- paramElement =
(Element)servletElement.getOwnerDocument().importNode(paramElement, true);
- servletElement.appendChild(paramElement);
- targetBeanName = servletClassName;
- }
-
- // reattach the elements
- itDetached = detachedElements.iterator();
- while (itDetached.hasNext())
- {
- Element el = (Element)itDetached.next();
- servletElement.appendChild(el);
- }
- }
- else
- {
- Iterator itParams = DOMUtils.getChildElements(servletElement,
"init-param");
- while (itParams.hasNext())
- {
- Element elParam = (Element)itParams.next();
- Element elParamName = DOMUtils.getFirstChildElement(elParam,
"param-name");
- Element elParamValue = DOMUtils.getFirstChildElement(elParam,
"param-value");
- if
(INIT_PARAM_SERVICE_ENDPOINT_IMPL.equals(DOMUtils.getTextContent(elParamName)))
- {
- targetBeanName = DOMUtils.getTextContent(elParamValue);
- }
- }
- }
-
- if (targetBeanName == null)
- throw new IllegalStateException("Cannot obtain service endpoint bean
for: " + linkName);
-
- sepTargetMap.put(linkName, targetBeanName.trim());
- }
-
- return sepTargetMap;
- }
-
- // Return true if the web.xml is already modified
- private boolean isAlreadyModified(Element servletElement)
- {
- Iterator itParams = DOMUtils.getChildElements(servletElement,
"init-param");
- while (itParams.hasNext())
- {
- Element elParam = (Element)itParams.next();
- Element elParamName = DOMUtils.getFirstChildElement(elParam,
"param-name");
- if
(INIT_PARAM_SERVICE_ENDPOINT_IMPL.equals(DOMUtils.getTextContent(elParamName)))
- return true;
- }
- return false;
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointPublisher.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointPublisher.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointServlet.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointServlet.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointServlet.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,164 +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.core.server;
-
-// $Id: AbstractServiceEndpointServlet.java 396 2006-05-23 09:48:45Z
thomas.diesler(a)jboss.com $
-
-import java.io.IOException;
-import java.io.Writer;
-import java.net.URL;
-
-import javax.management.ObjectName;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.xml.rpc.JAXRPCException;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.utils.ObjectNameFactory;
-import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-
-/**
- * A servlet that is installed for every web service endpoint.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 15-Jan-2005
- */
-public abstract class AbstractServiceEndpointServlet extends HttpServlet
-{
- // provide logging
- private static final Logger log =
Logger.getLogger(AbstractServiceEndpointServlet.class);
-
- protected ObjectName sepId;
- protected ServiceEndpointManager epManager;
-
- public void init(ServletConfig config) throws ServletException
- {
- super.init(config);
- initServiceEndpointManager();
- }
-
- public void destroy()
- {
- super.destroy();
- }
-
- public void service(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException
- {
- if (sepId == null)
- {
- String contextPath = req.getContextPath();
- initServiceEndpoint(contextPath);
- }
- super.service(req, res);
- }
-
- public void doGet(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException
- {
- // Process a WSDL request
- if (req.getParameter("wsdl") != null ||
req.getParameter("WSDL") != null)
- {
- res.setContentType("text/xml");
- try
- {
- // For the base document the resourcePath should be null
- String resourcePath = (String)req.getParameter("resource");
- URL requestURL = new URL(req.getRequestURL().toString());
- epManager.processWSDLRequest(sepId, res.getOutputStream(), requestURL,
resourcePath);
- }
- catch (Exception ex)
- {
- handleException(ex);
- }
- }
- else
- {
- res.setStatus(405);
- res.setContentType("text/plain");
- Writer out = res.getWriter();
- out.write("HTTP GET not supported");
- out.flush();
- out.close();
- }
- }
-
- public void doPost(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException
- {
- log.debug("doPost: " + req.getRequestURI());
-
- try
- {
- EndpointContext context = new EndpointContext(getServletContext(), req, res);
- epManager.processSOAPRequest(sepId, req.getInputStream(), res.getOutputStream(),
context);
- }
- catch (Exception ex)
- {
- handleException(ex);
- }
- }
-
- private void handleException(Exception ex) throws ServletException
- {
- log.error("Error processing web service request", ex);
-
- if (ex instanceof JAXRPCException)
- throw (JAXRPCException)ex;
-
- throw new ServletException(ex);
- }
-
- protected void initServiceEndpointManager()
- {
- ServiceEndpointManagerFactory factory =
ServiceEndpointManagerFactory.getInstance();
- epManager = factory.getServiceEndpointManager();
- }
-
- /** Initialize the service endpoint
- */
- protected void initServiceEndpoint(String contextPath)
- {
- String servletName = getServletName();
- if (contextPath.startsWith("/"))
- contextPath = contextPath.substring(1);
-
- for (ObjectName sepId : epManager.getServiceEndpoints())
- {
- String context =
sepId.getKeyProperty(ServerEndpointMetaData.SEPID_PROPERTY_CONTEXT);
- String endpoint =
sepId.getKeyProperty(ServerEndpointMetaData.SEPID_PROPERTY_ENDPOINT);
- if (servletName.equals(endpoint) && contextPath.equals(context))
- {
- this.sepId = sepId;
- break;
- }
- }
-
- if (sepId == null)
- {
- ObjectName oname = ObjectNameFactory.create(ServerEndpointMetaData.SEPID_DOMAIN
+ ":" + ServerEndpointMetaData.SEPID_PROPERTY_CONTEXT + "=" +
contextPath
- + "," + ServerEndpointMetaData.SEPID_PROPERTY_ENDPOINT +
"=" + servletName);
- throw new WSException("Cannot obtain endpoint for: " + oname);
- }
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointServlet.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointServlet.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/server/EndpointContext.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/EndpointContext.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/server/EndpointContext.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,76 +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.core.server;
-
-// $Id$
-
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-import javax.xml.rpc.handler.MessageContext;
-
-import org.jboss.ws.core.soap.MessageContextAssociation;
-
-/**
- * Implementation of ServletEndpointContext
- *
- * @author Thomas.Diesler(a)jboss.org
- */
-public class EndpointContext
-{
- private ServletContext context;
- private HttpServletRequest request;
- private HttpServletResponse response;
-
- public EndpointContext(ServletContext context, HttpServletRequest request,
HttpServletResponse response)
- {
- this.context = context;
- this.request = request;
- this.response = response;
- }
-
- public HttpSession getHttpSession()
- {
- return request.getSession();
- }
-
- public MessageContext getMessageContext()
- {
- return (MessageContext)MessageContextAssociation.peekMessageContext();
- }
-
- public ServletContext getServletContext()
- {
- return context;
- }
-
- public HttpServletRequest getHttpServletRequest()
- {
- return request;
- }
-
- public HttpServletResponse getHttpServletResponse()
- {
- return response;
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/core/server/EndpointContext.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/EndpointContext.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/server/HandlerDelegate.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/HandlerDelegate.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/server/HandlerDelegate.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,40 +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.core.server;
-
-// $Id$
-
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-
-/** An implementation of handles invocations on the endpoint
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 19-Jan-2005
- */
-public interface HandlerDelegate
-{
- public boolean callRequestHandlerChain(ServiceEndpointInfo seInfo, HandlerType type);
-
- public boolean callResponseHandlerChain(ServiceEndpointInfo seInfo, HandlerType
type);
-
- public boolean callFaultHandlerChain(ServiceEndpointInfo seInfo, HandlerType type,
Exception ex);
-}
Copied: trunk/src/main/java/org/jboss/ws/core/server/HandlerDelegate.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/HandlerDelegate.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/server/HeaderSource.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/HeaderSource.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/server/HeaderSource.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,49 +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.core.server;
-
-import javax.xml.soap.MimeHeaders;
-
-/**
- * Generic abstraction of a source that allows getting and setting
- * of transport specific MIME headers.
- *
- * @author <a href="mailto:jason@stacksmash.com">Jason T.
Greene</a>
- */
-public interface HeaderSource
-{
- /**
- * Gets the MIME headers from an inbound source. An implementation may
- * return <code>null</code> if the transport does not provide headers.
- *
- * @return the MIME headers
- */
- public MimeHeaders getMimeHeaders();
-
- /**
- * Sets the MIME headers for an outbound source. An implementation may
- * return <code>null</code> if the transport does not provide headers.
- *
- * @param headers the MIME headers
- */
- public void setMimeHeaders(MimeHeaders headers);
-}
Copied: trunk/src/main/java/org/jboss/ws/core/server/HeaderSource.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/HeaderSource.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/server/HttpContext.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/HttpContext.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/server/HttpContext.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,52 +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.core.server;
-
-// $Id$
-
-/**
- * An abstract HTTP Context
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 07-Jul-2006
- */
-public class HttpContext
-{
- private HttpServer server;
- private String contextRoot;
-
- public HttpContext(HttpServer server, String contextRoot)
- {
- this.server = server;
- this.contextRoot = contextRoot;
- }
-
- public HttpServer getHttpServer()
- {
- return server;
- }
-
- public String getContextRoot()
- {
- return contextRoot;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/server/HttpContext.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/HttpContext.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/server/HttpServer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/HttpServer.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/server/HttpServer.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -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.core.server;
-
-// $Id$
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.xml.ws.Endpoint;
-
-import org.jboss.ws.core.jaxws.util.FactoryFinder;
-
-/**
- * An abstract HTTP Server
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 07-Jul-2006
- */
-public abstract class HttpServer
-{
- public static String HTTP_SERVER_PROPERTY = HttpServer.class.getName();
- public static String DEFAULT_HTTP_SERVER_PROPERTY =
"org.jboss.ws.integration.jboss.JBossHttpServer";
-
- private Map<String, Object> properties = new HashMap<String, Object>();
-
- // Hide constructor
- protected HttpServer ()
- {
- }
-
- /**
- * Create an instance of an HTTP server.
- * The discovery algorithm is described in {@link FactoryFinder.find(String,String)}
- */
- public static HttpServer create()
- {
- HttpServer server = (HttpServer)FactoryFinder.find(HTTP_SERVER_PROPERTY,
DEFAULT_HTTP_SERVER_PROPERTY);
- return server;
- }
-
- /** Start an instance of this HTTP server */
- public abstract void start();
-
- /** Create an HTTP context */
- public abstract HttpContext createContext(String string);
-
- /** Publish an JAXWS endpoint to the HTTP server */
- public abstract void publish(HttpContext context, Endpoint endpoint);
-
- /** Destroys an JAXWS endpoint on the HTTP server */
- public abstract void destroy(HttpContext context, Endpoint endpoint);
-
- public Map<String, Object> getProperties()
- {
- return properties;
- }
-
- public void setProperties(Map<String, Object> map)
- {
- properties = map;
- }
-
- public void setProperty(String key, Object value)
- {
- properties.put(key, value);
- }
-
- public Object getProperty(String key)
- {
- return properties.get(key);
- }
-
-}
Copied: trunk/src/main/java/org/jboss/ws/core/server/HttpServer.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/HttpServer.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/server/JAXWSDeployment.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/JAXWSDeployment.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/server/JAXWSDeployment.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,40 +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.core.server;
-
-
-
-// $Id$
-
-/**
- * The container independent deployment info.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 29-Jun-2006
- */
-public class JAXWSDeployment extends UnifiedDeploymentInfo
-{
- public JAXWSDeployment(DeploymentType type)
- {
- super(type);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/server/JAXWSDeployment.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/JAXWSDeployment.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/server/KernelLocator.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/KernelLocator.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/server/KernelLocator.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,54 +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.core.server;
-
-//$Id: WebServiceDeployer.java 312 2006-05-11 10:49:22Z thomas.diesler(a)jboss.com $
-
-import org.jboss.kernel.Kernel;
-import org.jboss.kernel.spi.dependency.KernelControllerContext;
-import org.jboss.kernel.spi.dependency.KernelControllerContextAware;
-
-/**
- * Locate the single instance of the kernel
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-May-2006
- */
-public class KernelLocator implements KernelControllerContextAware
-{
- private static Kernel kernel;
-
- public static Kernel getKernel()
- {
- return kernel;
- }
-
- public void setKernelControllerContext(KernelControllerContext context) throws
Exception
- {
- kernel = context.getKernel();
- }
-
- public void unsetKernelControllerContext(KernelControllerContext arg0) throws
Exception
- {
- kernel = null;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/server/KernelLocator.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/KernelLocator.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/server/MessageContextInjector.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/MessageContextInjector.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/server/MessageContextInjector.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,85 +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.core.server;
-
-// $Id$
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-import javax.annotation.Resource;
-import javax.xml.ws.WebServiceContext;
-import javax.xml.ws.handler.MessageContext;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.jaxws.WebServiceContextImpl;
-
-/**
- * Inject the JAXWS WebServiceContext
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Jan-2006
- */
-public class MessageContextInjector
-{
- // provide logging
- private static Logger log = Logger.getLogger(MessageContextInjector.class);
-
- public static void injectMessageContext(Object epImpl, MessageContext msgContext)
- {
- WebServiceContextImpl webServiceContext = new WebServiceContextImpl(msgContext);
-
- try
- {
- // scan fields that are marked with @Resource
- Field[] fields = epImpl.getClass().getFields();
- for (Field field : fields)
- {
- Class type = field.getType();
- if (type == WebServiceContext.class &&
field.isAnnotationPresent(Resource.class))
- {
- field.set(epImpl, webServiceContext);
- }
- }
-
- // scan methods that are marked with @Resource
- Method[] methods = epImpl.getClass().getMethods();
- for (Method method : methods)
- {
- Class[] paramTypes = method.getParameterTypes();
- if (paramTypes.length == 1 && paramTypes[0] ==
WebServiceContext.class && method.isAnnotationPresent(Resource.class))
- {
- method.invoke(epImpl, new Object[] { webServiceContext });
-
- }
- }
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- log.warn("Cannot inject WebServiceContext", ex);
- }
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/server/MessageContextInjector.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/MessageContextInjector.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/server/MessageContextPropertyHelper.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/MessageContextPropertyHelper.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/server/MessageContextPropertyHelper.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,41 +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.core.server;
-
-/**
- * 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();
-
-}
Copied: trunk/src/main/java/org/jboss/ws/core/server/MessageContextPropertyHelper.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/MessageContextPropertyHelper.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/server/ServerConfig.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServerConfig.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/server/ServerConfig.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,41 +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.core.server;
-
-// $Id: ServiceEndpointManagerFactory.java 293 2006-05-08 16:31:50Z
thomas.diesler(a)jboss.com $
-
-import java.io.File;
-
-/**
- * Interface to container independent config
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 08-May-2006
- */
-public interface ServerConfig
-{
- static final String BEAN_NAME = "ServerConfig";
-
- File getServerTempDir();
-
- File getServerDataDir();
-}
Copied: trunk/src/main/java/org/jboss/ws/core/server/ServerConfig.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServerConfig.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/server/ServerConfigFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServerConfigFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/server/ServerConfigFactory.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,57 +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.core.server;
-
-import org.jboss.kernel.spi.registry.KernelRegistry;
-import org.jboss.logging.Logger;
-
-// $Id: ServiceEndpointManagerFactory.java 293 2006-05-08 16:31:50Z
thomas.diesler(a)jboss.com $
-
-/**
- * Factory to container independent config
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 08-May-2006
- */
-public class ServerConfigFactory
-{
- // provide logging
- private static final Logger log = Logger.getLogger(ServerConfigFactory.class);
-
- private static ServerConfigFactory instance = new ServerConfigFactory();
-
- // Hide ctor
- protected ServerConfigFactory()
- {
- }
-
- public static ServerConfigFactory getInstance()
- {
- return instance;
- }
-
- public ServerConfig getServerConfig()
- {
- KernelRegistry registry = KernelLocator.getKernel().getRegistry();
- return (ServerConfig)registry.getEntry(ServerConfig.BEAN_NAME).getTarget();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/server/ServerConfigFactory.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServerConfigFactory.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpoint.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpoint.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpoint.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,301 +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.core.server;
-
-// $Id$
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.net.URL;
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.JAXRPCException;
-import javax.xml.rpc.soap.SOAPFaultException;
-import javax.xml.soap.MimeHeaders;
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPMessage;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.CommonBindingProvider;
-import org.jboss.ws.core.jaxrpc.binding.CommonSOAPBinding;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.core.soap.MessageFactoryImpl;
-import org.jboss.ws.core.soap.SOAPElementImpl;
-import org.jboss.ws.core.soap.SOAPElementWriter;
-import org.jboss.ws.core.soap.SOAPMessageImpl;
-import org.jboss.ws.core.utils.DOMWriter;
-import org.jboss.ws.extensions.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.w3c.dom.Document;
-
-/**
- * This object registered with the ServiceEndpointManager service.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 16-Jan-2005
- */
-public class ServiceEndpoint
-{
- // provide logging
- private static Logger log = Logger.getLogger(ServiceEndpoint.class);
- private static Logger msgLog = Logger.getLogger("jbossws.SOAPMessage");
-
- /** Endpoint type enum */
- public enum State
- {
- CREATED, STARTED, STOPED, DESTROYED
- }
-
- // The deployment info for this endpoint
- protected ServiceEndpointInfo seInfo;
- // Some metrics for this endpoint
- protected ServiceEndpointMetrics seMetrics;
-
- public ServiceEndpoint(ServiceEndpointInfo seInfo)
- {
- this.seInfo = seInfo;
- this.seInfo.setState(State.CREATED);
- this.seMetrics = new ServiceEndpointMetrics(seInfo.getServiceEndpointID());
- }
-
- public State getState()
- {
- return seInfo.getState();
- }
-
- public ServiceEndpointInfo getServiceEndpointInfo()
- {
- return seInfo;
- }
-
- public ServiceEndpointMetrics getServiceEndpointMetrics()
- {
- return seMetrics;
- }
-
- public void create() throws Exception
- {
- seInfo.setState(State.CREATED);
- }
-
- public void start() throws Exception
- {
- // eagerly initialize the UMDM
- ServerEndpointMetaData epMetaData = seInfo.getServerEndpointMetaData();
- UnifiedMetaData wsMetaData = epMetaData.getServiceMetaData().getUnifiedMetaData();
- wsMetaData.eagerInitialize();
-
- seMetrics.start();
- seInfo.setState(State.STARTED);
- }
-
- public void stop()
- {
- seMetrics.stop();
- seInfo.setState(State.STOPED);
- log.debug("Stop Endpoint" + seMetrics);
- }
-
- public void destroy()
- {
- seInfo.setState(State.DESTROYED);
- }
-
- /** Handle a WSDL request or a request for an included resource
- */
- public void handleWSDLRequest(OutputStream outStream, URL reqURL, String resPath)
throws IOException
- {
- ServiceEndpointInfo sepInfo = getServiceEndpointInfo();
- EndpointMetaData epMetaData = sepInfo.getServerEndpointMetaData();
-
- String wsdlHost = reqURL.getHost();
-
- ServiceEndpointManagerFactory factory =
ServiceEndpointManagerFactory.getInstance();
- ServiceEndpointManager epManager = factory.getServiceEndpointManager();
- if (epManager.getWebServiceHost().equals(ServiceEndpointManager.UNDEFINED_HOSTNAME)
== false)
- {
- wsdlHost = epManager.getWebServiceHost();
- }
- log.debug("WSDL request, using host: " + wsdlHost);
-
- WSDLRequestHandler wsdlRequestHandler = new WSDLRequestHandler(epMetaData);
- Document document = wsdlRequestHandler.getDocumentForPath(reqURL, wsdlHost,
resPath);
-
- OutputStreamWriter writer = new OutputStreamWriter(outStream);
- new DOMWriter(writer).setPrettyprint(true).print(document.getDocumentElement());
- outStream.flush();
- outStream.close();
- }
-
- /**
- * Handle a request to this web service endpoint
- */
- public SOAPMessage handleRequest(HeaderSource headerSource, EndpointContext context,
InputStream inputStream) throws BindingException
- {
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- ServerEndpointMetaData epMetaData = seInfo.getServerEndpointMetaData();
-
- long beginProcessing = 0;
- ClassLoader ctxClassLoader = Thread.currentThread().getContextClassLoader();
- try
- {
- State state = seInfo.getState();
- if (state != State.STARTED)
- {
- QName faultCode = Constants.SOAP11_FAULT_CODE_SERVER;
- String faultString = "Endpoint cannot handle requests in state: " +
state;
- throw new SOAPFaultException(faultCode, faultString, null, null);
- }
-
- log.debug("BEGIN handleRequest: " + seInfo.getServiceEndpointID());
- beginProcessing = seMetrics.processRequestMessage();
-
- MessageFactoryImpl msgFactory = new MessageFactoryImpl();
- msgFactory.setServiceMode(epMetaData.getServiceMode());
- msgFactory.setStyle(epMetaData.getStyle());
-
- MimeHeaders headers = (headerSource != null ? headerSource.getMimeHeaders() :
null);
- SOAPMessageImpl reqMessage = (SOAPMessageImpl)msgFactory.createMessage(headers,
inputStream);
-
- // Associate current message with message context
- msgContext.setSOAPMessage(reqMessage);
-
- // debug the incomming message
- if (msgLog.isTraceEnabled())
- {
- SOAPEnvelope soapEnv = reqMessage.getSOAPPart().getEnvelope();
- String envStr = SOAPElementWriter.writeElement((SOAPElementImpl)soapEnv,
true);
- msgLog.trace("Incomming SOAPMessage\n" + envStr);
- }
-
- // Set the thread context class loader
- ClassLoader classLoader = epMetaData.getClassLoader();
- Thread.currentThread().setContextClassLoader(classLoader);
-
- // Invoke the service endpoint
- ServiceEndpointInvoker seInvoker = seInfo.getInvoker();
- SOAPMessage resMessage = seInvoker.invoke(seInfo, context);
-
- postProcessResponse(headerSource, resMessage);
-
- return resMessage;
- }
- catch (Exception ex)
- {
- SOAPMessage resMessage = msgContext.getSOAPMessage();
-
- // In case we have an exception before the invoker is called
- // we create the fault message here.
- if (resMessage == null || ((SOAPMessageImpl)resMessage).isFaultMessage() ==
false)
- {
- CommonBindingProvider bindingProvider = getCommonBindingProvider();
- CommonSOAPBinding soapBinding =
(CommonSOAPBinding)bindingProvider.getCommonBinding();
-
- resMessage = soapBinding.exceptionToFaultMessage(ex);
- msgContext.setSOAPMessage(resMessage);
- }
-
- postProcessResponse(headerSource, resMessage);
- return resMessage;
- }
- finally
- {
- try
- {
- SOAPMessage soapMessage = msgContext.getSOAPMessage();
- if (soapMessage != null && soapMessage.getSOAPPart().getEnvelope() !=
null)
- {
- if (soapMessage.getSOAPPart().getEnvelope().getBody().getFault() != null)
- {
- seMetrics.processFaultMessage(beginProcessing);
- }
- else
- {
- seMetrics.processResponseMessage(beginProcessing);
- }
- }
- }
- catch (Exception ex)
- {
- log.error("Cannot process metrics", ex);
- }
-
- // Reset the thread context class loader
- Thread.currentThread().setContextClassLoader(ctxClassLoader);
- log.debug("END handleRequest: " + seInfo.getServiceEndpointID());
- }
- }
-
- /** Set response mime headers
- */
- private void postProcessResponse(HeaderSource headerSource, SOAPMessage resMessage)
- {
- try
- {
- // Set the outbound headers
- if (headerSource != null)
- {
- XOPContext.eagerlyCreateAttachments();
- resMessage.saveChanges();
- headerSource.setMimeHeaders(resMessage.getMimeHeaders());
- }
-
- // debug the outgoing message
- if (msgLog.isTraceEnabled())
- {
- resMessage.saveChanges();
- SOAPEnvelope soapEnv = resMessage.getSOAPPart().getEnvelope();
- if (soapEnv != null)
- {
- String envStr = SOAPElementWriter.writeElement((SOAPElementImpl)soapEnv,
true);
- msgLog.trace("Outgoing SOAPMessage\n" + envStr);
- }
- }
- }
- catch (Exception ex)
- {
- throw new JAXRPCException("Cannot create or send response message",
ex);
- }
- }
-
- private CommonBindingProvider getCommonBindingProvider()
- {
- return new CommonBindingProvider(seInfo.getServerEndpointMetaData());
- }
-
- /**
- * Returns a string representation of the object.
- */
- public String toString()
- {
- StringBuilder buffer = new StringBuilder(seInfo.toString());
- buffer.append("\n state=" + seInfo.getState());
- return buffer.toString();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpoint.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpoint.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointDeployer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointDeployer.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointDeployer.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,228 +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.core.server;
-
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import javax.management.ObjectName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-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;
-
-/**
- * The POJO deployer for web service endpoints. This Deployer is already decoupled from
the target
- * container (i.e. JBoss, Tomcat). The containers deployer architecture should be used to
populate
- * the UnifiedDeploymentInfo object.
- *
- * @deprecated
- * This functionality should be handled by the ServiceEndpointManager
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-May-2006
- */
-public class ServiceEndpointDeployer
-{
- // logging support
- private static Logger log = Logger.getLogger(ServiceEndpointDeployer.class);
-
- // default bean name
- public static final String BEAN_NAME = "ServiceEndpointDeployer";
-
- // The servlet init param in web.xml that is the service endpoint class
- public static final String INIT_PARAM_SERVICE_ENDPOINT_IMPL =
"ServiceEndpointImpl";
-
- // The ServiceEndpointManger injected by the kernel
- private ServiceEndpointManager epManager;
-
- // Maps the deployment url to UMDM
- private Map<String, UnifiedMetaData> metaDataMap = new
ConcurrentHashMap<String, UnifiedMetaData>();
-
- // Injected by the Microkernel
- public void setServiceEndpointManager(ServiceEndpointManager epManager)
- {
- this.epManager = epManager;
- }
-
- public void create(UnifiedDeploymentInfo udi)
- {
- log.debug("create: " + udi.url);
- try
- {
- UnifiedMetaData wsMetaData;
- if (udi.type == UnifiedDeploymentInfo.DeploymentType.JAXRPC_JSE)
- {
- JAXRPCServerMetaDataBuilder builder = new JAXRPCServerMetaDataBuilder();
- wsMetaData = builder.buildMetaData((JAXRPCDeployment)udi);
- }
- else if (udi.type == UnifiedDeploymentInfo.DeploymentType.JAXRPC_EJB21)
- {
- JAXRPCServerMetaDataBuilder builder = new JAXRPCServerMetaDataBuilder();
- wsMetaData = builder.buildMetaData((JAXRPCDeployment)udi);
- }
- else if (udi.type == UnifiedDeploymentInfo.DeploymentType.JAXWS_JSE)
- {
- JAXWSMetaDataBuilderJSE builder = new JAXWSMetaDataBuilderJSE();
- wsMetaData = builder.buildMetaData(udi);
- }
- else if (udi.type == UnifiedDeploymentInfo.DeploymentType.JAXWS_EJB3)
- {
- JAXWSMetaDataBuilderEJB3 builder = new JAXWSMetaDataBuilderEJB3();
- wsMetaData = builder.buildMetaData(udi);
- }
- else
- {
- throw new IllegalStateException("Invalid type: " + udi.type);
- }
-
- metaDataMap.put(udi.url.toExternalForm(), wsMetaData);
-
- for (ServiceMetaData serviceMetaData : wsMetaData.getServices())
- {
- for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
- {
- ServiceEndpointInfo seInfo = new ServiceEndpointInfo(udi,
(ServerEndpointMetaData)epMetaData);
- epManager.createServiceEndpoint(seInfo);
- }
- }
- }
- catch (Exception ex)
- {
- log.error("Cannot create service endpoint", ex);
- if (ex instanceof RuntimeException)
- throw (RuntimeException)ex;
-
- throw new WSException(ex);
- }
- }
-
- public void start(UnifiedDeploymentInfo udi)
- {
- log.debug("start: " + udi.url);
- try
- {
- UnifiedMetaData wsMetaData = getUnifiedMetaData(udi);
- if (wsMetaData != null)
- {
- // late initialization of the web context loader
- if (wsMetaData.getClassLoader() != udi.classLoader)
- wsMetaData.setClassLoader(udi.classLoader);
-
- // Publish the WSDL file
- WSDLFilePublisher wsdlfp = new WSDLFilePublisher(udi);
- wsdlfp.publishWsdlFiles(wsMetaData);
- for (ServiceMetaData serviceMetaData : wsMetaData.getServices())
- {
- for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
- {
- ObjectName sepID =
((ServerEndpointMetaData)epMetaData).getServiceEndpointID();
- epManager.startServiceEndpoint(sepID);
- }
- }
- }
- }
- catch (Exception ex)
- {
- log.error("Cannot start service endpoint", ex);
- if (ex instanceof RuntimeException)
- throw (RuntimeException)ex;
-
- throw new WSException(ex);
- }
- }
-
- public void stop(UnifiedDeploymentInfo udi)
- {
- log.debug("stop: " + udi.url);
- try
- {
- UnifiedMetaData wsMetaData = getUnifiedMetaData(udi);
- if (wsMetaData != null)
- {
- // Stop the service endpoints
- for (ServiceMetaData serviceMetaData : wsMetaData.getServices())
- {
- for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
- {
- ObjectName sepID =
((ServerEndpointMetaData)epMetaData).getServiceEndpointID();
- epManager.stopServiceEndpoint(sepID);
- }
- }
-
- // Unpublish the WSDL file
- WSDLFilePublisher wsdlfp = new WSDLFilePublisher(udi);
- wsdlfp.unpublishWsdlFiles();
- }
- }
- catch (Exception ex)
- {
- log.error("Cannot stop service endpoint", ex);
- if (ex instanceof RuntimeException)
- throw (RuntimeException)ex;
-
- throw new WSException(ex);
- }
- }
-
- public void destroy(UnifiedDeploymentInfo udi)
- {
- log.debug("destroy: " + udi.url);
- try
- {
- UnifiedMetaData wsMetaData = getUnifiedMetaData(udi);
- if (wsMetaData != null)
- {
- // Destroy the service endpoints
- for (ServiceMetaData serviceMetaData : wsMetaData.getServices())
- {
- for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
- {
- ObjectName sepID =
((ServerEndpointMetaData)epMetaData).getServiceEndpointID();
- epManager.destroyServiceEndpoint(sepID);
- }
- }
- }
- }
- catch (Exception ex)
- {
- log.error("Cannot destroy service endpoint", ex);
- if (ex instanceof RuntimeException)
- throw (RuntimeException)ex;
-
- throw new WSException(ex);
- }
- }
-
- public UnifiedMetaData getUnifiedMetaData(UnifiedDeploymentInfo udi)
- {
- UnifiedMetaData wsMetaData = metaDataMap.get(udi.url.toExternalForm());
- return wsMetaData;
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointDeployer.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointDeployer.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInfo.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInfo.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInfo.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,148 +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.core.server;
-
-// $Id$
-
-import javax.management.ObjectName;
-
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
-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.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 16-Jan-2005
- */
-public class ServiceEndpointInfo
-{
- /** Endpoint type enum */
- public enum EndpointType
- {
- JSE, SLSB21, SLSB30, MDB21
- }
-
- // The deployment info for this endpoint
- private UnifiedDeploymentInfo udi;
- // The endpoint type
- private EndpointType type;
- // The endpoint meta data
- private ServerEndpointMetaData sepMetaData;
- // The service endpoint invoker
- private ServiceEndpointInvoker seInvoker;
- // The current state of the endpoint
- private ServiceEndpoint.State state;
-
- public ServiceEndpointInfo(UnifiedDeploymentInfo udi, ServerEndpointMetaData
sepMetaData)
- {
- this.udi = udi;
- this.sepMetaData = sepMetaData;
-
- // Set the endpoint type
- if (udi.type == DeploymentType.JAXRPC_JSE || udi.type == DeploymentType.JAXWS_JSE)
- {
- this.type = EndpointType.JSE;
- }
- else if (udi.type == DeploymentType.JAXRPC_EJB21 || udi.type ==
DeploymentType.JAXWS_EJB21)
- {
- String ejbName = sepMetaData.getLinkName();
- if (ejbName == null)
- throw new WSException("Cannot obtain ejb-link from port
component");
-
- UnifiedApplicationMetaData applMetaData =
(UnifiedApplicationMetaData)udi.metaData;
- UnifiedBeanMetaData beanMetaData =
(UnifiedBeanMetaData)applMetaData.getBeanByEjbName(ejbName);
- if (beanMetaData == null)
- throw new WSException("Cannot obtain ejb meta data for: " +
ejbName);
-
- if (beanMetaData instanceof UnifiedSessionMetaData)
- {
- this.type = EndpointType.SLSB21;
- }
- else if (beanMetaData instanceof UnifiedMessageDrivenMetaData)
- {
- this.type = EndpointType.MDB21;
- }
- }
- else if (udi.type == DeploymentType.JAXRPC_EJB3 || udi.type ==
DeploymentType.JAXWS_EJB3)
- {
- this.type = EndpointType.SLSB30;
- }
-
- if (type == null)
- throw new WSException("Unsupported endpoint type: " + type);
- }
-
- public ServerEndpointMetaData getServerEndpointMetaData()
- {
- return sepMetaData;
- }
-
- public ObjectName getServiceEndpointID()
- {
- return sepMetaData.getServiceEndpointID();
- }
-
- public UnifiedDeploymentInfo getUnifiedDeploymentInfo()
- {
- return udi;
- }
-
- public EndpointType getType()
- {
- return type;
- }
-
- public ServiceEndpointInvoker getInvoker()
- {
- return seInvoker;
- }
-
- public void setInvoker(ServiceEndpointInvoker seInvoker)
- {
- this.seInvoker = seInvoker;
- }
-
- public ServiceEndpoint.State getState()
- {
- return state;
- }
-
- public void setState(ServiceEndpoint.State state)
- {
- this.state = state;
- }
-
- /**
- * Returns a string representation of the object.
- */
- public String toString()
- {
- StringBuilder buffer = new StringBuilder("[id=" + getServiceEndpointID()
+ "state=" + state + "]");
- return buffer.toString();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInfo.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInfo.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,40 +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.core.server;
-
-// $Id$
-
-import javax.xml.soap.SOAPMessage;
-
-/** An implementation handles invocations on the endpoint
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 19-Jan-2005
- */
-public interface ServiceEndpointInvoker
-{
- /** Initialize the service endpoint */
- public void initServiceEndpoint(ServiceEndpointInfo seInfo);
-
- /** Invoke the the service endpoint */
- public SOAPMessage invoke(ServiceEndpointInfo seInfo, Object endpointContext) throws
Exception;
-}
Copied: trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvokerJSE.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvokerJSE.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvokerJSE.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,115 +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.core.server;
-
-// $Id: $
-
-import java.lang.reflect.Method;
-
-import javax.xml.rpc.ServiceException;
-import javax.xml.rpc.server.ServiceLifecycle;
-import javax.xml.rpc.server.ServletEndpointContext;
-import javax.xml.rpc.soap.SOAPFaultException;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.EndpointInvocation;
-import org.jboss.ws.core.jaxrpc.ServletEndpointContextImpl;
-import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-
-/**
- * Handles invocations on JSE endpoints.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 19-Jan-2005
- */
-public class ServiceEndpointInvokerJSE extends AbstractServiceEndpointInvoker implements
ServiceEndpointInvoker
-{
- // provide logging
- private Logger log = Logger.getLogger(ServiceEndpointInvokerJSE.class);
-
- /** Load the SEI implementation bean if necessary */
- public Class loadServiceEndpoint(ServiceEndpointInfo seInfo) throws
ClassNotFoundException
- {
- ServerEndpointMetaData epMetaData = seInfo.getServerEndpointMetaData();
- ClassLoader cl = epMetaData.getClassLoader();
- String seiImplName = epMetaData.getServiceEndpointImplName();
- Class seiImplClass = cl.loadClass(seiImplName);
- return seiImplClass;
- }
-
- /** Create an instance of the SEI implementation bean if necessary */
- public Object createServiceEndpoint(ServiceEndpointInfo seInfo, Object context, Class
seiImplClass) throws IllegalAccessException, InstantiationException
- {
- Object seiImpl = seiImplClass.newInstance();
- if (seiImpl instanceof ServiceLifecycle && context != null)
- {
- try
- {
- ServiceLifecycle serviceLifecycle = ((ServiceLifecycle)seiImpl);
- ServletEndpointContext servletEndpointContext = new
ServletEndpointContextImpl((EndpointContext)context);
- serviceLifecycle.init(servletEndpointContext);
- }
- catch (ServiceException ex)
- {
- throw new WSException(ex);
- }
- }
- return seiImpl;
- }
-
- /** Invoke an instance of the SEI implementation bean */
- public void invokeServiceEndpoint(ServiceEndpointInfo seInfo, Object seiImpl,
EndpointInvocation epInv) throws SOAPFaultException, Exception
- {
- log.debug("invokeServiceEndpoint: " + epInv.getJavaMethod().getName());
- try
- {
- CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
- if (msgContext instanceof SOAPMessageContextJAXWS)
- MessageContextInjector.injectMessageContext(seiImpl,
(SOAPMessageContextJAXWS)msgContext);
-
- Class implClass = seiImpl.getClass();
- Method seiMethod = epInv.getJavaMethod();
- Method implMethod = getImplMethod(implClass, seiMethod);
-
- Object[] args = epInv.getRequestPayload();
- Object retObj = implMethod.invoke(seiImpl, args);
- epInv.setReturnValue(retObj);
- }
- catch (Exception e)
- {
- handleInvocationException(e);
- }
- }
-
- /** Destroy an instance of the SEI implementation bean if necessary */
- public void destroyServiceEndpoint(ServiceEndpointInfo seInfo, Object seiImpl)
- {
- if (seiImpl instanceof ServiceLifecycle)
- {
- ((ServiceLifecycle)seiImpl).destroy();
- }
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvokerJSE.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvokerJSE.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointManager.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointManager.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointManager.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,658 +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.core.server;
-
-// $Id$
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.lang.reflect.Constructor;
-import java.net.InetAddress;
-import java.net.URL;
-import java.net.UnknownHostException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import javax.activation.DataHandler;
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.management.ObjectName;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.soap.SOAPPart;
-import javax.xml.ws.addressing.AddressingProperties;
-import javax.xml.ws.addressing.JAXWSAConstants;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.jaxrpc.handler.MessageContextJAXRPC;
-import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
-import org.jboss.ws.core.jaxws.handler.MessageContextJAXWS;
-import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.core.soap.SOAPConnectionImpl;
-import org.jboss.ws.core.utils.ThreadLocalAssociation;
-import org.jboss.ws.extensions.addressing.AddressingConstantsImpl;
-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;
-
-/**
- * A service that manages JBossWS endpoints.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 15-Jan-2005
- */
-public class ServiceEndpointManager implements ServiceEndpointManagerMBean
-{
- // provide logging
- private static final Logger log = Logger.getLogger(ServiceEndpointManager.class);
-
- // Default bean name
- public static final String BEAN_NAME = "ServiceEndpointManager";
- // The host name that is returned if there is no other defined
- public static String UNDEFINED_HOSTNAME = "jbossws.undefined.host";
-
- // maps serviceID to EndpointInfo
- private Map<ObjectName, ServiceEndpoint> registry = new
ConcurrentHashMap<ObjectName, ServiceEndpoint>();
-
- // The webservice host name that will be used when updating the wsdl
- private String webServiceHost = UNDEFINED_HOSTNAME;
- // The webservice port that will be used when updating the wsdl
- private int webServicePort;
- // The webservice port that will be used when updating the wsdl
- private int webServiceSecurePort;
- // Whether we should always modify the soap address to the deployed endpoing location
- private boolean alwaysModifySOAPAddress;
- // The name of the invoker that handles invocations on JSE endpoints
- private String serviceEndpointInvokerJSE;
- // The name of the invoker that handles invocations on EJB2.1 endpoints
- private String serviceEndpointInvokerEJB21;
- // The name of the invoker that handles invocations on EJB3 endpoints
- private String serviceEndpointInvokerEJB3;
- // The name of the invoker that handles invocations on MDB endpoints
- private String serviceEndpointInvokerMDB;
-
- public String getWebServiceHost()
- {
- return webServiceHost;
- }
-
- public int getWebServicePort()
- {
- return webServicePort;
- }
-
- public int getWebServiceSecurePort()
- {
- return webServiceSecurePort;
- }
-
- public boolean isAlwaysModifySOAPAddress()
- {
- return alwaysModifySOAPAddress;
- }
-
- public void setWebServiceHost(String host) throws UnknownHostException
- {
- if (host == null || host.trim().length() == 0)
- {
- log.debug("Using undefined host: " + UNDEFINED_HOSTNAME);
- host = UNDEFINED_HOSTNAME;
- }
- if ("0.0.0.0".equals(host))
- {
- InetAddress localHost = InetAddress.getLocalHost();
- log.debug("Using local host: " + localHost.getHostName());
- host = localHost.getHostName();
- }
- this.webServiceHost = host;
- }
-
- public void setWebServicePort(int port)
- {
- this.webServicePort = port;
- }
-
- public void setWebServiceSecurePort(int port)
- {
- this.webServiceSecurePort = port;
- }
-
- public void setAlwaysModifySOAPAddress(boolean modify)
- {
- this.alwaysModifySOAPAddress = modify;
- }
-
- public String getServiceEndpointInvokerEJB21()
- {
- return serviceEndpointInvokerEJB21;
- }
-
- public void setServiceEndpointInvokerEJB21(String invoker)
- {
- this.serviceEndpointInvokerEJB21 = invoker;
- }
-
- public String getServiceEndpointInvokerEJB3()
- {
- return serviceEndpointInvokerEJB3;
- }
-
- public void setServiceEndpointInvokerEJB3(String invoker)
- {
- this.serviceEndpointInvokerEJB3 = invoker;
- }
-
- public String getServiceEndpointInvokerMDB()
- {
- return serviceEndpointInvokerMDB;
- }
-
- public void setServiceEndpointInvokerMDB(String invoker)
- {
- this.serviceEndpointInvokerMDB = invoker;
- }
-
- public String getServiceEndpointInvokerJSE()
- {
- return serviceEndpointInvokerJSE;
- }
-
- public void setServiceEndpointInvokerJSE(String invoker)
- {
- this.serviceEndpointInvokerJSE = invoker;
- }
-
- public List<ObjectName> getServiceEndpoints()
- {
- ArrayList<ObjectName> list = new ArrayList<ObjectName>();
- list.addAll(registry.keySet());
- return list;
- }
-
- /** Get service endpoint for a given serviceID
- *
- * The keys into the registry are:
- *
- * [deploment.ear]/[deployment.war]#WsdlService/PortName
- * [deploment.ear]/[deployment.jar]#ServiceName/PortName
- *
- */
- public ServiceEndpoint getServiceEndpointByID(ObjectName sepID)
- {
- ServiceEndpoint wsEndpoint = (ServiceEndpoint)registry.get(sepID);
- if (wsEndpoint == null)
- log.warn("No ServiceEndpoint found for serviceID: " + sepID);
-
- return wsEndpoint;
- }
-
- /** Resolve a port-component-link, like:
- *
- * [deployment.war]#PortComponentName
- * [deployment.jar]#PortComponentName
- *
- */
- public ServiceEndpoint resolvePortComponentLink(String pcLink)
- {
- String pcName = pcLink;
- int hashIndex = pcLink.indexOf("#");
- if (hashIndex > 0)
- {
- pcName = pcLink.substring(hashIndex + 1);
- }
-
- ServiceEndpoint serviceEndpoint = null;
- for (ObjectName sepID : registry.keySet())
- {
- ServiceEndpoint auxEndpoint = registry.get(sepID);
- ServiceEndpointInfo sepInfo = auxEndpoint.getServiceEndpointInfo();
- if (pcName.equals(sepInfo.getServerEndpointMetaData().getPortComponentName()))
- {
- if (serviceEndpoint != null)
- {
- log.warn("Multiple service endoints found for: " + pcLink);
- serviceEndpoint = null;
- break;
- }
- serviceEndpoint = auxEndpoint;
- }
- }
-
- if (serviceEndpoint == null)
- log.warn("No ServiceEndpoint found for pcLink: " + pcLink);
-
- return serviceEndpoint;
- }
-
- /** Show the registered webservices
- */
- public String showServiceEndpointTable()
- {
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
-
- pw.println("<h3>Registered Service Endpoints</h3>");
-
- pw.println("<table>");
-
pw.println("<tr><td>ServiceEndpointID</td><td>ServiceEndpointAddress</td><td> </td></tr>");
- Iterator it = registry.entrySet().iterator();
- while (it.hasNext())
- {
- Map.Entry entry = (Map.Entry)it.next();
- ObjectName sepID = (ObjectName)entry.getKey();
- ServiceEndpoint wsEndpoint = (ServiceEndpoint)entry.getValue();
- ServiceEndpointInfo seInfo = wsEndpoint.getServiceEndpointInfo();
- String endpointAddress =
seInfo.getServerEndpointMetaData().getEndpointAddress();
- pw.println("<tr><td>" + sepID.getCanonicalName() +
"</td><td><a href='" + endpointAddress +
"?wsdl'>" + endpointAddress +
"?wsdl</a></td></tr>");
- }
- pw.println("</table>");
- pw.close();
-
- return sw.toString();
- }
-
- /** Get the endpoint metrics
- */
- public ServiceEndpointMetrics getServiceEndpointMetrics(ObjectName sepID)
- {
- ServiceEndpoint wsEndpoint = getServiceEndpointByID(sepID);
- return (wsEndpoint != null ? wsEndpoint.getServiceEndpointMetrics() : null);
- }
-
- /** Show endpoint metrics
- */
- public String showServiceEndpointMetrics(ObjectName sepID)
- {
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
-
- ServiceEndpointMetrics seMetrics = getServiceEndpointMetrics(sepID);
- if (seMetrics != null)
- {
- pw.println("<h3>Service Endpoint Metrics</h3>");
-
- pw.println("<table>");
- pw.println("<tr><td>EndpointID</td><td>" +
seMetrics.getEndpointID() + "</td></tr>");
- pw.println("<tr><td>Start Time</td><td>" +
seMetrics.getStartTime() + "</td></tr>");
- pw.println("<tr><td>Stop Time</td><td>" +
seMetrics.getStopTime() + "</td></tr>");
- pw.println("<tr><td>Request Count</td><td>" +
seMetrics.getRequestCount() + "</td></tr>");
- pw.println("<tr><td>Response Count</td><td>" +
seMetrics.getRequestCount() + "</td></tr>");
- pw.println("<tr><td>Fault Count</td><td>" +
seMetrics.getResponseCount() + "</td></tr>");
- pw.println("<tr><td>Max Processing
Time</td><td>" + seMetrics.getMaxProcessingTime() +
"</td></tr>");
- pw.println("<tr><td>Min Processing
Time</td><td>" + seMetrics.getMinProcessingTime() +
"</td></tr>");
- pw.println("<tr><td>Avg Processing
Time</td><td>" + seMetrics.getAverageProcessingTime() +
"</td></tr>");
- pw.println("<tr><td>Total Processing
Time</td><td>" + seMetrics.getTotalProcessingTime() +
"</td></tr>");
- pw.println("</table>");
- pw.close();
- }
- return sw.toString();
- }
-
- public void processWSDLRequest(ObjectName sepID, OutputStream outStream, URL
requestURL, String resourcePath) throws Exception
- {
- ServiceEndpoint wsEndpoint = getServiceEndpointByID(sepID);
- if (wsEndpoint == null)
- throw new WSException("Cannot obtain endpoint for: " + sepID);
-
- wsEndpoint.handleWSDLRequest(outStream, requestURL, resourcePath);
- }
-
- public void processSOAPRequest(ObjectName sepID, InputStream inStream, OutputStream
outStream, EndpointContext context) throws Exception
- {
- ServiceEndpoint wsEndpoint = getServiceEndpointByID(sepID);
- if (wsEndpoint == null)
- throw new WSException("Cannot obtain endpoint for: " + sepID);
-
- // Get the type of the endpoint
- ServerEndpointMetaData sepMetaData =
wsEndpoint.getServiceEndpointInfo().getServerEndpointMetaData();
- Type type = sepMetaData.getType();
-
- MessageContextPropertyHelper httpSession = new HttpSessionPropertyHelper(context);
- ServletContext servletContext = context.getServletContext();
- HttpServletRequest httpRequest = context.getHttpServletRequest();
- HttpServletResponse httpResponse = context.getHttpServletResponse();
- ServletHeaderSource headerSource = new ServletHeaderSource(httpRequest,
httpResponse);
-
- // Associate a message context with the current thread
- CommonMessageContext msgContext;
- if (type == EndpointMetaData.Type.JAXRPC)
- {
- msgContext = new SOAPMessageContextJAXRPC();
- msgContext.setProperty(MessageContextJAXRPC.SERVLET_CONTEXT, servletContext);
- msgContext.setProperty(MessageContextJAXRPC.SERVLET_REQUEST, httpRequest);
- msgContext.setProperty(MessageContextJAXRPC.SERVLET_RESPONSE, httpResponse);
- msgContext.setProperty(MessageContextJAXRPC.SERVLET_SESSION, httpSession);
- }
- else
- {
- msgContext = new SOAPMessageContextJAXWS();
- msgContext.setProperty(MessageContextJAXWS.MESSAGE_OUTBOUND_PROPERTY, new
Boolean(false));
- msgContext.setProperty(MessageContextJAXWS.INBOUND_MESSAGE_ATTACHMENTS, new
HashMap<String, DataHandler>());
- msgContext.setProperty(MessageContextJAXWS.HTTP_REQUEST_HEADERS,
headerSource.getHeaderMap());
- msgContext.setProperty(MessageContextJAXWS.HTTP_REQUEST_METHOD,
httpRequest.getMethod());
- msgContext.setProperty(MessageContextJAXWS.QUERY_STRING,
httpRequest.getQueryString());
- msgContext.setProperty(MessageContextJAXWS.PATH_INFO,
httpRequest.getPathInfo());
- msgContext.setProperty(MessageContextJAXWS.SERVLET_CONTEXT, servletContext);
- msgContext.setProperty(MessageContextJAXWS.SERVLET_REQUEST, httpRequest);
- msgContext.setProperty(MessageContextJAXWS.SERVLET_RESPONSE, httpResponse);
-
- }
- msgContext.setEndpointMetaData(sepMetaData);
-
- MessageContextAssociation.pushMessageContext(msgContext);
- try
- {
- SOAPMessage resMessage = wsEndpoint.handleRequest(headerSource, context,
inStream);
-
- Map<String, List<String>> headers = (Map<String,
List<String>>)msgContext.getProperty(MessageContextJAXWS.HTTP_RESPONSE_HEADERS);
- if (headers != null)
- headerSource.setHeaderMap(headers);
-
- Integer code =
(Integer)msgContext.getProperty(MessageContextJAXWS.HTTP_RESPONSE_CODE);
- if (code != null)
- httpResponse.setStatus(code.intValue());
-
- SOAPPart part = resMessage.getSOAPPart();
- if (part == null)
- throw new SOAPException("Cannot obtain SOAPPart from response
message");
-
- // R1126 An INSTANCE MUST return a "500 Internal Server Error" HTTP
status code
- // if the response envelope is a Fault.
- //
- // Also, a one-way operation must show up as empty content, and can be detected
- // by a null envelope.
- SOAPEnvelope soapEnv = part.getEnvelope();
- boolean isFault = soapEnv != null && soapEnv.getBody().getFault() !=
null;
- if (isFault && httpResponse != null)
- {
- httpResponse.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
- }
-
- sendResponse(outStream, msgContext, isFault);
- }
- finally
- {
- outStream.flush();
- outStream.close();
-
- // Reset the message context association
- MessageContextAssociation.popMessageContext();
-
- // clear thread local storage
- ThreadLocalAssociation.clear();
- }
- }
-
- private void sendResponse(OutputStream outputStream, CommonMessageContext msgContext,
boolean isFault) throws SOAPException, IOException
- {
- SOAPMessage soapMessage = msgContext.getSOAPMessage();
- String wsaTo = null;
-
- // Get the destination from the AddressingProperties
- AddressingProperties outProps =
(AddressingProperties)msgContext.getProperty(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND);
- if (outProps != null && outProps.getTo() != null)
- {
- AddressingConstantsImpl ADDR = new AddressingConstantsImpl();
- wsaTo = outProps.getTo().getURI().toString();
- if (wsaTo.equals(ADDR.getAnonymousURI()))
- wsaTo = null;
- }
- if (wsaTo != null)
- {
- log.debug("Sending response to addressing destination: " + wsaTo);
- new SOAPConnectionImpl().callOneWay(soapMessage, wsaTo);
- }
- else
- {
- soapMessage.writeTo(outputStream);
- }
- }
-
- /** Process the given SOAPRequest and return the corresponding SOAPResponse
- */
- public String processSOAPRequest(ObjectName sepID, String inMessage) throws Exception
- {
- log.debug("processSOAPRequest: " + sepID);
-
- ByteArrayInputStream inputStream = new
ByteArrayInputStream(inMessage.getBytes("UTF-8"));
- ByteArrayOutputStream outputStream = new ByteArrayOutputStream(512);
-
- processSOAPRequest(sepID, inputStream, outputStream, null);
-
- String outMsg = new String(outputStream.toByteArray());
- return outMsg;
- }
-
- /** Get the ServiceEndpointInvoker for this type of service endpoint
- */
- private ServiceEndpointInvoker getServiceEndpointInvoker(ServiceEndpointInfo seInfo)
throws ClassNotFoundException, InstantiationException, IllegalAccessException
- {
- ServiceEndpointInvoker seInvoker = null;
-
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
- if (seInfo.getType() == ServiceEndpointInfo.EndpointType.JSE)
- {
- Class seInvokerClass = cl.loadClass(serviceEndpointInvokerJSE);
- seInvoker = (ServiceEndpointInvoker)seInvokerClass.newInstance();
- }
- else if (seInfo.getType() == ServiceEndpointInfo.EndpointType.SLSB21)
- {
- Class seInvokerClass = cl.loadClass(serviceEndpointInvokerEJB21);
- seInvoker = (ServiceEndpointInvoker)seInvokerClass.newInstance();
- }
- else if (seInfo.getType() == ServiceEndpointInfo.EndpointType.SLSB30)
- {
- Class seInvokerClass = cl.loadClass(serviceEndpointInvokerEJB3);
- seInvoker = (ServiceEndpointInvoker)seInvokerClass.newInstance();
- }
- else if (seInfo.getType() == ServiceEndpointInfo.EndpointType.MDB21)
- {
- Class seInvokerClass = cl.loadClass(serviceEndpointInvokerMDB);
- seInvoker = (ServiceEndpointInvoker)seInvokerClass.newInstance();
- }
-
- if (seInvoker == null)
- throw new WSException("Cannot obtain service endpoint invoker");
-
- return seInvoker;
- }
-
- /** Get the list of HandlerInfos associated with a given service endpoint
- */
- public List<HandlerMetaData> getHandlerMetaData(ObjectName sepID)
- {
- ServiceEndpoint wsEndpoint = getServiceEndpointByID(sepID);
- if (wsEndpoint == null)
- throw new WSException("Cannot find service endpoint: " + sepID);
-
- List<HandlerMetaData> handlers = null;
- if (wsEndpoint != null)
- {
- ServerEndpointMetaData sepMetaData =
wsEndpoint.getServiceEndpointInfo().getServerEndpointMetaData();
- handlers = sepMetaData.getHandlerMetaData(HandlerType.ALL);
- }
- return handlers;
- }
-
- /**
- * Dynamically change the list of handlers associated with a given service endpoint
- * The endpoint is expected to be in STOPED state
- */
- public void setHandlerMetaData(ObjectName sepID, List<HandlerMetaData>
handlers)
- {
- ServiceEndpoint wsEndpoint = getServiceEndpointByID(sepID);
- if (wsEndpoint == null)
- throw new WSException("Cannot find service endpoint: " + sepID);
-
- ServiceEndpointInfo sepInfo = wsEndpoint.getServiceEndpointInfo();
- if (sepInfo.getState() != ServiceEndpoint.State.STOPED)
- throw new WSException("Endpoint expected to be in STOPED state");
-
- ServerEndpointMetaData sepMetaData =
wsEndpoint.getServiceEndpointInfo().getServerEndpointMetaData();
- sepMetaData.clearHandlers();
-
- for (HandlerMetaData handlerMetaData : handlers)
- {
- handlerMetaData.setEndpointMetaData(sepMetaData);
- sepMetaData.addHandler(handlerMetaData);
- }
- }
-
- /** Create a service endpoint
- */
- public void createServiceEndpoint(ServiceEndpointInfo seInfo) throws Exception
- {
- ObjectName sepID = seInfo.getServiceEndpointID();
- if (registry.get(sepID) != null)
- throw new WSException("Service already registerd: " + sepID);
-
- ServiceEndpointInvoker seInvoker = getServiceEndpointInvoker(seInfo);
- seInvoker.initServiceEndpoint(seInfo);
- seInfo.setInvoker(seInvoker);
-
- // Load/Create the service endpoint impl
- ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
- ServerEndpointMetaData epMetaData = seInfo.getServerEndpointMetaData();
- String managedEndpointBean = epMetaData.getManagedEndpointBean();
- Class seClass = ctxLoader.loadClass(managedEndpointBean);
- Constructor ctor = seClass.getConstructor(new Class[] { ServiceEndpointInfo.class
});
- ServiceEndpoint wsEndpoint = (ServiceEndpoint)ctor.newInstance(new Object[] {
seInfo });
- wsEndpoint.create();
-
- // Register the endpoint with the MBeanServer
- registry.put(sepID, wsEndpoint);
-
- log.debug("WebService created: " + sepID);
- }
-
- /** Start a service endpoint
- */
- public void startServiceEndpoint(ObjectName sepID) throws Exception
- {
- ServiceEndpoint wsEndpoint = getServiceEndpointByID(sepID);
- if (wsEndpoint == null)
- throw new WSException("Cannot find service endpoint: " + sepID);
-
- wsEndpoint.start();
-
- ServiceEndpointInfo seInfo = wsEndpoint.getServiceEndpointInfo();
- log.info("WebService started: " +
seInfo.getServerEndpointMetaData().getEndpointAddress());
- }
-
- /** Stop a service endpoint
- */
- public void stopServiceEndpoint(ObjectName sepID) throws Exception
- {
- ServiceEndpoint wsEndpoint = getServiceEndpointByID(sepID);
- if (wsEndpoint == null)
- throw new WSException("Cannot find service endpoint: " + sepID);
-
- wsEndpoint.stop();
-
- ServiceEndpointInfo seInfo = wsEndpoint.getServiceEndpointInfo();
- log.info("WebService stopped: " +
seInfo.getServerEndpointMetaData().getEndpointAddress());
- }
-
- /** Destroy a service endpoint
- */
- public void destroyServiceEndpoint(ObjectName sepID) throws Exception
- {
- ServiceEndpoint wsEndpoint = getServiceEndpointByID(sepID);
- if (wsEndpoint == null)
- throw new WSException("Cannot find service endpoint: " + sepID);
-
- wsEndpoint.destroy();
-
- // Remove the endpoint from the MBeanServer
- registry.remove(sepID);
-
- ServiceEndpointInfo seInfo = wsEndpoint.getServiceEndpointInfo();
- log.debug("WebService destroyed: " +
seInfo.getServerEndpointMetaData().getEndpointAddress());
- }
-
- public void create() throws Exception
- {
- log.info(UnifiedMetaData.getImplementationVersion());
- MBeanServer server = getJMXServer();
- if (server != null)
- {
- server.registerMBean(this, OBJECT_NAME);
- }
- }
-
- public void destroy() throws Exception
- {
- log.debug("Destroy service endpoint manager");
- MBeanServer server = getJMXServer();
- if (server != null)
- {
- server.unregisterMBean(OBJECT_NAME);
- }
- }
-
- private MBeanServer getJMXServer()
- {
- MBeanServer server = null;
- ArrayList servers = MBeanServerFactory.findMBeanServer(null);
- if (servers.size() > 0)
- {
- server = (MBeanServer)servers.get(0);
- }
- return server;
- }
-
- public static class HttpSessionPropertyHelper implements MessageContextPropertyHelper
- {
-
- private EndpointContext context;
-
- public HttpSessionPropertyHelper(final EndpointContext context)
- {
- this.context = context;
- }
-
- public Object get()
- {
- return context.getHttpSession();
- }
-
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointManager.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointManager.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointManagerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointManagerFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointManagerFactory.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,55 +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.core.server;
-
-import org.jboss.kernel.spi.registry.KernelRegistry;
-import org.jboss.kernel.spi.registry.KernelRegistryEntry;
-
-// $Id$
-
-/**
- * Factory to the singleton instance of the ServiceEndpointManager
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 08-May-2006
- */
-public class ServiceEndpointManagerFactory
-{
- private static ServiceEndpointManagerFactory instance = new
ServiceEndpointManagerFactory();
-
- // Hide ctor
- private ServiceEndpointManagerFactory()
- {
- }
-
- public static ServiceEndpointManagerFactory getInstance()
- {
- return instance;
- }
-
- public ServiceEndpointManager getServiceEndpointManager()
- {
- KernelRegistry registry = KernelLocator.getKernel().getRegistry();
- KernelRegistryEntry entry = registry.getEntry(ServiceEndpointManager.BEAN_NAME);
- return (ServiceEndpointManager)entry.getTarget();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointManagerFactory.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointManagerFactory.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointManagerMBean.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointManagerMBean.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointManagerMBean.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,58 +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.core.server;
-
-import java.net.UnknownHostException;
-import java.util.List;
-
-import javax.management.ObjectName;
-
-import org.jboss.ws.core.utils.ObjectNameFactory;
-import org.jboss.ws.metadata.umdm.HandlerMetaData;
-
-/**
- * MBean interface.
- * @since 15-April-2004
- */
-public interface ServiceEndpointManagerMBean
-{
- // default object name
- static final ObjectName OBJECT_NAME =
ObjectNameFactory.create("jboss.ws:service=ServiceEndpointManager");
-
- String getWebServiceHost();
- void setWebServiceHost(String host) throws UnknownHostException;
-
- int getWebServicePort();
- void setWebServicePort(int port);
-
- int getWebServiceSecurePort();
- void setWebServiceSecurePort(int port);
-
- boolean isAlwaysModifySOAPAddress();
- void setAlwaysModifySOAPAddress(boolean modify);
-
- public List<HandlerMetaData> getHandlerMetaData(ObjectName sepID);
- public void setHandlerMetaData(ObjectName sepID, List<HandlerMetaData>
handlers);
-
- void startServiceEndpoint(ObjectName sepID) throws Exception;
- void stopServiceEndpoint(ObjectName sepID) throws Exception;
-}
Copied: trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointManagerMBean.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointManagerMBean.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointMetrics.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointMetrics.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointMetrics.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,175 +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.core.server;
-
-// $Id$
-
-import java.io.Serializable;
-import java.util.Date;
-
-import javax.management.ObjectName;
-
-/**
- * Service Endpoint Metrics
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 14-Dec-2005
- */
-public class ServiceEndpointMetrics implements Serializable
-{
- private static final long serialVersionUID = -7730514070812711512L;
-
- // The unique service endpointID
- private ObjectName endpointID;
-
- private Date startTime;
- private Date stopTime;
- private long requestCount;
- private long responseCount;
- private long faultCount;
- private long maxProcessingTime;
- private long minProcessingTime;
- private long avgProcessingTime;
- private long totalProcessingTime;
-
- public ServiceEndpointMetrics(ObjectName endpointID)
- {
- this.endpointID = endpointID;
- }
-
- public void start()
- {
- startTime = new Date();
- stopTime = null;
- requestCount = 0;
- responseCount = 0;
- faultCount = 0;
- maxProcessingTime = 0;
- minProcessingTime = 0;
- avgProcessingTime = 0;
- totalProcessingTime = 0;
- }
-
- public void stop()
- {
- stopTime = new Date();
- }
-
- public long processRequestMessage()
- {
- requestCount++;
- return System.currentTimeMillis();
- }
-
- public void processResponseMessage(long beginTime)
- {
- responseCount++;
- processAnyMessage(beginTime);
- }
-
- public void processFaultMessage(long beginTime)
- {
- faultCount++;
- processAnyMessage(beginTime);
- }
-
- private void processAnyMessage(long beginTime)
- {
- if (beginTime > 0)
- {
- long procTime = System.currentTimeMillis() - beginTime;
-
- if (minProcessingTime == 0)
- minProcessingTime = procTime;
-
- maxProcessingTime = Math.max(maxProcessingTime, procTime);
- minProcessingTime = Math.min(minProcessingTime, procTime);
- totalProcessingTime = totalProcessingTime + procTime;
- avgProcessingTime = totalProcessingTime / (responseCount + faultCount);
- }
- }
-
- public ObjectName getEndpointID()
- {
- return endpointID;
- }
-
- public Date getStartTime()
- {
- return startTime;
- }
-
- public Date getStopTime()
- {
- return stopTime;
- }
-
- public long getMinProcessingTime()
- {
- return minProcessingTime;
- }
-
- public long getMaxProcessingTime()
- {
- return maxProcessingTime;
- }
-
- public long getAverageProcessingTime()
- {
- return avgProcessingTime;
- }
-
- public long getTotalProcessingTime()
- {
- return totalProcessingTime;
- }
-
- public long getRequestCount()
- {
- return requestCount;
- }
-
- public long getFaultCount()
- {
- return faultCount;
- }
-
- public long getResponseCount()
- {
- return responseCount;
- }
-
- public String toString()
- {
- StringBuilder buffer = new StringBuilder("\nEndpoint Metrics: " +
endpointID);
- buffer.append("\n startTime=" + startTime);
- buffer.append("\n stopTime=" + stopTime);
- buffer.append("\n requestCount=" + requestCount);
- buffer.append("\n responseCount=" + responseCount);
- buffer.append("\n faultCount=" + faultCount);
- buffer.append("\n maxProcessingTime=" + maxProcessingTime);
- buffer.append("\n minProcessingTime=" + minProcessingTime);
- buffer.append("\n avgProcessingTime=" + avgProcessingTime);
- buffer.append("\n totalProcessingTime=" + totalProcessingTime);
- return buffer.toString();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointMetrics.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointMetrics.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/server/ServletHeaderSource.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServletHeaderSource.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/server/ServletHeaderSource.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,115 +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.core.server;
-
-// $Id$
-
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.xml.soap.MimeHeader;
-import javax.xml.soap.MimeHeaders;
-
-/**
- * Implementation of <code>HeaderSource</code> that pulls header
- * information from an HttpServlet.
- *
- * @author <a href="mailto:jason@stacksmash.com">Jason T.
Greene</a>
- * @author Thomas.Diesler(a)jboss.org
- */
-public class ServletHeaderSource implements HeaderSource
-{
- private HttpServletRequest req;
- private HttpServletResponse res;
-
- public ServletHeaderSource(HttpServletRequest req, HttpServletResponse res)
- {
- this.req = req;
- this.res = res;
- }
-
- public MimeHeaders getMimeHeaders()
- {
- Enumeration e = req.getHeaderNames();
- if (e == null)
- return null;
-
- MimeHeaders headers = new MimeHeaders();
-
- while (e.hasMoreElements())
- {
- String name = (String)e.nextElement();
- headers.addHeader(name, req.getHeader(name));
- }
-
- return headers;
- }
-
- public Map<String, List<String>> getHeaderMap()
- {
- Map<String, List<String>> headerMap = new HashMap<String,
List<String>>();
-
- Enumeration e = req.getHeaderNames();
- if (e != null)
- {
- while (e.hasMoreElements())
- {
- String name = (String)e.nextElement();
- List<String> values = new ArrayList<String>();
- values.add(req.getHeader(name));
- headerMap.put(name, values);
- }
- }
-
- return headerMap;
- }
-
- public void setMimeHeaders(MimeHeaders headers)
- {
- Iterator i = headers.getAllHeaders();
- while (i.hasNext())
- {
- MimeHeader header = (MimeHeader)i.next();
- res.addHeader(header.getName(), header.getValue());
- }
- }
-
- public void setHeaderMap(Map<String, List<String>> headers)
- {
- Iterator<String> it = headers.keySet().iterator();
- while (it.hasNext())
- {
- String name = it.next();
- List<String> values = headers.get(name);
- for (String value : values)
- {
- res.addHeader(name, value);
- }
- }
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/server/ServletHeaderSource.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServletHeaderSource.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,84 +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.core.server;
-
-// $Id$
-
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * The container independent deployment info.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class UnifiedDeploymentInfo
-{
- public enum DeploymentType
- {
- JAXRPC_Client, JAXRPC_JSE, JAXRPC_EJB21, JAXRPC_EJB3, JAXWS_JSE, JAXWS_EJB21,
JAXWS_EJB3
- };
-
- public UnifiedDeploymentInfo(DeploymentType type)
- {
- this.type = type;
- }
-
- /** The type of this deployment */
- public DeploymentType type;
- /** Sub deployments have a parent */
- public UnifiedDeploymentInfo parent;
- /** The suffix of the deployment url */
- public String shortName;
- /** The URL identifing this deployment **/
- public URL url;
- /** The URL to the expanded webapp **/
- public URL expandedWebApp;
- /** We can hold "typed" metadata */
- public Object metaData;
- /** The deployment classloader **/
- public ClassLoader classLoader;
- /** An arbitrary map of state associated with the deployment */
- public Map<String, Object> context = new HashMap<String, Object>();
-
- /** The sortName concatenated with the canonical names of all parents. */
- public String getCanonicalName()
- {
- String name = shortName;
- if (parent != null)
- name = parent.getCanonicalName() + "/" + name;
- return name;
- }
-
- public String toString()
- {
- StringBuilder builder = new StringBuilder();
- builder.append("[");
- builder.append("type=" + type);
- builder.append(",shortName=" + shortName);
- builder.append(",url=" + url);
- builder.append("]");
- return builder.toString();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,327 +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.core.server;
-
-// $Id$
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Writer;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.wsdl.Definition;
-import javax.wsdl.Import;
-import javax.wsdl.factory.WSDLFactory;
-
-import org.jboss.logging.Logger;
-import org.jboss.util.NotImplementedException;
-import org.jboss.ws.Constants;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.core.utils.IOUtils;
-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.tools.wsdl.WSDLWriter;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/** A helper class that publishes the wsdl files and their imports to the
server/data/wsdl directory.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 02-June-2004
- */
-public class WSDLFilePublisher
-{
- // provide logging
- private static final Logger log = Logger.getLogger(WSDLFilePublisher.class);
-
- // The deployment info for the web service archive
- private UnifiedDeploymentInfo udi;
- // The expected wsdl location in the deployment
- private String expLocation;
-
- public WSDLFilePublisher(UnifiedDeploymentInfo udi)
- {
- this.udi = udi;
-
- String archiveName = udi.shortName;
- if (archiveName.endsWith(".jar") ||
archiveName.endsWith(".ejb3"))
- expLocation = "META-INF/wsdl/";
- else if (archiveName.endsWith(".war"))
- expLocation = "WEB-INF/wsdl/";
- else throw new WSException("Can only publish wsdl from WAR or JAR
deployment");
- }
-
- /** Publish the deployed wsdl file to the data directory
- */
- public void publishWsdlFiles(UnifiedMetaData wsMetaData) throws IOException
- {
- String deploymentName = udi.getCanonicalName();
-
- // For each service
- for (ServiceMetaData serviceMetaData : wsMetaData.getServices())
- {
- String wsdlFile = serviceMetaData.getWsdlFile();
- log.debug("Publish WSDL file: " + wsdlFile);
-
- if (wsdlFile != null)
- {
- File targetFile = getPublishLocation(deploymentName, serviceMetaData);
- targetFile.getParentFile().mkdirs();
-
- // Get the wsdl definition and write it to the wsdl publish location
- try
- {
- Writer fWriter = IOUtils.getCharsetFileWriter(targetFile,
Constants.DEFAULT_XML_CHARSET);
- WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
- new WSDLWriter(wsdlDefinitions).write(fWriter,
Constants.DEFAULT_XML_CHARSET);
-
- URL wsdlPublishURL = targetFile.toURL();
- log.info("WSDL published to: " + wsdlPublishURL);
-
- // delete wsdl temp file
- ServerConfigFactory factory = ServerConfigFactory.getInstance();
- ServerConfig config = factory.getServerConfig();
- if
(wsdlFile.startsWith(config.getServerTempDir().toURL().toExternalForm()))
- {
- new File(wsdlFile).delete();
- }
-
- // udpate the wsdl file location
- serviceMetaData.setWsdlFile(wsdlPublishURL.toExternalForm());
-
- // Process the wsdl imports
- Definition wsdl11Definition = wsdlDefinitions.getWsdlOneOneDefinition();
- if (wsdl11Definition != null)
- {
- publishWsdlImports(targetFile.toURL(), wsdl11Definition);
-
- // Publish XMLSchema imports
- Document document = wsdlDefinitions.getWsdlDocument();
- publishSchemaImports(targetFile.toURL(),
document.getDocumentElement());
- }
- else
- {
- throw new NotImplementedException("WSDL-2.0 imports");
- }
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception e)
- {
- throw new WSException("Cannot publish wsdl to: " + targetFile,
e);
- }
- }
- }
- }
-
- /** Publish the wsdl imports for a given wsdl definition
- */
- private void publishWsdlImports(URL parentURL, Definition parentDefinition) throws
Exception
- {
- String baseURI = parentURL.toExternalForm();
-
- Iterator it = parentDefinition.getImports().values().iterator();
- while (it.hasNext())
- {
- for (Import wsdlImport : (List<Import>)it.next())
- {
- String locationURI = wsdlImport.getLocationURI();
- Definition subdef = wsdlImport.getDefinition();
-
- // its an external import, don't publish locally
- if (locationURI.startsWith("http://") == false)
- {
- URL targetURL = new URL(baseURI.substring(0,
baseURI.lastIndexOf("/") + 1) + locationURI);
- File targetFile = new File(targetURL.getPath());
- targetFile.getParentFile().mkdirs();
-
- WSDLFactory wsdlFactory = WSDLFactory.newInstance();
- javax.wsdl.xml.WSDLWriter wsdlWriter = wsdlFactory.newWSDLWriter();
- FileWriter fw = new FileWriter(targetFile);
- wsdlWriter.writeWSDL(subdef, fw);
- fw.close();
-
- log.debug("WSDL import published to: " + targetURL);
-
- // recursivly publish imports
- publishWsdlImports(targetURL, subdef);
-
- // Publish XMLSchema imports
- Element subdoc = DOMUtils.parse(targetURL.openStream());
- publishSchemaImports(targetURL, subdoc);
- }
- }
- }
- }
-
- /** Publish the schema imports for a given wsdl definition
- */
- private void publishSchemaImports(URL parentURL, Element element) throws Exception
- {
- String baseURI = parentURL.toExternalForm();
-
- Iterator it = DOMUtils.getChildElements(element);
- while (it.hasNext())
- {
- Element childElement = (Element)it.next();
- if ("import".equals(childElement.getLocalName()) ||
"include".equals(childElement.getLocalName()))
- {
- String schemaLocation =
childElement.getAttribute("schemaLocation");
- if (schemaLocation.length() > 0)
- {
- if (schemaLocation.startsWith("http://") == false)
- {
- URL xsdURL = new URL(baseURI.substring(0,
baseURI.lastIndexOf("/") + 1) + schemaLocation);
- File targetFile = new File(xsdURL.getPath());
- targetFile.getParentFile().mkdirs();
-
- String deploymentName = udi.getCanonicalName();
-
- // get the resource path
- int index = baseURI.indexOf(deploymentName);
- String resourcePath = baseURI.substring(index +
deploymentName.length());
- resourcePath = resourcePath.substring(0,
resourcePath.lastIndexOf("/"));
- if (resourcePath.length() > 0)
- resourcePath = resourcePath + "/";
-
- resourcePath = expLocation + resourcePath + schemaLocation;
- InputStream is = udi.classLoader.getResourceAsStream(resourcePath);
- if (is == null)
- throw new IllegalArgumentException("Cannot find schema import
in deployment: " + resourcePath);
-
- FileOutputStream fos = new FileOutputStream(targetFile);
- IOUtils.copyStream(fos, is);
- fos.close();
- is.close();
-
- log.debug("XMLSchema import published to: " + xsdURL);
-
- // recursivly publish imports
- Element subdoc = DOMUtils.parse(xsdURL.openStream());
- publishSchemaImports(xsdURL, subdoc);
- }
- }
- }
- else
- {
- publishSchemaImports(parentURL, childElement);
- }
- }
- }
-
- /**
- * Delete the published wsdl
- */
- public void unpublishWsdlFiles() throws IOException
- {
- String deploymentDir = (udi.parent != null ? udi.parent.shortName :
udi.shortName);
- ServerConfig config = ServerConfigFactory.getInstance().getServerConfig();
- File serviceDir = new File(config.getServerDataDir().getCanonicalPath() +
"/wsdl/" + deploymentDir);
- deleteWsdlPublishDirectory(serviceDir);
- }
-
- /**
- * Delete the published wsdl document, traversing down the dir structure
- */
- private void deleteWsdlPublishDirectory(File dir) throws IOException
- {
- String[] files = dir.list();
- for (int i = 0; files != null && i < files.length; i++)
- {
- String fileName = files[i];
- File file = new File(dir + "/" + fileName);
- if (file.isDirectory())
- {
- deleteWsdlPublishDirectory(file);
- }
- else
- {
- if (file.delete() == false)
- log.warn("Cannot delete published wsdl document: " +
file.toURL());
- }
- }
-
- // delete the directory as well
- dir.delete();
- }
-
- /**
- * Get the file publish location
- */
- private File getPublishLocation(String archiveName, ServiceMetaData serviceMetaData)
throws IOException
- {
- // Only file URLs are supported in <wsdl-publish-location>
- String publishLocation = serviceMetaData.getWsdlPublishLocation();
- boolean predefinedLocation = publishLocation != null &&
publishLocation.startsWith("file:");
-
- File locationFile = null;
- if (predefinedLocation == false)
- {
- ServerConfig config = ServerConfigFactory.getInstance().getServerConfig();
- locationFile = new File(config.getServerDataDir().getCanonicalPath() +
"/wsdl/" + archiveName);
- }
- else
- {
- try
- {
- locationFile = new File(new URL(publishLocation).getPath());
- }
- catch (MalformedURLException e)
- {
- throw new IllegalArgumentException("Invalid publish location: " +
e.getMessage());
- }
- }
-
- // make sure we don't have a leadig '/'
- String wsdlFile = serviceMetaData.getWsdlFile();
- if (wsdlFile.startsWith("/"))
- wsdlFile = wsdlFile.substring(1);
-
- File wsdlLocation;
- if (wsdlFile.startsWith(expLocation))
- {
- wsdlFile = wsdlFile.substring(expLocation.length());
- wsdlLocation = new File(locationFile + "/" + wsdlFile);
- }
- else if (wsdlFile.startsWith("file:/"))
- {
- wsdlFile = wsdlFile.substring(wsdlFile.lastIndexOf("/") + 1);
- wsdlLocation = new File(locationFile + "/" + wsdlFile);
- }
- else
- {
- throw new WSException("Invalid wsdlFile '" + wsdlFile +
"', expected in: " + expLocation);
- }
-
- return wsdlLocation;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -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.core.server;
-
-// $Id$
-
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * Handles the delivery of the WSDL and its included artifacts.
- * It rewrites the include URL's.
- *
- *
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3871263#...
- *
- * For a discussion of this topic.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 23-Mar-2005
- */
-public class WSDLRequestHandler
-{
- // provide logging
- private Logger log = Logger.getLogger(WSDLRequestHandler.class);
-
- private EndpointMetaData epMetaData;
-
- public WSDLRequestHandler(EndpointMetaData epMetaData)
- {
- this.epMetaData = epMetaData;
- }
-
- /**
- * Get the WSDL resource for a given resource path
- * <p/>
- * Use path value of null to get the root document
- *
- * @param resPath The wsdl resource to get, can be null for the top level wsdl
- * @return A wsdl document, or null if it cannot be found
- */
- public Document getDocumentForPath(URL reqURL, String wsdlHost, String resPath) throws
IOException
- {
- String wsdlLocation = epMetaData.getServiceMetaData().getWsdlFile();
- if (wsdlLocation == null)
- throw new IllegalStateException("Cannot obtain wsdlFile from endpoint meta
data");
-
- Document wsdlDoc;
-
- // The WSDLFilePublisher should set the location to an URL
- URL wsdlURL = new URL(wsdlLocation);
-
- // get the root wsdl
- if (resPath == null)
- {
- Element wsdlElement = DOMUtils.parse(wsdlURL.openStream());
- wsdlDoc = wsdlElement.getOwnerDocument();
- }
-
- // get some imported resource
- else
- {
- String impResourcePath = new File(wsdlURL.getPath()).getParent() +
File.separatorChar + resPath;
- File impResourceFile = new File(impResourcePath);
-
- Element wsdlElement = DOMUtils.parse(impResourceFile.toURL().openStream());
- wsdlDoc = wsdlElement.getOwnerDocument();
- }
-
- modifyAddressReferences(reqURL, wsdlHost, resPath, wsdlDoc.getDocumentElement());
- return wsdlDoc;
- }
-
- /**
- * Modify the location of wsdl and schema imports
- */
- private void modifyAddressReferences(URL reqURL, String wsdlHost, String resPath,
Element element) throws MalformedURLException
- {
- // map wsdl definition imports
- NodeList nlist = element.getChildNodes();
- for (int i = 0; i < nlist.getLength(); i++)
- {
- Node childNode = nlist.item(i);
- if (childNode.getNodeType() == Node.ELEMENT_NODE)
- {
- Element childElement = (Element)childNode;
- String nodeName = childElement.getLocalName();
- if ("import".equals(nodeName) ||
"include".equals(nodeName))
- {
- Attr locationAttr =
childElement.getAttributeNode("schemaLocation");
- if (locationAttr == null)
- locationAttr = childElement.getAttributeNode("location");
-
- if (locationAttr != null)
- {
- String orgLocation = locationAttr.getNodeValue();
- boolean isAbsolute = orgLocation.startsWith("http://") ||
orgLocation.startsWith("https://");
- if (isAbsolute == false &&
orgLocation.startsWith(reqURL.getPath()) == false)
- {
- String newResourcePath = orgLocation;
-
- if (resPath != null && resPath.indexOf("/") >
0)
- newResourcePath = resPath.substring(0,
resPath.lastIndexOf("/") + 1) + orgLocation;
-
- String reqProtocol = reqURL.getProtocol();
- int reqPort = reqURL.getPort();
- String hostAndPort = wsdlHost + (reqPort > 0 ? ":" +
reqPort : "");
- String reqPath = reqURL.getPath();
-
- String newLocation = reqProtocol + "://" + hostAndPort +
reqPath + "?wsdl&resource=" + newResourcePath;
- locationAttr.setNodeValue(newLocation);
-
- log.debug("Mapping import from '" + orgLocation +
"' to '" + newLocation + "'");
- }
- }
- }
- else if ("address".equals(nodeName))
- {
- Attr locationAttr = childElement.getAttributeNode("location");
- if (locationAttr != null)
- {
- String orgLocation = locationAttr.getNodeValue();
-
- URL locURL = new URL(orgLocation);
- String locProtocol = locURL.getProtocol();
- String locPath = locURL.getPath();
- if (reqURL.getProtocol().equals(locProtocol) &&
reqURL.getPath().equals(locPath))
- {
- int locPort = locURL.getPort();
- String hostAndPort = wsdlHost + (locPort > 0 ? ":" +
locPort : "");
-
- String newLocation = locProtocol + "://" + hostAndPort +
locPath;
- locationAttr.setNodeValue(newLocation);
-
- log.debug("Mapping address from '" + orgLocation +
"' to '" + newLocation + "'");
- }
- }
- }
- else
- {
- modifyAddressReferences(reqURL, wsdlHost, resPath, childElement);
- }
- }
- }
- }
-
-}
Copied: trunk/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java)
Copied: trunk/src/main/java/org/jboss/ws/core/soap (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/AttrImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/AttrImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/AttrImpl.java 2006-12-07 10:43:36 UTC (rev
1600)
@@ -1,85 +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.core.soap;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.TypeInfo;
-
-/**
- * Facade for DOM Attr. Helps ensure that the propper SAAJ entities are returned
- * after DOM calls are made.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class AttrImpl extends NodeImpl implements Attr
-{
- private SOAPElementImpl element;
-
- private Attr attr;
-
- public AttrImpl(SOAPElementImpl element, Attr attr)
- {
- super(attr);
- this.attr = attr;
- this.element = element;
- }
-
- public String getName()
- {
- return attr.getName();
- }
-
- public Element getOwnerElement()
- {
- return element;
- }
-
- public Document getOwnerDocument()
- {
- return element.getOwnerDocument();
- }
-
- public boolean getSpecified()
- {
- return attr.getSpecified();
- }
-
- public String getValue()
- {
- return attr.getValue();
- }
-
- public TypeInfo getSchemaTypeInfo()
- {
- // TODO Implement DOM3
- return null;
- }
-
- public boolean isId()
- {
- // TODO Implement DOM3
- return false;
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/core/soap/AttrImpl.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/AttrImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/DetailEntryImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/DetailEntryImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/DetailEntryImpl.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -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.core.soap;
-
-import javax.xml.soap.DetailEntry;
-import javax.xml.soap.Name;
-
-/**
- * The content for a Detail object, giving details for a SOAPFault object.
- * A DetailEntry object, which carries information about errors related to the SOAPBody
object that contains it,
- * is application-specific.
- *
- * @author Thomas.Diesler(a)jboss.org
- */
-public class DetailEntryImpl extends SOAPElementImpl implements DetailEntry
-{
- public DetailEntryImpl(Name name)
- {
- super(name);
- }
-
- public DetailEntryImpl(SOAPElementImpl soapElement)
- {
- super(soapElement);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/soap/DetailEntryImpl.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/DetailEntryImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/DetailImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/DetailImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/DetailImpl.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,60 +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.core.soap;
-
-import java.util.Iterator;
-
-import javax.xml.soap.Detail;
-import javax.xml.soap.DetailEntry;
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPException;
-
-/**
- * A container for DetailEntry objects. DetailEntry objects give detailed error
information that is application-specific
- * and related to the SOAPBody object that contains it.
- *
- * A Detail object, which is part of a SOAPFault object, can be retrieved using the
method SOAPFault.getDetail.
- *
- * The Detail interface provides two methods. One creates a new DetailEntry object and
also automatically adds
- * it to the Detail object. The second method gets a list of the DetailEntry objects
contained in a Detail object.
- *
- * @author Thomas.Diesler(a)jboss.org
- */
-public class DetailImpl extends SOAPFaultElementImpl implements Detail
-{
- public DetailImpl()
- {
- super("detail");
- }
-
- public DetailEntry addDetailEntry(Name name) throws SOAPException
- {
- DetailEntryImpl detailEntry = new DetailEntryImpl(name);
- addChildElement(detailEntry);
- return detailEntry;
- }
-
- public Iterator getDetailEntries()
- {
- return getChildElements();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/soap/DetailImpl.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/DetailImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/DocumentFragmentImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/DocumentFragmentImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/DocumentFragmentImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,231 +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.core.soap;
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.UserDataHandler;
-
-/**
- * An implementation of a DOM Document fragment. This just delegates to
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class DocumentFragmentImpl implements DocumentFragment
-{
- private DocumentFragment delegate;
-
- public DocumentFragmentImpl(DocumentFragment fragment)
- {
- this.delegate = fragment;
- }
-
- public Node appendChild(Node arg0) throws DOMException
- {
- return delegate.appendChild(arg0);
- }
-
- public Node cloneNode(boolean arg0)
- {
- return delegate.cloneNode(arg0);
- }
-
- public short compareDocumentPosition(Node arg0) throws DOMException
- {
- return delegate.compareDocumentPosition(arg0);
- }
-
- public NamedNodeMap getAttributes()
- {
- return delegate.getAttributes();
- }
-
- public String getBaseURI()
- {
- return delegate.getBaseURI();
- }
-
- public NodeList getChildNodes()
- {
- return delegate.getChildNodes();
- }
-
- public Object getFeature(String arg0, String arg1)
- {
- return delegate.getFeature(arg0, arg1);
- }
-
- public Node getFirstChild()
- {
- return delegate.getFirstChild();
- }
-
- public Node getLastChild()
- {
- return delegate.getLastChild();
- }
-
- public String getLocalName()
- {
- return delegate.getLocalName();
- }
-
- public String getNamespaceURI()
- {
- return delegate.getNamespaceURI();
- }
-
- public Node getNextSibling()
- {
- return delegate.getNextSibling();
- }
-
- public String getNodeName()
- {
- return delegate.getNodeName();
- }
-
- public short getNodeType()
- {
- return delegate.getNodeType();
- }
-
- public String getNodeValue() throws DOMException
- {
- return delegate.getNodeValue();
- }
-
- public Document getOwnerDocument()
- {
- return delegate.getOwnerDocument();
- }
-
- public Node getParentNode()
- {
- return delegate.getParentNode();
- }
-
- public String getPrefix()
- {
- return delegate.getPrefix();
- }
-
- public Node getPreviousSibling()
- {
- return delegate.getPreviousSibling();
- }
-
- public String getTextContent() throws DOMException
- {
- return delegate.getTextContent();
- }
-
- public Object getUserData(String arg0)
- {
- return delegate.getUserData(arg0);
- }
-
- public boolean hasAttributes()
- {
- return delegate.hasAttributes();
- }
-
- public boolean hasChildNodes()
- {
- return delegate.hasChildNodes();
- }
-
- public Node insertBefore(Node arg0, Node arg1) throws DOMException
- {
- return delegate.insertBefore(arg0, arg1);
- }
-
- public boolean isDefaultNamespace(String arg0)
- {
- return delegate.isDefaultNamespace(arg0);
- }
-
- public boolean isEqualNode(Node arg0)
- {
- return delegate.isEqualNode(arg0);
- }
-
- public boolean isSameNode(Node arg0)
- {
- return delegate.isSameNode(arg0);
- }
-
- public boolean isSupported(String arg0, String arg1)
- {
- return delegate.isSupported(arg0, arg1);
- }
-
- public String lookupNamespaceURI(String arg0)
- {
- return delegate.lookupNamespaceURI(arg0);
- }
-
- public String lookupPrefix(String arg0)
- {
- return delegate.lookupPrefix(arg0);
- }
-
- public void normalize()
- {
- delegate.normalize();
- }
-
- public Node removeChild(Node arg0) throws DOMException
- {
- return delegate.removeChild(arg0);
- }
-
- public Node replaceChild(Node arg0, Node arg1) throws DOMException
- {
- return delegate.replaceChild(arg0, arg1);
- }
-
- public void setNodeValue(String arg0) throws DOMException
- {
- delegate.setNodeValue(arg0);
- }
-
- public void setPrefix(String arg0) throws DOMException
- {
- delegate.setPrefix(arg0);
- }
-
- public void setTextContent(String arg0) throws DOMException
- {
- delegate.setTextContent(arg0);
- }
-
- public Object setUserData(String arg0, Object arg1, UserDataHandler arg2)
- {
- return delegate.setUserData(arg0, arg1, arg2);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/soap/DocumentFragmentImpl.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/DocumentFragmentImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/EndpointInfo.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/EndpointInfo.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/EndpointInfo.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -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.core.soap;
-
-// $Id$
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-
-/** A wrapper object that associates the target address with some metadata
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 20-Jul-2005
- */
-public class EndpointInfo
-{
- private String targetAddress;
- private Map<String, Object> properties;
-
- public EndpointInfo(EndpointMetaData epMetaData, String targetAddress, Map<String,
Object> callProps)
- {
- this.targetAddress = targetAddress;
- this.properties = new HashMap<String, Object>();
-
- // Add the service properties
- Properties serviceProps = epMetaData.getServiceMetaData().getProperties();
- if (serviceProps != null)
- {
- Iterator it = serviceProps.entrySet().iterator();
- while (it.hasNext())
- {
- Map.Entry entry = (Map.Entry)it.next();
- String key = (String)entry.getKey();
- Object val = entry.getValue();
- properties.put(key, val);
- }
- }
-
- // Add the endpoint properties
- Properties epProps = epMetaData.getProperties();
- if (epProps != null)
- {
- Iterator it = epProps.entrySet().iterator();
- while (it.hasNext())
- {
- Map.Entry entry = (Map.Entry)it.next();
- String key = (String)entry.getKey();
- Object val = entry.getValue();
- properties.put(key, val);
- }
- }
-
- // Add the call properties
- if (callProps != null)
- {
- properties.putAll(callProps);
- }
- }
-
- public Map<String, Object> getProperties()
- {
- return properties;
- }
-
- public String getTargetAddress()
- {
- return targetAddress;
- }
-
- public boolean equals(Object obj)
- {
- if (!(obj instanceof EndpointInfo))
- return false;
- return toString().equals(obj.toString());
- }
-
- public int hashCode()
- {
- return toString().hashCode();
- }
-
- public String toString()
- {
- return "[addr=" + targetAddress + ",props=" + properties +
"]";
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/core/soap/EndpointInfo.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/EndpointInfo.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/JAXWSPayloadBuilder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/JAXWSPayloadBuilder.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/JAXWSPayloadBuilder.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,113 +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.core.soap;
-
-//$Id$
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPHeader;
-import javax.xml.transform.stream.StreamSource;
-
-import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.core.utils.DOMWriter;
-import org.w3c.dom.Element;
-
-/**
- * A SOAPEnvelope builder for JAXWS in service mode PAYLOAD
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 30-Jun-2006
- */
-public class JAXWSPayloadBuilder implements PayloadBuilder
-{
- public void build(SOAPMessageImpl soapMessage, InputStream ins, boolean
ignoreParseError) throws IOException, SOAPException
- {
- // Parse the XML input stream
- Element domEnv = null;
- try
- {
- domEnv = DOMUtils.parse(ins);
- }
- catch (IOException ex)
- {
- if (ignoreParseError)
- {
- return;
- }
- throw ex;
- }
-
- String envNS = domEnv.getNamespaceURI();
- String envPrefix = domEnv.getPrefix();
-
- // Construct the envelope
- SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
- SOAPPartImpl soapPart = (SOAPPartImpl)soapMessage.getSOAPPart();
- SOAPEnvelopeImpl soapEnv = new SOAPEnvelopeImpl(soapPart,
soapFactory.createElement(domEnv, false));
-
- DOMUtils.copyAttributes(soapEnv, domEnv);
-
- // Add the header elements
- Element domHeader = DOMUtils.getFirstChildElement(domEnv, new QName(envNS,
"Header"));
- if (domHeader != null)
- {
- SOAPHeader soapHeader = soapEnv.getHeader();
-
- DOMUtils.copyAttributes(soapHeader, domHeader);
-
- Iterator it = DOMUtils.getChildElements(domHeader);
- while (it.hasNext())
- {
- Element srcElement = (Element)it.next();
- String xmlFragment = DOMWriter.printNode(srcElement, false);
-
- Name name = new NameImpl(srcElement.getLocalName(), srcElement.getPrefix(),
srcElement.getNamespaceURI());
- SOAPContentElement destElement = new SOAPHeaderElementImpl(name);
- soapHeader.addChildElement(destElement);
-
- DOMUtils.copyAttributes(destElement, srcElement);
- destElement.setXMLFragment(xmlFragment);
- }
- }
-
- // Add the body elements
- Element domBody = DOMUtils.getFirstChildElement(domEnv, new QName(envNS,
"Body"));
- SOAPBodyImpl soapBody = (SOAPBodyImpl)soapEnv.getBody();
-
- DOMUtils.copyAttributes(soapBody, domBody);
-
- Iterator itBody = DOMUtils.getChildElements(domBody);
- if (itBody.hasNext())
- {
- Element domBodyElement = (Element)itBody.next();
- String xmlStr = DOMWriter.printNode(domBodyElement, false);
- soapBody.setPayload(new StreamSource(new
ByteArrayInputStream(xmlStr.getBytes())));
- }
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/soap/JAXWSPayloadBuilder.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/JAXWSPayloadBuilder.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/MessageContextAssociation.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/MessageContextAssociation.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/MessageContextAssociation.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,78 +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.core.soap;
-
-// $Id$
-
-import java.util.Stack;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.utils.ThreadLocalAssociation;
-
-/**
- * A thread local association with the current message context
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 14-Dec-2004
- */
-public class MessageContextAssociation
-{
- // provide logging
- private static Logger log = Logger.getLogger(MessageContextAssociation.class);
-
-
- public static void pushMessageContext(CommonMessageContext msgContext)
- {
- log.debug("pushMessageContext: " + msgContext + " (Thread "
+Thread.currentThread().getName()+ ")");
- Stack<CommonMessageContext> stack =
ThreadLocalAssociation.localMsgContextAssoc().get();
- if (stack == null)
- {
- stack = new Stack<CommonMessageContext>();
- ThreadLocalAssociation.localMsgContextAssoc().set(stack);
- }
- stack.push(msgContext);
- }
-
- public static CommonMessageContext peekMessageContext()
- {
- CommonMessageContext msgContext = null;
- Stack<CommonMessageContext> stack =
ThreadLocalAssociation.localMsgContextAssoc().get();
- if (stack != null && stack.isEmpty() == false)
- {
- msgContext = stack.peek();
- }
- return msgContext;
- }
-
- public static CommonMessageContext popMessageContext()
- {
- CommonMessageContext msgContext = null;
- Stack<CommonMessageContext> stack =
ThreadLocalAssociation.localMsgContextAssoc().get();
- if (stack != null && stack.isEmpty() == false)
- {
- msgContext = stack.pop();
- }
- log.debug("popMessageContext: " + msgContext +" (Thread "
+Thread.currentThread().getName()+ ")");
- return msgContext;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/soap/MessageContextAssociation.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/MessageContextAssociation.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,279 +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.core.soap;
-
-// $Id$
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Collection;
-import java.util.Iterator;
-
-import javax.mail.internet.ContentType;
-import javax.mail.internet.ParseException;
-import javax.xml.soap.AttachmentPart;
-import javax.xml.soap.MessageFactory;
-import javax.xml.soap.MimeHeader;
-import javax.xml.soap.MimeHeaders;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.Service.Mode;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.jaxrpc.Style;
-import org.jboss.ws.core.soap.attachment.MimeConstants;
-import org.jboss.ws.core.soap.attachment.MultipartRelatedDecoder;
-import org.jboss.ws.core.utils.IOUtils;
-
-/**
- * MessageFactory implementation
- *
- * @author Thomas.Diesler(a)jboss.org
- */
-public class MessageFactoryImpl extends MessageFactory
-{
- private static Logger log = Logger.getLogger(MessageFactoryImpl.class);
-
- // The envelope URI used by the MessageFactory
- private String envelopeURI = Constants.NS_SOAP11_ENV;
-
- // The JAXWS ServiceMode
- private Mode serviceMode;
- // The style used by this MessageFactory
- private Style style;
-
- /**
- * Get the SOAP envelope URI this factory will use when creating envelopes.
- */
- public String getEnvelopeURI()
- {
- return envelopeURI;
- }
-
- /**
- * Set the SOAP envelope URI this factory will use when creating envelopes.
- */
- public void setEnvelopeURI(String envelopeURI)
- {
- this.envelopeURI = envelopeURI;
- }
-
- /**
- * Get the Style this message factory will use
- */
- public Style getStyle()
- {
- if (style == null)
- {
- CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
- if (msgContext != null && msgContext.getOperationMetaData() != null)
- {
- style = msgContext.getOperationMetaData().getStyle();
- }
- log.trace("Using style: " + style);
- }
- return style;
- }
-
- public void setStyle(Style style)
- {
- this.style = style;
- }
-
- public Mode getServiceMode()
- {
- return serviceMode;
- }
-
- public void setServiceMode(Mode serviceMode)
- {
- this.serviceMode = serviceMode;
- }
-
- /**
- * Creates a new SOAPMessage object with the default SOAPPart, SOAPEnvelope,
- * SOAPBody, and SOAPHeader objects. Profile-specific message factories can
- * choose to prepopulate the SOAPMessage object with profile-specific
- * headers.
- *
- * Content can be added to this message's SOAPPart object, and the message
- * can be sent "as is" when a message containing only a SOAP part is
- * sufficient. Otherwise, the SOAPMessage object needs to create one or more
- * AttachmentPart objects and add them to itself. Any content that is not in
- * XML format must be in an AttachmentPart object.
- *
- * @return a new SOAPMessage object
- * @throws javax.xml.soap.SOAPException
- * if a SOAP error occurs
- */
- public SOAPMessage createMessage() throws SOAPException
- {
- SOAPMessageImpl soapMessage = new SOAPMessageImpl();
- SOAPPartImpl soapPart = (SOAPPartImpl)soapMessage.getSOAPPart();
- new SOAPEnvelopeImpl(soapPart, envelopeURI);
- return soapMessage;
- }
-
- /**
- * Internalizes the contents of the given InputStream object into a new
- * SOAPMessage object and returns the SOAPMessage object.
- *
- * @param mimeHeaders
- * the transport-specific headers passed to the message in a
- * transport-independent fashion for creation of the message
- * @param ins
- * the InputStream object that contains the data for a message
- * @return a new SOAPMessage object containing the data from the given
- * InputStream object
- * @throws java.io.IOException
- * if there is a problem in reading data from the input stream
- * @throws javax.xml.soap.SOAPException
- * if the message is invalid
- */
- public SOAPMessage createMessage(MimeHeaders mimeHeaders, InputStream ins) throws
IOException, SOAPException
- {
- return createMessageInternal(mimeHeaders, ins, false);
- }
-
- public SOAPMessage createMessageInternal(MimeHeaders mimeHeaders, InputStream ins,
boolean ignoreParseError) throws IOException, SOAPException
- {
- if (mimeHeaders == null)
- {
- mimeHeaders = new MimeHeaders();
- }
- else if (log.isTraceEnabled())
- {
- Iterator<MimeHeader> itMimeHeaders = mimeHeaders.getAllHeaders();
- while (itMimeHeaders.hasNext())
- {
- MimeHeader mh = itMimeHeaders.next();
- log.trace(mh);
- }
- }
-
- ContentType contentType = getContentType(mimeHeaders);
- log.debug("createMessage: [contentType=" + contentType + "]");
-
- // Debug the incoming message
- if (log.isTraceEnabled())
- {
- ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
- IOUtils.copyStream(baos, ins);
- byte[] bytes = baos.toByteArray();
-
- log.trace("createMessage\n" + new String(bytes));
- ins = new ByteArrayInputStream(bytes);
- }
-
- Collection<AttachmentPart> attachments = null;
- if (isMultipartRelatedContent(contentType))
- {
- MultipartRelatedDecoder decoder;
- try
- {
- decoder = new MultipartRelatedDecoder(contentType);
- decoder.decodeMultipartRelatedMessage(ins);
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (IOException ex)
- {
- throw ex;
- }
- catch (Exception ex)
- {
- throw new SOAPException("Cannot decode multipart related message",
ex);
- }
-
- ins = decoder.getRootPart().getDataHandler().getInputStream();
- attachments = decoder.getRelatedParts();
- }
- else if (isSoapContent(contentType) == false)
- {
- throw new SOAPException("Unsupported content type: " + contentType);
- }
-
- SOAPMessageImpl soapMessage = new SOAPMessageImpl();
- if (mimeHeaders != null)
- soapMessage.setMimeHeaders(mimeHeaders);
-
- if (attachments != null)
- soapMessage.setAttachments(attachments);
-
- // Get the SOAPEnvelope builder
- PayloadBuilder payloadBuilder;
- if (serviceMode == Mode.PAYLOAD)
- {
- payloadBuilder = new JAXWSPayloadBuilder();
- }
- else
- {
- SAAJPayloadBuilderDOM jaxrpcBuilder = new SAAJPayloadBuilderDOM(getStyle());
- payloadBuilder = jaxrpcBuilder;
- }
-
- // Build the payload
- payloadBuilder.build(soapMessage, ins, ignoreParseError);
-
- return soapMessage;
- }
-
- private static ContentType getContentType(MimeHeaders headers) throws SOAPException
- {
- ContentType contentType = null;
- try
- {
- String[] type = headers.getHeader(MimeConstants.CONTENT_TYPE);
- if (type != null)
- {
- contentType = new ContentType(type[0]);
- }
- else
- {
- contentType = new ContentType(MimeConstants.TYPE_SOAP11);
- }
- return contentType;
- }
- catch (ParseException e)
- {
- throw new SOAPException("Could not parse content type:" + e);
- }
- }
-
- private boolean isSoapContent(ContentType type)
- {
- String baseType = type.getBaseType();
- return MimeConstants.TYPE_SOAP11.equals(baseType) ||
MimeConstants.TYPE_SOAP12.equals(baseType);
- }
-
- private boolean isMultipartRelatedContent(ContentType type)
- {
- String baseType = type.getBaseType();
- return MimeConstants.TYPE_MULTIPART_RELATED.equals(baseType);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/NameImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/NameImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/NameImpl.java 2006-12-07 10:43:36 UTC (rev
1600)
@@ -1,127 +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.core.soap;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.Name;
-
-/**
- * An implementation of a Name
- * <p/>
- * At this time of writing, the spec does not say anything about null values.
- * We assume emty string for any null value.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 01-June-2004
- */
-public class NameImpl implements Name
-{
- private QName qname;
-
- public NameImpl(QName qname)
- {
- this.qname = qname;
- }
-
- public NameImpl(String local)
- {
- qname = new QName(local);
- }
-
- public NameImpl(String local, String prefix, String uri)
- {
- if (prefix != null)
- qname = new QName(uri, local, prefix);
- else
- qname = new QName(uri, local);
- }
-
- /**
- * Gets the local name part of the XML name that this Name object represents.
- *
- * @return a string giving the local name
- */
- public String getLocalName()
- {
- return qname.getLocalPart();
- }
-
- /**
- * Returns the prefix that was specified when this Name object was initialized.
- * This prefix is associated with the namespace for the XML name that this Name object
represents.
- *
- * @return the prefix as a string
- */
- public String getPrefix()
- {
- return qname.getPrefix();
- }
-
- /**
- * Gets the namespace-qualified name of the XML name that this Name object
represents.
- *
- * @return the namespace-qualified name as a string
- */
- public String getQualifiedName()
- {
- String prefix = getPrefix();
- if (prefix.length() > 0)
- return prefix + ":" + qname.getLocalPart();
- else
- return qname.getLocalPart();
- }
-
- /**
- * Returns the URI of the namespace for the XML name that this Name object
represents.
- *
- * @return the URI as a string
- */
- public String getURI()
- {
- return qname.getNamespaceURI();
- }
-
- public int hashCode()
- {
- return qname.hashCode();
- }
-
- public boolean equals(Object obj)
- {
- if (!(obj instanceof NameImpl)) return false;
- if (obj == this) return true;
- NameImpl other = (NameImpl)obj;
- return qname.equals(other.qname);
- }
-
- public QName toQName()
- {
- return qname;
- }
-
- public String toString()
- {
- return qname.toString();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/soap/NameImpl.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/NameImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/NodeImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/NodeImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/NodeImpl.java 2006-12-07 10:43:36 UTC (rev
1600)
@@ -1,674 +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.core.soap;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPException;
-
-import org.jboss.logging.Logger;
-import org.jboss.util.NotImplementedException;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.core.utils.DOMWriter;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.UserDataHandler;
-
-/**
- * A representation of a node (element) in an XML document.
- * This interface extnends the standard DOM Node interface with methods for getting and
setting the value of a node,
- * for getting and setting the parent of a node, and for removing a node.
- *
- * When creating a DOM2 tree the objects maintained by the tree are
<code>org.w3c.dom.Node</code> objects
- * and not <code>javax.xml.soap.Node</code> objects.
- * <p/>
- * This implementation schields the client from the the underlying DOM2 tree, returning
<code>javax.xml.soap.Node</code>
- * objects.
- *
- * @author Thomas.Diesler(a)jboss.org
- */
-public class NodeImpl implements javax.xml.soap.Node
-{
- // provide logging
- private static Logger log = Logger.getLogger(NodeImpl.class);
-
- // The parent of this Node
- protected SOAPElementImpl soapParent;
- // This org.w3c.dom.Node
- protected org.w3c.dom.Node domNode;
- // A list of soap children
- private List<NodeImpl> soapChildren = new ArrayList<NodeImpl>();
-
- /** Construct the Node for a given org.w3c.dom.Node
- *
- * This constructor is used:
- *
- * 1) SOAPElement construction
- * 2) Text construction
- */
- NodeImpl(org.w3c.dom.Node node)
- {
- // Method selection in Java is done at compile time
- // Late binding does not work in this case
- if (node instanceof NodeImpl)
- throw new IllegalArgumentException("Copy constructor should be
used");
-
- domNode = node;
-
- // SOAP child elements should be constructed externally
- if (DOMUtils.hasChildElements(node))
- throw new IllegalArgumentException("Node cannot have child
elements");
- }
-
- /** The copy constructor used when converting types (i.e. SOAPElement ->
SOAPHeaderElement)
- */
- NodeImpl(NodeImpl node)
- {
- soapParent = node.soapParent;
- domNode = node.domNode;
- Iterator i = node.soapChildren.iterator();
- while (i.hasNext())
- {
- NodeImpl childNode = (NodeImpl)i.next();
- childNode.soapParent = (SOAPElementImpl)this;
- soapChildren.add(childNode);
- }
- }
-
- /** Get the QName of this Node */
- protected QName getQName()
- {
- String nsURI = getNamespaceURI();
- String localPart = getLocalName();
- String prefix = getPrefix();
-
- QName qname;
- if (nsURI != null && prefix != null)
- {
- qname = new QName(nsURI, localPart, prefix);
- }
- else if (nsURI != null)
- {
- qname = new QName(nsURI, localPart);
- }
- else
- {
- qname = new QName(localPart);
- }
-
- return qname;
- }
-
- // javax.xml.soap.Node
*********************************************************************************************
-
- /**
- * Removes this Node object from the tree.
- */
- public void detachNode()
- {
- org.w3c.dom.Node domParent = domNode.getParentNode();
- if (domParent != null)
- domParent.removeChild(domNode);
-
- if (soapParent != null)
- ((NodeImpl)soapParent).soapChildren.remove(this);
-
- soapParent = null;
- }
-
- /**
- * Returns the parent node of this Node object.
- * This method can throw an UnsupportedOperationException if the tree is not kept in
memory.
- *
- * @return the SOAPElement object that is the parent of this Node object or null if
this Node object is root
- */
- public SOAPElement getParentElement()
- {
- return soapParent;
- }
-
- /**
- * Sets the parent of this Node object to the given SOAPElement object.
- *
- * @param parent the SOAPElement object to be set as the parent of this Node object
- * @throws javax.xml.soap.SOAPException if there is a problem in setting the parent to
the given node
- */
- public void setParentElement(SOAPElement parent) throws SOAPException
- {
- // detach from the old parent
- if (soapParent != null)
- detachNode();
-
- soapParent = (SOAPElementImpl)parent;
- }
-
- /**
- * Returns the value of this node if this is a Text node or the value of the immediate
child of this node otherwise.
- * <p/>
- * If there is an immediate child of this Node that it is a Text node then it's
value will be returned.
- * If there is more than one Text node then the value of the first Text Node will be
returned.
- * Otherwise null is returned.
- *
- * @return a String with the text of this node if this is a Text node or the text
contained by the first immediate
- * child of this Node object that is a Text object if such a child exists;
null otherwise.
- */
- public String getValue()
- {
- // The Text node should overwrite getValue
- if (this instanceof javax.xml.soap.Text)
- throw new WSException("javax.xml.soap.Text should take care of
this");
-
- String nodeValue = null;
- org.w3c.dom.Node child = (org.w3c.dom.Node)getFirstChild();
- if (child instanceof org.w3c.dom.Text)
- nodeValue = ((org.w3c.dom.Text)child).getNodeValue();
-
- return nodeValue;
- }
-
- /**
- * If this is a Text node then this method will set its value, otherwise it sets the
value of the immediate (Text) child of this node.
- * <p/>
- * The value of the immediate child of this node can be set only if, there is one
child node and
- * that node is a Text node, or if there are no children in which case a child Text
node will be created.
- *
- * @param value A value string
- * @throws IllegalStateException if the node is not a Text node and either has more
than one child node or has a child node that is not a Text node.
- */
- public void setValue(String value)
- {
- // The Text node should overwrite setValue
- if (this instanceof javax.xml.soap.Text)
- throw new WSException("javax.xml.soap.Text should take care of
this");
-
- org.w3c.dom.Node child = (org.w3c.dom.Node)getFirstChild();
- if (child instanceof org.w3c.dom.Text)
- ((org.w3c.dom.Text)child).setNodeValue(value);
-
- if (child == null)
- {
- child = domNode.getOwnerDocument().createTextNode(value);
- appendChild(new TextImpl(child));
- }
- }
-
- /**
- * Notifies the implementation that this Node object is no longer being used by the
application and that the
- * implementation is free to reuse this object for nodes that may be created later.
- * Calling the method recycleNode implies that the method detachNode has been called
previously.
- */
- public void recycleNode()
- {
-
- }
-
- private List<NodeImpl> convertDocumentFragment(DocumentFragment docFragment)
throws DOMException
- {
- List<NodeImpl> list = new ArrayList<NodeImpl>();
- try
- {
- SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
- for (Node node = docFragment.getFirstChild(); node != null; node =
node.getNextSibling())
- {
- switch (node.getNodeType())
- {
- case Node.ELEMENT_NODE:
- {
- SOAPElementImpl soapChild = soapFactory.createElement((Element)node,
true);
- list.add(soapChild);
- break;
- }
- case Node.TEXT_NODE:
- {
- TextImpl text = new TextImpl(node);
- list.add(text);
- break;
- }
- case Node.CDATA_SECTION_NODE:
- {
- TextImpl text = new TextImpl(node);
- list.add(text);
- break;
- }
- }
- }
- }
- catch (SOAPException ex)
- {
- throw new DOMException(DOMException.INVALID_STATE_ERR, "Could not convert a
document fragment to a node");
- }
- return list;
- }
-
- // BEGIN org.w3c.dom.Node
*******************************************************************************************
-
- public String getNodeName()
- {
- return domNode.getNodeName();
- }
-
- public String getNodeValue() throws DOMException
- {
- return domNode.getNodeValue();
- }
-
- public void setNodeValue(String nodeValue) throws DOMException
- {
- domNode.setNodeValue(nodeValue);
- }
-
- public short getNodeType()
- {
- return domNode.getNodeType();
- }
-
- public org.w3c.dom.Node getParentNode()
- {
- assertSOAPParent();
- return soapParent;
- }
-
- public NodeList getChildNodes()
- {
- return new NodeListImpl(soapChildren);
- }
-
- public org.w3c.dom.Node getFirstChild()
- {
- NodeImpl child = null;
- org.w3c.dom.Node domChild = domNode.getFirstChild();
- if (domChild != null)
- {
- child = (NodeImpl)soapChildren.get(0);
- if (domChild != child.domNode)
- throw new WSException("Inconsistent node, child lists not
synchronized");
- }
- return child;
- }
-
- public org.w3c.dom.Node getLastChild()
- {
- NodeImpl child = null;
- org.w3c.dom.Node domChild = domNode.getLastChild();
- if (domChild != null)
- {
- child = (NodeImpl)soapChildren.get(soapChildren.size() - 1);
- if (domChild != child.domNode)
- throw new WSException("Inconsistent node, child lists not
synchronized");
- }
- return child;
- }
-
- public org.w3c.dom.Node getPreviousSibling()
- {
- assertSOAPParent();
-
- NodeImpl sibling = null;
- if (soapParent != null)
- {
- List children = ((NodeImpl)soapParent).soapChildren;
- for (int i = 0; i < children.size(); i++)
- {
- NodeImpl node = (NodeImpl)children.get(i);
- if (node == this && i > 0)
- {
- sibling = (NodeImpl)children.get(i - 1);
- break;
- }
- }
-
- if (sibling != null && sibling.domNode != domNode.getPreviousSibling())
- throw new WSException("Inconsistent node, child lists not
synchronized");
- }
-
- return sibling;
- }
-
- public org.w3c.dom.Node getNextSibling()
- {
- assertSOAPParent();
-
- NodeImpl sibling = null;
- if (soapParent != null)
- {
- List children = ((NodeImpl)soapParent).soapChildren;
- for (int i = 0; i < children.size(); i++)
- {
- NodeImpl node = (NodeImpl)children.get(i);
- if (node == this && (i + 1) < children.size())
- {
- sibling = (NodeImpl)children.get(i + 1);
- break;
- }
- }
-
- if (sibling != null && sibling.domNode != domNode.getNextSibling())
- throw new WSException("Inconsistent node, child lists not
synchronized");
- }
-
- return sibling;
- }
-
- public NamedNodeMap getAttributes()
- {
- return domNode.getAttributes();
- }
-
- public Document getOwnerDocument()
- {
- // Climb the tree in hopes of finding the soap envelope.
- // If it's not there (a detached subtree), then we return a non-associated
document
- if (soapParent == null)
- return new SOAPDocument();
-
- return soapParent.getOwnerDocument();
- }
-
- public org.w3c.dom.Node insertBefore(org.w3c.dom.Node newChild, org.w3c.dom.Node
refChild) throws DOMException
- {
- // DOM says that if refChild is null, an append is performed
- if (refChild == null)
- return appendChild(newChild);
-
- newChild = convertDOMNode(newChild);
- refChild = convertDOMNode(refChild);
-
- if (newChild instanceof DocumentFragment)
- {
- List<NodeImpl> list =
convertDocumentFragment((DocumentFragment)newChild);
- for (NodeImpl node : list)
- {
- insertBefore(node, refChild);
- }
- return newChild;
- }
-
- int index = soapChildren.indexOf(refChild);
- if (index < 0)
- throw new IllegalArgumentException("Cannot find refChild in list of
javax.xml.soap.Node children");
-
- NodeImpl soapNewNode = (NodeImpl)newChild;
- soapNewNode.detachNode();
-
- NodeImpl soapRefNode = (NodeImpl)refChild;
- domNode.insertBefore(soapNewNode.domNode, soapRefNode.domNode);
- soapChildren.add(index, soapNewNode);
-
- soapNewNode.soapParent = (SOAPElementImpl)this;
-
- return newChild;
- }
-
- public org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild, org.w3c.dom.Node
oldChild) throws DOMException
- {
- newChild = convertDOMNode(newChild);
- oldChild = convertDOMNode(oldChild);
-
- if (newChild instanceof DocumentFragment)
- {
- insertBefore(newChild, oldChild);
- ((NodeImpl)oldChild).detachNode();
- return newChild;
- }
-
- int index = soapChildren.indexOf(oldChild);
- if (index < 0)
- throw new DOMException(DOMException.NOT_FOUND_ERR, "Cannot find oldChild in
list of javax.xml.soap.Node children");
-
- NodeImpl soapNewNode = (NodeImpl)newChild;
- NodeImpl soapOldNode = (NodeImpl)oldChild;
-
- soapNewNode.detachNode();
-
- if (soapNewNode.domNode != soapOldNode.domNode)
- domNode.replaceChild(soapNewNode.domNode, soapOldNode.domNode);
-
- soapChildren.remove(index);
- soapChildren.add(index, soapNewNode);
-
- soapNewNode.soapParent = soapOldNode.soapParent;
- soapOldNode.soapParent = null;
-
- return newChild;
- }
-
- public org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild) throws DOMException
- {
- oldChild = convertDOMNode(oldChild);
-
- int index = soapChildren.indexOf(oldChild);
- if (index < 0)
- throw new DOMException(DOMException.NOT_FOUND_ERR, "Cannot find oldChild in
list of javax.xml.soap.Node children");
-
- NodeImpl soapOldNode = (NodeImpl)oldChild;
- domNode.removeChild(soapOldNode.domNode);
- soapChildren.remove(index);
-
- soapOldNode.soapParent = null;
-
- return oldChild;
- }
-
- public org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild) throws DOMException
- {
- newChild = convertDOMNode(newChild);
-
- if (newChild instanceof DocumentFragment)
- {
- List<NodeImpl> list =
convertDocumentFragment((DocumentFragment)newChild);
- for (NodeImpl node : list)
- {
- appendChild(node);
- }
- return newChild;
- }
-
- if ((this instanceof SOAPElementImpl) == false)
- throw new DOMException(DOMException.INVALID_ACCESS_ERR, "Cannot append
child to this node: " + this);
-
- NodeImpl soapNode = (NodeImpl)newChild;
- soapNode.detachNode();
-
- domNode.appendChild(soapNode.domNode);
- soapNode.soapParent = (SOAPElementImpl)this;
-
- soapChildren.add(soapNode);
-
- return newChild;
- }
-
- public boolean hasChildNodes()
- {
- return domNode.hasChildNodes();
- }
-
- public org.w3c.dom.Node cloneNode(boolean deep)
- {
- return domNode.cloneNode(deep);
- }
-
- public void normalize()
- {
- domNode.normalize();
- }
-
- public boolean isSupported(String feature, String version)
- {
- return domNode.isSupported(feature, version);
- }
-
- public String getNamespaceURI()
- {
- return domNode.getNamespaceURI();
- }
-
- public String getPrefix()
- {
- return domNode.getPrefix();
- }
-
- public void setPrefix(String prefix) throws DOMException
- {
- domNode.setPrefix(prefix);
- }
-
- public String getLocalName()
- {
- return domNode.getLocalName();
- }
-
- public boolean hasAttributes()
- {
- return domNode.hasAttributes();
- }
-
- public int hashCode()
- {
- return domNode.hashCode();
- }
-
- public String toString()
- {
- return super.toString() + "[" + domNode.toString() + "]";
- }
-
- private Node convertDOMNode(org.w3c.dom.Node node)
- {
- Node retNode;
- if (node instanceof NodeImpl)
- {
- retNode = node;
- }
- else if (node instanceof DocumentFragment)
- {
- retNode = new DocumentFragmentImpl((DocumentFragment)node);
- }
- else if (node instanceof org.w3c.dom.Text)
- {
- retNode = new TextImpl(node);
- }
- else
- {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Operation only
supported for javax.xml.soap.Node, this is a " + node);
- }
- return retNode;
- }
-
- private void assertSOAPParent()
- {
- org.w3c.dom.Node domParent = domNode.getParentNode();
- if (domParent != null && soapParent == null)
- throw new WSException("Inconsistent node, has a DOM parent but no SOAP
parent [" + this + "] " + DOMWriter.printNode(this, false));
- if (domParent == null && soapParent != null)
- throw new WSException("Inconsistent node, has a SOAP parent but no DOM
parent [" + this + "] " + DOMWriter.printNode(this, false));
- if (soapParent != null && domParent != soapParent.domNode)
- throw new WSException("Inconsistent node, SOAP parent is not identical with
DOM parent [" + this + "] " + DOMWriter.printNode(this, false));
- }
-
- // END org.w3c.dom.Node
*******************************************************************************************
-
- // BEGIN org.w3c.dom.Node DOM Level 3
*****************************************************************************
-
- public short compareDocumentPosition(Node other) throws DOMException
- {
- // FIXME compareDocumentPosition
- throw new NotImplementedException("compareDocumentPosition");
- }
-
- public String getBaseURI()
- {
- // FIXME getBaseURI
- throw new NotImplementedException("getBaseURI");
- }
-
- public Object getFeature(String feature, String version)
- {
- // FIXME getFeature
- throw new NotImplementedException("getFeature");
- }
-
- public String getTextContent() throws DOMException
- {
- // FIXME getTextContent
- throw new NotImplementedException("getTextContent");
- }
-
- public Object getUserData(String key)
- {
- // FIXME getUserData
- throw new NotImplementedException("getUserData");
- }
-
- public boolean isDefaultNamespace(String namespaceURI)
- {
- // FIXME isDefaultNamespace
- throw new NotImplementedException("isDefaultNamespace");
- }
-
- public boolean isEqualNode(Node arg)
- {
- // FIXME isEqualNode
- throw new NotImplementedException("isEqualNode");
- }
-
- public boolean isSameNode(Node other)
- {
- // FIXME isSameNode
- throw new NotImplementedException("isSameNode");
- }
-
- public String lookupNamespaceURI(String prefix)
- {
- // FIXME lookupNamespaceURI
- throw new NotImplementedException("lookupNamespaceURI");
- }
-
- public String lookupPrefix(String namespaceURI)
- {
- // FIXME lookupPrefix
- throw new NotImplementedException("lookupPrefix");
- }
-
- public void setTextContent(String textContent) throws DOMException
- {
- // FIXME setTextContent
- throw new NotImplementedException("setTextContent");
- }
-
- public Object setUserData(String key, Object data, UserDataHandler handler)
- {
- // FIXME setUserData
- throw new NotImplementedException("setUserData");
- }
-
- // END org.w3c.dom.Node DOM Level 3
*****************************************************************************
-}
Copied: trunk/src/main/java/org/jboss/ws/core/soap/NodeImpl.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/NodeImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/NodeListImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/NodeListImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/NodeListImpl.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,67 +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.core.soap;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * The NodeList interface provides the abstraction of an ordered collection of nodes,
without defining or constraining
- * how this collection is implemented. NodeList objects in the DOM are live.
- *
- * The items in the NodeList are accessible via an integral index, starting from 0.
- *
- * @author Thomas.Diesler(a)jboss.org
- */
-class NodeListImpl implements NodeList
-{
- private List<NodeImpl> nodeList = new ArrayList<NodeImpl>();
-
- NodeListImpl(List<NodeImpl> nodes)
- {
- nodeList = new ArrayList<NodeImpl>(nodes);
- }
-
- NodeListImpl(Iterator<NodeImpl> nodes)
- {
- nodeList = new ArrayList<NodeImpl>();
- while (nodes.hasNext())
- nodeList.add(nodes.next());
- }
-
- public Node item(int index)
- {
- if (nodeList.size() > index)
- return nodeList.get(index);
- else
- return null;
- }
-
- public int getLength()
- {
- return nodeList.size();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/soap/NodeListImpl.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/NodeListImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/PayloadBuilder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/PayloadBuilder.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/PayloadBuilder.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,39 +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.core.soap;
-
-// $Id$
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import javax.xml.soap.SOAPException;
-
-/**
- * @author Heiko Braun, <heiko.braun(a)jboss.com>
- * @author Thomas.Diesler(a)jboss.com
- * @since 19-Apr-2006
- */
-public interface PayloadBuilder
-{
- void build(SOAPMessageImpl soapMessage, InputStream in, boolean ignoreParseError)
throws IOException, SOAPException;
-}
Copied: trunk/src/main/java/org/jboss/ws/core/soap/PayloadBuilder.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/PayloadBuilder.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderDOM.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderDOM.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderDOM.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,268 +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.core.soap;
-
-//$Id$
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.Detail;
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPHeader;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.jaxrpc.Style;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.core.utils.DOMWriter;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-/**
- * A SOAPEnvelope builder for JAXRPC based on DOM
- *
- * @author Heiko Braun, <heiko.braun(a)jboss.com>
- * @author Thomas.Diesler(a)jboss.com
- * @since 19-Apr-2006
- */
-public class SAAJPayloadBuilderDOM implements PayloadBuilder
-{
- // provide logging
- private static Logger log = Logger.getLogger(SAAJPayloadBuilderDOM.class);
-
- private Style style = Style.DOCUMENT;
-
- public SAAJPayloadBuilderDOM(Style style)
- {
- this.style = style;
- }
-
- public void build(SOAPMessageImpl soapMessage, InputStream ins, boolean
ignoreParseError) throws IOException, SOAPException
- {
- // Parse the XML input stream
- Element domEnv = null;
- try
- {
- domEnv = DOMUtils.parse(ins);
- }
- catch (IOException ex)
- {
- if (ignoreParseError)
- {
- return;
- }
- throw ex;
- }
-
- String envNS = domEnv.getNamespaceURI();
- String envPrefix = domEnv.getPrefix();
-
- // Construct the envelope
- SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
- SOAPPartImpl soapPart = (SOAPPartImpl)soapMessage.getSOAPPart();
- SOAPEnvelopeImpl soapEnv = new SOAPEnvelopeImpl(soapPart,
soapFactory.createElement(domEnv, false));
-
- DOMUtils.copyAttributes(soapEnv, domEnv);
-
- // Add the header elements
- Element domHeader = DOMUtils.getFirstChildElement(domEnv, new QName(envNS,
"Header"));
- if (domHeader != null)
- {
- SOAPHeader soapHeader = soapEnv.getHeader();
-
- DOMUtils.copyAttributes(soapHeader, domHeader);
-
- Iterator it = DOMUtils.getChildElements(domHeader);
- while (it.hasNext())
- {
- Element srcElement = (Element)it.next();
- //registerNamespacesLocally(srcElement);
- String xmlFragment = DOMWriter.printNode(srcElement, false);
-
- Name name = new NameImpl(srcElement.getLocalName(), srcElement.getPrefix(),
srcElement.getNamespaceURI());
- SOAPContentElement destElement = new SOAPHeaderElementImpl(name);
- soapHeader.addChildElement(destElement);
-
- DOMUtils.copyAttributes(destElement, srcElement);
- destElement.setXMLFragment(xmlFragment);
- }
- }
-
- // Add the body elements
- Element domBody = DOMUtils.getFirstChildElement(domEnv, new QName(envNS,
"Body"));
- SOAPBody soapBody = soapEnv.getBody();
-
- DOMUtils.copyAttributes(soapBody, domBody);
-
- Iterator itBody = DOMUtils.getChildElements(domBody);
- if (itBody.hasNext())
- {
- Element domBodyElement = (Element)itBody.next();
-
- String localName = domBodyElement.getLocalName();
- String prefix = domBodyElement.getPrefix();
- String nsURI = domBodyElement.getNamespaceURI();
- Name beName = new NameImpl(localName, prefix, nsURI);
-
- // Process a <env:Fault> message
- if (beName.equals(new NameImpl("Fault", envPrefix, envNS)))
- {
- SOAPFaultImpl soapFault = new SOAPFaultImpl(envNS);
- soapBody.addChildElement(soapFault);
-
- DOMUtils.copyAttributes(soapFault, domBodyElement);
-
- Element domFaultCode = DOMUtils.getFirstChildElement(domBodyElement, new
QName("faultcode"));
- if (domFaultCode == null)
- throw new SOAPException("SOAPFault does not contain a
<faultcode> element");
-
- Element domFaultString = DOMUtils.getFirstChildElement(domBodyElement, new
QName("faultstring"));
- if (domFaultString == null)
- throw new SOAPException("SOAPFault does not contain a
<faultstring> element");
-
- String faultCode = DOMUtils.getTextContent(domFaultCode);
- soapFault.setFaultCode(faultCode);
-
- String faultString = DOMUtils.getTextContent(domFaultString);
- soapFault.setFaultString(faultString);
-
- Element domFaultActor = DOMUtils.getFirstChildElement(domBodyElement, new
QName("faultactor"));
- if (domFaultActor != null)
- {
- String faultActor = DOMUtils.getTextContent(domFaultActor);
- soapFault.setFaultActor(faultActor);
- }
-
- // Add the fault detail
- Element domFaultDetail = DOMUtils.getFirstChildElement(domBodyElement,
"detail");
- if (domFaultDetail != null)
- {
- Detail detail = soapFault.addDetail();
- Iterator it = DOMUtils.getChildElements(domFaultDetail);
- while (it.hasNext())
- {
- Element domElement = (Element)it.next();
- SOAPElement detailEntry = new
DetailEntryImpl(soapFactory.createElement(domElement, true));
- detailEntry = detail.addChildElement(detailEntry);
- }
- }
- }
-
- // Process and RPC or DOCUMENT style message
- else
- {
-
- if (style == Style.RPC)
- {
- SOAPBodyElementRpc soapBodyElement = new SOAPBodyElementRpc(beName);
- soapBodyElement =
(SOAPBodyElementRpc)soapBody.addChildElement(soapBodyElement);
-
- DOMUtils.copyAttributes(soapBodyElement, domBodyElement);
-
- Iterator itBodyElement = DOMUtils.getChildElements(domBodyElement);
- while (itBodyElement.hasNext())
- {
- Element srcElement = (Element)itBodyElement.next();
- registerNamespacesLocally(srcElement);
-
- Name name = new NameImpl(srcElement.getLocalName(),
srcElement.getPrefix(), srcElement.getNamespaceURI());
- SOAPContentElement destElement = new SOAPContentElement(name);
- destElement =
(SOAPContentElement)soapBodyElement.addChildElement(destElement);
-
- DOMUtils.copyAttributes(destElement, srcElement);
-
- String xmlFragment = DOMWriter.printNode(srcElement, false);
- destElement.setXMLFragment(xmlFragment);
- }
- }
- else if (style == Style.DOCUMENT)
- {
- Element srcElement = (Element)domBodyElement;
- registerNamespacesLocally(srcElement);
- SOAPContentElement destElement = new SOAPBodyElementDoc(beName);
- destElement = (SOAPContentElement)soapBody.addChildElement(destElement);
-
- DOMUtils.copyAttributes(destElement, srcElement);
-
- String xmlFragment = DOMWriter.printNode(srcElement, false);
- destElement.setXMLFragment(xmlFragment);
- }
- else if (style == null)
- {
- SOAPBodyElementMessage soapBodyElement = new
SOAPBodyElementMessage(beName);
- soapBodyElement =
(SOAPBodyElementMessage)soapBody.addChildElement(soapBodyElement);
-
- DOMUtils.copyAttributes(soapBodyElement, domBodyElement);
-
- NodeList nlist = domBodyElement.getChildNodes();
- for (int i = 0; i < nlist.getLength(); i++)
- {
- org.w3c.dom.Node child = nlist.item(i);
- short childType = child.getNodeType();
- if (childType == org.w3c.dom.Node.ELEMENT_NODE)
- {
- SOAPElement soapElement = soapFactory.createElement((Element)child,
true);
- soapBodyElement.addChildElement(soapElement);
- }
- else if (childType == org.w3c.dom.Node.TEXT_NODE)
- {
- String nodeValue = child.getNodeValue();
- soapBodyElement.addTextNode(nodeValue);
- }
- else if (childType == org.w3c.dom.Node.CDATA_SECTION_NODE)
- {
- String nodeValue = child.getNodeValue();
- soapBodyElement.addTextNode(nodeValue);
- }
- else
- {
- log.warn("Ignore child type: " + childType);
- }
- }
- }
- else
- {
- throw new WSException("Unsupported message style: " + style);
- }
- }
- }
- }
-
- /**
- * Register globally available namespaces on element level.
- * This is necessary to ensure that each xml fragment is valid.
- */
- private void registerNamespacesLocally(Element srcElement) {
- if(srcElement.getPrefix()== null)
- {
- srcElement.setAttribute("xmlns", srcElement.getNamespaceURI());
- }
- else
- {
- srcElement.setAttribute("xmlns:"+srcElement.getPrefix(),
srcElement.getNamespaceURI());
- }
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderDOM.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderDOM.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderStax.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderStax.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderStax.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,467 +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.core.soap;
-
-// $Id$
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPFault;
-import javax.xml.soap.SOAPHeader;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.w3c.dom.Element;
-
-import com.ctc.wstx.stax.WstxInputFactory;
-
-/**
- * A SOAPEnvelope builder for JAXRPC based on Stax
- *
- * @author Heiko Braun, <heiko.braun(a)jboss.com>
- * @author Thomas.Diesler(a)jboss.com
- * @since 15-Apr-2006
- */
-public class SAAJPayloadBuilderStax implements PayloadBuilder
-{
- private static final String END_ELEMENT_BRACKET = "</";
- private static final String EMPTY_STRING = "";
- private static final String CLOSING_BRACKET = ">";
- private static final String START_ELEMENT_BRACKET = "<";
- private static final String HEADER_ELEMENT_NAME = "Header";
- private static final String BODY_ELEMENT_NAME = "Body";
- private static final String FAULT_ELEMENT_NAME = "Fault";
-
- private static enum Part
- {
- ENVELOPE, HEADER, BODY, FAULT, RPC_PAYLOAD, DOC_PAYLOAD, BARE_PAYLOAD
- }
-
- private Part currentPart = Part.ENVELOPE;
- private Part previousPart = null;
-
- // saaj
- private SOAPPartImpl soapPart;
- private SOAPEnvelopeImpl soapEnv;
-
- private StringBuffer fragmentBuffer;
- private QName fragmentRootCursor = null;
- private QName currentRootElement = null;
- private XMLStreamReader reader;
-
- private static XMLInputFactory factory;
-
- public SAAJPayloadBuilderStax()
- {
- resetFragmentBuffer();
- }
-
- private void resetFragmentBuffer()
- {
- this.fragmentBuffer = new StringBuffer();
- this.fragmentBuffer.ensureCapacity(2048);
- }
-
- public void build(SOAPMessageImpl soapMessage, InputStream in, boolean
ignoreParseError) throws IOException, SOAPException
- {
- try
- {
- reader = getFactoryInstance().createXMLStreamReader(in);
- }
- catch (XMLStreamException e)
- {
- throw new IOException("Failed to create stream reader:" +
e.getMessage());
- }
-
- try
- {
- soapPart = (SOAPPartImpl)soapMessage.getSOAPPart();
-
- while (reader.hasNext())
- {
-
- if (reader.isStartElement())
- {
- processStartElement();
- }
- else if (reader.isCharacters())
- {
- processCharacters();
- }
- else if (reader.isEndElement())
- {
- processEndElement();
- }
-
- reader.next();
- }
-
- }
- catch (XMLStreamException e)
- {
- if (!ignoreParseError)
- throw new IOException("Failed to parse stream: " +
e.getMessage());
- }
- catch (SOAPException e)
- {
- e.printStackTrace();
- throw e;
- }
- finally
- {
- try
- {
- if (reader != null)
- reader.close();
- }
- catch (XMLStreamException e)
- {
- // ignore
- }
- }
- }
-
- private static synchronized XMLInputFactory getFactoryInstance()
- {
- if (null == factory)
- {
- System.setProperty("javax.xml.stream.XMLInputFactory",
"com.ctc.wstx.stax.WstxInputFactory");
- //System.setProperty("javax.xml.stream.XMLInputFactory",
"com.sun.xml.stream.ZephyrParserFactory");
- factory = XMLInputFactory.newInstance();
- factory.setProperty(XMLInputFactory.IS_VALIDATING, Boolean.FALSE);
- ((WstxInputFactory)factory).configureForSpeed();
- }
- return factory;
-
- }
-
- private void processCharacters() throws SOAPException
- {
- if (fragmentRootCursor != null)
- consumeCharacters();
- }
-
- private void consumeCharacters() throws SOAPException
- {
-
- String text = normalize(reader.getText());
-
- if (!atPartMargin() && !reader.isWhiteSpace())
- {
-
- fragmentBuffer.append(text);
-
- if (Part.FAULT == currentPart)
- {
- String localName = currentRootElement.getLocalPart();
- SOAPFault fault = soapEnv.getBody().getFault();
- if ("faultcode".equalsIgnoreCase(localName))
- fault.setFaultCode(text);
- else if ("faultactor".equalsIgnoreCase(localName))
- fault.setFaultActor(text);
- else if ("faultstring".equalsIgnoreCase(localName))
- fault.setFaultString(text);
- }
- }
- }
-
- private void processEndElement() throws SOAPException
- {
- if (fragmentRootCursor != null)
- consumeEndElement();
- }
-
- private void consumeEndElement() throws SOAPException
- {
-
- QName qName = reader.getName();
-
- fragmentBuffer.append(END_ELEMENT_BRACKET);
- fragmentBuffer.append(getFQElementName(qName));
- fragmentBuffer.append(CLOSING_BRACKET);
-
- if (fragmentRootCursor != null && fragmentRootCursor.equals(qName))
- {
- flushBuffer();
- fragmentRootCursor = null;
- }
- }
-
- private void flushBuffer() throws SOAPException
- {
- if (Part.HEADER == currentPart)
- {
- SOAPHeader soapHeader = soapEnv.getHeader();
- SOAPContentElement lastHeaderElement =
(SOAPContentElement)soapHeader.getChildNodes().item(soapHeader.getChildNodes().getLength()
- 1);
-
- lastHeaderElement.setXMLFragment(fragmentBuffer.toString());
- }
- else if (Part.BODY == currentPart)
- {
- SOAPBody soapBody = soapEnv.getBody();
- SOAPContentElement lastBodyElement =
(SOAPContentElement)soapBody.getChildNodes().item(soapBody.getChildNodes().getLength() -
1);
- lastBodyElement.setXMLFragment(fragmentBuffer.toString());
- }
- else if (Part.FAULT == currentPart)
- {
- SOAPBody soapBody = soapEnv.getBody();
- SOAPContentElement faultElement = (SOAPContentElement)soapBody.getFault();
- faultElement.setXMLFragment(fragmentBuffer.toString());
- }
-
- resetFragmentBuffer();
- }
-
- private void processStartElement() throws SOAPException
- {
-
- QName qName = reader.getName();
- currentRootElement = qName;
-
- // identify current envelope part
- togglePartMargin(qName);
-
- // toggle current element
- Element destElement = null;
- if (Part.ENVELOPE == currentPart)
- {
- // setup envelope impl
- soapEnv = new SOAPEnvelopeImpl(soapPart, qName.getNamespaceURI());
- destElement = soapEnv; // soapEnv becomes current
- }
- else if (Part.HEADER == currentPart)
- {
- if (atPartMargin())
- {
- // the env:Header element itself
- SOAPHeader soapHeader = soapEnv.getHeader();
- destElement = soapHeader; // header becomes current
- previousPart = Part.HEADER;
- }
- else
- {
- // child element of env:Header
- if (fragmentRootCursor == null)
- {
- Name name = new NameImpl(qName.getLocalPart(), qName.getPrefix(),
qName.getNamespaceURI());
- SOAPContentElement headerElement = new SOAPHeaderElementImpl(name);
- soapEnv.getHeader().addChildElement(headerElement);
-
- destElement = headerElement; // headerElement becomes current
- fragmentRootCursor = qName;
- }
-
- consumeStartElement();
- }
- }
- else if (Part.BODY == currentPart)
- {
-
- SOAPBody soapBody = soapEnv.getBody();
-
- if (atPartMargin())
- {
- // the env:Body element
- destElement = soapBody;
- previousPart = Part.BODY;
- }
- else
- {
- // payload not fault
- Name bodyElementName = new NameImpl(qName.getLocalPart(), qName.getPrefix(),
qName.getNamespaceURI());
-
- if (fragmentRootCursor == null)
- {
- SOAPBodyElementDoc docBodyElement = new
SOAPBodyElementDoc(bodyElementName);
- docBodyElement =
(SOAPBodyElementDoc)soapBody.addChildElement(docBodyElement);
-
- destElement = docBodyElement;
- fragmentRootCursor = qName;
- }
-
- consumeStartElement();
- }
- }
- else if (Part.FAULT == currentPart)
- {
- // payload is fault
- if (atPartMargin())
- {
- SOAPBody soapBody = soapEnv.getBody();
- SOAPFaultImpl soapFault = new SOAPFaultImpl(soapEnv.getNamespaceURI());
- soapBody.addChildElement(soapFault);
- destElement = soapFault;
- previousPart = Part.FAULT;
- }
-
- if (fragmentRootCursor == null)
- {
- fragmentRootCursor = qName;
- }
-
- consumeStartElement();
- }
-
- if (fragmentRootCursor == null) // constructing soap elements
- {
- copyAttributes(destElement);
- }
- }
-
- private void togglePartMargin(QName qName)
- {
- // identify the current part
- if (qName.getLocalPart().equalsIgnoreCase(HEADER_ELEMENT_NAME))
- {
- previousPart = currentPart;
- currentPart = Part.HEADER;
- }
- else if (qName.getLocalPart().equalsIgnoreCase(BODY_ELEMENT_NAME))
- {
- previousPart = currentPart;
- currentPart = Part.BODY;
- }
- else if (qName.getLocalPart().equalsIgnoreCase(FAULT_ELEMENT_NAME))
- {
- previousPart = currentPart;
- currentPart = Part.FAULT;
- }
- }
-
- private void consumeStartElement()
- {
-
- QName qName = reader.getName();
-
- // element
- fragmentBuffer.append(START_ELEMENT_BRACKET);
- fragmentBuffer.append(getFQElementName(qName));
-
- // local namespaces
- for (int x = 0; x < reader.getNamespaceCount(); x++)
- {
- if (reader.getNamespacePrefix(x) != null)
- {
- fragmentBuffer.append(" xmlns:");
-
fragmentBuffer.append(reader.getNamespacePrefix(x)).append("='");
- fragmentBuffer.append(reader.getNamespaceURI(x)).append("'");
- }
- else if (reader.getNamespaceURI(x) != null)
- {
- fragmentBuffer.append(" xmlns='");
- fragmentBuffer.append(reader.getNamespaceURI(x)).append("'");
- }
- }
-
- // attributes
- if (reader.getAttributeCount() > 0)
- {
- for (int i = 0; i < reader.getAttributeCount(); i++)
- {
- QName attQName = reader.getAttributeName(i);
- fragmentBuffer.append(" ").append(getFQElementName(attQName));
-
fragmentBuffer.append("='").append(reader.getAttributeValue(i)).append("'");
- }
- }
-
- fragmentBuffer.append(CLOSING_BRACKET);
- }
-
- private String getFQElementName(QName qName)
- {
- return !qName.getPrefix().equals(EMPTY_STRING) ? qName.getPrefix() + ":"
+ qName.getLocalPart() : qName.getLocalPart();
- }
-
- private void copyAttributes(Element destElement)
- {
-
- if (reader.getAttributeCount() == 0)
- return;
-
- for (int i = 0; i < reader.getAttributeCount(); i++)
- {
- destElement.setAttributeNS(reader.getAttributeNamespace(i),
reader.getAttributeLocalName(i), reader.getAttributeValue(i));
- }
- }
-
- private boolean atPartMargin()
- {
- return previousPart != currentPart;
- }
-
- private static String normalize(String valueStr)
- {
- // We assume most strings will not contain characters that need
"escaping",
- // and optimize for this case.
- boolean found = false;
- int i = 0;
-
- outer: for (; i < valueStr.length(); i++)
- {
- switch (valueStr.charAt(i))
- {
- case '<':
- case '>':
- case '&':
- case '"':
- found = true;
- break outer;
- }
- }
-
- if (!found)
- return valueStr;
-
- // Resume where we left off
- StringBuilder builder = new StringBuilder();
- builder.append(valueStr.substring(0, i));
- for (; i < valueStr.length(); i++)
- {
- char c = valueStr.charAt(i);
- switch (c)
- {
- case '<':
- builder.append("<");
- break;
- case '>':
- builder.append(">");
- break;
- case '&':
- builder.append("&");
- break;
- case '"':
- builder.append(""");
- break;
- default:
- builder.append(c);
- }
- }
-
- return builder.toString();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderStax.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderStax.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/SAAJVisitable.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SAAJVisitable.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SAAJVisitable.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,31 +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.core.soap;
-
-/**
- * @author Heiko Braun <heiko.braun(a)jboss.com>
- * @version $Id$
- * @since Sep 26, 2006
- */
-public interface SAAJVisitable {
- public void accept(SAAJVisitor visitor);
-}
Copied: trunk/src/main/java/org/jboss/ws/core/soap/SAAJVisitable.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SAAJVisitable.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/SAAJVisitor.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SAAJVisitor.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SAAJVisitor.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,33 +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.core.soap;
-
-
-/**
- * @author Heiko Braun <heiko.braun(a)jboss.com>
- * @version $Id$
- * @since Sep 26, 2006
- */
-public interface SAAJVisitor {
- void visitSOAPElement(SOAPElementImpl soapElement);
- void visitSOAPContentElement(SOAPContentElement scElement);
-}
Copied: trunk/src/main/java/org/jboss/ws/core/soap/SAAJVisitor.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SAAJVisitor.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementDoc.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementDoc.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementDoc.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,46 +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.core.soap;
-
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPBodyElement;
-
-/**
- * An abstract implemenation of the SOAPBodyElement
- * <p/>
- * This class should not expose functionality that is not part of
- * {@link javax.xml.soap.SOAPBodyElement}. Client code should use
<code>SOAPBodyElement</code>.
- *
- * @author Thomas.Diesler(a)jboss.org
- */
-public class SOAPBodyElementDoc extends SOAPContentElement implements SOAPBodyElement
-{
- public SOAPBodyElementDoc(Name name)
- {
- super(name);
- }
-
- public SOAPBodyElementDoc(SOAPElementImpl element)
- {
- super(element);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementDoc.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementDoc.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementMessage.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementMessage.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementMessage.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,63 +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.core.soap;
-
-import java.io.Writer;
-
-import javax.xml.rpc.JAXRPCException;
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPBodyElement;
-
-import org.jboss.ws.core.utils.DOMWriter;
-
-/**
- * An abstract implemenation of the SOAPBodyElement
- * <p/>
- * This class should not expose functionality that is not part of
- * {@link javax.xml.soap.SOAPBodyElement}. Client code should use
<code>SOAPBodyElement</code>.
- *
- * @author Thomas.Diesler(a)jboss.org
- */
-public class SOAPBodyElementMessage extends SOAPElementImpl implements SOAPBodyElement
-{
- public SOAPBodyElementMessage(Name name)
- {
- super(name);
- }
-
- public SOAPBodyElementMessage(SOAPElementImpl element)
- {
- super(element);
- }
-
- public void writeElement(Writer writer) {
- try
- {
- DOMWriter domWriter = new DOMWriter(writer);
- domWriter.print(this);
- }
- catch (Exception e)
- {
- throw new JAXRPCException(e);
- }
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementMessage.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementMessage.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementRpc.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementRpc.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementRpc.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,46 +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.core.soap;
-
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPBodyElement;
-
-/**
- * An abstract implemenation of the SOAPBodyElement
- * <p/>
- * This class should not expose functionality that is not part of
- * {@link javax.xml.soap.SOAPBodyElement}. Client code should use
<code>SOAPBodyElement</code>.
- *
- * @author Thomas.Diesler(a)jboss.org
- */
-public class SOAPBodyElementRpc extends SOAPElementImpl implements SOAPBodyElement
-{
- public SOAPBodyElementRpc(Name name)
- {
- super(name);
- }
-
- public SOAPBodyElementRpc(SOAPElementImpl element)
- {
- super(element);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementRpc.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementRpc.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,406 +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.core.soap;
-
-// $Id$
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.io.Writer;
-import java.util.Iterator;
-import java.util.Locale;
-
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPBodyElement;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPFault;
-import javax.xml.transform.Source;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
-
-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.core.utils.DOMUtils;
-import org.jboss.ws.core.utils.DOMWriter;
-import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.InputSource;
-
-/**
- * An object that represents the contents of the SOAP body element in a SOAP message.
- * A SOAP body element consists of XML data that affects the way the application-specific
content is processed.
- *
- * A SOAPBody object contains SOAPBodyElement objects, which have the content for the
SOAP body.
- * A SOAPFault object, which carries status and/or error information, is an example of a
SOAPBodyElement object.
- *
- * @author Thomas.Diesler(a)jboss.org
- */
-public class SOAPBodyImpl extends SOAPElementImpl implements SOAPBody
-{
- // provide logging
- private static Logger log = Logger.getLogger(SOAPBodyImpl.class);
-
- // Generic JAXWS payload
- private Source payload;
- private boolean isDOMValid = true;
- private boolean isModifiedFromSource;
-
- public SOAPBodyImpl(String prefix, String namespace)
- {
- super("Body", prefix, namespace);
- }
-
- public boolean isDOMValid()
- {
- return isDOMValid;
- }
-
- public boolean isModifiedFromSource()
- {
- return isModifiedFromSource;
- }
-
- public Source getPayload()
- {
- return payload;
- }
-
- public void setPayload(Source payload)
- {
- log.debug("setPayload: " + payload.getClass().getName());
- removeContents();
- this.payload = payload;
- this.isDOMValid = false;
- }
-
- /** Convert the child into a SOAPBodyElement */
- public SOAPElement addChildElement(SOAPElement child) throws SOAPException
- {
- log.trace("addChildElement: " + child.getElementName());
- expandToDOM();
- if ((child instanceof SOAPBodyElement) == false)
- child = convertToBodyElement(child);
-
- child = super.addChildElement(child);
- return child;
- }
-
- public SOAPBodyElement addBodyElement(Name name) throws SOAPException
- {
- log.trace("addBodyElement: " + name);
- expandToDOM();
- SOAPBodyElement child = new SOAPBodyElementDoc(name);
- return (SOAPBodyElement)addChildElement(child);
- }
-
- public SOAPBodyElement addDocument(Document doc) throws SOAPException
- {
- log.trace("addDocument");
- expandToDOM();
- Element rootElement = doc.getDocumentElement();
- SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
- SOAPElementImpl soapElement = soapFactory.createElement(rootElement, true);
- return (SOAPBodyElement)addChildElement(soapElement);
- }
-
- public SOAPFault addFault() throws SOAPException
- {
- log.trace("addFault");
- expandToDOM();
- if (hasFault())
- throw new SOAPException("A SOAPBody may contain at most one SOAPFault child
element");
-
- return addFault(new NameImpl(Constants.SOAP11_FAULT_CODE_SERVER), "Generic
server fault");
- }
-
- public SOAPFault addFault(Name faultCode, String faultString) throws SOAPException
- {
- log.trace("addFault");
- expandToDOM();
- if (hasFault())
- throw new SOAPException("A SOAPBody may contain at most one SOAPFault child
element");
-
- SOAPFaultImpl soapFault = new SOAPFaultImpl(getNamespaceURI());
- soapFault = (SOAPFaultImpl)addChildElement(soapFault);
- soapFault.setFaultCode(faultCode);
- soapFault.setFaultString(faultString);
- return soapFault;
- }
-
- public SOAPFault addFault(Name faultCode, String faultString, Locale locale) throws
SOAPException
- {
- log.trace("addFault");
- expandToDOM();
- if (hasFault())
- throw new SOAPException("A SOAPBody may contain at most one SOAPFault child
element");
-
- SOAPFaultImpl soapFault = new SOAPFaultImpl(getNamespaceURI());
- soapFault.setFaultCode(faultCode);
- soapFault.setFaultString(faultString, locale);
- addChildElement(soapFault);
- return soapFault;
- }
-
- public SOAPFault getFault()
- {
- log.trace("getFault");
- expandToDOM();
- Iterator it = getChildElements(new NameImpl("Fault",
Constants.PREFIX_ENV, getSOAPEnvelope().getNamespaceURI()));
- return (it.hasNext() ? (SOAPFault)it.next() : null);
- }
-
- public boolean hasFault()
- {
- log.trace("hasFault");
- expandToDOM();
- return getChildElements(Constants.SOAP11_FAULT).hasNext();
- }
-
- public Node appendChild(Node newChild) throws DOMException
- {
- log.trace("appendChild: " + newChild.getNodeName());
- expandToDOM();
- Node retNode;
- if (!(newChild instanceof SOAPBodyElement || newChild instanceof
DocumentFragment))
- {
- newChild = convertToBodyElement(newChild);
- }
- retNode = super.appendChild(newChild);
- return retNode;
- }
-
- public Node insertBefore(Node newChild, Node refChild) throws DOMException
- {
- log.trace("insertBefore: " + newChild.getNodeName());
- expandToDOM();
- if (!(newChild instanceof SOAPBodyElement || newChild instanceof
DocumentFragment))
- newChild = convertToBodyElement(newChild);
-
- return super.insertBefore(newChild, refChild);
- }
-
- public Node replaceChild(Node newChild, Node oldChild) throws DOMException
- {
- log.trace("replaceChild: " + newChild.getNodeName());
- expandToDOM();
- if (!(newChild instanceof SOAPBodyElement || newChild instanceof
DocumentFragment))
- {
- newChild = convertToBodyElement(newChild);
- }
-
- return super.replaceChild(newChild, oldChild);
- }
-
- public Iterator getChildElements()
- {
- log.trace("getChildElements");
- expandToDOM();
- return super.getChildElements();
- }
-
- public Iterator getChildElements(Name name)
- {
- log.trace("getChildElements: " + name);
- expandToDOM();
- return super.getChildElements(name);
- }
-
- public NodeList getChildNodes()
- {
- log.trace("getChildNodes");
- expandToDOM();
- return super.getChildNodes();
- }
-
- public Node getFirstChild()
- {
- log.trace("getFirstChild");
- expandToDOM();
- return super.getFirstChild();
- }
-
- public Node getLastChild()
- {
- log.trace("getLastChild");
- expandToDOM();
- return super.getLastChild();
- }
-
- public boolean hasChildNodes()
- {
- log.trace("hasChildNodes");
- expandToDOM();
- return super.hasChildNodes();
- }
-
- private SOAPBodyElementDoc convertToBodyElement(Node node)
- {
- if (!(node instanceof SOAPElementImpl))
- throw new IllegalArgumentException("SOAPElement expected");
-
- SOAPElementImpl element = (SOAPElementImpl)node;
- element.detachNode();
- return new SOAPBodyElementDoc(element);
- }
-
- private void expandToDOM()
- {
- if (isDOMValid == false)
- {
- // DOM expansion should only happen when a handler accesses the DOM API.
- // We do not allow DOM expansion on a dev release.
- CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
- if (msgContext != null && UnifiedMetaData.isFinalRelease() == false)
- {
- Boolean allowExpand =
(Boolean)msgContext.getProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
- if (Boolean.TRUE.equals(allowExpand) == false)
- throw new WSException("Expanding content element to DOM");
- }
-
- log.trace("BEGIN expandToDOM");
-
- isDOMValid = true;
- try
- {
- Element child = getBodyElementFromSource();
- SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
- addChildElement(soapFactory.createElement(child, true));
- payload = null;
- }
- catch (RuntimeException rte)
- {
- isDOMValid = false;
- throw rte;
- }
- catch (Exception ex)
- {
- isDOMValid = false;
- throw new WSException("Cannot expand to DOM" + ex);
- }
- finally
- {
- isModifiedFromSource = true;
- log.trace("END expandToDOM");
- }
- }
- }
-
- private Element getBodyElementFromSource()
- {
- Element child = null;
- try
- {
- if (payload instanceof StreamSource)
- {
- StreamSource streamSource = (StreamSource)payload;
-
- InputStream ins = streamSource.getInputStream();
- if (ins != null)
- {
- child = DOMUtils.parse(ins);
- }
- else
- {
- Reader reader = streamSource.getReader();
- child = DOMUtils.parse(new InputSource(reader));
- }
-
- // reset the excausted input stream
- String xmlStr = DOMWriter.printNode(child, false);
- payload = new StreamSource(new ByteArrayInputStream(xmlStr.getBytes()));
- }
- else if (payload instanceof DOMSource)
- {
- DOMSource domSource = (DOMSource)payload;
- Node node = domSource.getNode();
- if (node instanceof Element)
- {
- child = (Element)node;
- }
- else if (node instanceof Document)
- {
- child = ((Document)node).getDocumentElement();
- }
- else
- {
- throw new WSException("Unsupported Node type: " +
node.getClass().getName());
- }
- }
- else if (payload instanceof SAXSource)
- {
- // The fact that JAXBSource derives from SAXSource is an implementation
detail.
- // Thus in general applications are strongly discouraged from accessing
methods defined on SAXSource.
- // The XMLReader object obtained by the getXMLReader method shall be used
only for parsing the InputSource object returned by the getInputSource method.
-
- TransformerFactory tf = TransformerFactory.newInstance();
- ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
- tf.newTransformer().transform(payload, new StreamResult(baos));
-
- child = DOMUtils.parse(new ByteArrayInputStream(baos.toByteArray()));
- }
- else
- {
- throw new WSException("Source type not implemented: " +
payload.getClass().getName());
- }
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WSException("Cannot get root element from Source" + ex);
- }
- return child;
- }
-
- @Override
- public void writeElementContent(Writer writer) throws IOException
- {
- if (payload != null)
- {
- Element child = getBodyElementFromSource();
- String xmlPayload = DOMWriter.printNode(child, false);
- log.debug("Content from payload: " + xmlPayload);
- writer.write(xmlPayload);
- }
- else
- {
- super.writeElementContent(writer);
- }
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyImpl.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/SOAPConnectionFactoryImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPConnectionFactoryImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPConnectionFactoryImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,80 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2002-2003 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (
http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Axis" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache(a)apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <
http://www.apache.org/>.
- */
-package org.jboss.ws.core.soap;
-
-// $Id$
-
-import javax.xml.soap.SOAPConnection;
-import javax.xml.soap.SOAPConnectionFactory;
-import javax.xml.soap.SOAPException;
-
-/**
- * SOAP Connection Factory implementation
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 02-Feb-2005
- */
-public class SOAPConnectionFactoryImpl extends SOAPConnectionFactory
-{
- /** Create a new SOAPConnection.
- *
- * @return the new SOAPConnection object.
- * @throws javax.xml.soap.SOAPException if there was an exception creating
theSOAPConnection object.
- */
- public SOAPConnection createConnection() throws SOAPException
- {
- return new SOAPConnectionImpl();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/soap/SOAPConnectionFactoryImpl.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPConnectionFactoryImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/SOAPConnectionImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPConnectionImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPConnectionImpl.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,356 +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.core.soap;
-
-// $Id$
-
-import java.net.MalformedURLException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.xml.rpc.Stub;
-import javax.xml.soap.MimeHeader;
-import javax.xml.soap.MimeHeaders;
-import javax.xml.soap.SOAPConnection;
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.addressing.EndpointReference;
-
-import org.jboss.logging.Logger;
-import org.jboss.remoting.Client;
-import org.jboss.remoting.InvokerLocator;
-import org.jboss.remoting.security.SSLSocketBuilder;
-import org.jboss.remoting.transport.http.HTTPMetadataConstants;
-import org.jboss.ws.core.jaxrpc.StubExt;
-import org.jboss.ws.extensions.xop.XOPContext;
-
-/**
- * SOAPConnection implementation
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author <a href="mailto:jason@stacksmash.com">Jason T.
Greene</a>
- *
- * @since 02-Feb-2005
- */
-public class SOAPConnectionImpl extends SOAPConnection
-{
- // provide logging
- private static Logger log = Logger.getLogger(SOAPConnectionImpl.class);
- private static Logger msgLog = Logger.getLogger("jbossws.SOAPMessage");
-
- private Map<String, Object> config = new HashMap<String, Object>();
-
- private static Map<String, String> metadataMap = new HashMap<String,
String>();
- static
- {
- metadataMap.put(Stub.USERNAME_PROPERTY, "http.basic.username");
- metadataMap.put(Stub.PASSWORD_PROPERTY, "http.basic.password");
- metadataMap.put(BindingProvider.USERNAME_PROPERTY,
"http.basic.username");
- metadataMap.put(BindingProvider.PASSWORD_PROPERTY,
"http.basic.password");
- }
- private static Map<String, String> configMap = new HashMap<String,
String>();
- static
- {
- configMap.put(StubExt.PROPERTY_KEY_STORE,
SSLSocketBuilder.REMOTING_KEY_STORE_FILE_PATH);
- configMap.put(StubExt.PROPERTY_KEY_STORE_PASSWORD,
SSLSocketBuilder.REMOTING_KEY_STORE_PASSWORD);
- configMap.put(StubExt.PROPERTY_KEY_STORE_TYPE,
SSLSocketBuilder.REMOTING_KEY_STORE_TYPE);
- configMap.put(StubExt.PROPERTY_TRUST_STORE,
SSLSocketBuilder.REMOTING_TRUST_STORE_FILE_PATH);
- configMap.put(StubExt.PROPERTY_TRUST_STORE_PASSWORD,
SSLSocketBuilder.REMOTING_TRUST_STORE_PASSWORD);
- configMap.put(StubExt.PROPERTY_TRUST_STORE_TYPE,
SSLSocketBuilder.REMOTING_TRUST_STORE_TYPE);
- }
-
- private boolean closed;
-
- public SOAPConnectionImpl()
- {
- // HTTPClientInvoker conect sends gratuitous POST
- //
http://jira.jboss.com/jira/browse/JBWS-711
- config.put(Client.ENABLE_LEASE, false);
- }
-
- /**
- * Sends the given message to the specified endpoint and blocks until it has
- * returned the response.
- */
- public SOAPMessage call(SOAPMessage reqMessage, Object endpoint) throws SOAPException
- {
- return callInternal(reqMessage, endpoint, false);
- }
-
- /**
- * Sends the given message to the specified endpoint. This method is logically
- * non blocking.
- */
- public SOAPMessage callOneWay(SOAPMessage reqMessage, Object endpoint) throws
SOAPException
- {
- return callInternal(reqMessage, endpoint, true);
- }
-
- /** Sends the given message to the specified endpoint. */
- private SOAPMessage callInternal(SOAPMessage reqMessage, Object endpoint, boolean
oneway) throws SOAPException
- {
- if (reqMessage == null)
- throw new IllegalArgumentException("Given SOAPMessage cannot be
null");
- if (endpoint == null)
- throw new IllegalArgumentException("Given endpoint cannot be null");
-
- if (closed)
- throw new SOAPException("SOAPConnection is already closed");
-
- InvokerLocator locator;
- Client remotingClient;
- String targetAddress;
- Map callProps;
-
- if (endpoint instanceof EndpointInfo)
- {
- EndpointInfo epInfo = (EndpointInfo)endpoint;
- targetAddress = epInfo.getTargetAddress();
- callProps = epInfo.getProperties();
-
- if (callProps.containsKey(StubExt.PROPERTY_CLIENT_TIMEOUT))
- {
- Object timeout = callProps.get(StubExt.PROPERTY_CLIENT_TIMEOUT);
- int qmIndex = targetAddress.indexOf("?");
- targetAddress += (qmIndex < 0 ? "?" : "&") +
"timeout=" + timeout;
- }
- }
- else if (endpoint instanceof EndpointReference)
- {
- EndpointReference epr = (EndpointReference)endpoint;
- targetAddress = epr.getAddress().toString();
- callProps = null;
- }
- else
- {
- targetAddress = endpoint.toString();
- callProps = null;
- }
-
- // enforce xop transitions
- // TODO: there should be a clear transition to an immutable object model
- XOPContext.eagerlyCreateAttachments();
-
- // save object model changes
- if (reqMessage.saveRequired()) reqMessage.saveChanges();
-
- try
- {
- // Get the invoker from Remoting for a given endpoint address
- log.debug("Get locator for: " + endpoint);
- locator = new InvokerLocator(targetAddress);
- }
- catch (MalformedURLException e)
- {
- throw new SOAPException("Malformed endpoint address", e);
- }
-
- Map metadata = getRemotingMetaData(reqMessage, targetAddress, callProps);
-
- try
- {
- remotingClient = new Client(locator, "saaj", config);
- remotingClient.connect();
- remotingClient.setMarshaller(new SOAPMessageMarshaller());
- if (oneway == false)
- remotingClient.setUnMarshaller(new SOAPMessageUnMarshaller());
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception e)
- {
- throw new SOAPException("Could not setup remoting client", e);
- }
-
- try
- {
- // debug the outgoing message
- if(msgLog.isTraceEnabled())
- {
- SOAPEnvelope soapReqEnv = reqMessage.getSOAPPart().getEnvelope();
- String envStr = SOAPElementWriter.writeElement((SOAPElementImpl)soapReqEnv,
true);
- msgLog.trace("Remoting meta data: " + metadata);
- msgLog.trace("Outgoing SOAPMessage\n" + envStr);
- }
-
- SOAPMessage resMessage = null;
- if (oneway == true)
- {
- remotingClient.invokeOneway(reqMessage, metadata, false);
- }
- else
- {
- resMessage = (SOAPMessage)remotingClient.invoke(reqMessage, metadata);
- }
-
- // disconnect the rmoting client
- remotingClient.disconnect();
-
- // debug the incomming response message
- if (resMessage != null && msgLog.isTraceEnabled())
- {
- SOAPEnvelope soapResEnv = resMessage.getSOAPPart().getEnvelope();
- String envStr = SOAPElementWriter.writeElement((SOAPElementImpl)soapResEnv,
true);
- msgLog.trace("Incoming Response SOAPMessage\n" + envStr);
- }
-
- return resMessage;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Throwable t)
- {
- throw new SOAPException("Could not transmit message", t);
- }
- }
-
- /** Closes this SOAPConnection
- */
- public void close() throws SOAPException
- {
- if (closed)
- throw new SOAPException("SOAPConnection is already closed");
-
- closed = true;
- }
-
- private Map getRemotingMetaData(SOAPMessage reqMessage, String targetAddress, Map
callProps) throws SOAPException
- {
- // R2744 A HTTP request MESSAGE MUST contain a SOAPAction HTTP header field
- // with a quoted value equal to the value of the soapAction attribute of
- // soapbind:operation, if present in the corresponding WSDL description.
-
- // R2745 A HTTP request MESSAGE MUST contain a SOAPAction HTTP header field
- // with a quoted empty string value, if in the corresponding WSDL description,
- // the soapAction attribute of soapbind:operation is either not present, or
- // present with an empty string as its value.
-
- MimeHeaders mimeHeaders = reqMessage.getMimeHeaders();
- String[] action = mimeHeaders.getHeader("SOAPAction");
- if (action != null && action.length > 0)
- {
- String soapAction = action[0];
-
- // R1109 The value of the SOAPAction HTTP header field in a HTTP request MESSAGE
MUST be a quoted string.
- if (soapAction.startsWith("\"") == false ||
soapAction.endsWith("\"") == false)
- soapAction = "\"" + soapAction + "\"";
-
- mimeHeaders.setHeader("SOAPAction", soapAction);
- }
- else
- {
- mimeHeaders.setHeader("SOAPAction", "\"\"");
- }
-
- Map<String, Object> metadata = new HashMap<String, Object>();
-
- // We need to unmarshall faults (HTTP 500)
- metadata.put(HTTPMetadataConstants.NO_THROW_ON_ERROR, "true");
-
- Properties props = new Properties();
- metadata.put("HEADER", props);
-
- Iterator i = mimeHeaders.getAllHeaders();
- while (i.hasNext())
- {
- MimeHeader header = (MimeHeader)i.next();
- String currentValue = props.getProperty(header.getName());
-
- /*
- * Coalesce multiple headers into one
- *
- * From HTTP/1.1 RFC 2616:
- *
- * Multiple message-header fields with the same field-name MAY be
- * present in a message if and only if the entire field-value for that
- * header field is defined as a comma-separated list [i.e., #(values)].
- * It MUST be possible to combine the multiple header fields into one
- * "field-name: field-value" pair, without changing the semantics of
- * the message, by appending each subsequent field-value to the first,
- * each separated by a comma.
- */
- if (currentValue != null)
- {
- props.put(header.getName(), currentValue + "," +
header.getValue());
- }
- else
- {
- props.put(header.getName(), header.getValue());
- }
- }
-
- if (callProps != null)
- {
- Iterator it = callProps.entrySet().iterator();
-
- // Get authentication type, default to BASIC authetication
- String authType = (String)callProps.get(StubExt.PROPERTY_AUTH_TYPE);
- if (authType == null)
- authType = StubExt.PROPERTY_AUTH_TYPE_BASIC;
-
- while (it.hasNext())
- {
- Map.Entry entry = (Map.Entry)it.next();
- String key = (String)entry.getKey();
- Object val = entry.getValue();
-
- // pass properties to remoting meta data
- if (metadataMap.containsKey(key))
- {
- String remotingKey = metadataMap.get(key);
- if (key.equals(Stub.USERNAME_PROPERTY) ||
key.equals(Stub.PASSWORD_PROPERTY))
- {
- if (authType.equals(StubExt.PROPERTY_AUTH_TYPE_BASIC))
- {
- metadata.put(remotingKey, val);
- }
- else
- {
- log.warn("Ignore '" + key + "' with auth
typy: " + authType);
- }
- }
- else
- {
- metadata.put(remotingKey, val);
- }
- }
-
- // pass properties to remoting client config
- if (configMap.containsKey(key))
- {
- String remotingKey = configMap.get(key);
- config.put(remotingKey, val);
- }
- }
- }
-
- return metadata;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/soap/SOAPConnectionImpl.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPConnectionImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,1047 +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.core.soap;
-
-// $Id$
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Writer;
-import java.lang.reflect.Array;
-import java.lang.reflect.Method;
-import java.util.Iterator;
-
-import javax.activation.DataHandler;
-import javax.activation.DataSource;
-import javax.xml.namespace.QName;
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPException;
-
-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.core.jaxrpc.TypeMappingImpl;
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.DeserializerFactoryBase;
-import org.jboss.ws.core.jaxrpc.binding.DeserializerSupport;
-import org.jboss.ws.core.jaxrpc.binding.NullValueSerializer;
-import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
-import org.jboss.ws.core.jaxrpc.binding.SerializerFactoryBase;
-import org.jboss.ws.core.jaxrpc.binding.SerializerSupport;
-import org.jboss.ws.core.soap.attachment.SwapableMemoryDataSource;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.core.utils.DOMWriter;
-import org.jboss.ws.core.utils.JavaUtils;
-import org.jboss.ws.core.utils.MimeUtils;
-import org.jboss.ws.extensions.xop.XOPContext;
-import org.jboss.ws.metadata.umdm.ParameterMetaData;
-import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-import org.w3c.dom.Attr;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.TypeInfo;
-
-/**
- * A SOAPElement that gives access to its content as XML fragment or Java object.
- *
- * The SOAPContentElement has three content representations, which may exist in
parallel.
- * The getter and setter of the content properties perform the conversions.
- * It is the responsibility of this objects to keep the representations in sync.
- *
- * +---------+ +-------------+ +-------------+
- * | Object | <-----> | XMLFragment | <-----> | DOMTree |
- * +---------+ +-------------+ +-------------+
- *
- * The idea is, that jaxrpc handlers can work with both the object and the dom view of
this SOAPElement.
- * Note, that state transitions may be expensive.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 13-Dec-2004
- */
-public class SOAPContentElement extends SOAPElementImpl
-{
- // provide logging
- private static Logger log = Logger.getLogger(SOAPContentElement.class);
-
- // The well formed XML content of this element.
- private String xmlFragment;
- // The java object content of this element.
- private Object objectValue;
- // True if the current DOM tree is valid
- private boolean isDOMValid;
- // True if the current content object is valid
- private boolean isObjectValid;
- // True while expanding to DOM
- private boolean expandingToDOM;
-
- // The associated parameter
- private ParameterMetaData paramMetaData;
-
- /** Construct a SOAPContentElement
- */
- public SOAPContentElement(Name name)
- {
- super(name);
- isDOMValid = true;
- }
-
- public SOAPContentElement(SOAPElementImpl element)
- {
- super(element);
- isDOMValid = true;
- }
-
- public ParameterMetaData getParamMetaData()
- {
- if (paramMetaData == null)
- throw new IllegalStateException("Parameter meta data not available");
-
- return paramMetaData;
- }
-
- public void setParamMetaData(ParameterMetaData paramMetaData)
- {
- this.paramMetaData = paramMetaData;
- }
-
- public QName getXmlType()
- {
- return getParamMetaData().getXmlType();
- }
-
- public Class getJavaType()
- {
- return getParamMetaData().getJavaType();
- }
-
- public boolean isDOMValid()
- {
- return isDOMValid;
- }
-
- public boolean isObjectValid()
- {
- return isObjectValid;
- }
-
- public boolean isFragmentValid()
- {
- return xmlFragment != null;
- }
-
- public String getXMLFragment()
- {
- // Serialize the valueContent
- if (xmlFragment == null && isObjectValid)
- {
- assertContentMapping();
-
- QName xmlType = getXmlType();
- Class javaType = getJavaType();
- log.debug("getXMLFragment from Object [xmlType=" + xmlType +
",javaType=" + javaType + "]");
-
- CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
- if (msgContext == null)
- throw new WSException("MessageContext not available");
-
- SerializationContext serContext = msgContext.getSerializationContext();
- serContext.setProperty(ParameterMetaData.class.getName(), getParamMetaData());
-
- TypeMappingImpl typeMapping = serContext.getTypeMapping();
-
- QName xmlName = getQName();
- try
- {
- SerializerSupport ser;
- if (objectValue != null)
- {
- SerializerFactoryBase serializerFactory =
getSerializerFactory(typeMapping, javaType, xmlType);
- ser = (SerializerSupport)serializerFactory.getSerializer();
- }
- else
- {
- ser = new NullValueSerializer();
- }
-
- xmlFragment = ser.serialize(xmlName, xmlType, getObjectValue(), serContext,
null);
- log.debug("xmlFragment: " + xmlFragment);
- invalidateObjectContent();
- }
- catch (BindingException e)
- {
- throw new WSException(e);
- }
- }
-
- // Generate the xmlFragment from the DOM tree
- else if (xmlFragment == null && isDOMValid)
- {
- log.debug("getXMLFragment from DOM");
- xmlFragment = DOMWriter.printNode(this, false);
- log.debug("xmlFragment: " + xmlFragment);
- invalidateDOMContent();
- }
-
- if (xmlFragment == null || xmlFragment.startsWith("<") == false)
- throw new WSException("Invalid XMLFragment: " + xmlFragment);
-
- return xmlFragment;
- }
-
- public void setXMLFragment(String xmlFragment)
- {
- log.debug("setXMLFragment: " + xmlFragment);
-
- if (xmlFragment == null || xmlFragment.startsWith("<") == false)
- throw new WSException("Invalid XMLFragment: " + xmlFragment);
-
- removeContentsAsIs();
- resetElementContent();
-
- this.xmlFragment = xmlFragment;
- invalidateDOMContent();
- invalidateObjectContent();
- }
-
- public Object getObjectValue()
- {
- if (isObjectValid == false)
- {
- QName xmlType = getXmlType();
- Class javaType = getJavaType();
-
- log.debug("getObjectValue [xmlType=" + xmlType +
",javaType=" + javaType + "]");
- assertContentMapping();
-
- CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
- if (msgContext == null)
- throw new WSException("MessageContext not available");
-
- SerializationContext serContext = msgContext.getSerializationContext();
- serContext.setProperty(ParameterMetaData.class.getName(), getParamMetaData());
-
- try
- {
- // Get the deserializer from the type mapping
- TypeMappingImpl typeMapping = serContext.getTypeMapping();
- DeserializerFactoryBase deserializerFactory =
getDeserializerFactory(typeMapping, javaType, xmlType);
- DeserializerSupport des =
(DeserializerSupport)deserializerFactory.getDeserializer();
-
- String strContent = getXMLFragment();
-
- Object obj = des.deserialize(getQName(), xmlType, strContent, serContext);
- if (obj != null)
- {
- Class objType = obj.getClass();
- boolean isAssignable = JavaUtils.isAssignableFrom(javaType, objType);
- if (isAssignable == false && javaType.isArray())
- {
- try
- {
- Method toArrayMethod = objType.getMethod("toArray", new
Class[] {});
- Class returnType = toArrayMethod.getReturnType();
- if (JavaUtils.isAssignableFrom(javaType, returnType))
- {
- Method getValueMethod = objType.getMethod("getValue",
new Class[] {});
- Object value = getValueMethod.invoke(obj, new Object[] {});
- if (value != null)
- {
- // Do not invoke toArray if getValue returns null
- obj = toArrayMethod.invoke(obj, new Object[] {});
- }
- else
- {
- // if the fragment did not indicate a null return
- // by an xsi:nil we return an empty array
- Class componentType = javaType.getComponentType();
- obj = Array.newInstance(componentType, 0);
- }
- isAssignable = true;
- }
- }
- catch (Exception e)
- {
- // ignore
- }
- }
-
- if (isAssignable == false)
- {
- // handle XOP simple types, i.e. in RPC/LIT
- try
- {
- String contentType = MimeUtils.resolveMimeType(javaType);
- log.debug("Adopt DataHandler to " + javaType +",
contentType "+ contentType);
-
- DataSource ds = new
SwapableMemoryDataSource(((DataHandler)obj).getInputStream(), contentType);
- DataHandler dh = new DataHandler(ds);
- obj = dh.getContent();
-
- // 'application/octet-stream' will return a byte[] instead
fo the stream
- if(obj instanceof InputStream)
- {
- ByteArrayOutputStream bout = new ByteArrayOutputStream();
- dh.writeTo(bout);
- obj = bout.toByteArray();
- }
- }
- catch (IOException e)
- {
- throw new WSException("Failed to adopt XOP content type",
e);
- }
-
- if(!JavaUtils.isAssignableFrom(javaType, obj.getClass()))
- {
- throw new WSException("Java type '" + javaType +
"' is not assignable from: " + objType.getName());
- }
- }
- }
-
- this.objectValue = obj;
- this.isObjectValid = true;
- }
- catch (BindingException e)
- {
- throw new WSException(e);
- }
-
- log.debug("objectValue: " + (objectValue != null ?
objectValue.getClass().getName() : null));
- }
-
- return objectValue;
- }
-
- public void setObjectValue(Object objValue)
- {
- log.debug("setObjectValue: " + objValue);
- removeContentsAsIs();
- resetElementContent();
- this.objectValue = objValue;
- this.isObjectValid = true;
- }
-
- private void removeContentsAsIs()
- {
- log.trace("removeContentsAsIs");
- boolean cachedFlag = isDOMValid;
- try
- {
- this.isDOMValid = true;
- super.removeContents();
- }
- finally
- {
- this.isDOMValid = cachedFlag;
- }
- }
-
- // Get the serializer factory for a given javaType and xmlType
- private SerializerFactoryBase getSerializerFactory(TypeMappingImpl typeMapping, Class
javaType, QName xmlType)
- {
- SerializerFactoryBase serializerFactory =
(SerializerFactoryBase)typeMapping.getSerializer(javaType, xmlType);
-
- // The type mapping might contain a mapping for the array wrapper bean
- if (serializerFactory == null && javaType.isArray())
- {
- Class arrayWrapperType = typeMapping.getJavaType(xmlType);
- if (arrayWrapperType != null)
- {
- try
- {
- Method toArrayMethod = arrayWrapperType.getMethod("toArray", new
Class[] {});
- Class returnType = toArrayMethod.getReturnType();
- if (JavaUtils.isAssignableFrom(javaType, returnType))
- {
- serializerFactory =
(SerializerFactoryBase)typeMapping.getSerializer(arrayWrapperType, xmlType);
- }
- }
- catch (NoSuchMethodException e)
- {
- // ignore
- }
- }
- }
-
- if (serializerFactory == null)
- throw new WSException("Cannot obtain serializer factory for:
[xmlType=" + xmlType + ",javaType=" + javaType + "]");
-
- return serializerFactory;
- }
-
- // Get the deserializer factory for a given javaType and xmlType
- private DeserializerFactoryBase getDeserializerFactory(TypeMappingImpl typeMapping,
Class javaType, QName xmlType)
- {
- DeserializerFactoryBase deserializerFactory =
(DeserializerFactoryBase)typeMapping.getDeserializer(javaType, xmlType);
-
- // The type mapping might contain a mapping for the array wrapper bean
- if (deserializerFactory == null && javaType.isArray())
- {
- Class arrayWrapperType = typeMapping.getJavaType(xmlType);
- if (arrayWrapperType != null)
- {
- try
- {
- Method toArrayMethod = arrayWrapperType.getMethod("toArray", new
Class[] {});
- Class returnType = toArrayMethod.getReturnType();
- if (JavaUtils.isAssignableFrom(javaType, returnType))
- {
- deserializerFactory =
(DeserializerFactoryBase)typeMapping.getDeserializer(arrayWrapperType, xmlType);
- }
- }
- catch (NoSuchMethodException e)
- {
- // ignore
- }
- }
- }
-
- if (deserializerFactory == null)
- throw new WSException("Cannot obtain deserializer factory for:
[xmlType=" + xmlType + ",javaType=" + javaType + "]");
-
- return deserializerFactory;
- }
-
- /** Assert the notNull state of the xmlType and javaType
- */
- private void assertContentMapping()
- {
- if (getJavaType() == null)
- throw new WSException("javaType cannot be null");
- if (getXmlType() == null)
- throw new WSException("xmlType cannot be null");
- }
-
- // SOAPElement interface
********************************************************************************************
-
- public SOAPElement addChildElement(SOAPElement child) throws SOAPException
- {
- log.trace("addChildElement: " + child);
- expandToDOM();
- SOAPElement soapElement = super.addChildElement(child);
- invalidateObjectContent();
- invalidateXMLContent();
- return soapElement;
- }
-
- public SOAPElement addChildElement(String localName, String prefix) throws
SOAPException
- {
- log.trace("addChildElement: [localName=" + localName +
",prefix=" + prefix + "]");
- expandToDOM();
- SOAPElement soapElement = super.addChildElement(localName, prefix);
- invalidateObjectContent();
- invalidateXMLContent();
- return soapElement;
- }
-
- public SOAPElement addChildElement(String localName, String prefix, String uri) throws
SOAPException
- {
- log.trace("addChildElement: [localName=" + localName +
",prefix=" + prefix + ",uri=" + uri + "]");
- expandToDOM();
- SOAPElement soapElement = super.addChildElement(localName, prefix, uri);
- invalidateObjectContent();
- invalidateXMLContent();
- return soapElement;
- }
-
- public SOAPElement addChildElement(Name name) throws SOAPException
- {
- log.trace("addChildElement: [name=" + name + "]");
- expandToDOM();
- SOAPElement soapElement = super.addChildElement(name);
- invalidateObjectContent();
- invalidateXMLContent();
- return soapElement;
- }
-
- public SOAPElement addChildElement(String name) throws SOAPException
- {
- log.trace("addChildElement: [name=" + name + "]");
- expandToDOM();
- SOAPElement soapElement = super.addChildElement(name);
- invalidateObjectContent();
- invalidateXMLContent();
- return soapElement;
- }
-
- public SOAPElement addTextNode(String value) throws SOAPException
- {
- log.trace("addTextNode: [value=" + value + "]");
- expandToDOM();
- SOAPElement soapElement = super.addTextNode(value);
- invalidateObjectContent();
- invalidateXMLContent();
- return soapElement;
- }
-
- public Iterator getChildElements()
- {
- log.trace("getChildElements");
- expandToDOM();
- return super.getChildElements();
- }
-
- public Iterator getChildElements(Name name)
- {
- log.trace("getChildElements: [name=" + name + "]");
- expandToDOM();
- return super.getChildElements(name);
- }
-
- public void removeContents()
- {
- log.trace("removeContents");
- expandToDOM();
- super.removeContents();
- invalidateObjectContent();
- invalidateXMLContent();
- }
-
- public Iterator getAllAttributes()
- {
- return super.getAllAttributes();
- }
-
- public String getAttribute(String name)
- {
- return super.getAttribute(name);
- }
-
- public Attr getAttributeNode(String name)
- {
- return super.getAttributeNode(name);
- }
-
- public Attr getAttributeNodeNS(String namespaceURI, String localName)
- {
- return super.getAttributeNodeNS(namespaceURI, localName);
- }
-
- public String getAttributeNS(String namespaceURI, String localName)
- {
- return super.getAttributeNS(namespaceURI, localName);
- }
-
- public String getAttributeValue(Name name)
- {
- return super.getAttributeValue(name);
- }
-
- public SOAPElement addAttribute(Name name, String value) throws SOAPException
- {
- log.trace("addAttribute: [name=" + name + ",value=" + value +
"]");
- expandToDOM();
- return super.addAttribute(name, value);
- }
-
- public SOAPElement addNamespaceDeclaration(String prefix, String nsURI)
- {
- log.trace("addNamespaceDeclaration: [prefix=" + prefix +
",nsURI=" + nsURI + "]");
- expandToDOM();
- return super.addNamespaceDeclaration(prefix, nsURI);
- }
-
- public Name getElementName()
- {
- return super.getElementName();
- }
-
- public NodeList getElementsByTagName(String name)
- {
- log.trace("getElementsByTagName: [name=" + name + "]");
- expandToDOM();
- return super.getElementsByTagName(name);
- }
-
- public NodeList getElementsByTagNameNS(String namespaceURI, String localName)
- {
- log.trace("getElementsByTagName: [nsURI=" + namespaceURI +
",localName=" + localName + "]");
- expandToDOM();
- return super.getElementsByTagNameNS(namespaceURI, localName);
- }
-
- public String getEncodingStyle()
- {
- return super.getEncodingStyle();
- }
-
- public Iterator getNamespacePrefixes()
- {
- return super.getNamespacePrefixes();
- }
-
- public String getNamespaceURI(String prefix)
- {
- return super.getNamespaceURI(prefix);
- }
-
- public TypeInfo getSchemaTypeInfo()
- {
- return super.getSchemaTypeInfo();
- }
-
- public String getTagName()
- {
- return super.getTagName();
- }
-
- public Iterator getVisibleNamespacePrefixes()
- {
- return super.getVisibleNamespacePrefixes();
- }
-
- public boolean hasAttribute(String name)
- {
- return super.hasAttribute(name);
- }
-
- public boolean hasAttributeNS(String namespaceURI, String localName)
- {
- return super.hasAttributeNS(namespaceURI, localName);
- }
-
- public boolean removeAttribute(Name name)
- {
- log.trace("removeAttribute: " + name.getQualifiedName());
- expandToDOM();
- return super.removeAttribute(name);
- }
-
- public void removeAttribute(String name) throws DOMException
- {
- log.trace("removeAttribute: " + name);
- expandToDOM();
- super.removeAttribute(name);
- }
-
- public Attr removeAttributeNode(Attr oldAttr) throws DOMException
- {
- log.trace("removeAttribute: " + oldAttr.getNodeName());
- expandToDOM();
- return super.removeAttributeNode(oldAttr);
- }
-
- public void removeAttributeNS(String namespaceURI, String localName) throws
DOMException
- {
- log.trace("removeAttributeNS: {" + namespaceURI + "}" +
localName);
- expandToDOM();
- super.removeAttributeNS(namespaceURI, localName);
- }
-
- public boolean removeNamespaceDeclaration(String prefix)
- {
- log.trace("removeNamespaceDeclaration: " + prefix);
- expandToDOM();
- return super.removeNamespaceDeclaration(prefix);
- }
-
- public void setAttribute(String name, String value) throws DOMException
- {
- log.trace("setAttribute: [name=" + name + ",value=" + value +
"]");
- expandToDOM();
- super.setAttribute(name, value);
- }
-
- public Attr setAttributeNode(Attr newAttr) throws DOMException
- {
- log.trace("setAttributeNode: " + newAttr);
- expandToDOM();
- return super.setAttributeNode(newAttr);
- }
-
- public Attr setAttributeNodeNS(Attr newAttr) throws DOMException
- {
- log.trace("setAttributeNodeNS: " + newAttr);
- expandToDOM();
- return super.setAttributeNodeNS(newAttr);
- }
-
- public void setAttributeNS(String namespaceURI, String qualifiedName, String value)
throws DOMException
- {
- log.trace("setAttribute: [nsURI=" + namespaceURI + ",name=" +
qualifiedName + ",value=" + value + "]");
- expandToDOM();
- super.setAttributeNS(namespaceURI, qualifiedName, value);
- }
-
- public void setEncodingStyle(String encodingStyle) throws SOAPException
- {
- super.setEncodingStyle(encodingStyle);
- }
-
- public void setIdAttribute(String name, boolean isId) throws DOMException
- {
- log.trace("setIdAttribute: [name=" + name + ",value=" + isId +
"]");
- expandToDOM();
- super.setIdAttribute(name, isId);
- }
-
- public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException
- {
- log.trace("setIdAttributeNode: [idAttr=" + idAttr + ",value=" +
isId + "]");
- expandToDOM();
- super.setIdAttributeNode(idAttr, isId);
- }
-
- public void setIdAttributeNS(String namespaceURI, String localName, boolean isId)
throws DOMException
- {
- log.trace("setIdAttributeNS: [nsURI=" + namespaceURI + ",name="
+ localName + ",value=" + isId + "]");
- expandToDOM();
- super.setIdAttributeNS(namespaceURI, localName, isId);
- }
-
- // Node interface
**************************************************************************************************
-
- public Node appendChild(Node newChild) throws DOMException
- {
- log.trace("appendChild: " + newChild);
- expandToDOM();
- Node node = super.appendChild(newChild);
- invalidateObjectContent();
- invalidateXMLContent();
- return node;
- }
-
- public Node cloneNode(boolean deep)
- {
- log.trace("cloneNode: deep=" + deep);
- expandToDOM();
- return super.cloneNode(deep);
- }
-
- public NodeList getChildNodes()
- {
- log.trace("getChildNodes");
- expandToDOM();
- return super.getChildNodes();
- }
-
- public Node getFirstChild()
- {
- log.trace("getFirstChild");
- expandToDOM();
- return super.getFirstChild();
- }
-
- public Node getLastChild()
- {
- log.trace("getLastChild");
- expandToDOM();
- return super.getLastChild();
- }
-
- public String getValue()
- {
- log.trace("getValue");
- expandToDOM();
- return super.getValue();
- }
-
- public boolean hasChildNodes()
- {
- log.trace("hasChildNodes");
- expandToDOM();
- return super.hasChildNodes();
- }
-
- public Node removeChild(Node oldChild) throws DOMException
- {
- log.trace("removeChild: " + oldChild);
- expandToDOM();
- Node node = super.removeChild(oldChild);
- invalidateObjectContent();
- invalidateXMLContent();
- return node;
- }
-
- public Node replaceChild(Node newChild, Node oldChild) throws DOMException
- {
- log.trace("replaceChild: [new=" + newChild + ",old=" + oldChild
+ "]");
- expandToDOM();
- Node node = super.replaceChild(newChild, oldChild);
- invalidateObjectContent();
- invalidateXMLContent();
- return node;
- }
-
- public void setValue(String value)
- {
- log.trace("setValue: " + value);
- expandToDOM();
- super.setValue(value);
- invalidateObjectContent();
- invalidateXMLContent();
- }
-
- public NamedNodeMap getAttributes()
- {
- return super.getAttributes();
- }
-
- public boolean hasAttributes()
- {
- return super.hasAttributes();
- }
-
- // END Node interface
***********************************************************************************************
-
- /** Expand the content, generating appropriate child nodes
- */
- private void expandToDOM()
- {
- // SOAPContentElements should only be expanded when handlers do require it.
- if (isDOMValid == false && expandingToDOM == false)
- {
- log.trace("BEGIN: expandToDOM " + getElementName());
- expandingToDOM = true;
-
- // DOM expansion should only happen when a handler accesses the DOM API.
- CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
- if (msgContext != null && !UnifiedMetaData.isFinalRelease())
- {
- Boolean allowExpand =
(Boolean)msgContext.getProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
- if (Boolean.TRUE.equals(allowExpand) == false)
- throw new WSException("Expanding content element to DOM");
- }
-
- try
- {
- if (xmlFragment == null && isObjectValid)
- xmlFragment = getXMLFragment();
-
- if (xmlFragment == null && isObjectValid == false)
- throw new IllegalStateException("Neither DOM, nor XML, nor Object
valid");
-
- if (xmlFragment != null)
- {
- String wrappedXMLFragment =
insertNamespaceDeclarations("<wrapper>" + xmlFragment +
"</wrapper>");
- Element contentRoot = DOMUtils.parse(wrappedXMLFragment);
- contentRoot = DOMUtils.getFirstChildElement(contentRoot);
-
- String rootLocalName = contentRoot.getLocalName();
- String rootPrefix = contentRoot.getPrefix();
- String rootNS = contentRoot.getNamespaceURI();
- Name contentRootName = new NameImpl(rootLocalName, rootPrefix, rootNS);
-
- // Make sure the content root element name matches this element name
- Name name = getElementName();
- if (contentRootName.equals(name) == false)
- throw new WSException("Content root name does not match element
name: " + contentRootName + " != " + name);
-
- // Copy attributes
- DOMUtils.copyAttributes(this, contentRoot);
-
- SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
-
- NodeList nlist = contentRoot.getChildNodes();
- for (int i = 0; i < nlist.getLength(); i++)
- {
- Node child = nlist.item(i);
- short childType = child.getNodeType();
- if (childType == Node.ELEMENT_NODE)
- {
- SOAPElementImpl soapElement =
soapFactory.createElement((Element)child, true);
- super.addChildElement(soapElement);
- if (Constants.NAME_XOP_INCLUDE.equals(name) || isXOPParameter())
- XOPContext.inlineXOPData(soapElement);
- }
- else if (childType == Node.TEXT_NODE)
- {
- String nodeValue = child.getNodeValue();
- super.addTextNode(nodeValue);
- }
- else if (childType == Node.CDATA_SECTION_NODE)
- {
- String nodeValue = child.getNodeValue();
- super.addTextNode(nodeValue);
- }
- else
- {
- log.trace("Ignore child type: " + childType);
- }
- }
- }
-
- isDOMValid = true;
- }
- catch (RuntimeException e)
- {
- invalidateDOMContent();
- throw e;
- }
- catch (Exception e)
- {
- invalidateDOMContent();
- throw new WSException(e);
- }
- finally
- {
- expandingToDOM = false;
- log.trace("END: expandToDOM " + getElementName());
- }
-
- invalidateXMLContent();
- invalidateObjectContent();
- }
- }
-
- public String insertNamespaceDeclarations(String xmlfragment)
- {
- StringBuilder xmlBuffer = new StringBuilder(xmlfragment);
-
- int endIndex = xmlfragment.indexOf(">");
- int insIndex = endIndex;
- if (xmlfragment.charAt(insIndex - 1) == '/')
- insIndex = insIndex - 1;
-
- SOAPElement soapElement = this;
- while (soapElement != null)
- {
- Iterator it = soapElement.getNamespacePrefixes();
- while (it.hasNext())
- {
- String prefix = (String)it.next();
- String nsURI = soapElement.getNamespaceURI(prefix);
- String nsDecl = " xmlns:" + prefix + "='" + nsURI +
"'";
-
- // Make sure there is not a duplicate on just the wrapper tag
- int nsIndex = xmlBuffer.indexOf("xmlns:" + prefix);
- if (nsIndex < 0 || nsIndex > endIndex)
- {
- xmlBuffer.insert(insIndex, nsDecl);
- endIndex += nsDecl.length();
- }
- }
- soapElement = soapElement.getParentElement();
- }
-
- log.trace("insertNamespaceDeclarations: " + xmlBuffer);
- return xmlBuffer.toString();
- }
-
- private void invalidateDOMContent()
- {
- if (expandingToDOM == false)
- {
- log.trace("invalidateDOMContent");
- this.isDOMValid = false;
- }
- }
-
- private void invalidateObjectContent()
- {
- if (expandingToDOM == false)
- {
- log.trace("invalidateObjectContent");
- this.isObjectValid = false;
- this.objectValue = null;
- }
- }
-
- private void invalidateXMLContent()
- {
- if (expandingToDOM == false)
- {
- log.trace("invalidateXMLContent");
- this.xmlFragment = null;
- }
- }
-
- private void resetElementContent()
- {
- if (expandingToDOM == false)
- {
- log.trace("resetElementContent");
- invalidateDOMContent();
- invalidateObjectContent();
- invalidateXMLContent();
- }
- }
-
- public void writeElement(Writer writer) throws IOException
- {
- handleMTOMTransitions();
-
- if (isDOMValid)
- {
- new DOMWriter(writer).print(this);
- }
- else
- {
- writer.write(getXMLFragment());
- }
- }
-
- /**
- * When a SOAPContentElement transitions between dom-valid and xml-valid
- * the XOP elements need to transition from XOP optimized to base64 and
reverse.<p>
- *
- * If MTOM is disabled through a message context property we always enforce the
- * base64 representation by expanding to DOM, the same happens when a JAXRPC handler
- * accesses the SOAPContentElement.<p>
- *
- * If the element is in dom-valid state (because a handlers accessed it), upon
marshalling
- * it's needs to be decided wether or not the <code>xop:Include</code>
should be restored.
- * This as well depends upon the message context property.
- */
- public void handleMTOMTransitions()
- {
- // MTOM processing is only required on XOP parameters
- if( isXOPParameter() == false)
- return;
-
- if ( !XOPContext.isMTOMEnabled() )
- {
- // If MTOM is disabled, we force dom expansion on XOP parameters.
- // This will inline any XOP include element and remove the attachment part.
- // See SOAPFactoryImpl for details.
-
- log.debug("MTOM disabled: Force inline XOP data");
- CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
- msgContext.setProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
- expandToDOM();
- }
- else if ( isDOMValid && XOPContext.isMTOMEnabled() )
- {
- // When the DOM representation is valid,
- // but MTOM is enabled we need to convert the inlined
- // element back to an xop:Include element and create the attachment part
-
- log.debug("MTOM enabled: Restore XOP data");
- XOPContext.restoreXOPDataDOM(this);
- }
- }
-
- private boolean isXOPParameter()
- {
- return paramMetaData != null && paramMetaData.isXOP();
- }
-
- public void accept(SAAJVisitor visitor)
- {
- visitor.visitSOAPContentElement(this);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/SOAPDocument.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPDocument.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPDocument.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,440 +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.core.soap;
-
-import org.jboss.ws.core.utils.DOMUtils;
-import org.w3c.dom.Attr;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Comment;
-import org.w3c.dom.DOMConfiguration;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.EntityReference;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-import org.w3c.dom.UserDataHandler;
-
-/**
- * <code>SOAPDocument</code> ensures that the propper SAAJ elements are
- * returned when Document calls are made from a DOM client. This implementation
- * enscapsulates a single ThreadLocal Document object.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class SOAPDocument implements Document
-{
- // TODO Revisit methods that are restricted or not implemented.
-
- private Document doc = DOMUtils.getOwnerDocument();
-
- // Document methods
-
- public DocumentType getDoctype()
- {
- return doc.getDoctype();
- }
-
- public DOMImplementation getImplementation()
- {
- // Should this be allowed?
- return doc.getImplementation();
- }
-
- public Element getDocumentElement()
- {
- // The base SOAPDocument does not have an element, only SOAPPart will
- return null;
- }
-
- public Element createElement(String tagName) throws DOMException
- {
- return new SOAPElementImpl(tagName);
- }
-
- public DocumentFragment createDocumentFragment()
- {
- return doc.createDocumentFragment();
- }
-
- public Text createTextNode(String data)
- {
- return doc.createTextNode(data);
- }
-
- public Comment createComment(String data)
- {
- return doc.createComment(data);
- }
-
- public CDATASection createCDATASection(String data) throws DOMException
- {
- return createCDATASection(data);
- }
-
- public ProcessingInstruction createProcessingInstruction(String target, String data)
throws DOMException
- {
- return createProcessingInstruction(target, data);
- }
-
- public Attr createAttribute(String name) throws DOMException
- {
- return doc.createAttribute(name);
- }
-
- public EntityReference createEntityReference(String name) throws DOMException
- {
- // Not allowed
- return null;
- }
-
- public NodeList getElementsByTagName(String tagname)
- {
- // The base SOAPDocument does not have an element, only SOAPPart will
- return null;
- }
-
- public Node importNode(Node importedNode, boolean deep) throws DOMException
- {
- // This should never be needed
- return doc.importNode(importedNode, deep);
- }
-
- public Element createElementNS(String namespaceURI, String qualifiedName) throws
DOMException
- {
- int loc = qualifiedName.indexOf(":");
-
- if (loc == -1)
- return new SOAPElementImpl(qualifiedName, null, namespaceURI);
-
- if (loc == qualifiedName.length() - 1)
- throw new IllegalArgumentException("Invalid qualified name");
-
- return new SOAPElementImpl(qualifiedName.substring(loc + 1),
qualifiedName.substring(0, loc), namespaceURI);
- }
-
- public Attr createAttributeNS(String namespaceURI, String qualifiedName) throws
DOMException
- {
- return doc.createAttributeNS(namespaceURI, qualifiedName);
- }
-
- public NodeList getElementsByTagNameNS(String namespaceURI, String localName)
- {
- // The base SOAPDocument does not have an element, only SOAPPart will
- return null;
- }
-
- public Element getElementById(String elementId)
- {
- // The base SOAPDocument does not have an element, only SOAPPart will
- return null;
- }
-
- // Node methods
- public String getNodeName()
- {
- return doc.getNodeName();
- }
-
- public String getNodeValue() throws DOMException
- {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
- }
-
- public void setNodeValue(String nodeValue) throws DOMException
- {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
- }
-
- public short getNodeType()
- {
- return doc.getNodeType();
- }
-
- public Node getParentNode()
- {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
- }
-
- public NodeList getChildNodes()
- {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
- }
-
- public Node getFirstChild()
- {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
- }
-
- public Node getLastChild()
- {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
- }
-
- public Node getPreviousSibling()
- {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
- }
-
- public Node getNextSibling()
- {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
- }
-
- public NamedNodeMap getAttributes()
- {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
- }
-
- public Document getOwnerDocument()
- {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
- }
-
- public Node insertBefore(Node newChild, Node refChild) throws DOMException
- {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
- }
-
- public Node replaceChild(Node newChild, Node oldChild) throws DOMException
- {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
- }
-
- public Node removeChild(Node oldChild) throws DOMException
- {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
- }
-
- public Node appendChild(Node newChild) throws DOMException
- {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
- }
-
- public boolean hasChildNodes()
- {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
- }
-
- public Node cloneNode(boolean deep)
- {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
- }
-
- public void normalize()
- {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
- }
-
- public boolean isSupported(String feature, String version)
- {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
- }
-
- public String getNamespaceURI()
- {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
- }
-
- public String getPrefix()
- {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
- }
-
- public void setPrefix(String prefix) throws DOMException
- {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
- }
-
- public String getLocalName()
- {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
- }
-
- public boolean hasAttributes()
- {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
- }
-
- // DOM3 methods
-
- public String getInputEncoding()
- {
- // FIXME getInputEncoding
- return null;
- }
-
- public String getXmlEncoding()
- {
- // FIXME getXmlEncoding
- return null;
- }
-
- public boolean getXmlStandalone()
- {
- // FIXME getXmlStandalone
- return false;
- }
-
- public void setXmlStandalone(boolean arg0) throws DOMException
- {
- // FIXME setXmlStandalone
- }
-
- public String getXmlVersion()
- {
- // FIXME getXmlVersion
- return null;
- }
-
- public void setXmlVersion(String arg0) throws DOMException
- {
- // FIXME setXmlVersion
- }
-
- public boolean getStrictErrorChecking()
- {
- // FIXME getStrictErrorChecking
- return false;
- }
-
- public void setStrictErrorChecking(boolean arg0)
- {
- // FIXME setStrictErrorChecking
-
- }
-
- public String getDocumentURI()
- {
- // FIXME getDocumentURI
- return null;
- }
-
- public void setDocumentURI(String arg0)
- {
- // FIXME setDocumentURI
-
- }
-
- public Node adoptNode(Node arg0) throws DOMException
- {
- // FIXME adoptNode
- return null;
- }
-
- public DOMConfiguration getDomConfig()
- {
- // FIXME getDomConfig
- return null;
- }
-
- public void normalizeDocument()
- {
- // FIXME normalizeDocument
-
- }
-
- public Node renameNode(Node arg0, String arg1, String arg2) throws DOMException
- {
- // FIXME renameNode
- return null;
- }
-
- public String getBaseURI()
- {
- // FIXME getBaseURI
- return null;
- }
-
- public short compareDocumentPosition(Node arg0) throws DOMException
- {
- // FIXME compareDocumentPosition
- return 0;
- }
-
- public String getTextContent() throws DOMException
- {
- // FIXME getTextContent
- return null;
- }
-
- public void setTextContent(String arg0) throws DOMException
- {
- // FIXME setTextContent
-
- }
-
- public boolean isSameNode(Node arg0)
- {
- // FIXME isSameNode
- return false;
- }
-
- public String lookupPrefix(String arg0)
- {
- // FIXME lookupPrefix
- return null;
- }
-
- public boolean isDefaultNamespace(String arg0)
- {
- // FIXME isDefaultNamespace
- return false;
- }
-
- public String lookupNamespaceURI(String arg0)
- {
- // FIXME lookupNamespaceURI
- return null;
- }
-
- public boolean isEqualNode(Node arg0)
- {
- // FIXME isEqualNode
- return false;
- }
-
- public Object getFeature(String arg0, String arg1)
- {
- // FIXME getFeature
- return null;
- }
-
- public Object setUserData(String arg0, Object arg1, UserDataHandler arg2)
- {
- // FIXME setUserData
- return null;
- }
-
- public Object getUserData(String arg0)
- {
- // FIXME getUserData
- return null;
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/core/soap/SOAPDocument.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPDocument.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/SOAPElementImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPElementImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPElementImpl.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,738 +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.core.soap;
-
-// $Id$
-
-import java.io.IOException;
-import java.io.Writer;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.Name;
-import javax.xml.soap.Node;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.Text;
-
-import org.jboss.logging.Logger;
-import org.jboss.util.NotImplementedException;
-import org.jboss.ws.Constants;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.w3c.dom.Attr;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.TypeInfo;
-
-/**
- * An object representing an element of a SOAP message that is allowed but not
specifically prescribed by a
- * SOAP specification. This interface serves as the base interface for those objects that
are specifically
- * prescribed by a SOAP specification.
- *
- * Methods in this interface that are required to return SAAJ specific objects may
"silently" replace nodes
- * in the tree as required to successfully return objects of the correct type.
- *
- * @author Thomas.Diesler(a)jboss.org
- */
-public class SOAPElementImpl extends NodeImpl implements SOAPElement, SAAJVisitable
-{
- // provide logging
- private static Logger log = Logger.getLogger(SOAPElementImpl.class);
-
- // The org.w3c.dom.Element
- private Element element;
- // The element name
- private Name elementName;
- // The element's encoding style
- private String encodingStyle = Constants.URI_LITERAL_ENC;
-
- /** Called by SOAPFactory */
- public SOAPElementImpl(String localPart)
- {
-
- super(DOMUtils.createElement(localPart, null, null));
- this.element = (Element)domNode;
- log.trace("new SOAPElementImpl: " + getElementName());
- }
-
- /** Called by SOAPFactory */
- public SOAPElementImpl(String localPart, String prefix, String nsURI)
- {
- super(DOMUtils.createElement(localPart, prefix, nsURI));
- this.element = (Element)domNode;
- log.trace("new SOAPElementImpl: " + getElementName());
- }
-
- /** Called by SOAPFactory */
- public SOAPElementImpl(Name name)
- {
- this(name.getLocalName(), name.getPrefix(), name.getURI());
- }
-
- /** Copy constructor for converting SOAPElement types
- */
- protected SOAPElementImpl(SOAPElementImpl element)
- {
- super(element);
- this.element = (Element)domNode;
- log.trace("new SOAPElementImpl: " + getElementName());
- }
-
- /** Get the SOAPEnvelope for this SOAPElement */
- public SOAPEnvelope getSOAPEnvelope()
- {
- SOAPElement soapElement = this;
- while (soapElement != null && (soapElement instanceof SOAPEnvelope) ==
false)
- soapElement = soapElement.getParentElement();
-
- return (SOAPEnvelope)soapElement;
- }
-
- // javax.xml.soap.SOAPElement
*************************************************************************************
-
- /**
- * Adds an attribute with the specified name and value to this SOAPElement object.
- *
- * @param name a Name object with the name of the attribute
- * @param value a String giving the value of the attribute
- * @return the SOAPElement object into which the attribute was inserted
- * @throws javax.xml.soap.SOAPException if there is an error in creating the
Attribute
- */
- public SOAPElement addAttribute(Name name, String value) throws SOAPException
- {
- // xml:lang='en'
- if ("xml".equals(name.getPrefix()))
- {
- setAttribute(name.getQualifiedName(), value);
- }
- else
- {
- setAttributeNS(name.getURI(), name.getQualifiedName(), value);
- }
- return this;
- }
-
- /**
- * Creates a new SOAPElement object initialized with the specified local name and adds
the new element to this SOAPElement object.
- *
- * @param name a String giving the local name for the element
- * @return the new SOAPElement object that was created
- * @throws javax.xml.soap.SOAPException if there is an error in creating the
SOAPElement object
- */
- public SOAPElement addChildElement(String name) throws SOAPException
- {
- SOAPElement soapElement = new SOAPElementImpl(name);
- soapElement = addChildElement(soapElement);
- return soapElement;
- }
-
- /**
- * Creates a new SOAPElement object initialized with the specified local name and
prefix and adds the new element to this SOAPElement object.
- *
- * @param localName a String giving the local name for the new element
- * @param prefix a String giving the namespace prefix for the new element
- * @return the new SOAPElement object that was created
- * @throws javax.xml.soap.SOAPException if there is an error in creating the
SOAPElement object
- */
- public SOAPElement addChildElement(String localName, String prefix) throws
SOAPException
- {
- String nsURI = getNamespaceURI(prefix);
- if (nsURI == null)
- throw new IllegalArgumentException("Cannot obtain namespace URI for prefix:
" + prefix);
-
- SOAPElement soapElement = new SOAPElementImpl(localName, prefix, nsURI);
- soapElement = addChildElement(soapElement);
- return soapElement;
- }
-
- /**
- * Creates a new SOAPElement object initialized with the specified local name, prefix,
and URI and adds the new element to this SOAPElement object.
- *
- * @param localName a String giving the local name for the new element
- * @param prefix a String giving the namespace prefix for the new element
- * @param uri a String giving the URI of the namespace to which the new element
belongs
- * @return the new SOAPElement object that was created
- * @throws javax.xml.soap.SOAPException if there is an error in creating the
SOAPElement object
- */
- public SOAPElement addChildElement(String localName, String prefix, String uri) throws
SOAPException
- {
- SOAPElement soapElement = new SOAPElementImpl(localName, prefix, uri);
- soapElement = addChildElement(soapElement);
- return soapElement;
- }
-
- /**
- * Creates a new SOAPElement object initialized with the given Name object and adds
the new element to this SOAPElement object.
- *
- * @param name a Name object with the XML name for the new element
- * @return the new SOAPElement object that was created
- * @throws javax.xml.soap.SOAPException if there is an error in creating the
SOAPElement object
- */
- public SOAPElement addChildElement(Name name) throws SOAPException
- {
- SOAPElement soapElement = new SOAPElementImpl(name);
- soapElement = addChildElement(soapElement);
- return soapElement;
- }
-
- /**
- * Add a SOAPElement as a child of this SOAPElement instance. The SOAPElement is
expected to be created by a
- * SOAPElementFactory.
- * <p/>
- * Callers should not rely on the element instance being added as is into the XML
tree.
- * Implementations could end up copying the content of the SOAPElement passed into an
instance of a different SOAPElement
- * implementation. For instance if addChildElement() is called on a SOAPHeader,
element will be copied into an instance
- * of a SOAPHeaderElement.
- * <p/>
- * The fragment rooted in element is either added as a whole or not at all, if there
was an error.
- * <p/>
- * The fragment rooted in element cannot contain elements named "Envelope",
"Header" or "Body" and in the SOAP namespace.
- * Any namespace prefixes present in the fragment should be fully resolved using
appropriate namespace declarations
- * within the fragment itself.
- *
- * @param child the SOAPElement to be added as a new child
- * @return an instance representing the new SOAP element that was actually added to
the tree.
- * @throws javax.xml.soap.SOAPException if there was an error in adding this element
as a child
- */
- public SOAPElement addChildElement(SOAPElement child) throws SOAPException
- {
- log.trace("addChildElement: " + getElementName() + " -> " +
child.getElementName());
- SOAPElementImpl soapElement = (SOAPElementImpl)child;
- soapElement = (SOAPElementImpl)appendChild(soapElement);
- return soapElement.completeNamespaceDeclaration();
- }
-
- /**
- * Adds a namespace declaration with the specified prefix and URI to this SOAPElement
object.
- *
- * @param prefix a String giving the prefix of the namespace
- * @param nsURI a String giving the uri of the namespace
- * @return the SOAPElement object into which this namespace declaration was inserted.
- * @throws javax.xml.soap.SOAPException if there is an error in creating the
namespace
- */
- public SOAPElement addNamespaceDeclaration(String prefix, String nsURI)
- {
- if (nsURI == null)
- throw new IllegalArgumentException("Invalid 'null' namespace
URI");
- if (nsURI.length() == 0)
- throw new IllegalArgumentException("Invalid empty namespace URI");
-
- String qualifiedName = "xmlns";
- if (prefix != null && prefix.length() > 0)
- qualifiedName += ":" + prefix;
-
- log.trace("addNamespaceDeclaration: " + qualifiedName +
"='" + nsURI + "'");
-
element.setAttributeNS("http://www.w3.org/2000/xmlns/", qualifiedName,
nsURI);
- return this;
- }
-
- // Add the namespace declaration if it is not visible yet
- private SOAPElement completeNamespaceDeclaration()
- {
- String prefix = getPrefix();
- String nsURI = getNamespaceURI();
- if (prefix != null && nsURI != null)
- {
- String prevNS = getNamespaceURI(prefix);
- if (nsURI.equals(prevNS) == false)
- addNamespaceDeclaration(prefix, nsURI);
- }
- return this;
- }
-
- /**
- * Creates a new Text object initialized with the given String and adds it to this
SOAPElement object.
- *
- * @param value a String object with the textual content to be added
- * @return the SOAPElement object into which the new Text object was inserted
- * @throws javax.xml.soap.SOAPException if there is an error in creating the new Text
object
- */
- public SOAPElement addTextNode(String value) throws SOAPException
- {
- log.trace("addTextNode: " + value);
- org.w3c.dom.Text domText = element.getOwnerDocument().createTextNode(value);
- javax.xml.soap.Text soapText = new TextImpl(domText);
- appendChild(soapText);
- return this;
- }
-
- /**
- * Returns an Iterator over all of the attribute Name objects in this SOAPElement
object.
- * <p/>
- * The iterator can be used to get the attribute names, which can then be passed to
the method getAttributeValue to
- * retrieve the value of each attribute.
- *
- * @return an iterator over the names of the attributes
- */
- public Iterator getAllAttributes()
- {
- ArrayList list = new ArrayList();
- NamedNodeMap nnm = getAttributes();
- for (int i = 0; i < nnm.getLength(); i++)
- {
- org.w3c.dom.Node node = (org.w3c.dom.Node)nnm.item(i);
- String local = node.getLocalName();
- String prefix = node.getPrefix();
- String uri = node.getNamespaceURI();
- if ("xmlns".equals(prefix) == false)
- {
- Name name;
- if (uri != null && uri.length() > 0)
- {
- name = new NameImpl(local, prefix, uri);
- }
- else
- {
- name = new NameImpl(local);
- }
- list.add(name);
- }
- }
- return list.iterator();
- }
-
- /**
- * Returns the value of the attribute with the specified name.
- *
- * @param name a Name object with the name of the attribute
- * @return a String giving the value of the specified attribute
- */
- public String getAttributeValue(Name name)
- {
- Attr attr = getAttributeNode(name);
- return (attr != null ? attr.getValue() : null);
- }
-
- private Attr getAttributeNode(Name name)
- {
- Attr attr = null;
- String nsURI = name.getURI();
- if (nsURI.length() > 0)
- attr = element.getAttributeNodeNS(nsURI, name.getLocalName());
- else attr = element.getAttributeNode(name.getLocalName());
-
- return attr;
- }
-
- /**
- * Returns an Iterator over all the immediate child Nodes of this element.
- * <p/>
- * This includes javax.xml.soap.Text objects as well as SOAPElement objects.
- * Calling this method may cause child Element, SOAPElement and org.w3c.dom.Text nodes
to be replaced by SOAPElement,
- * SOAPHeaderElement, SOAPBodyElement or javax.xml.soap.Text nodes as appropriate for
the type of this parent node.
- * As a result the calling application must treat any existing references to these
child nodes that have been obtained
- * through DOM APIs as invalid and either discard them or refresh them with the values
returned by this Iterator.
- * This behavior can be avoided by calling the equivalent DOM APIs. See javax.xml.soap
for more details.
- *
- * @return an iterator with the content of this SOAPElement object
- */
- public Iterator getChildElements()
- {
- List list = new ArrayList();
- NodeList nodeList = getChildNodes();
- for (int i = 0; i < nodeList.getLength(); i++)
- {
- org.w3c.dom.Node node = nodeList.item(i);
- if (node instanceof SOAPElement)
- {
- list.add(node);
- }
- else if (node instanceof Text)
- {
- String value = node.getNodeValue();
- if (value.trim().length() > 0)
- list.add(node);
- }
- }
- return list.iterator();
- }
-
- /**
- * Returns an Iterator over all the immediate child Nodes of this element with the
specified name.
- * <p/>
- * All of these children will be SOAPElement nodes.
- * Calling this method may cause child Element, SOAPElement and org.w3c.dom.Text nodes
to be replaced by SOAPElement,
- * SOAPHeaderElement, SOAPBodyElement or javax.xml.soap.Text nodes as appropriate for
the type of this parent node.
- * As a result the calling application must treat any existing references to these
child nodes that have been obtained
- * through DOM APIs as invalid and either discard them or refresh them with the values
returned by this Iterator.
- * This behavior can be avoided by calling the equivalent DOM APIs. See javax.xml.soap
for more details.
- *
- * @param name a Name object with the name of the child elements to be returned
- * @return an Iterator object over all the elements in this SOAPElement object with
the specified name
- */
- public Iterator getChildElements(Name name)
- {
- List<SOAPElement> list = new ArrayList<SOAPElement>();
- Iterator it = getChildElements();
- while (it.hasNext())
- {
- Object elementOrTextNode = it.next();
- if (elementOrTextNode instanceof SOAPElement)
- {
- SOAPElement el = (SOAPElement)elementOrTextNode;
- if (el.getElementName().equals(name))
- list.add(el);
- }
- }
- return list.iterator();
- }
-
- /**
- * Returns the name of this SOAPElement object.
- *
- * @return a Name object with the name of this SOAPElement object
- */
- public Name getElementName()
- {
- if (elementName == null)
- {
- String nsURI = element.getNamespaceURI();
- if (nsURI != null && nsURI.length() > 0)
- {
- String prefix = element.getPrefix();
- String localName = element.getLocalName();
- elementName = new NameImpl(localName, prefix, nsURI);
- }
- else
- {
- String nodeName = element.getNodeName();
- elementName = new NameImpl(nodeName);
- }
- }
- return elementName;
- }
-
- /**
- * Returns the encoding style for this SOAPElement object.
- *
- * @return a String giving the encoding style
- */
- public String getEncodingStyle()
- {
- return encodingStyle;
- }
-
- /**
- * Returns an Iterator over the namespace prefix Strings declared by this element.
- * <p/>
- * The prefixes returned by this iterator can be passed to the method getNamespaceURI
to retrieve the URI of each namespace.
- *
- * @return an iterator over the namespace prefixes in this SOAPElement object
- */
- public Iterator getNamespacePrefixes()
- {
- ArrayList list = getNamespacePrefixList();
- return list.iterator();
- }
-
- private ArrayList getNamespacePrefixList()
- {
- ArrayList list = new ArrayList();
- NamedNodeMap attrMap = element.getAttributes();
- for (int i = 0; i < attrMap.getLength(); i++)
- {
- Attr attr = (Attr)attrMap.item(i);
- String attrName = attr.getNodeName();
- if (attrName.startsWith("xmlns:"))
- list.add(attrName.substring(6));
- }
- return list;
- }
-
- /**
- * Returns the URI of the namespace that has the given prefix.
- *
- * @param prefix a String giving the prefix of the namespace for which to search
- * @return a String with the uri of the namespace that has the given prefix
- */
- public String getNamespaceURI(String prefix)
- {
- String nsURI = element.getAttribute("xmlns:" + prefix);
- if (nsURI.length() == 0 && getParentElement() != null)
- return getParentElement().getNamespaceURI(prefix);
-
- return (nsURI.length() > 0 ? nsURI : null);
- }
-
- /**
- * Returns an Iterator over the namespace prefix Strings visible to this element.
- * <p/>
- * The prefixes returned by this iterator can be passed to the method getNamespaceURI
to retrieve the URI of each namespace.
- *
- * @return an iterator over the namespace prefixes are within scope of this
SOAPElement object
- */
- public Iterator getVisibleNamespacePrefixes()
- {
- ArrayList list = getNamespacePrefixList();
- SOAPElementImpl parent = (SOAPElementImpl)getParentElement();
- while (parent != null)
- {
- list.addAll(parent.getNamespacePrefixList());
- parent = (SOAPElementImpl)parent.getParentElement();
- }
- return list.iterator();
- }
-
- /**
- * Removes the attribute with the specified name.
- *
- * @param name the Name object with the name of the attribute to be removed
- * @return true if the attribute was removed successfully; false if it was not
- */
- public boolean removeAttribute(Name name)
- {
- Attr attr = getAttributeNode(name);
- if (attr != null)
- {
- element.removeAttributeNode(attr);
- return true;
- }
- return false;
- }
-
- /**
- * Detaches all children of this SOAPElement.
- * <p/>
- * This method is useful for rolling back the construction of partially completed
SOAPHeaders and SOAPBodys in
- * preparation for sending a fault when an error condition is detected.
- * It is also useful for recycling portions of a document within a SOAP message.
- */
- public void removeContents()
- {
- log.trace("removeContents");
- Iterator it = getChildElements();
- while (it.hasNext())
- {
- SOAPElement el = (SOAPElement)it.next();
- el.detachNode();
- }
- }
-
- /**
- * Removes the namespace declaration corresponding to the given prefix.
- *
- * @param prefix a String giving the prefix for which to search
- * @return true if the namespace declaration was removed successfully; false if it was
not
- */
- public boolean removeNamespaceDeclaration(String prefix)
- {
- boolean ret = getAttributeNode("xmlns:" + prefix) != null;
- removeAttribute("xmlns:" + prefix);
- return ret;
- }
-
- /**
- * Sets the encoding style for this SOAPElement object to one specified.
- *
- * @param encodingStyle a String giving the encoding style
- * @throws javax.xml.soap.SOAPException if there was a problem in the encoding style
being set.
- */
- public void setEncodingStyle(String encodingStyle) throws SOAPException
- {
- if (!Constants.URI_LITERAL_ENC.equals(encodingStyle) &&
!Constants.URI_SOAP11_ENC.equals(encodingStyle))
- throw new IllegalArgumentException("Unsupported encodingStyle: " +
encodingStyle);
-
- this.encodingStyle = encodingStyle;
- }
-
- // org.w3c.Element
***********************************************************************************************
-
- public String getTagName()
- {
- return element.getTagName();
- }
-
- public void removeAttribute(String name) throws DOMException
- {
- element.removeAttribute(name);
- }
-
- public boolean hasAttribute(String name)
- {
- return element.hasAttribute(name);
- }
-
- public String getAttribute(String name)
- {
- return element.getAttribute(name);
- }
-
- public void removeAttributeNS(String namespaceURI, String localName) throws
DOMException
- {
- element.removeAttributeNS(namespaceURI, localName);
- }
-
- public void setAttribute(String name, String value) throws DOMException
- {
- element.setAttribute(name, value);
- }
-
- public boolean hasAttributeNS(String namespaceURI, String localName)
- {
- return element.hasAttributeNS(namespaceURI, localName);
- }
-
- public Attr getAttributeNode(String name)
- {
- Attr attr = element.getAttributeNode(name);
-
- return (attr == null) ? null : new AttrImpl(this, attr);
- }
-
- public Attr removeAttributeNode(Attr oldAttr) throws DOMException
- {
- return element.removeAttributeNode(oldAttr);
- }
-
- public Attr setAttributeNode(Attr newAttr) throws DOMException
- {
- return element.setAttributeNode(newAttr);
- }
-
- public Attr setAttributeNodeNS(Attr newAttr) throws DOMException
- {
- return element.setAttributeNodeNS(newAttr);
- }
-
- public NodeList getElementsByTagName(String name)
- {
- return new NodeListImpl(DOMUtils.getChildElements(this, name));
- }
-
- public String getAttributeNS(String namespaceURI, String localName)
- {
- return element.getAttributeNS(namespaceURI, localName);
- }
-
- public void setAttributeNS(String namespaceURI, String qualifiedName, String value)
throws DOMException
- {
- element.setAttributeNS(namespaceURI, qualifiedName, value);
- }
-
- public Attr getAttributeNodeNS(String namespaceURI, String localName)
- {
- /* FIXME We really need to do more than just return an object wrapper.
- * All Attrs should be stored as nodes on our local tree, so that
- * they are discovered during node traversal calls.
- */
- Attr attr = element.getAttributeNodeNS(namespaceURI, localName);
-
- return (attr == null) ? null : new AttrImpl(this, attr);
- }
-
- public NodeList getElementsByTagNameNS(String namespaceURI, String localName)
- {
- return new NodeListImpl(DOMUtils.getChildElements(this, new QName(namespaceURI,
localName)));
- }
-
- public TypeInfo getSchemaTypeInfo()
- {
- throw new NotImplementedException("getSchemaTypeInfo");
- }
-
- public void setIdAttribute(String name, boolean isId) throws DOMException
- {
- throw new NotImplementedException("setIdAttribute");
- }
-
- public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException
- {
- throw new NotImplementedException("setIdAttributeNode");
- }
-
- public void setIdAttributeNS(String namespaceURI, String localName, boolean isId)
throws DOMException
- {
- throw new NotImplementedException("setIdAttributeNS");
- }
-
- public void accept(SAAJVisitor visitor) {
- visitor.visitSOAPElement(this);
- }
- /**
- * The default implementation uses a DOMWriter.
- * SOAPContentElements overwrite this to optimize DOM callbacks.
- */
- public void writeElement(Writer writer) throws IOException
- {
- String qualName = getElementName().getQualifiedName();
- writer.write("<" + qualName);
-
- // namespaces
- Iterator nsPrefixes = getNamespacePrefixes();
- while (nsPrefixes.hasNext())
- {
- String prefix = (String)nsPrefixes.next();
- writer.write(" xmlns:" + prefix + "='" +
getNamespaceURI(prefix) + "'");
- }
-
- // attributes
- Iterator attNames = getAllAttributes();
- while (attNames.hasNext())
- {
- NameImpl name = (NameImpl)attNames.next();
- String attPrefix = name.getPrefix() != null ? name.getPrefix() : "";
- String attFqn = attPrefix.length() > 0 ? attPrefix + ":" +
name.getLocalName() : name.getLocalName();
- writer.write(" " + attFqn + "='" +
getAttributeValue(name) + "'");
- }
- writer.write(">");
-
- writeElementContent(writer);
-
- writer.write("</" + qualName + ">");
- }
-
- protected void writeElementContent(Writer out) throws IOException
- {
- Iterator it = getChildElements();
- if (it.hasNext())
- {
- while (it.hasNext())
- {
- Node node = (Node)it.next();
- if (node instanceof SOAPElementImpl)
- {
- ((SOAPElementImpl)node).writeElement(out);
- }
- else if (node instanceof TextImpl)
- {
- out.write(node.getValue());
- }
- else
- {
- throw new WSException("Unhandled soap node: " +
node.getClass().getName());
- }
- }
- }
- else
- {
- String value = getValue();
- if (value != null)
- out.write(value);
- }
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/soap/SOAPElementImpl.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPElementImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/SOAPElementWriter.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPElementWriter.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPElementWriter.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,157 +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.core.soap;
-
-// $Id$
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.io.UnsupportedEncodingException;
-import java.io.Writer;
-
-import javax.xml.soap.SOAPEnvelope;
-
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.core.utils.DOMWriter;
-
-/**
- * Writes a SAAJ elements to an output stream.
- *
- * @author Heiko Braun <heiko.braun(a)jboss.com>
- * @author Thomas.Diesler(a)jboss.com
- * @since 4-Aug-2006
- */
-public class SOAPElementWriter
-{
-
- // Print writer
- private PrintWriter out;
- // True, if the XML declaration should be written
- private boolean writeXMLDeclaration;
- // Explicit character set encoding
- private String charsetName;
-
- public SOAPElementWriter(Writer w)
- {
- this.out = new PrintWriter(w);
- }
-
- public SOAPElementWriter(OutputStream stream)
- {
- try
- {
- this.out = new PrintWriter(new OutputStreamWriter(stream, "UTF-8"));
- }
- catch (UnsupportedEncodingException e)
- {
- // ignore, UTF-8 should be available
- }
- }
-
- public SOAPElementWriter(OutputStream stream, String charsetName)
- {
- try
- {
- this.out = new PrintWriter(new OutputStreamWriter(stream, charsetName));
- this.charsetName = charsetName;
- }
- catch (UnsupportedEncodingException e)
- {
- throw new IllegalArgumentException("Unsupported encoding: " +
charsetName);
- }
- }
-
- /**
- * Set wheter the XML declaration should be written.
- * The default is false.
- */
- public SOAPElementWriter setWriteXMLDeclaration(boolean writeXMLDeclaration)
- {
- this.writeXMLDeclaration = writeXMLDeclaration;
- return this;
- }
-
- /**
- * Print a node with explicit prettyprinting.
- * The defaults for all other DOMWriter properties apply.
- */
- public static String writeElement(SOAPElementImpl element, boolean pretty)
- {
- if (element == null)
- return null;
-
- StringWriter strw = new StringWriter();
- new SOAPElementWriter(strw).writeElement(element);
- String xmlStr = strw.toString();
-
- if (pretty)
- {
- // This is expensive. Make sure it only happens for debugging
- try
- {
- xmlStr = DOMWriter.printNode(DOMUtils.parse(xmlStr), true);
- }
- catch (IOException ex)
- {
- throw new WSException ("Cannot parse xml: " + xmlStr, ex);
- }
- }
-
- return xmlStr;
- }
-
- public void writeElement(SOAPElementImpl element)
- {
- writeElementInternal(element);
- }
-
- private void writeElementInternal(SOAPElementImpl element)
- {
- if (element != null)
- {
- try
- {
- if (writeXMLDeclaration == true && element instanceof SOAPEnvelope)
- {
- out.print("<?xml version='1.0'");
- if (charsetName != null)
- out.print(" encoding='" + charsetName +
"'");
-
- out.println("?>");
- writeXMLDeclaration = false;
- }
-
- element.writeElement(out);
-
- out.flush();
- }
- catch (IOException ex)
- {
- throw new WSException("Cannot write SOAP element", ex);
- }
- }
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/soap/SOAPElementWriter.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPElementWriter.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/SOAPEnvelopeImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPEnvelopeImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPEnvelopeImpl.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,182 +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.core.soap;
-
-// $Id$
-
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.soap.SOAPFaultException;
-import javax.xml.soap.Name;
-import javax.xml.soap.Node;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPHeader;
-import javax.xml.soap.SOAPMessage;
-
-import org.jboss.ws.Constants;
-import org.w3c.dom.Document;
-
-/**
- * The container for the SOAPHeader and SOAPBody portions of a SOAPPart object. By
default, a
- * SOAPMessage object is created with a SOAPPart object that has a SOAPEnvelope object.
- * The SOAPEnvelope object by default has an empty SOAPBody object and an empty
SOAPHeader object.
- * The SOAPBody object is required, and the SOAPHeader object, though optional, is used
in the majority of cases.
- *
- * @author Thomas.Diesler(a)jboss.org
- */
-public class SOAPEnvelopeImpl extends SOAPElementImpl implements SOAPEnvelope
-{
- // Reference the enclosing SOAPPart, so that getOwnerDocument() works correctly
- private SOAPPartImpl soapPart;
- private boolean domExpansionEnabled = false;
-
- /** Construct a SOAP envelope for the given SOAP version URI prefix, etc.
- */
- public SOAPEnvelopeImpl(SOAPPartImpl soapPart, SOAPElementImpl element) throws
SOAPException
- {
- super(element);
-
- this.soapPart = soapPart;
- soapPart.setEnvelope(this);
-
- String prefix = getPrefix();
- String namespaceURI = getNamespaceURI();
-
- assertEnvelopeNamespace(namespaceURI);
- addNamespaceDeclaration(prefix, namespaceURI);
-
- addHeader();
- addBody();
- }
-
- /** Construct a SOAP envelope for the given SOAP version URI.
- */
- SOAPEnvelopeImpl(SOAPPartImpl soapPart, String namespace) throws SOAPException
- {
- super("Envelope", Constants.PREFIX_ENV, namespace);
-
- this.soapPart = soapPart;
- soapPart.setEnvelope(this);
-
- assertEnvelopeNamespace(namespace);
- addNamespaceDeclaration(getPrefix(), namespace);
-
- addHeader();
- addBody();
- }
-
- private void assertEnvelopeNamespace(String namespaceURI)
- {
- if (!Constants.NS_SOAP12_ENV.equals(namespaceURI) &&
!Constants.NS_SOAP11_ENV.equals(namespaceURI))
- {
- QName faultCode = Constants.SOAP11_FAULT_CODE_VERSION_MISMATCH;
- String faultString = "Invalid SOAP envelope namespace: " +
namespaceURI;
- throw new SOAPFaultException(faultCode, faultString, null, null);
- }
- }
-
- public SOAPMessage getSOAPMessage()
- {
- return soapPart.getSOAPMessage();
- }
-
- public SOAPBody addBody() throws SOAPException
- {
- SOAPBody body = getBody();
- if (body != null)
- throw new SOAPException("SOAPEnvelope already has a body element");
-
- body = new SOAPBodyImpl(getPrefix(), getNamespaceURI());
- addChildElement(body);
- return body;
- }
-
- public SOAPHeader addHeader() throws SOAPException
- {
- SOAPHeader header = getHeader();
- if (header != null)
- throw new SOAPException("SOAPEnvelope already has a header element");
-
- header = new SOAPHeaderImpl(getPrefix(), getNamespaceURI());
- return (SOAPHeader)addChildElement(header);
- }
-
- /** Make sure the child is either a SOAPHeader or SOAPBody */
- public SOAPElement addChildElement(SOAPElement child) throws SOAPException
- {
- if ((child instanceof SOAPHeader) == false && (child instanceof SOAPBody)
== false)
- throw new IllegalArgumentException("SOAPHeader or SOAPBody
expected");
-
- return super.addChildElement(child);
- }
-
- public Name createName(String localName) throws SOAPException
- {
- return new NameImpl(localName);
- }
-
- public Name createName(String localName, String prefix, String uri) throws
SOAPException
- {
- return new NameImpl(localName, prefix, uri);
- }
-
- public SOAPBody getBody() throws SOAPException
- {
- Iterator it = getChildElements();
- while (it.hasNext())
- {
- Node node = (Node)it.next();
- if (node.getLocalName().equals("Body"))
- return (SOAPBody)node;
- }
- return null;
- }
-
- public SOAPHeader getHeader() throws SOAPException
- {
- Iterator it = getChildElements();
- while (it.hasNext())
- {
- Node node = (Node)it.next();
- if (node.getLocalName().equals("Header"))
- return (SOAPHeader)node;
- }
- return null;
- }
-
- /**
- * Text nodes are not supported.
- */
- public SOAPElement addTextNode(String value) throws SOAPException
- {
- throw new SOAPException("Cannot add Text node to SOAPEnvelope");
- }
-
- public Document getOwnerDocument()
- {
- return soapPart;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/soap/SOAPEnvelopeImpl.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPEnvelopeImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/SOAPFactoryImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPFactoryImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPFactoryImpl.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,81 +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.core.soap;
-
-// $Id$
-
-import javax.xml.soap.Detail;
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPFactory;
-
-import org.jboss.ws.core.jaxrpc.binding.SOAPElementDeserializer;
-import org.w3c.dom.Element;
-
-/**
- * SOAPFactory implementation.
- *
- * @author Thomas.Diesler(a)jboss.org
- */
-public class SOAPFactoryImpl extends SOAPFactory
-{
- public SOAPElement createElement(Name name) throws SOAPException
- {
- return new SOAPElementImpl(name);
- }
-
- public SOAPElement createElement(String localName) throws SOAPException
- {
- return new SOAPElementImpl(localName);
- }
-
- public SOAPElement createElement(String localName, String prefix, String uri) throws
SOAPException
- {
- return new SOAPElementImpl(localName, prefix, uri);
- }
-
- /**
- * Create a SOAPElement from a DOM Element.
- * This method is not part of the javax.xml.soap.SOAPFactory interface.
- */
- public SOAPElementImpl createElement(Element domNode, boolean deep) throws
SOAPException
- {
- SOAPElementDeserializer des = new SOAPElementDeserializer();
- return (SOAPElementImpl)des.createElement(domNode, deep);
- }
-
- public Detail createDetail() throws SOAPException
- {
- return new DetailImpl();
- }
-
- public Name createName(String localName, String prefix, String uri) throws
SOAPException
- {
- return new NameImpl(localName, prefix, uri);
- }
-
- public Name createName(String localName) throws SOAPException
- {
- return new NameImpl(localName);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/soap/SOAPFactoryImpl.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPFactoryImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/SOAPFaultElementImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPFaultElementImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPFaultElementImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,43 +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.core.soap;
-
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPFaultElement;
-
-public class SOAPFaultElementImpl extends SOAPElementImpl implements SOAPFaultElement
-{
- public SOAPFaultElementImpl(String localPart)
- {
- super(localPart);
- }
-
- public SOAPFaultElementImpl(String localPart, String prefix, String namespace)
- {
- super(localPart, prefix, namespace);
- }
-
- public SOAPFaultElementImpl(Name name)
- {
- super(name);
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/core/soap/SOAPFaultElementImpl.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPFaultElementImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/SOAPFaultImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPFaultImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPFaultImpl.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,240 +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.core.soap;
-
-import java.io.Writer;
-import java.util.Iterator;
-import java.util.Locale;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.Detail;
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPFault;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.core.utils.DOMWriter;
-import org.jboss.xb.QNameBuilder;
-import org.w3c.dom.Element;
-
-/**
- * An element in the SOAPBody object that contains error and/or status information.
- * This information may relate to errors in the SOAPMessage object or to problems
- * that are not related to the content in the message itself. Problems not related
- * to the message itself are generally errors in processing, such as the inability
- * to communicate with an upstream server.
- *
- * The SOAPFault interface provides methods for retrieving the information contained
- * in a SOAPFault object and for setting the fault code, the fault actor, and a string
- * describing the fault. A fault code is one of the codes defined in the SOAP 1.1
specification
- * that describe the fault. An actor is an intermediate recipient to whom a message was
routed.
- * The message path may include one or more actors, or, if no actors are specified, the
message
- * goes only to the default actor, which is the final intended recipient.
- *
- * @author Thomas.Diesler(a)jboss.org
- */
-public class SOAPFaultImpl extends SOAPBodyElementDoc implements SOAPFault
-{
- // provide logging
- private static Logger log = Logger.getLogger(SOAPFaultImpl.class);
-
- private SOAPElement faultcode;
- private SOAPElement faultstring;
- private SOAPElement faultactor;
- private Locale faultStringLocale;
-
- public SOAPFaultImpl(String namespaceURI) throws SOAPException
- {
- super(new NameImpl("Fault", Constants.PREFIX_ENV, namespaceURI));
- SOAPFactoryImpl factory = new SOAPFactoryImpl();
- addChildElement(faultcode = factory.createElement("faultcode"));
- addChildElement(faultstring = factory.createElement("faultstring"));
- }
-
- /** Creates an optional Detail object and sets it as the Detail object for this
SOAPFault object.
- */
- public Detail addDetail() throws SOAPException
- {
- Detail detail = getDetail();
- if (detail != null)
- throw new SOAPException("SOAPFault already contains a detail node");
-
- SOAPFactoryImpl factory = new SOAPFactoryImpl();
- detail = (Detail)addChildElement(factory.createDetail());
- return detail;
- }
-
- /** Returns the optional detail element for this SOAPFault object.
- */
- public Detail getDetail()
- {
- Detail detail = null;
- Iterator it = getChildElements(new NameImpl("detail"));
- while (it.hasNext())
- {
- Object obj = it.next();
- if (obj instanceof Detail)
- {
- detail = (Detail)obj;
- }
- else if (obj instanceof SOAPElementImpl)
- {
- try
- {
- SOAPElementImpl soapEl = (SOAPElementImpl)obj;
- SOAPFactoryImpl factory = new SOAPFactoryImpl();
- detail = (Detail)addChildElement(factory.createDetail());
-
- Iterator childIt = DOMUtils.getChildElements(soapEl);
- while (childIt.hasNext())
- {
- Element domElement = (Element)childIt.next();
- SOAPElement detailEntry = new
DetailEntryImpl(factory.createElement(domElement, true));
- detail.addChildElement(detailEntry);
- }
- }
- catch (SOAPException e)
- {
- throw new WSException("Unable to create fault detail: " +
e.getMessage());
- }
-
- }
- }
-
- return detail;
- }
-
- /** Gets the fault actor for this SOAPFault object.
- */
- public String getFaultActor()
- {
- return (faultactor != null ? faultactor.getValue() : null);
- }
-
- /** Gets the fault code for this SOAPFault object.
- */
- public String getFaultCode()
- {
- String value = faultcode.getValue();
- return value;
- }
-
- /**
- * Gets the mandatory SOAP 1.1 fault code for this SOAPFault object as a SAAJ Name
object.
- */
- public Name getFaultCodeAsName()
- {
- QName qname = QNameBuilder.buildQName(this, faultcode.getValue());
- return new NameImpl(qname);
- }
-
- /** Gets the fault string for this SOAPFault object.
- */
- public String getFaultString()
- {
- String value = faultstring.getValue();
- return value;
- }
-
- /** Gets the locale of the fault string for this SOAPFault object.
- */
- public Locale getFaultStringLocale()
- {
- return faultStringLocale;
- }
-
- /** Sets this SOAPFault object with the given fault actor.
- */
- public void setFaultActor(String faultActor) throws SOAPException
- {
- if (faultactor == null)
- {
- SOAPFactoryImpl factory = new SOAPFactoryImpl();
- addChildElement(faultactor = factory.createElement("faultactor"));
- }
-
- faultactor.setValue(faultActor);
- }
-
- /** Sets this SOAPFault object with the give fault code.
- */
- public void setFaultCode(String faultCode) throws SOAPException
- {
- // Must be of the form "prefix:localName" where the prefix has been
defined in a namespace declaration.
- if (faultCode == null || faultCode.indexOf(":") < 1)
- throw new IllegalArgumentException("Invalid faultCode: " +
faultCode);
-
- QName qname = QNameBuilder.buildQName(this, faultCode);
- setFaultCode(new NameImpl(qname));
- }
-
- /** Sets this SOAPFault object with the given fault code.
- */
- public void setFaultCode(Name faultName) throws SOAPException
- {
- String nsURI = faultName.getURI();
- String prefix = faultName.getPrefix();
- String localName = faultName.getLocalName();
-
- // For lazy folkes like the CTS that don't bother to give
- // a namesapce URI, assume they use a standard code
- if ("".equals(nsURI))
- {
- log.warn("Empty namespace URI with fault code '" + faultName +
"', assuming: " + Constants.NS_SOAP11_ENV);
- nsURI = Constants.NS_SOAP11_ENV;
- }
-
- if ("".equals(prefix) && getNamespaceURI().equals(nsURI))
- prefix = getPrefix();
-
- String prevNS = getNamespaceURI(prefix);
- if (nsURI.equals(prevNS) == false)
- addNamespaceDeclaration(prefix, nsURI);
-
- String faultCode = prefix + ":" + localName;
- faultcode.setValue(faultCode);
- }
-
- /** Sets the fault string for this SOAPFault object to the given string.
- */
- public void setFaultString(String faultString) throws SOAPException
- {
- faultstring.setValue(faultString);
- }
-
- /** Sets the fault string for this SOAPFault object to the given string and localized
to the given locale.
- */
- public void setFaultString(String faultString, Locale locale) throws SOAPException
- {
- setFaultString(faultString);
- this.faultStringLocale = locale;
- }
-
- public void writeElement(Writer writer)
- {
- new DOMWriter(writer).print(this);
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/core/soap/SOAPFaultImpl.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPFaultImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/SOAPHeaderElementImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPHeaderElementImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPHeaderElementImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,142 +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.core.soap;
-
-import java.io.IOException;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPHeader;
-import javax.xml.soap.SOAPHeaderElement;
-
-import org.jboss.ws.Constants;
-
-/**
- * An object representing the contents in the SOAP header part of the SOAP envelope.
- * The immediate children of a SOAPHeader object can be represented only as
SOAPHeaderElement objects.
- *
- * A SOAPHeaderElement object can have other SOAPElement objects as its children.
- *
- * @author Thomas.Diesler(a)jboss.org
- */
-public class SOAPHeaderElementImpl extends SOAPContentElement implements
SOAPHeaderElement
-{
- public SOAPHeaderElementImpl(Name name)
- {
- super(name);
- }
-
- public SOAPHeaderElementImpl(SOAPElementImpl element)
- {
- super(element);
- }
-
- public String getActor()
- {
- String envURI = Constants.NS_SOAP11_ENV;
- String attr = getAttributeNS(envURI, Constants.SOAP11_ATTR_ACTOR);
- return attr;
- }
-
- public boolean getMustUnderstand()
- {
- String envURI = Constants.NS_SOAP11_ENV;
- String attr = getAttributeNS(envURI, Constants.SOAP11_ATTR_MUST_UNDERSTAND);
- return "1".equals(attr);
- }
-
- public void setActor(String actorURI)
- {
- String envURI = Constants.NS_SOAP11_ENV;
- String qualifiedName = Constants.PREFIX_ENV + ":" +
Constants.SOAP11_ATTR_ACTOR;
- setAttributeNS(envURI, qualifiedName, actorURI);
- }
-
- public void setMustUnderstand(boolean mustUnderstand)
- {
- String envURI = Constants.NS_SOAP11_ENV;
- String qualifiedName = Constants.PREFIX_ENV + ":" +
Constants.SOAP11_ATTR_MUST_UNDERSTAND;
- setAttributeNS(envURI, qualifiedName, mustUnderstand ? "1" :
"0");
- }
-
- public void setParentElement(SOAPElement parent) throws SOAPException
- {
- if (parent == null)
- throw new SOAPException("Invalid null parent element");
-
- if ((parent instanceof SOAPHeader) == false)
- throw new SOAPException("Invalid parent element: " +
parent.getElementName());
-
- super.setParentElement(parent);
- }
-
- @Override
- public void writeElement(Writer writer) throws IOException
- {
- StringWriter strwr = new StringWriter(256);
- super.writeElement(strwr);
-
- SOAPHeader soapHeader = (SOAPHeader)getParentElement();
- SOAPEnvelope soapEnvelope = (SOAPEnvelope)soapHeader.getParentElement();
-
- // Find known namespace declarations
- List<String> knownNamespaces = new ArrayList<String>();
- Iterator prefixes = soapEnvelope.getNamespacePrefixes();
- while (prefixes.hasNext())
- {
- String prefix = (String)prefixes.next();
- String nsURI = soapEnvelope.getNamespaceURI(prefix);
- String xmlns = " xmlns:" + prefix + "='" + nsURI +
"'";
- knownNamespaces.add(xmlns);
- }
- prefixes = soapHeader.getNamespacePrefixes();
- while (prefixes.hasNext())
- {
- String prefix = (String)prefixes.next();
- String nsURI = soapHeader.getNamespaceURI(prefix);
- String xmlns = " xmlns:" + prefix + "='" + nsURI +
"'";
- knownNamespaces.add(xmlns);
- }
-
- // Remove known namespace declarations
- String xmlFragment = strwr.toString();
- for (String xmlns : knownNamespaces)
- {
- int start = xmlFragment.indexOf(xmlns);
- while (start > 0)
- {
- int end = start + xmlns.length();
- xmlFragment = xmlFragment.substring(0, start) + xmlFragment.substring(end);
- start = xmlFragment.indexOf(xmlns);
- }
- }
-
- writer.write(xmlFragment);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/soap/SOAPHeaderElementImpl.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPHeaderElementImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/SOAPHeaderImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPHeaderImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPHeaderImpl.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,197 +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.core.soap;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPHeader;
-import javax.xml.soap.SOAPHeaderElement;
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.Node;
-
-/**
- * A representation of the SOAP header element. A SOAP header element consists of XML
data that affects the way the
- * application-specific content is processed by the message provider. For example,
transaction semantics,
- * authentication information, and so on, can be specified as the content of a SOAPHeader
object.
- *
- * @author Thomas.Diesler(a)jboss.org
- */
-public class SOAPHeaderImpl extends SOAPElementImpl implements SOAPHeader
-{
- public SOAPHeaderImpl(String prefix, String namespace)
- {
- super("Header", prefix, namespace);
- }
-
- private SOAPHeaderElementImpl convertToHeaderElement(Node node)
- {
- if (!(node instanceof SOAPElementImpl))
- throw new IllegalArgumentException("SOAPElement expected");
-
- SOAPElementImpl element = (SOAPElementImpl)node;
-
- // convert to SOAPHeaderElement
- element.detachNode();
- return new SOAPHeaderElementImpl(element);
- }
-
- /*** Add a SOAPHeaderElement as a child of this SOAPHeader instance.
- */
- public SOAPElement addChildElement(SOAPElement child) throws SOAPException
- {
- // Check that we get a SOAPHeaderElement
- if ((child instanceof SOAPHeaderElement) == false)
- child = convertToHeaderElement(child);
-
- return super.addChildElement(child);
- }
-
- /** Creates a new SOAPHeaderElement object initialized with the specified name and
adds it to this SOAPHeader object.
- */
- public SOAPHeaderElement addHeaderElement(Name name) throws SOAPException
- {
- if (name == null || name.getURI().length() == 0 || name.getPrefix().length() == 0)
- throw new SOAPException("Invalid SOAPHeaderElement name: " + name);
-
- SOAPHeaderElementImpl headerElement = new SOAPHeaderElementImpl(name);
- addChildElement(headerElement);
- return headerElement;
- }
-
- /** Returns an Iterator over all the SOAPHeaderElement objects in this SOAPHeader
object.
- */
- public Iterator examineAllHeaderElements()
- {
- // make a defensive copy
- ArrayList list = new ArrayList();
- Iterator it = getChildElements();
- while (it.hasNext())
- {
- SOAPHeaderElement shElement = (SOAPHeaderElement)it.next();
- list.add(shElement);
- }
- return list.iterator();
- }
-
- /** Returns an Iterator over all the SOAPHeaderElement objects in this SOAPHeader
object that have the specified actor.
- */
- public Iterator examineHeaderElements(String actor)
- {
- if (actor == null)
- throw new IllegalArgumentException("Invalid actor: " + actor);
-
- // make a defensive copy
- ArrayList list = new ArrayList();
- Iterator it = getChildElements();
- while (it.hasNext())
- {
- SOAPHeaderElement shElement = (SOAPHeaderElement)it.next();
- if (actor.equals(shElement.getActor()))
- list.add(shElement);
- }
- return list.iterator();
- }
-
- /** Returns an Iterator over all the SOAPHeaderElement objects in this SOAPHeader
object that have the specified
- * actor and that have a MustUnderstand attribute whose value is equivalent to true.
- */
- public Iterator examineMustUnderstandHeaderElements(String actor)
- {
- if (actor == null)
- throw new IllegalArgumentException("Invalid actor: " + actor);
-
- // make a defensive copy
- ArrayList list = new ArrayList();
- Iterator it = getChildElements();
- while (it.hasNext())
- {
- SOAPHeaderElement shElement = (SOAPHeaderElement)it.next();
- if (actor.equals(shElement.getActor()) &&
shElement.getMustUnderstand())
- list.add(shElement);
- }
- return list.iterator();
- }
-
- public Iterator extractAllHeaderElements()
- {
- // make a defensive copy
- ArrayList list = new ArrayList();
- Iterator it = getChildElements();
- while (it.hasNext())
- {
- SOAPHeaderElement shElement = (SOAPHeaderElement)it.next();
- removeChild(shElement);
- list.add(shElement);
- }
- return list.iterator();
- }
-
- public Iterator extractHeaderElements(String actor)
- {
- if (actor == null)
- throw new IllegalArgumentException("Invalid actor: " + actor);
-
- // make a defensive copy
- ArrayList list = new ArrayList();
- Iterator it = getChildElements();
- while (it.hasNext())
- {
- SOAPHeaderElement shElement = (SOAPHeaderElement)it.next();
- if (actor.equals(shElement.getActor()))
- {
- removeChild(shElement);
- list.add(shElement);
- }
- }
- return list.iterator();
- }
-
- public Node appendChild(Node newChild) throws DOMException
- {
- if (!(newChild instanceof SOAPHeaderElementImpl || newChild instanceof
DocumentFragment))
- newChild = convertToHeaderElement(newChild);
-
- return super.appendChild(newChild);
- }
-
- public Node insertBefore(Node newChild, Node refChild) throws DOMException
- {
- if (!(newChild instanceof SOAPHeaderElementImpl || newChild instanceof
DocumentFragment))
- newChild = convertToHeaderElement(newChild);
-
- return super.insertBefore(newChild, refChild);
- }
-
- public Node replaceChild(Node newChild, Node oldChild) throws DOMException
- {
- if (!(newChild instanceof SOAPHeaderElementImpl || newChild instanceof
DocumentFragment))
- newChild = convertToHeaderElement(newChild);
-
- return super.replaceChild(newChild, oldChild);
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/core/soap/SOAPHeaderImpl.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPHeaderImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,135 +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.core.soap;
-
-// $Id$
-
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPBodyElement;
-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.core.CommonMessageContext;
-import org.jboss.ws.core.jaxrpc.Style;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-
-/**
- * Derive the operation meta data from incomming SOAP message
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 22-Nov-2005
- */
-public class SOAPMessageDispatcher
-{
- // provide logging
- private static Logger log = Logger.getLogger(SOAPMessageDispatcher.class);
-
- /** Get the operation meta data for a given SOAP message
- */
- public OperationMetaData getDispatchDestination(EndpointMetaData epMetaData,
SOAPMessage soapMessage) throws SOAPException
- {
- OperationMetaData opMetaData = null;
-
- // Dispatch based on wsa:Action
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- AddressingProperties inProps =
(AddressingProperties)msgContext.getProperty(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
- if (inProps != null && inProps.getAction() != null)
- {
- String wsaAction = inProps.getAction().getURI().toASCIIString();
- for (OperationMetaData opAux : epMetaData.getOperations())
- {
- if (wsaAction.equals(opAux.getSOAPAction()))
- {
- opMetaData = opAux;
- log.debug("Use wsa:Action dispatch: " + wsaAction);
- break;
- }
- }
- }
-
- // Dispatch to JAXWS Provider
- if (opMetaData == null && epMetaData.getServiceMode() != null)
- {
- QName xmlName = new QName(epMetaData.getQName().getNamespaceURI(),
"invoke");
- opMetaData = epMetaData.getOperation(xmlName);
- }
-
- // Dispatch based on SOAPBodyElement name
- if (opMetaData == null)
- {
- SOAPBody soapBody = soapMessage.getSOAPBody();
-
- Iterator bodyChildren = soapBody.getChildElements();
- if (bodyChildren.hasNext() == false)
- {
- if (epMetaData.getStyle() == Style.RPC)
- throw new SOAPException("Empty SOAP body with no child element not
supported for RPC");
-
- // [JBWS-1125] Support empty soap body elements
- for (OperationMetaData opAux : epMetaData.getOperations())
- {
- if (opAux.getParameters().size() == 0)
- {
- log.debug ("Dispatching empty SOAP body");
- opMetaData = opAux;
- break;
- }
- }
- }
- else
- {
- SOAPBodyElement soapBodyElement = (SOAPBodyElement)bodyChildren.next();
- if (bodyChildren.hasNext())
- throw new SOAPException("SOAPBody has more than on child
element");
-
- Name soapName = soapBodyElement.getElementName();
- QName xmlElementName = new QName(soapName.getURI(),
soapName.getLocalName());
- opMetaData = epMetaData.getOperation(xmlElementName);
- }
- }
-
- // Dispatch to a generic operation that takes an org.w3c.dom.Element
- if (opMetaData == null)
- {
- for (OperationMetaData opAux : epMetaData.getOperations())
- {
- if (opAux.isMessageEndpoint())
- {
- log.debug("Use generic message style dispatch");
- opMetaData = opAux;
- break;
- }
- }
- }
-
- log.debug("getDispatchDestination: " + (opMetaData != null ?
opMetaData.getQName() : null));
- return opMetaData;
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageImpl.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,414 +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.core.soap;
-
-// $Id$
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
-import javax.mail.MessagingException;
-import javax.xml.soap.AttachmentPart;
-import javax.xml.soap.MimeHeader;
-import javax.xml.soap.MimeHeaders;
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPFault;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.soap.SOAPPart;
-
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.soap.attachment.AttachmentPartImpl;
-import org.jboss.ws.core.soap.attachment.CIDGenerator;
-import org.jboss.ws.core.soap.attachment.MimeConstants;
-import org.jboss.ws.core.soap.attachment.MultipartRelatedEncoder;
-import org.jboss.ws.core.soap.attachment.MultipartRelatedSwAEncoder;
-import org.jboss.ws.core.soap.attachment.MultipartRelatedXOPEncoder;
-import org.jboss.ws.extensions.xop.XOPContext;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-
-/**
- * The root class for all SOAP messages. As transmitted on the "wire", a SOAP
message is an XML document or a
- * MIME message whose first body part is an XML/SOAP document.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author <a href="mailto:jason@stacksmash.com">Jason T.
Greene</a>
- */
-public class SOAPMessageImpl extends SOAPMessage
-{
- private boolean saveRequired = true;
- private MimeHeaders mimeHeaders = new MimeHeaders();
- private List<AttachmentPart> attachments = new
LinkedList<AttachmentPart>();
- private CIDGenerator cidGenerator = new CIDGenerator();
- private boolean isXOPMessage;
- private SOAPPartImpl soapPart;
- private MultipartRelatedEncoder multipartRelatedEncoder;
-
- // Cache the associated operation meta data
- private OperationMetaData opMetaData;
-
- SOAPMessageImpl() throws SOAPException
- {
- soapPart = new SOAPPartImpl(this);
- setProperty(CHARACTER_SET_ENCODING, "UTF-8");
- setProperty(WRITE_XML_DECLARATION, false);
- }
-
- public CIDGenerator getCidGenerator()
- {
- return cidGenerator;
- }
-
- public boolean isXOPMessage()
- {
- return isXOPMessage;
- }
-
- public void setXOPMessage(boolean isXOPMessage)
- {
- this.isXOPMessage = isXOPMessage;
- }
-
- public void setAttachments(Collection<AttachmentPart> parts) throws
SOAPException
- {
- for (AttachmentPart part : parts)
- {
- attachments.add(part);
- }
- saveRequired = true;
- }
-
- public void addAttachmentPart(AttachmentPart part)
- {
- if (part == null)
- return;
-
- attachments.add(part);
- saveRequired = true;
- }
-
- public AttachmentPart getAttachmentByContentId(String cid) throws SOAPException
- {
- for (AttachmentPart part : attachments)
- {
- String contentId = part.getContentId();
- if (contentId.equals(cid))
- return part;
- }
- return null;
- }
-
- public AttachmentPart removeAttachmentByContentId(String cid)
- {
- for (AttachmentPart part : attachments)
- {
- String contentId = part.getContentId();
- if (contentId.equals(cid))
- {
- attachments.remove(part);
- return part;
- }
- }
-
- return null;
- }
- public AttachmentPart getAttachmentByPartName(String partName)
- {
- for (AttachmentPart part : attachments)
- {
- String contentId = part.getContentId();
- if (contentId.startsWith("<" + partName + "="))
- return part;
- }
- return null;
- }
-
- public AttachmentPart createAttachmentPart()
- {
- return new AttachmentPartImpl();
- }
-
- public String getContentDescription()
- {
- String[] value = mimeHeaders.getHeader(MimeConstants.CONTENT_DESCRIPTION);
-
- return (value == null) ? null : value[0];
- }
-
- public void setContentDescription(String description)
- {
- mimeHeaders.setHeader(MimeConstants.CONTENT_DESCRIPTION, description);
- }
-
- public MimeHeaders getMimeHeaders()
- {
- return mimeHeaders;
- }
-
- public void setMimeHeaders(MimeHeaders headers)
- {
- if (headers == null)
- throw new IllegalArgumentException("MimeHeaders cannot be null");
- this.mimeHeaders = headers;
- }
-
- public SOAPPart getSOAPPart()
- {
- return soapPart;
- }
-
- public void removeAllAttachments()
- {
- attachments.clear();
- saveRequired = true;
- }
-
- public int countAttachments()
- {
- return attachments.size();
- }
-
- public Iterator getAttachments()
- {
- // Someone could call remove on this iterator, affecting the attachment count
- saveRequired = true;
- return attachments.iterator();
- }
-
- public Iterator getAttachments(MimeHeaders headers)
- {
- if (headers == null)
- throw new WSException("MimeHeaders can not be null");
-
- return new MimeMatchingAttachmentsIterator(headers, attachments);
- }
-
- public void saveChanges() throws SOAPException
- {
- if (saveRequired == true)
- {
- try
- {
- boolean hasAttachments = attachments.size() > 0;
-
- if (isXOPMessage() && !XOPContext.isMTOMEnabled() &&
hasAttachments)
- throw new IllegalStateException("XOP parameter not properly
inlined");
-
- // default content-type
- String contentType = MimeConstants.TYPE_SOAP11 + "; charset=" +
getCharSetEncoding();
-
- if (hasAttachments)
- {
- if (isXOPMessage() && XOPContext.isMTOMEnabled())
- {
- multipartRelatedEncoder = new MultipartRelatedXOPEncoder(this);
- multipartRelatedEncoder.encodeMultipartRelatedMessage();
- contentType = multipartRelatedEncoder.getContentType();
- }
- else
- {
- multipartRelatedEncoder = new MultipartRelatedSwAEncoder(this);
- multipartRelatedEncoder.encodeMultipartRelatedMessage();
- contentType = multipartRelatedEncoder.getContentType();
- }
- }
-
- mimeHeaders.setHeader(MimeConstants.CONTENT_TYPE, contentType);
-
- }
- catch (MessagingException ex)
- {
- throw new SOAPException(ex);
- }
-
- /*
- * We are lazily encoding our message, which means that currently
- * Content-Length is not being calculated. This should not be a problem
- * because HTTP/1.1 does not require that it be sent (WS Basic Profile 1.1
- * states that implementations SHOULD send HTTP 1.1). If it is determined
- * that it must be sent, this perhaps should be done by the transport
- * layer. However, there could be a space optimization where length is
- * precalulated per attachment, and that calculation would, of course,
- * belong here.
- */
-
- saveRequired = false;
- }
- }
-
- public boolean saveRequired()
- {
- return saveRequired;
- }
-
- public void writeTo(OutputStream outs) throws SOAPException, IOException
- {
- // Save all changes
- saveChanges();
-
- // If there are attachments then we delegate encoding to MultipartRelatedEncoder
- if (attachments.size() > 0)
- {
- multipartRelatedEncoder.writeTo(outs);
- }
- else
- {
- SOAPEnvelope soapEnv = getSOAPPart().getEnvelope();
- if (soapEnv != null)
- {
- boolean writeXML = isWriteXMLDeclaration();
- String charsetEncoding = getCharSetEncoding();
- SOAPElementWriter writer = new SOAPElementWriter(outs, charsetEncoding);
-
writer.setWriteXMLDeclaration(writeXML).writeElement((SOAPEnvelopeImpl)soapEnv);
- }
- }
- }
-
- private String getCharSetEncoding() throws SOAPException
- {
- String charsetName = (String)getProperty(CHARACTER_SET_ENCODING);
- if (charsetName == null)
- charsetName = "UTF-8";
- return charsetName;
- }
-
- /** Get the operation meta data for this SOAP message
- */
- public OperationMetaData getOperationMetaData(EndpointMetaData epMetaData) throws
SOAPException
- {
- if (opMetaData == null)
- {
- SOAPMessageDispatcher dispatcher = new SOAPMessageDispatcher();
- opMetaData = dispatcher.getDispatchDestination(epMetaData, this);
- }
- return opMetaData;
- }
-
- public boolean isFaultMessage()
- {
- SOAPFault soapFault = null;
- try
- {
- soapFault = getSOAPBody().getFault();
- }
- catch (Exception ignore)
- {
- }
- return soapFault != null;
- }
-
- private boolean isWriteXMLDeclaration() throws SOAPException
- {
- Boolean booleanValue = new Boolean(false);
- Object propValue = getProperty(WRITE_XML_DECLARATION);
- if (propValue instanceof Boolean)
- booleanValue = (Boolean)propValue;
- if (propValue instanceof String)
- booleanValue = new Boolean((String)propValue);
- return booleanValue.booleanValue();
- }
-
- public static class MimeMatchingAttachmentsIterator implements Iterator
- {
- private Iterator iterator;
-
- private MimeHeaders headers = new MimeHeaders();
-
- private AttachmentPart lastMatch;
-
- public MimeMatchingAttachmentsIterator(MimeHeaders headers, List attachments)
- {
- iterator = attachments.iterator();
-
- if (headers != null)
- this.headers = headers;
- }
-
- private boolean containsAllHeaders(Iterator headerIterator, AttachmentPart part)
- {
- while (headerIterator.hasNext())
- {
- MimeHeader header = (MimeHeader)headerIterator.next();
- String[] values = part.getMimeHeader(header.getName());
- if (values == null)
- return false;
-
- boolean match = false;
- for (int j = 0; j < values.length; j++)
- {
- if (values[j].equalsIgnoreCase(header.getValue()))
- {
- match = true;
- break;
- }
- }
-
- if (!match)
- return false;
- }
-
- return true;
- }
-
- private void nextMatch()
- {
- while (iterator.hasNext())
- {
- AttachmentPart part = (AttachmentPart)iterator.next();
- if (containsAllHeaders(headers.getAllHeaders(), part))
- {
- lastMatch = part;
- break;
- }
- }
- }
-
- public boolean hasNext()
- {
- if (lastMatch == null)
- nextMatch();
-
- return lastMatch != null;
- }
-
- public Object next()
- {
- if (!hasNext())
- return null;
-
- Object retval = lastMatch;
- lastMatch = null;
-
- return retval;
- }
-
- public void remove()
- {
- iterator.remove();
- }
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageImpl.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageMarshaller.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageMarshaller.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageMarshaller.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,89 +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.core.soap;
-
-import java.io.IOException;
-import java.io.OutputStream;
-
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-
-import org.jboss.logging.Logger;
-import org.jboss.remoting.InvocationRequest;
-import org.jboss.remoting.invocation.OnewayInvocation;
-import org.jboss.remoting.marshal.Marshaller;
-/**
- * @author Thomas.Diesler(a)jboss.org
- * @since 25-Nov-2004
- */
-public class SOAPMessageMarshaller implements Marshaller
-{
- // Provide logging
- private static Logger log = Logger.getLogger(SOAPMessageMarshaller.class);
-
- /**
- * Marshaller will need to take the dataObject and convert
- * into primitive java data types and write to the
- * given output.
- *
- * @param dataObject Object to be writen to output
- * @param output The data output to write the object
- * data to.
- */
- public void write(Object dataObject, OutputStream output) throws IOException
- {
- if (dataObject instanceof InvocationRequest)
- dataObject = ((InvocationRequest)dataObject).getParameter();
-
- if (dataObject instanceof OnewayInvocation)
- dataObject = ((OnewayInvocation)dataObject).getParameters()[0];
-
- if ((dataObject instanceof SOAPMessage) == false)
- throw new IllegalArgumentException("Not a SOAPMessage: " +
dataObject);
-
- try
- {
- SOAPMessageImpl soapMessage = (SOAPMessageImpl)dataObject;
-
- // debug the outgoing message
- if (log.isTraceEnabled())
- {
- SOAPEnvelope soapEnv = soapMessage.getSOAPPart().getEnvelope();
- String envStr = SOAPElementWriter.writeElement((SOAPElementImpl)soapEnv,
true);
- log.trace("Outgoing SOAPMessage\n" + envStr);
- }
-
- soapMessage.writeTo(output);
- }
- catch (SOAPException e)
- {
- log.error("Cannot marshall SOAPMessage", e);
- throw new IOException(e.toString());
- }
- }
-
- public Marshaller cloneMarshaller() throws CloneNotSupportedException
- {
- return new SOAPMessageMarshaller();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageMarshaller.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageMarshaller.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshaller.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshaller.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshaller.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,123 +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.core.soap;
-
-// $Id$
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletResponse;
-import javax.xml.soap.MimeHeaders;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-
-import org.jboss.logging.Logger;
-import org.jboss.remoting.marshal.UnMarshaller;
-import org.jboss.remoting.transport.http.HTTPMetadataConstants;
-import org.jboss.ws.WSException;
-
-/**
- * @author Thomas.Diesler(a)jboss.org
- * @since 25-Nov-2004
- */
-public class SOAPMessageUnMarshaller implements UnMarshaller
-{
- // Provide logging
- private static Logger log = Logger.getLogger(SOAPMessageUnMarshaller.class);
-
- private static List validResponseCodes = new ArrayList();
- static
- {
- validResponseCodes.add(HttpServletResponse.SC_OK);
- validResponseCodes.add(HttpServletResponse.SC_ACCEPTED);
- validResponseCodes.add(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
- }
-
- public Object read(InputStream inputStream, Map metadata) throws IOException,
ClassNotFoundException
- {
- if (log.isTraceEnabled())
- {
- log.trace("Read input stream with metadata=" + metadata);
- }
-
- try
- {
- Integer resCode = (Integer)metadata.get(HTTPMetadataConstants.RESPONSE_CODE);
- String resMessage =
(String)metadata.get(HTTPMetadataConstants.RESPONSE_CODE_MESSAGE);
- if (resCode != null && validResponseCodes.contains(resCode) == false)
- throw new WSException("Invalid HTTP server response [" + resCode +
"] - " + resMessage);
-
- MimeHeaders mimeHeaders = getMimeHeaders(metadata);
- SOAPMessage soapMsg = new
MessageFactoryImpl().createMessageInternal(mimeHeaders, inputStream, true);
- return soapMsg;
- }
- catch (SOAPException e)
- {
- log.error("Cannot unmarshall SOAPMessage", e);
- throw new IOException(e.toString());
- }
- }
-
- /**
- * Set the class loader to use for unmarhsalling. This may
- * be needed when need to have access to class definitions that
- * are not part of this unmarshaller's parent classloader (especially
- * when doing remote classloading).
- *
- * @param classloader
- */
- public void setClassLoader(ClassLoader classloader)
- {
- //NO OP
- }
-
- public UnMarshaller cloneUnMarshaller() throws CloneNotSupportedException
- {
- return new SOAPMessageUnMarshaller();
- }
-
- private MimeHeaders getMimeHeaders(Map metadata)
- {
- log.debug("getMimeHeaders from: " + metadata);
-
- MimeHeaders headers = new MimeHeaders();
- Iterator i = metadata.keySet().iterator();
- while (i.hasNext())
- {
- String key = (String)i.next();
- Object value = metadata.get(key);
- if (key != null && value instanceof List)
- {
- for (Object listValue : (List)value)
- {
- headers.addHeader(key, listValue.toString());
- }
- }
- }
- return headers;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshaller.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshaller.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/SOAPPartImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPPartImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPPartImpl.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,547 +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.core.soap;
-
-// $Id$
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.soap.MimeHeaders;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.soap.SOAPPart;
-import javax.xml.transform.Source;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamSource;
-
-import org.jboss.logging.Logger;
-import org.jboss.util.NotImplementedException;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.w3c.dom.Attr;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Comment;
-import org.w3c.dom.DOMConfiguration;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.EntityReference;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-import org.w3c.dom.UserDataHandler;
-
-/** An implementation of SOAPPart.
- *
- *
- * @author Thomas.Diesler(a)jboss.org
- */
-public class SOAPPartImpl extends SOAPPart
-{
- // provide logging
- private static Logger log = Logger.getLogger(SOAPPartImpl.class);
-
- private SOAPMessage soapMessage;
- private SOAPEnvelope soapEnvelope;
-
- private SOAPDocument doc = new SOAPDocument();
-
- SOAPPartImpl(SOAPMessage message)
- {
- this.soapMessage = message;
- }
-
- public SOAPMessage getSOAPMessage()
- {
- return soapMessage;
- }
-
- public SOAPEnvelope getEnvelope() throws SOAPException
- {
- return soapEnvelope;
- }
-
- public void setEnvelope(SOAPEnvelope soapEnvelope)
- {
- this.soapEnvelope = soapEnvelope;
- }
-
- public void removeMimeHeader(String s)
- {
- MimeHeaders mimeHeaders = soapMessage.getMimeHeaders();
- mimeHeaders.removeHeader(s);
- }
-
- public void removeAllMimeHeaders()
- {
- MimeHeaders mimeHeaders = soapMessage.getMimeHeaders();
- mimeHeaders.removeAllHeaders();
- }
-
- public String[] getMimeHeader(String name)
- {
- MimeHeaders mimeHeaders = soapMessage.getMimeHeaders();
- return mimeHeaders.getHeader(name);
- }
-
- public void setMimeHeader(String name, String value)
- {
- MimeHeaders mimeHeaders = soapMessage.getMimeHeaders();
- mimeHeaders.setHeader(name, value);
- }
-
- public void addMimeHeader(String name, String value)
- {
- MimeHeaders mimeHeaders = soapMessage.getMimeHeaders();
- mimeHeaders.addHeader(name, value);
- }
-
- public Iterator getAllMimeHeaders()
- {
- MimeHeaders mimeHeaders = soapMessage.getMimeHeaders();
- return mimeHeaders.getAllHeaders();
- }
-
- public Iterator getMatchingMimeHeaders(String names[])
- {
- MimeHeaders mimeHeaders = soapMessage.getMimeHeaders();
- return mimeHeaders.getMatchingHeaders(names);
- }
-
- public Iterator getNonMatchingMimeHeaders(String names[])
- {
- MimeHeaders mimeHeaders = soapMessage.getMimeHeaders();
- return mimeHeaders.getNonMatchingHeaders(names);
- }
-
- public void setContent(Source source) throws SOAPException
- {
- // 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 (source == null)
- {
- log.debug("Setting content source to null removes the SOAPEnvelope");
- soapEnvelope = null;
- return;
- }
-
- Element domElement;
- if (source instanceof DOMSource)
- {
- DOMSource domSource = (DOMSource)source;
- Node node = domSource.getNode();
- if (node instanceof Document)
- domElement = ((Document)node).getDocumentElement();
- else if (node instanceof Element)
- domElement = (Element)node;
- else
- throw new SOAPException("Unsupported DOMSource node: " + node);
- }
- else if (source instanceof StreamSource)
- {
- try
- {
- StreamSource streamSource = (StreamSource)source;
- domElement = DOMUtils.parse(streamSource.getInputStream());
- }
- catch (IOException e)
- {
- throw new SOAPException("Cannot parse stream source", e);
- }
- }
- else
- {
- throw new SOAPException("Unsupported source parameter: " + source);
- }
-
- SOAPFactoryImpl factory = new SOAPFactoryImpl();
- SOAPElementImpl soapElement = factory.createElement(domElement, true);
-
- SOAPBody body = soapEnvelope.getBody();
- body.removeContents();
- body.addChildElement(soapElement);
- }
-
- public Source getContent() throws SOAPException
- {
- SOAPBody body = soapEnvelope.getBody();
- return new DOMSource(body.getFirstChild());
- }
-
- // Document
*********************************************************************************************************
-
- public DOMImplementation getImplementation()
- {
- return doc.getImplementation();
- }
-
- public DocumentFragment createDocumentFragment()
- {
- return doc.createDocumentFragment();
- }
-
- public DocumentType getDoctype()
- {
- return doc.getDoctype();
- }
-
- public Element getDocumentElement()
- {
- return soapEnvelope;
- }
-
- public Attr createAttribute(String name) throws DOMException
- {
- return doc.createAttribute(name);
- }
-
- public CDATASection createCDATASection(String data) throws DOMException
- {
- return doc.createCDATASection(data);
- }
-
- public Comment createComment(String data)
- {
- return doc.createComment(data);
- }
-
- public Element createElement(String tagName) throws DOMException
- {
- return doc.createElement(tagName);
- }
-
- public Element getElementById(String elementId)
- {
- return doc.getElementById(elementId);
- }
-
- public EntityReference createEntityReference(String name) throws DOMException
- {
- return doc.createEntityReference(name);
- }
-
- public org.w3c.dom.Node importNode(org.w3c.dom.Node importedNode, boolean deep) throws
DOMException
- {
- return doc.importNode(importedNode, deep);
- }
-
- public NodeList getElementsByTagName(String tagname)
- {
- return doc.getElementsByTagName(tagname);
- }
-
- public Text createTextNode(String data)
- {
- return doc.createTextNode(data);
- }
-
- public Attr createAttributeNS(String namespaceURI, String qualifiedName) throws
DOMException
- {
- return doc.createAttributeNS(namespaceURI, qualifiedName);
- }
-
- public Element createElementNS(String namespaceURI, String qualifiedName) throws
DOMException
- {
- return doc.createElementNS(namespaceURI, qualifiedName);
- }
-
- public NodeList getElementsByTagNameNS(String namespaceURI, String localName)
- {
- return doc.getElementsByTagNameNS(namespaceURI, localName);
- }
-
- public ProcessingInstruction createProcessingInstruction(String target, String data)
throws DOMException
- {
- return doc.createProcessingInstruction(target, data);
- }
-
- // Node
*********************************************************************************************************
-
- public org.w3c.dom.Node appendChild(org.w3c.dom.Node node) throws DOMException
- {
- throw new NotImplementedException();
- }
-
- public org.w3c.dom.Node cloneNode(boolean b)
- {
- throw new NotImplementedException();
- }
-
- public NamedNodeMap getAttributes()
- {
- throw new NotImplementedException();
- }
-
- public NodeList getChildNodes()
- {
- List<NodeImpl> list = new ArrayList<NodeImpl>();
- if (soapEnvelope != null)
- {
- list.add((NodeImpl)soapEnvelope);
- }
- return new NodeListImpl(list);
- }
-
- public org.w3c.dom.Node getFirstChild()
- {
- return soapEnvelope;
- }
-
- public org.w3c.dom.Node getLastChild()
- {
- return soapEnvelope;
- }
-
- public String getLocalName()
- {
- throw new NotImplementedException();
- }
-
- public String getNamespaceURI()
- {
- throw new NotImplementedException();
- }
-
- public org.w3c.dom.Node getNextSibling()
- {
- throw new NotImplementedException();
- }
-
- public String getNodeName()
- {
- return doc.getNodeName();
- }
-
- public short getNodeType()
- {
- return doc.getNodeType();
- }
-
- public String getNodeValue() throws DOMException
- {
- throw new NotImplementedException();
- }
-
- public Document getOwnerDocument()
- {
- throw new NotImplementedException();
- }
-
- public org.w3c.dom.Node getParentNode()
- {
- throw new NotImplementedException();
- }
-
- public String getPrefix()
- {
- throw new NotImplementedException();
- }
-
- public org.w3c.dom.Node getPreviousSibling()
- {
- throw new NotImplementedException();
- }
-
- public boolean hasAttributes()
- {
- throw new NotImplementedException();
- }
-
- public boolean hasChildNodes()
- {
- throw new NotImplementedException();
- }
-
- public org.w3c.dom.Node insertBefore(org.w3c.dom.Node node, org.w3c.dom.Node node1)
throws DOMException
- {
- throw new NotImplementedException();
- }
-
- public boolean isSupported(String s, String s1)
- {
- throw new NotImplementedException();
- }
-
- public void normalize()
- {
- throw new NotImplementedException();
- }
-
- public org.w3c.dom.Node removeChild(org.w3c.dom.Node node) throws DOMException
- {
- throw new NotImplementedException();
- }
-
- public org.w3c.dom.Node replaceChild(org.w3c.dom.Node node, org.w3c.dom.Node node1)
throws DOMException
- {
- throw new NotImplementedException();
- }
-
- public void setNodeValue(String s) throws DOMException
- {
- throw new NotImplementedException();
- }
-
- public void setPrefix(String s) throws DOMException
- {
- throw new NotImplementedException();
- }
-
- public Node adoptNode(Node source) throws DOMException
- {
- throw new NotImplementedException("adoptNode");
- }
-
- public String getDocumentURI()
- {
- throw new NotImplementedException("getDocumentURI");
- }
-
- public DOMConfiguration getDomConfig()
- {
- throw new NotImplementedException("getDomConfig");
- }
-
- public String getInputEncoding()
- {
- throw new NotImplementedException("getInputEncoding");
- }
-
- public boolean getStrictErrorChecking()
- {
- throw new NotImplementedException("getStrictErrorChecking");
- }
-
- public String getXmlEncoding()
- {
- throw new NotImplementedException("getXmlEncoding");
- }
-
- public boolean getXmlStandalone()
- {
- throw new NotImplementedException("getXmlStandalone");
- }
-
- public String getXmlVersion()
- {
- throw new NotImplementedException("getXmlVersion");
- }
-
- public void normalizeDocument()
- {
- throw new NotImplementedException("normalizeDocument");
- }
-
- public Node renameNode(Node n, String namespaceURI, String qualifiedName) throws
DOMException
- {
- throw new NotImplementedException("renameNode");
- }
-
- public void setDocumentURI(String documentURI)
- {
- throw new NotImplementedException("setDocumentURI");
- }
-
- public void setStrictErrorChecking(boolean strictErrorChecking)
- {
- throw new NotImplementedException("setStrictErrorChecking");
- }
-
- public void setXmlStandalone(boolean xmlStandalone) throws DOMException
- {
- throw new NotImplementedException("setXmlStandalone");
- }
-
- public void setXmlVersion(String xmlVersion) throws DOMException
- {
- throw new NotImplementedException("setXmlVersion");
- }
-
- public short compareDocumentPosition(Node other) throws DOMException
- {
- throw new NotImplementedException("compareDocumentPosition");
- }
-
- public String getBaseURI()
- {
- throw new NotImplementedException("getBaseURI");
- }
-
- public Object getFeature(String feature, String version)
- {
- throw new NotImplementedException("getFeature");
- }
-
- public String getTextContent() throws DOMException
- {
- throw new NotImplementedException("getTextContent");
- }
-
- public Object getUserData(String key)
- {
- throw new NotImplementedException("getUserData");
- }
-
- public boolean isDefaultNamespace(String namespaceURI)
- {
- throw new NotImplementedException("isDefaultNamespace");
- }
-
- public boolean isEqualNode(Node arg)
- {
- throw new NotImplementedException("isEqualNode");
- }
-
- public boolean isSameNode(Node other)
- {
- throw new NotImplementedException("isSameNode");
- }
-
- public String lookupNamespaceURI(String prefix)
- {
- throw new NotImplementedException("lookupNamespaceURI");
- }
-
- public String lookupPrefix(String namespaceURI)
- {
- throw new NotImplementedException("lookupPrefix");
- }
-
- public void setTextContent(String textContent) throws DOMException
- {
- throw new NotImplementedException("setTextContent");
- }
-
- public Object setUserData(String key, Object data, UserDataHandler handler)
- {
- throw new NotImplementedException("setUserData");
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/soap/SOAPPartImpl.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPPartImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/TextImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/TextImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/TextImpl.java 2006-12-07 10:43:36 UTC (rev
1600)
@@ -1,327 +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.core.soap;
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Text;
-
-/**
- * A representation of a node whose value is text. A Text
- * object may represent text that is content or text that is a comment.
- *
- * @author Thomas.Diesler(a)jboss.org
- */
-public class TextImpl extends NodeImpl implements javax.xml.soap.Text
-{
-
- public TextImpl(org.w3c.dom.Node node)
- {
- super(node);
- }
-
- /** Retrieves whether this object represents a comment.
- */
- public boolean isComment()
- {
- String value = getNodeValue().trim();
- return value.startsWith("<!--") &&
value.endsWith("-->");
- }
-
- public String getValue()
- {
- return getNodeValue();
- }
-
- public void setValue(String value)
- {
- setNodeValue(value);
- }
-
- /**
- * Breaks this node into two nodes at the specified <code>offset</code>,
keeping both in the tree as siblings.
- * <p/>
- * After being split, this node will contain all the content up to the
<code>offset</code> point. A
- * new node of the same type, which contains all the content at and after the
<code>offset</code> point, is returned.
- * If the original node had a parent node, the new node is inserted as the next
sibling of the original node.
- * When the <code>offset</code> is equal to the length of this node, the
new node has no data.
- *
- * @param offset The 16-bit unit offset at which to split, starting from
<code>0</code>.
- * @return The new node, of the same type as this node.
- * @throws org.w3c.dom.DOMException INDEX_SIZE_ERR: Raised if the specified offset is
negative or greater
- * than the number of 16-bit units in
<code>data</code>.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is
readonly.
- */
- public Text splitText(int offset) throws DOMException
- {
-
- if (offset < 0 || offset > getNodeValue().length())
- throw new IllegalArgumentException("Invalid offset [" + offset +
"] for '" + getNodeValue() + "'");
-
- String before = getNodeValue().substring(0, offset + 1);
- setNodeValue(before);
-
- String after = getNodeValue().substring(offset + 1);
- TextImpl txtNode = new TextImpl(domNode.getOwnerDocument().createTextNode(after));
-
- org.w3c.dom.Node parent = getParentNode();
- if (parent != null)
- {
- org.w3c.dom.Node sibling = getNextSibling();
- if (sibling == null)
- parent.appendChild(txtNode);
- else
- parent.insertBefore(txtNode, sibling);
- }
-
- return txtNode;
- }
-
- // org.w3c.dom.CharacterData
***************************************************************************************
-
- /**
- * The number of 16-bit units that are available through
<code>data</code>
- * and the <code>substringData</code> method below. This may have the
- * value zero, i.e., <code>CharacterData</code> nodes may be empty.
- */
- public int getLength()
- {
- return getNodeValue().length();
- }
-
- /**
- * Remove a range of 16-bit units from the node. Upon success,
- * <code>data</code> and <code>length</code> reflect the
change.
- *
- * @param offset The offset from which to start removing.
- * @param count The number of 16-bit units to delete. If the sum of
- * <code>offset</code> and <code>count</code>
exceeds
- * <code>length</code> then all 16-bit units from
<code>offset</code>
- * to the end of the data are deleted.
- * @throws org.w3c.dom.DOMException INDEX_SIZE_ERR: Raised if the specified
<code>offset</code> is
- * negative or greater than the number of 16-bit
units in
- * <code>data</code>, or if the specified
<code>count</code> is
- * negative.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if
this node is readonly.
- */
- public void deleteData(int offset, int count) throws DOMException
- {
- String value = getNodeValue().substring(0, offset + 1);
- setNodeValue(value);
- }
-
- /**
- * The character data of the node that implements this interface. The DOM
- * implementation may not put arbitrary limits on the amount of data
- * that may be stored in a <code>CharacterData</code> node. However,
- * implementation limits may mean that the entirety of a node's data may
- * not fit into a single <code>DOMString</code>. In such cases, the user
- * may call <code>substringData</code> to retrieve the data in
- * appropriately sized pieces.
- *
- * @throws org.w3c.dom.DOMException NO_MODIFICATION_ALLOWED_ERR: Raised when the node
is readonly.
- * @throws org.w3c.dom.DOMException DOMSTRING_SIZE_ERR: Raised when it would return
more characters than
- * fit in a <code>DOMString</code>
variable on the implementation
- * platform.
- */
- public String getData() throws DOMException
- {
- return getNodeValue();
- }
-
- /**
- * Extracts a range of data from the node.
- *
- * @param offset Start offset of substring to extract.
- * @param count The number of 16-bit units to extract.
- * @return The specified substring. If the sum of <code>offset</code> and
- * <code>count</code> exceeds the <code>length</code>,
then all 16-bit
- * units to the end of the data are returned.
- * @throws org.w3c.dom.DOMException INDEX_SIZE_ERR: Raised if the specified
<code>offset</code> is
- * negative or greater than the number of 16-bit
units in
- * <code>data</code>, or if the specified
<code>count</code> is
- * negative.
- * <br>DOMSTRING_SIZE_ERR: Raised if the
specified range of text does
- * not fit into a
<code>DOMString</code>.
- */
- public String substringData(int offset, int count) throws DOMException
- {
- return getNodeValue().substring(offset, offset + count);
- }
-
- /**
- * Replace the characters starting at the specified 16-bit unit offset
- * with the specified string.
- *
- * @param offset The offset from which to start replacing.
- * @param count The number of 16-bit units to replace. If the sum of
- * <code>offset</code> and <code>count</code>
exceeds
- * <code>length</code>, then all 16-bit units to the end of
the data
- * are replaced; (i.e., the effect is the same as a
<code>remove</code>
- * method call with the same range, followed by an
<code>append</code>
- * method invocation).
- * @param arg The <code>DOMString</code> with which the range must be
- * replaced.
- * @throws org.w3c.dom.DOMException INDEX_SIZE_ERR: Raised if the specified
<code>offset</code> is
- * negative or greater than the number of 16-bit
units in
- * <code>data</code>, or if the specified
<code>count</code> is
- * negative.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if
this node is readonly.
- */
- public void replaceData(int offset, int count, String arg) throws DOMException
- {
- StringBuilder buffer = new StringBuilder(getNodeValue());
- buffer.replace(offset, offset + count, arg);
- setNodeValue(buffer.toString());
- }
-
- /**
- * Insert a string at the specified 16-bit unit offset.
- *
- * @param offset The character offset at which to insert.
- * @param arg The <code>DOMString</code> to insert.
- * @throws org.w3c.dom.DOMException INDEX_SIZE_ERR: Raised if the specified
<code>offset</code> is
- * negative or greater than the number of 16-bit
units in
- * <code>data</code>.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if
this node is readonly.
- */
- public void insertData(int offset, String arg) throws DOMException
- {
- StringBuilder buffer = new StringBuilder(getNodeValue());
- buffer.insert(offset, arg);
- setNodeValue(buffer.toString());
- }
-
- /**
- * Append the string to the end of the character data of the node. Upon
- * success, <code>data</code> provides access to the concatenation of
- * <code>data</code> and the <code>DOMString</code>
specified.
- *
- * @param arg The <code>DOMString</code> to append.
- * @throws org.w3c.dom.DOMException NO_MODIFICATION_ALLOWED_ERR: Raised if this node
is readonly.
- */
- public void appendData(String arg) throws DOMException
- {
- setNodeValue(getNodeValue() + arg);
- }
-
- /**
- * The character data of the node that implements this interface. The DOM
- * implementation may not put arbitrary limits on the amount of data
- * that may be stored in a <code>CharacterData</code> node. However,
- * implementation limits may mean that the entirety of a node's data may
- * not fit into a single <code>DOMString</code>. In such cases, the user
- * may call <code>substringData</code> to retrieve the data in
- * appropriately sized pieces.
- *
- * @throws org.w3c.dom.DOMException NO_MODIFICATION_ALLOWED_ERR: Raised when the node
is readonly.
- * @throws org.w3c.dom.DOMException DOMSTRING_SIZE_ERR: Raised when it would return
more characters than
- * fit in a <code>DOMString</code>
variable on the implementation
- * platform.
- */
- public void setData(String data) throws DOMException
- {
- setNodeValue(data);
- }
-
- // Stubbed out org.w3c.dom.Text methods **************************
-
- /**
- * TODO - complete the implementation
- *
- * Returns whether this text node contains <a
href='http://www.w3.org/TR/2004/REC-xml-infoset-20040204#infoitem.cha...
- * element content whitespace</a>, often abusively called "ignorable
whitespace". The text node is
- * determined to contain whitespace in element content during the load
- * of the document or if validation occurs while using
- * <code>Document.normalizeDocument()</code>.
- * @since DOM Level 3
- */
- public boolean isElementContentWhitespace()
- {
- return false;
- }
-
- /**
- * TODO - complete the implementation
- *
- * Returns all text of <code>Text</code> nodes logically-adjacent text
- * nodes to this node, concatenated in document order.
- * <br>For instance, in the example below <code>wholeText</code> on
the
- * <code>Text</code> node that contains "bar" returns
"barfoo", while on
- * the <code>Text</code> node that contains "foo" it returns
"barfoo".
- * @since DOM Level 3
- */
- public String getWholeText()
- {
- return null;
- }
-
- /**
- * TODO - complete the implementation
- *
- * Replaces the text of the current node and all logically-adjacent text
- * nodes with the specified text. All logically-adjacent text nodes are
- * removed including the current node unless it was the recipient of the
- * replacement text.
- * <br>This method returns the node which received the replacement text.
- * The returned node is:
- * <ul>
- * <li><code>null</code>, when the replacement text is
- * the empty string;
- * </li>
- * <li>the current node, except when the current node is
- * read-only;
- * </li>
- * <li> a new <code>Text</code> node of the same type (
- * <code>Text</code> or <code>CDATASection</code>) as the
current node
- * inserted at the location of the replacement.
- * </li>
- * </ul>
- * <br>For instance, in the above example calling
- * <code>replaceWholeText</code> on the <code>Text</code> node
that
- * contains "bar" with "yo" in argument results in the following:
- * <br>Where the nodes to be removed are read-only descendants of an
- * <code>EntityReference</code>, the
<code>EntityReference</code> must
- * be removed instead of the read-only nodes. If any
- * <code>EntityReference</code> to be removed has descendants that are
- * not <code>EntityReference</code>, <code>Text</code>, or
- * <code>CDATASection</code> nodes, the
<code>replaceWholeText</code>
- * method must fail before performing any modification of the document,
- * raising a <code>DOMException</code> with the code
- * <code>NO_MODIFICATION_ALLOWED_ERR</code>.
- * <br>For instance, in the example below calling
- * <code>replaceWholeText</code> on the <code>Text</code> node
that
- * contains "bar" fails, because the
<code>EntityReference</code> node
- * "ent" contains an <code>Element</code> node which cannot be
removed.
- * @param content The content of the replacing <code>Text</code> node.
- * @return The <code>Text</code> node created with the specified content.
- * @exception org.w3c.dom.DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if one of the <code>Text</code>
- * nodes being replaced is readonly.
- * @since DOM Level 3
- */
- public Text replaceWholeText(String content)
- throws DOMException
- {
- return null;
- }
-
-}
Copied: trunk/src/main/java/org/jboss/ws/core/soap/TextImpl.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/TextImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/UnboundHeader.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/UnboundHeader.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/UnboundHeader.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,100 +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.core.soap;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.ParameterMode;
-
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-import org.jboss.ws.metadata.umdm.ParameterMetaData;
-
-/**
- * Represents an unbound SOAPHeaderElement
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Jan-2005
- */
-public class UnboundHeader
-{
- private QName xmlName;
- private QName xmlType;
- private Class javaType;
- private ParameterMode mode;
- private Object headerValue;
-
- public UnboundHeader(QName xmlName, QName xmlType, Class javaType, ParameterMode
mode)
- {
- this.xmlName = xmlName;
- this.xmlType = xmlType;
- this.javaType = javaType;
- this.mode = mode;
- }
-
- public QName getXmlName()
- {
- return xmlName;
- }
-
- public QName getXmlType()
- {
- return xmlType;
- }
-
- public Class getJavaType()
- {
- return javaType;
- }
-
- public ParameterMode getMode()
- {
- return mode;
- }
-
- public Object getHeaderValue()
- {
- return headerValue;
- }
-
- public void setHeaderValue(Object headerValue)
- {
- this.headerValue = headerValue;
- }
-
- public ParameterMetaData toParameterMetaData(OperationMetaData opMetaData)
- {
- ParameterMetaData paramMetaData = new ParameterMetaData(opMetaData, xmlName,
xmlType, javaType.getName());
- paramMetaData.setInHeader(true);
- return paramMetaData;
- }
-
- public String toString()
- {
- StringBuilder buffer = new StringBuilder("\nUnboundHeader:");
- buffer.append("\n xmlName=" + getXmlName());
- buffer.append("\n xmlType=" + getXmlType());
- buffer.append("\n javaType=" + getJavaType().getName());
- buffer.append("\n mode=" + getMode());
- return buffer.toString();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/soap/UnboundHeader.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/UnboundHeader.java)
Copied: trunk/src/main/java/org/jboss/ws/core/soap/attachment (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/attachment/AttachmentPartImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/AttachmentPartImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/soap/attachment/AttachmentPartImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,264 +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.core.soap.attachment;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Iterator;
-
-import javax.activation.DataHandler;
-import javax.mail.internet.MimeMultipart;
-import javax.xml.soap.AttachmentPart;
-import javax.xml.soap.MimeHeaders;
-import javax.xml.soap.SOAPException;
-
-/**
- * Implementation of the <code>AttachmentPart</code> interface.
- * @see javax.xml.soap.AttachmentPart
- *
- * @author <a href="mailto:jason@stacksmash.com">Jason T.
Greene</a>
- * @author Thomas.Diesler(a)jboss.org
- */
-public class AttachmentPartImpl extends AttachmentPart
-{
- private MimeHeaders mimeHeaders = new MimeHeaders();
-
- private DataHandler dataHandler;
-
- private String cachedContentId;
-
- private String cachedContentType;
-
- private String cachedContentLocation;
-
- static
- {
- // Load JAF content handlers
- ContentHandlerRegistry.register();
- }
-
- public AttachmentPartImpl()
- {
- }
-
- public AttachmentPartImpl(DataHandler handler)
- {
- this.dataHandler = handler;
- }
-
- private void clearHeaderCache()
- {
- cachedContentId = null;
- cachedContentType = null;
- cachedContentLocation = null;
- }
-
- public void addMimeHeader(String name, String value)
- {
- clearHeaderCache();
- mimeHeaders.addHeader(name, value);
- }
-
- public void clearContent()
- {
- dataHandler = null;
- }
-
- public Iterator getAllMimeHeaders()
- {
- clearHeaderCache();
- return mimeHeaders.getAllHeaders();
- }
-
- public Object getContent() throws SOAPException
- {
- if (dataHandler == null)
- throw new SOAPException("No content available");
-
- try
- {
- return dataHandler.getContent();
- }
- catch (IOException e)
- {
- throw new SOAPException(e);
- }
- }
-
- public DataHandler getDataHandler() throws SOAPException
- {
- if (dataHandler == null)
- throw new SOAPException("No data handler on attachment");
-
- return dataHandler;
- }
-
- public Iterator getMatchingMimeHeaders(String[] names)
- {
- clearHeaderCache();
- return mimeHeaders.getMatchingHeaders(names);
- }
-
- public String[] getMimeHeader(String name)
- {
- return mimeHeaders.getHeader(name);
- }
-
- /**
- * Returns the first occurence of a MIME header.
- *
- * @param header the mime header
- * @return the value of the first occurence of a MIME header
- */
- public String getFirstMimeHeader(String header)
- {
- String[] values = mimeHeaders.getHeader(header.toLowerCase());
- if ((values != null) && (values.length > 0))
- {
- return values[0];
- }
- return null;
- }
-
- public Iterator getNonMatchingMimeHeaders(String[] names)
- {
- clearHeaderCache();
- return mimeHeaders.getNonMatchingHeaders(names);
- }
-
- public int getSize() throws SOAPException
- {
- if (dataHandler == null)
- return 0;
-
- // In order to be accurate this method must be somewhat inefficient
- // TODO optimize this for specific data sources
- int count = 0, ret = 0;
- byte[] buffer = new byte[256];
-
- try
- {
- InputStream stream = dataHandler.getInputStream();
-
- do
- {
- count += ret;
- ret = stream.read(buffer);
- }
- while (ret != -1);
- }
- catch (IOException e)
- {
- throw new SOAPException(e);
- }
-
- return count;
- }
-
- public void removeAllMimeHeaders()
- {
- clearHeaderCache();
- mimeHeaders.removeAllHeaders();
- }
-
- public void removeMimeHeader(String name)
- {
- clearHeaderCache();
- mimeHeaders.removeHeader(name);
- }
-
- public void setContent(Object object, String contentType)
- {
-
- // Override the content type if its a mime multipart object because we need to
preserve
- // the all of the content type parameters
- if (object instanceof MimeMultipart)
- contentType = ((MimeMultipart)object).getContentType();
-
- dataHandler = new DataHandler(object, contentType);
-
- setContentType(contentType);
- }
-
- public void setDataHandler(DataHandler dataHandler)
- {
- if (dataHandler == null)
- throw new IllegalArgumentException("Null data handler");
-
- this.dataHandler = dataHandler;
- setContentType(dataHandler.getContentType());
- }
-
- public void setMimeHeader(String name, String value)
- {
- clearHeaderCache();
- mimeHeaders.setHeader(name, value);
- }
-
- public String getContentId()
- {
- if (cachedContentId == null)
- {
- cachedContentId = getFirstMimeHeader(MimeConstants.CONTENT_ID);
- }
-
- return cachedContentId;
- }
-
- public String getContentLocation()
- {
- if (cachedContentLocation == null)
- {
- cachedContentLocation = getFirstMimeHeader(MimeConstants.CONTENT_LOCATION);
- }
-
- return cachedContentLocation;
- }
-
- public String getContentType()
- {
- if (cachedContentType == null)
- {
- cachedContentType = getFirstMimeHeader(MimeConstants.CONTENT_TYPE);
- }
-
- return cachedContentType;
- }
-
- public void setContentId(String contentId)
- {
- setMimeHeader(MimeConstants.CONTENT_ID, contentId);
- cachedContentId = contentId;
- }
-
- public void setContentLocation(String contentLocation)
- {
- setMimeHeader(MimeConstants.CONTENT_LOCATION, contentLocation);
- cachedContentLocation = contentLocation;
- }
-
- public void setContentType(String contentType)
- {
- setMimeHeader(MimeConstants.CONTENT_TYPE, contentType);
- cachedContentType = contentType;
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/core/soap/attachment/AttachmentPartImpl.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/AttachmentPartImpl.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/soap/attachment/BoundaryDelimitedInputStream.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/BoundaryDelimitedInputStream.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/soap/attachment/BoundaryDelimitedInputStream.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,320 +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.core.soap.attachment;
-
-import java.io.FilterInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * <code>BoundaryDelimitedInputStream</code> encapsulates a stream that is
- * sepearated into different sections by a common boundary, such as a MIME
- * multipart message. The full stream is referred to as the outer stream. Each
- * boundary separated section in the outer stream is referred to as an inner
- * stream.
- *
- * All read() methods will start from the first inner stream, returning -1 when
- * a boundary is reached. Subsequent calls will then advance to the next stream,
- * skipping the boundary.
- *
- * @author <a href="mailto:jason@stacksmash.com">Jason T.
Greene</a>
- */
-public class BoundaryDelimitedInputStream extends FilterInputStream
-{
- private static final int BOUNDARY_NOT_FOUND = SimpleBoyerMoore.PATTERN_NOT_FOUND;
-
- private byte[] boundary;
-
- private SimpleBoyerMoore boyerMoore;
-
- private byte[] leftOvers;
-
- private int leftOverPosition;
-
- private InputStream source;
-
- private boolean simulateEof;
-
- private boolean realEof;
-
- private boolean bufferingCompleted;
-
- /**
- * Constructs a <code>BoundaryDelimitedInputStream</code> using the
passed
- * <code>InputStream</code> as the source for the outer stream.
- *
- * @param in the source input stream
- * @param boundary the byte boundary separating sections of this stream
- */
- public BoundaryDelimitedInputStream(InputStream in, byte[] boundary)
- {
- super(in);
- source = in;
- this.boundary = (byte[]) boundary.clone();
- boyerMoore = new SimpleBoyerMoore(this.boundary);
- }
-
- /*
- * Buffers read-ahead data for future read calls.
- */
- private void createLeftOvers(byte[] buffer, int start, int end)
- {
- int length = end - start;
-
- if (length <= 0)
- return;
-
- // If we are no longer buffering, we no longer have to expand the buffer, so we
- // can reuse it (if its still there, which may not be the case if a boundary was
found
- // after the left over buffer was consumed) by just moving the position back.
- if (bufferingCompleted && leftOvers != null)
- {
- leftOverPosition -= length;
- return;
- }
-
- int leftOverLength = (leftOvers == null) ? 0 : leftOvers.length -
leftOverPosition;
-
- byte[] newLeftOvers = new byte[length + leftOverLength];
-
- System.arraycopy(buffer, start, newLeftOvers, 0, length);
-
- if (leftOvers != null)
- System.arraycopy(leftOvers, leftOverPosition, newLeftOvers, length,
leftOverLength);
-
- leftOvers = newLeftOvers;
- leftOverPosition = 0;
- }
-
- /*
- * Reads from previous buffered read-ahead data
- */
- private int consumeLeftOvers(byte[] buffer, int offset, int length)
- {
- if (leftOvers == null) return 0;
-
- int i = 0;
- while (i < length && leftOverPosition < leftOvers.length)
- {
- buffer[offset + i++] = leftOvers[leftOverPosition++];
- }
-
- if (leftOverPosition >= leftOvers.length)
- {
- leftOvers = null;
- leftOverPosition = 0;
- }
-
- return i;
- }
-
- /*
- * Repeatably reaads from the source stream until the desired number of bytes
- * are returned.
- */
- private int fullRead(byte[] buffer, int offset, int length) throws IOException
- {
- int count = 0;
- int read = 0;
-
- do
- {
- read = source.read(buffer, offset + count, length - count);
- if (read > 0)
- count += read;
- }
- while (read > 0 && count < length);
-
- if (read < 0)
- realEof = true;
-
- return count;
- }
-
- private int findBoundary(byte[] buffer, int length)
- {
- return boyerMoore.patternSearch(buffer, 0, length);
- }
-
- private int read(byte[] b, int off, int len, boolean skip) throws IOException
- {
- if (len == 0) return 0;
-
- if (simulateEof)
- {
- simulateEof = false;
- return -1;
- }
-
- if (realEof)
- {
- if (leftOvers == null)
- return -1;
- if (bufferingCompleted == false)
- {
- bufferingCompleted = true;
- }
- }
-
- // Our buffer must always contain room for 2 boundary string occurences,
- // and one of those boundary string size chunks must extend past the length
- // of the requested read size to insure the returned byte chunk contains
- // no potion of the boundary.
- int bufferLength = Math.max(boundary.length * 2, len + boundary.length);
-
- byte[] buffer = new byte[bufferLength];
-
- int position = consumeLeftOvers(buffer, 0, bufferLength);
- if (position < bufferLength)
- position += fullRead(buffer, position, bufferLength - position);
-
- // This should only occur when the source stream is already closed at start
- if (realEof && position == 0)
- return -1;
-
- int returnLength;
-
- int boundaryPosition = findBoundary(buffer, position);
- if (boundaryPosition == BOUNDARY_NOT_FOUND || boundaryPosition >= len)
- {
- returnLength = Math.min(len, position);
- createLeftOvers(buffer, returnLength, position);
- }
- else
- {
- returnLength = boundaryPosition;
- createLeftOvers(buffer, returnLength + boundary.length, position);
-
- // If there is no data to return, send the eof immediately
- if (returnLength == 0)
- return -1;
-
- // Notify the client that this inner stream has ended by returning -1 on the
- // next read request.
- simulateEof = true;
- }
-
- if (! skip)
- System.arraycopy(buffer, 0, b, off, returnLength);
-
- return returnLength;
- }
-
-
- /**
- * This method will always return 0 because this input stream must
- * always read ahead to determine the location of the boundary.
- */
- public int available() throws IOException
- {
- return 0;
- }
-
- /**
- * Close this input stream, and its source input stream. Once this
- * is called, no further data can be read.
- */
- public void close() throws IOException
- {
- source.close();
- leftOvers = null;
- leftOverPosition = 0;
- realEof = true;
- }
-
- /**
- * Returns false. Mark is not support by this input stream.
- */
- public boolean markSupported()
- {
- return false;
- }
-
- /**
- * Reads a single byte from the inner input stream. See the general contract
- * of the read method of <code>InputStream</code>.
- *
- * @return a signle byte value from the stream in the range of 0-255 or -1
- * on eof of the inner stream.
- */
- public int read() throws IOException
- {
- byte[] b = new byte[1];
- if (read(b) == -1)
- return -1;
- return b[0] & 0xff;
- }
-
- /**
- * Reads from the inner input stream, attempting to fill the passed byte array.
- * See the general contract of the read method of
<code>InputStream</code>.
- *
- * @param b the byte array to populate
- * @return number of bytes returned in <code>b</code>, -1 on EOF
- */
- public int read(byte[] b) throws IOException
- {
- return read(b, 0, b.length);
- }
-
- /**
- * Skips the specified number of bytes from the inner input stream. See the
- * general contract of the read method of <code>InputStream</code>.
- *
- * @param n the number of bytes to skip
- * @return the number of bytes actually skipped, -1 on EOF
- */
- public long skip(long n) throws IOException
- {
- return read(null, 0, (int) n, true);
- }
-
- /**
- * Reads the specified number of bytes starting from the specified offset
- * into the specified buffer from the inner input stream. See the
- * general contract of the read method of <code>InputStream</code>.
- *
- * @param b the byte array to populate
- * @param off the offset in the array to start at
- * @param len the number of bytes to read, -1 on EOF
- */
- public int read(byte[] b, int off, int len) throws IOException
- {
- return read(b, off, len, false);
- }
-
- /**
- * Returns whether the outer stream is closed.
- *
- * @return boolean indicating whether the outer stream is closed
- */
- public boolean isOuterStreamClosed()
- {
- return realEof && leftOvers == null;
- }
-
-
- public void printLeftOvers()
- {
- if (leftOvers != null) System.out.println("LEFT = " + new
String(leftOvers, leftOverPosition, leftOvers.length - leftOverPosition));
- }
-}
\ No newline at end of file
Copied:
trunk/src/main/java/org/jboss/ws/core/soap/attachment/BoundaryDelimitedInputStream.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/BoundaryDelimitedInputStream.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/soap/attachment/ByteArrayContentHandler.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/ByteArrayContentHandler.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/soap/attachment/ByteArrayContentHandler.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,78 +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.core.soap.attachment;
-
-import java.awt.datatransfer.DataFlavor;
-import java.awt.datatransfer.UnsupportedFlavorException;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-
-import javax.activation.ActivationDataFlavor;
-import javax.activation.DataContentHandler;
-import javax.activation.DataHandler;
-import javax.activation.DataSource;
-
-import org.jboss.ws.core.utils.IOUtils;
-import org.jboss.ws.core.utils.MimeUtils;
-
-/**
- * @author Heiko Braun <heiko.braun(a)jboss.com>
- * @version $Id$
- * @since Jul 31, 2006
- */
-public class ByteArrayContentHandler implements DataContentHandler {
-
- private DataFlavor[] flavors = new ActivationDataFlavor[]
- {
- new ActivationDataFlavor(ByteArrayInputStream.class,
"application/octet-stream", "OCTETS"),
- };
-
- public Object getContent(DataSource dataSource) throws IOException {
- return dataSource.getInputStream();
- }
-
- public Object getTransferData(DataFlavor dataFlavor, DataSource dataSource) throws
UnsupportedFlavorException, IOException {
- return getContent(dataSource);
- }
-
- public DataFlavor[] getTransferDataFlavors() {
- return flavors;
- }
-
- public void writeTo(Object object, String string, OutputStream outputStream) throws
IOException {
-
- if(object instanceof byte[])
- {
- outputStream.write((byte[])object);
- }
- else if(object instanceof DataHandler)
- {
- IOUtils.copyStream(outputStream, ((DataHandler)object).getInputStream());
- }
- else
- {
- MimeUtils.ByteArrayConverter converter =
MimeUtils.getConverterForJavaType(object.getClass());
- converter.writeTo(object, outputStream);
- }
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/soap/attachment/ByteArrayContentHandler.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/ByteArrayContentHandler.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/attachment/CIDGenerator.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/CIDGenerator.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/attachment/CIDGenerator.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,75 +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.core.soap.attachment;
-
-//$Id$
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.utils.UUIDGenerator;
-
-/**
- * A common CID generator
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 17-Jan-2006
- */
-public class CIDGenerator
-{
- // provide logging
- private static Logger log = Logger.getLogger(CIDGenerator.class);
-
- private int count = 0;
-
- public String generateFromCount()
- {
- StringBuilder cid = new StringBuilder();
- long time = System.currentTimeMillis();
-
-
cid.append("cid:").append(count++).append("-").append(time).append("-")
- .append(cid.hashCode()).append("(a)").append(MimeConstants.CID_DOMAIN);
-
- log.debug("generateFromCount: " + cid);
- return cid.toString();
- }
-
- public String generateFromName(String name)
- {
-
- // See
http://www.ietf.org/rfc/rfc2392.txt on rules howto create cid's
- // TODO: URL decode when cid's are received
- try
- {
- name = URLEncoder.encode(name, "UTF-8");
- }
- catch (UnsupportedEncodingException ex)
- {
- log.error("Cannot encode name for cid: " + ex);
- }
-
- String cid = name + "-" + UUIDGenerator.generateRandomUUIDString() +
"@" + MimeConstants.CID_DOMAIN;
- log.debug("generateFromName: " + cid);
- return cid;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/soap/attachment/CIDGenerator.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/CIDGenerator.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/soap/attachment/ContentHandlerRegistry.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/ContentHandlerRegistry.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/soap/attachment/ContentHandlerRegistry.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,99 +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.core.soap.attachment;
-
-import java.awt.datatransfer.DataFlavor;
-import java.util.HashSet;
-import java.util.Iterator;
-
-import javax.activation.CommandMap;
-import javax.activation.DataContentHandler;
-import javax.activation.MailcapCommandMap;
-
-import com.sun.mail.handlers.multipart_mixed;
-import com.sun.mail.handlers.text_html;
-import com.sun.mail.handlers.text_plain;
-
-/**
- * <code>ContentHandlerRegistry</code> is responsible for registering
- * JBossWS data content handlers in JAF.
- *
- * @author <a href="mailto:jason@stacksmash.com">Jason T.
Greene</a>
- */
-public class ContentHandlerRegistry
-{
- private static final String JAF_CONTENT_HANDLER = "x-java-content-handler";
-
- private static HashSet handlerRegistry = new HashSet();
-
- static
- {
- addRegistryEntry(XmlDataContentHandler.class);
- addRegistryEntry(ImageDataContentHandler.class);
- addRegistryEntry(ByteArrayContentHandler.class);
- addRegistryEntry(text_plain.class);
- addRegistryEntry(text_html.class);
- addRegistryEntry(multipart_mixed.class);
- }
-
- private static void addRegistryEntry(Class contentHandler)
- {
- handlerRegistry.add(contentHandler);
- }
-
- private static void registerContentHandler(Class contentHandler)
- {
- DataContentHandler handler;
- MailcapCommandMap mailcap;
-
- try
- {
- mailcap = (MailcapCommandMap) CommandMap.getDefaultCommandMap();
- handler = (DataContentHandler) contentHandler.newInstance();
- }
- catch (Exception e)
- {
- throw new RuntimeException("Can not register content handler:" +
e.getMessage());
- }
-
- DataFlavor[] flavors = handler.getTransferDataFlavors();
- if (flavors == null)
- return;
-
- for (int i = 0; i < flavors.length; i++)
- {
- DataFlavor flavor = flavors[i];
- String entry = flavor.getMimeType() + ";;" + JAF_CONTENT_HANDLER +
"=" + contentHandler.getName();
- mailcap.addMailcap(entry);
- }
- }
-
- /**
- * Loads all JBossWS content handlers.
- */
- public static void register()
- {
- Iterator i = handlerRegistry.iterator();
- while (i.hasNext())
- registerContentHandler((Class) i.next());
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/soap/attachment/ContentHandlerRegistry.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/ContentHandlerRegistry.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/soap/attachment/ImageDataContentHandler.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/ImageDataContentHandler.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/soap/attachment/ImageDataContentHandler.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,203 +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.core.soap.attachment;
-
-import java.awt.Component;
-import java.awt.Graphics2D;
-import java.awt.Image;
-import java.awt.MediaTracker;
-import java.awt.datatransfer.DataFlavor;
-import java.awt.datatransfer.UnsupportedFlavorException;
-import java.awt.image.BufferedImage;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import javax.activation.ActivationDataFlavor;
-import javax.activation.DataContentHandler;
-import javax.activation.DataSource;
-import javax.imageio.ImageIO;
-import javax.imageio.ImageWriter;
-import javax.imageio.stream.ImageOutputStream;
-
-import org.jboss.logging.Logger;
-
-/**
- * <code>ImageDataContentHandler</code> is a JAF content handler that
handles
- * marshalling/unmarshalling between <code>Image</code> objects and a
stream.
- *
- * This handler provides support for all mime types handled by the ImageIO
- * implementation on the virtual machine that this class is ran under. These
- * are dynamically registered, so any custom ImageIO plugins are discovered and
- * used.
- *
- * It's important to note that some mime types (for example image/gif) may not
- * have encoding support provided by the ImageIO implementation. If this happens
- * an exception will be thrown indicating the lack of encoding support.
- *
- * @author <a href="mailto:jason@stacksmash.com">Jason T.
Greene</a>
- * @author <a href="mailto:mageshbk@jboss.com">Magesh Kumar B</a>
- */
-public class ImageDataContentHandler extends Component implements DataContentHandler
-{
- // provide logging
- private static Logger log = Logger.getLogger(ImageDataContentHandler.class);
-
- private static DataFlavor[] flavors;
-
- static
- {
- buildFlavors();
-
- // Don't write back to disk since the images are in memory anyways
- ImageIO.setUseCache(false);
- }
-
- private static void buildFlavors()
- {
- String[] mimeTypes = ImageIO.getReaderMIMETypes();
- if (mimeTypes == null)
- return;
- ArrayList flavs = new ArrayList ();
- DataFlavor flavor;
- //flavors = new DataFlavor[mimeTypes.length];
- for (int i = 0; i < mimeTypes.length; i++)
- {
- try
- {
- flavor = new ActivationDataFlavor(Image.class, mimeTypes[i],
"Image");
- flavs.add(flavor);
- }
- catch (IllegalArgumentException iae)
- {
- //This mime type is not supported
- log.warn("Unsupported MIME Type '" + mimeTypes[i]
+"'");
- }
- }
- int size = flavs.size();
- flavors = new DataFlavor[size];
- for (int i = 0; i < size; i++)
- {
- flavors[i] = (ActivationDataFlavor)flavs.get(i);
- }
- }
-
- private static ImageWriter getImageWriter(String mimeType) {
- Iterator i = ImageIO.getImageWritersByMIMEType(mimeType);
- if (! i.hasNext())
- return null;
-
- return (ImageWriter) i.next();
- }
-
- private BufferedImage getBufferedImage(Image image) throws IOException
- {
- if (image instanceof BufferedImage)
- return (BufferedImage) image;
-
- try
- {
- BufferedImage buffered;
-
- MediaTracker tracker = new MediaTracker(this);
- tracker.addImage(image, 0);
- tracker.waitForAll();
- buffered = new BufferedImage(image.getHeight(null), image.getWidth(null),
BufferedImage.TYPE_INT_RGB);
- Graphics2D gfx = buffered.createGraphics();
- gfx.drawImage(image, 0, 0, null);
- return buffered;
- }
- catch (InterruptedException e)
- {
- throw new IOException("Could not convert image " + e.getMessage());
- }
- }
-
- /**
- * Returns a {@link Image} from the specified
- * data source.
- *
- * @param ds the activation datasource
- * @return an AWT image object
- */
- public Object getContent(DataSource ds) throws IOException
- {
- return ImageIO.read(ds.getInputStream());
- }
-
- /**
- * Returns a {@link Image}from the specified data source. This method is
- * useless for this content handler because the image format is dynamically
- * discovered.
- *
- * @param df the flavor specifiying the mime type of ds
- * @param ds the activation data source
- * @return an AWT image object
- */
- public Object getTransferData(DataFlavor df, DataSource ds) throws
UnsupportedFlavorException, IOException
- {
- return getContent(ds);
- }
-
- /**
- * Returns the acceptable data flavors that this content handler supports.
- *
- * @return array of <code>ActivationDataHandlers</code>
- */
- public DataFlavor[] getTransferDataFlavors()
- {
- return flavors;
- }
-
- /**
- * Writes the passed in {@link Image} object using the specified
- * mime type to the specified output stream.
- *
- * @param obj an AWT image object
- * @param mimeType the mime type of the image format to use
- * @param os the output stream to write this image to
- */
- public void writeTo(Object obj, String mimeType, OutputStream os) throws IOException
- {
- if (obj == null)
- throw new IOException("Cannot write null source object");
-
- if (!(obj instanceof Image))
- throw new IOException("Requires the source object to be a java.awt.Image
but is: " + obj.getClass().getName());
-
- ImageWriter writer = getImageWriter(mimeType);
- if (writer == null)
- throw new IOException("Image encoding not available for mime type " +
mimeType + " on this vm");
-
- BufferedImage buffered = getBufferedImage((Image) obj);
- ImageOutputStream stream = ImageIO.createImageOutputStream(os);
-
- writer.setOutput(stream);
- writer.write(buffered);
-
- // We must close the stream now because if we are wrapping a ServletOutputStream,
- // a future gc can commit a stream that used in another thread (very very bad)
- stream.flush();
- stream.close();
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/core/soap/attachment/ImageDataContentHandler.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/ImageDataContentHandler.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/attachment/MimeConstants.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/MimeConstants.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/attachment/MimeConstants.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,58 +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.core.soap.attachment;
-
-/**
- * Generic mime related constants.
- *
- * @author <a href="mailto:jason@stacksmash.com">Jason T.
Greene</a>
- */
-public class MimeConstants
-{
- // Header constants
- public static final String CONTENT_TYPE = "Content-Type";
- public static final String CONTENT_LOCATION = "Content-Location";
- public static final String CONTENT_ID = "Content-Id";
- public static final String CONTENT_DESCRIPTION = "Content-Description";
- public static final String CONTENT_TRANSFER_ENCODING =
"Content-Transfer-Encoding";
-
- // Types
- public static final String TYPE_APPLICATION_OCTET_STREAM =
"application/octet-stream";
- public static final String TYPE_APPLICATION_XOP_XML =
"application/xop+xml";
- public static final String TYPE_MULTIPART_RELATED = "multipart/related";
- public static final String TYPE_TEXT_XML = "text/xml";
- public static final String TYPE_XML_UTF8 = TYPE_TEXT_XML + ";
charset=UTF-8";
- public static final String TYPE_SOAP11 = TYPE_TEXT_XML;
- public static final String TYPE_SOAP12 = "application/soap+xml";
-
- // Encoding
- public static final String TEXT_8BIT_ENCODING = "8bit";
- public static final String TEXT_7BIT_ENCODING = "7bit";
- public static final String BINARY_ENCODING = "binary";
- public static final String QUOTED_PRINTABLE_ENCODING = "quoted-printable";
- public static final String BASE64_ENCODING = "base64";
-
- // Misc
- public static final String CID_DOMAIN = "ws.jboss.org";
- public static final String ROOTPART_CID = "<rootpart@" + CID_DOMAIN +
">";
- public static final String START_INFO_XOP = "text/xml";
-}
Copied: trunk/src/main/java/org/jboss/ws/core/soap/attachment/MimeConstants.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/MimeConstants.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedDecoder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedDecoder.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedDecoder.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,210 +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.core.soap.attachment;
-
-// $Id$
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.LinkedList;
-
-import javax.activation.DataHandler;
-import javax.mail.Header;
-import javax.mail.MessagingException;
-import javax.mail.internet.ContentType;
-import javax.mail.internet.InternetHeaders;
-import javax.mail.internet.ParseException;
-import javax.xml.soap.AttachmentPart;
-
-import org.jboss.ws.WSException;
-
-/**
- * Abstract MutilPartRelatedDecoder decodes a mime multipart/related stream.
- *
- * @author <a href="mailto:jason@stacksmash.com">Jason T.
Greene</a>
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Jan-2006
- */
-public class MultipartRelatedDecoder
-{
- private ContentType contentType;
-
- private String rootType;
-
- private AttachmentPartImpl rootPart;
-
- private LinkedList<AttachmentPart> relatedParts = new
LinkedList<AttachmentPart>();
-
- /**
- * Constructs a <code>MultipartRelatedDecoder</code>. This will block
until the message
- * has been decoded.
- *
- * @param contentType the mime Content-Type header provided by the transport
- * @param stream The stream to pull the multipart message from
- */
- public MultipartRelatedDecoder(ContentType contentType) throws IOException,
MessagingException
- {
- this.contentType = contentType;
- if (!contentType.getBaseType().equals(MimeConstants.TYPE_MULTIPART_RELATED))
- throw new IllegalArgumentException("Multipart related decoder called with a
non-multipart/related type");
-
- rootType = contentType.getParameter("type");
- if (rootType == null)
- throw new IllegalArgumentException("multipart/related type is invalid, it
is missing the root type parameter");
- }
-
- private boolean isValidRootType(String type) throws ParseException
- {
- // The type multipart/related parameter can not have parameters itself
- ContentType contentType = new ContentType(type);
- type = contentType.getBaseType();
-
- return rootType.equals(type);
- }
-
- public void decodeMultipartRelatedMessage(InputStream stream) throws IOException,
MessagingException
- {
- String boundaryParameter = contentType.getParameter("boundary");
- String start = contentType.getParameter("start");
- byte[] boundary;
-
- if (boundaryParameter == null)
- throw new IllegalArgumentException("multipart/related content type did not
contain a boundary");
-
- try
- {
- boundary = ("\r\n--" +
boundaryParameter).getBytes("US-ASCII");
- }
- catch (UnsupportedEncodingException e)
- {
- throw new WSException("US-ASCII not supported, this should never
happen");
- }
-
- BoundaryDelimitedInputStream delimitedStream = new
BoundaryDelimitedInputStream(stream, boundary);
-
- // Eat first inner stream since its empty
- byte[] buffer = new byte[256];
- while (delimitedStream.read(buffer) != -1)
- {
- }
-
- while (!delimitedStream.isOuterStreamClosed())
- {
- // If the stream is empty or an end marker is reached, skip to the next
- // one
- if (!advanceToHeaders(delimitedStream))
- continue;
-
- InternetHeaders headers = new InternetHeaders(delimitedStream);
- String typeHeader[] = headers.getHeader(MimeConstants.CONTENT_TYPE);
-
- if (typeHeader == null)
- throw new IllegalArgumentException("multipart/related stream invalid,
component Content-type missing.");
-
- SwapableMemoryDataSource source = new SwapableMemoryDataSource(delimitedStream,
typeHeader[0]);
- AttachmentPartImpl part = new AttachmentPartImpl(new DataHandler(source));
-
- Enumeration enumeration = headers.getAllHeaders();
-
- while (enumeration.hasMoreElements())
- {
- Header header = (Header)enumeration.nextElement();
- part.addMimeHeader(header.getName(), header.getValue());
- }
-
- // The root part is either the one pointed to by the start parameter, or
- // the first occuring part if start is not defined.
- if (rootPart == null && (start == null ||
start.equals(part.getContentId())))
- {
- if (isValidRootType(part.getContentType()) == false)
- throw new IllegalArgumentException("multipart/related type specified
a root type other than the one" + " that was found.");
-
- rootPart = part;
- }
- else
- {
- relatedParts.add(part);
- }
- }
- if (rootPart == null)
- throw new IllegalArgumentException("multipart/related stream invalid, no
root part was found");
- }
-
- private boolean advanceToHeaders(InputStream stream) throws IOException
- {
- boolean dash = false, cr = false;
- while (true)
- {
- int b = stream.read();
-
- switch (b)
- {
- case -1:
- return false;
- case '\r':
- cr = true;
- dash = false;
- break;
- case '-':
- if (dash == true)
- {
- // Two dashes indicate no further content
- stream.close();
- return false;
- }
- dash = true;
- cr = false;
- break;
- case '\n':
- if (cr == true)
- return true;
- dash = false;
- break;
- default:
- dash = false;
- cr = false;
- }
- }
- }
-
- /**
- * Returns an <code>AttachmentPart</code> representing the root part of
this multipart/related message.
- *
- * @return the root part of this multipart/related message
- */
- public AttachmentPart getRootPart()
- {
- return rootPart;
- }
-
- /**
- * Returns a collection of <code>AttachmentPart</code> objects that
represent the attachments on this message.
- * If there are no attachments, an empty collection is returned.
- */
- public Collection<AttachmentPart> getRelatedParts()
- {
- return relatedParts;
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedDecoder.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedDecoder.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedEncoder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedEncoder.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedEncoder.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,132 +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.core.soap.attachment;
-
-//$Id$
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.Iterator;
-
-import javax.activation.DataHandler;
-import javax.mail.MessagingException;
-import javax.mail.internet.MimeBodyPart;
-import javax.mail.internet.MimeMultipart;
-import javax.xml.soap.AttachmentPart;
-import javax.xml.soap.MimeHeader;
-import javax.xml.soap.SOAPException;
-
-import org.jboss.ws.core.soap.SOAPMessageImpl;
-
-/**
- * MultipartRelatedEncoder encodes a SOAPMessage
- * into a multipart/related stream.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 17-Jan-2006
- */
-public abstract class MultipartRelatedEncoder
-{
- protected SOAPMessageImpl soapMessage;
- protected MimeMultipart multipart;
-
- public MultipartRelatedEncoder(SOAPMessageImpl soapMessage) throws SOAPException
- {
- this.soapMessage = soapMessage;
- }
-
- /** Build the multipart message */
- public abstract void encodeMultipartRelatedMessage() throws SOAPException,
MessagingException;
-
- protected void addAttachmentParts(MimeMultipart multipart) throws SOAPException,
MessagingException
- {
- Iterator attachmentParts = soapMessage.getAttachments();
- while (attachmentParts.hasNext())
- {
- AttachmentPart attachmentPart = (AttachmentPart)attachmentParts.next();
- DataHandler handler = attachmentPart.getDataHandler();
- MimeBodyPart mimePart = new MimeBodyPart();
- mimePart.setDataHandler(handler);
-
- Iterator mimeHeaders = attachmentPart.getAllMimeHeaders();
- while (mimeHeaders.hasNext())
- {
- MimeHeader soapHeader = (MimeHeader)mimeHeaders.next();
- mimePart.addHeader(soapHeader.getName(), soapHeader.getValue());
- }
-
- if (mimePart.getHeader(MimeConstants.CONTENT_TYPE) == null)
- {
- String type = handler.getContentType();
- mimePart.setHeader(MimeConstants.CONTENT_TYPE, (type != null) ? type :
MimeConstants.TYPE_APPLICATION_OCTET_STREAM);
- }
-
- if (mimePart.getHeader(MimeConstants.CONTENT_ID) == null)
- {
- CIDGenerator cidGenerator = soapMessage.getCidGenerator();
- mimePart.setHeader(MimeConstants.CONTENT_ID,
cidGenerator.generateFromCount());
- }
-
- // TODO - Binary encoding is the most efficient, however, some transports (old
mail servers)
- // require 7 bit ascii. Can we ask the remoting layer about the transport's
binary safety?
- mimePart.setHeader(MimeConstants.CONTENT_TRANSFER_ENCODING,
MimeConstants.BINARY_ENCODING);
-
- multipart.addBodyPart(mimePart);
- }
- }
-
- /**
- * Returns the new content type of this encoder. This value must be specified
- * in the mime Content-type header in what ever way that the transport
- * requires it.
- *
- * @return the content type
- */
- public String getContentType()
- {
- String contentType = multipart.getContentType();
- return contentType;
- }
-
- /**
- * Writes this message to the specified output stream.
- *
- * @param os the stream to write this message
- */
- public void writeTo(OutputStream os) throws IOException
- {
- if (multipart == null)
- throw new IOException("No data to write because encoding failed on
construction");
-
- try
- {
- // Ensure that the first boundary is always proceeded by CRLF
- os.write(13);
- os.write(10);
- multipart.writeTo(os);
- }
- catch (MessagingException e)
- {
- throw new IOException(e.getMessage());
- }
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedEncoder.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedEncoder.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedSwAEncoder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedSwAEncoder.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedSwAEncoder.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,86 +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.core.soap.attachment;
-
-import java.io.OutputStream;
-
-import javax.mail.MessagingException;
-import javax.mail.internet.MimeBodyPart;
-import javax.mail.internet.MimeMultipart;
-import javax.mail.internet.ParameterList;
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPException;
-
-import org.jboss.ws.core.soap.SOAPElementImpl;
-import org.jboss.ws.core.soap.SOAPElementWriter;
-import org.jboss.ws.core.soap.SOAPMessageImpl;
-
-/**
- * MultipartRelatedEncoder encodes a SOAPMessage
- * into a multipart/related stream.
- *
- * @author <a href="mailto:jason@stacksmash.com">Jason T.
Greene</a>
- */
-public class MultipartRelatedSwAEncoder extends MultipartRelatedEncoder
-{
- /**
- * Construct a MultipartRelatedEncoder from the specified
<code>SOAPMessage</code>.
- * There is minimal overhead on construction because all source streams are read
- * only on a call to {@link #writeTo(OutputStream)}.
- *
- * @param soapMessage the SOAP message to be sent as a root part
- */
- public MultipartRelatedSwAEncoder(SOAPMessageImpl soapMessage) throws SOAPException
- {
- super(soapMessage);
- }
-
- public void encodeMultipartRelatedMessage() throws SOAPException, MessagingException
- {
- ParameterList p = new ParameterList();
- p.set("type", MimeConstants.TYPE_TEXT_XML);
- p.set("start", MimeConstants.ROOTPART_CID);
-
- MimeMultipart multipart = new MimeMultipart("related" + p);
- MimeBodyPart rootPart = new MimeBodyPart();
-
- /*
- * TODO - For now we build the root part content from a serialized string of the
- * DOM tree, in the future, this should utilize a DataHandler, and a
DataContentHandler
- * to marshall the message. In this way the root part can be lazily written to the
output
- * stream.
- */
- SOAPEnvelope soapEnv = soapMessage.getSOAPPart().getEnvelope();
- String envStr = SOAPElementWriter.writeElement((SOAPElementImpl)soapEnv, false);
- rootPart.setText(envStr, "UTF-8");
-
- rootPart.setContentID(MimeConstants.ROOTPART_CID);
- rootPart.setHeader(MimeConstants.CONTENT_TYPE, MimeConstants.TYPE_XML_UTF8);
- rootPart.setHeader(MimeConstants.CONTENT_TRANSFER_ENCODING,
MimeConstants.TEXT_8BIT_ENCODING);
-
- multipart.addBodyPart(rootPart);
-
- addAttachmentParts(multipart);
-
- this.multipart = multipart;
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedSwAEncoder.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedSwAEncoder.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedXOPEncoder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedXOPEncoder.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedXOPEncoder.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,88 +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.core.soap.attachment;
-
-import java.io.OutputStream;
-
-import javax.mail.MessagingException;
-import javax.mail.internet.MimeBodyPart;
-import javax.mail.internet.MimeMultipart;
-import javax.mail.internet.ParameterList;
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPException;
-
-import org.jboss.ws.core.soap.SOAPElementImpl;
-import org.jboss.ws.core.soap.SOAPElementWriter;
-import org.jboss.ws.core.soap.SOAPMessageImpl;
-
-/**
- * <code>MultipartRelatedEncoder</code> encodes a
<code>SOAPMessage</code>
- * into a multipart/related stream.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 17-Jan-2006
- */
-public class MultipartRelatedXOPEncoder extends MultipartRelatedEncoder
-{
- /**
- * Construct a MultipartRelatedEncoder from the specified
<code>SOAPMessage</code>.
- * There is minimal overhead on construction because all source streams are read
- * only on a call to {@link #writeTo(OutputStream)}.
- *
- * @param soapMessage the SOAP message to be sent as a root part
- */
- public MultipartRelatedXOPEncoder(SOAPMessageImpl soapMessage) throws SOAPException
- {
- super(soapMessage);
- }
-
- public void encodeMultipartRelatedMessage() throws SOAPException, MessagingException
- {
- ParameterList p = new ParameterList();
- p.set("type", MimeConstants.TYPE_APPLICATION_XOP_XML);
- p.set("start", MimeConstants.ROOTPART_CID);
- p.set("start-info", MimeConstants.START_INFO_XOP);
-
- MimeMultipart multipart = new MimeMultipart("related" + p);
- MimeBodyPart rootPart = new MimeBodyPart();
-
- /*
- * TODO - For now we build the root part content from a serialized string of the
- * DOM tree, in the future, this should utilize a DataHandler, and a
DataContentHandler
- * to marshall the message. In this way the root part can be lazily written to the
output
- * stream.
- */
- SOAPEnvelope soapEnv = soapMessage.getSOAPPart().getEnvelope();
- String envStr = SOAPElementWriter.writeElement((SOAPElementImpl)soapEnv, false);
- rootPart.setText(envStr, "UTF-8");
-
- rootPart.setContentID(MimeConstants.ROOTPART_CID);
- rootPart.setHeader(MimeConstants.CONTENT_TYPE,
MimeConstants.TYPE_APPLICATION_XOP_XML + "; type=\"text/xml\"");
- rootPart.setHeader(MimeConstants.CONTENT_TRANSFER_ENCODING,
MimeConstants.TEXT_8BIT_ENCODING);
-
- multipart.addBodyPart(rootPart);
-
- addAttachmentParts(multipart);
-
- this.multipart = multipart;
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedXOPEncoder.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedXOPEncoder.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/soap/attachment/RawByteArrayOutputStream.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/RawByteArrayOutputStream.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/soap/attachment/RawByteArrayOutputStream.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,37 +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.core.soap.attachment;
-
-import java.io.ByteArrayOutputStream;
-
-/**
- * Extension of ByteArrayOutputStream that provides access to buf, saving a copy.
- *
- * @author <a href="mailto:jason@stacksmash.com">Jason T.
Greene</a>
- */
-public class RawByteArrayOutputStream extends ByteArrayOutputStream
-{
- public byte[] getBytes()
- {
- return buf;
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/core/soap/attachment/RawByteArrayOutputStream.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/RawByteArrayOutputStream.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/attachment/SimpleBoyerMoore.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/SimpleBoyerMoore.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/soap/attachment/SimpleBoyerMoore.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,102 +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.core.soap.attachment;
-
-/**
- * <code>SimpleBoyerMoore</code> is an implementation of the simplified
- * version of the Boyer-Moore pattern search algorithm. This just means that the
- * "good match" portion of the algorithm is removed, which improves the
- * performance of non repeating patterns with the obvious side-effect of
- * reducing repeating pattern performance (e.g. gaggaggaaaggaggaagagaggaga).
- *
- * This version of the algorithm performs incredibly well if the pattern is
- * rare, for example a MIME boundary.
- *
- * This algorithm is binary safe.
- *
- * @author <a href="mailto:jason@stacksmash.com">Jason T.
Greene</a>
- */
-public class SimpleBoyerMoore
-{
- private int[] badMatch = new int[256];
-
- private byte[] pattern;
-
- public static final int PATTERN_NOT_FOUND = -1;
-
- /**
- * Constructs a <code>SimpleBoyerMoore</code> instance. This internally
- * stores the pattern so that the same instance can be used across several
- * searches.
- *
- * @param pattern the pattern to search for
- */
- public SimpleBoyerMoore(byte[] pattern)
- {
- this.pattern = pattern;
- precomputeBadMatchTable();
- }
-
- private void precomputeBadMatchTable()
- {
- java.util.Arrays.fill(badMatch, pattern.length);
- for (int i = 0; i < pattern.length - 1; i++)
- {
- badMatch[pattern[i] & 0xff] = pattern.length - i - 1;
- }
- }
-
- /**
- * Find an occurence of the search pattern within text.
- *
- * @param text a byte array of data to seach
- * @param offset the index in text to start searching from
- * @param length the maximum number of bytes to search
- *
- * @return if a match is found, the index of text where the patter occurs,
- * otherwise {@link #PATTERN_NOT_FOUND}
- */
- public int patternSearch(byte[] text, int offset, int length)
- {
- if (pattern.length > length)
- {
- return PATTERN_NOT_FOUND;
- }
-
- int i = 0, j = 0, k = 0;
- int end = offset + length;
-
- for (i = offset + pattern.length - 1; i < end; i += badMatch[text[i] &
0xff])
- {
- for (j = pattern.length - 1, k = i; (j >= 0) && (text[k] ==
pattern[j]); j--)
- {
- k--;
- }
- if (j == -1)
- {
- return k + 1;
- }
- }
-
- return PATTERN_NOT_FOUND;
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/core/soap/attachment/SimpleBoyerMoore.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/SimpleBoyerMoore.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/soap/attachment/SwapableMemoryDataSource.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/SwapableMemoryDataSource.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/soap/attachment/SwapableMemoryDataSource.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -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.core.soap.attachment;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import javax.activation.DataSource;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.utils.IOUtils;
-
-/**
- * A datasource which offloads large attachments to disk.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author <a href="mailto:jason@stacksmash.com">Jason T.
Greene</a>
- */
-public class SwapableMemoryDataSource implements DataSource
-{
- private static Logger log = Logger.getLogger(SwapableMemoryDataSource.class);
-
- private static final int BLOCK_SIZE = 32 * 1024;
-
- private static final int DEFAULT_MAX_MEMORY_SIZE = 64 * 1024;
-
- private static final String SWAP_PREFIX = "JBossWSsattachment";
-
- private static final String SWAP_SUFFIX = ".dat";
-
- private File swapFile;
-
- private String contentType = MimeConstants.TYPE_APPLICATION_OCTET_STREAM;
-
- private byte[] content;
-
- private int contentLength;
-
- private int maxMemorySize = 64 * 1024;
-
-
- /**
- * Constructs a <code>SwapableMemoryDataSource</code> from inputStream,
and contentType.
- * The instance then reads from the input stream, and stores it in memory unless the
size
- * of the content is larger that 64KB, at whichpoint the stream is stored in a
temporary
- * file on disk.
- *
- * @param inputStream the stream to read from
- * @param contentType the content type of this stream
- */
- public SwapableMemoryDataSource(InputStream inputStream, String contentType) throws
IOException
- {
- this(inputStream, contentType, DEFAULT_MAX_MEMORY_SIZE);
- }
-
- /**
- * Constructs a <code>SwapableMemoryDataSource</code> from inputStream,
and
- * contentType. The instance then reads from the input stream, and stores it
- * in memory unless the size of the content is larger than maxMemorySize, at
- * whichpoint the stream is stored in a temporary file on disk.
- *
- * @param inputStream the stream to read from
- * @param contentType the content type of this stream
- * @param maxMemorySize the maximum size in bytes that this data source is
- * allowed to allocate for stream storage
- */
- public SwapableMemoryDataSource(InputStream inputStream, String contentType, int
maxMemorySize) throws IOException
- {
- if (contentType != null)
- this.contentType = contentType;
-
- this.maxMemorySize = maxMemorySize;
-
- load(inputStream);
- }
-
- private void load(InputStream inputStream) throws IOException
- {
- RawByteArrayOutputStream rbaos = new RawByteArrayOutputStream();
- OutputStream os = rbaos;
-
- byte[] buffer = new byte[BLOCK_SIZE];
- int count = inputStream.read(buffer);
- while (count > 0) {
- os.write(buffer, 0, count);
-
- if (rbaos != null && rbaos.size() > maxMemorySize)
- {
- File tmpdir = null;
- try
- {
- tmpdir = IOUtils.createTempDirectory();
- }
- catch (Throwable e)
- {
- // Ignore if the server config cannot be found
- // this would be the case if we are on the client side
- }
-
- swapFile = File.createTempFile(SWAP_PREFIX, SWAP_SUFFIX, tmpdir);
- swapFile.deleteOnExit();
- os = new FileOutputStream(swapFile);
- rbaos.writeTo(os);
- rbaos = null;
- }
-
- count = inputStream.read(buffer);
- }
-
- os.flush();
- os.close();
-
- if (rbaos == null)
- {
- log.debug("Using swap file, location = " + swapFile.toURL() + "
size = " + swapFile.length());
- }
- else
- {
- contentLength = rbaos.size();
- log.debug("Using memory buffer, size = " + contentLength);
- content = rbaos.getBytes();
- }
- }
-
- protected void finalize() throws Throwable
- {
- super.finalize();
-
- if (swapFile != null)
- swapFile.delete();
- }
-
- /**
- * Returns the content type of this data source.
- *
- * @return the content type
- */
- public String getContentType()
- {
- return contentType;
- }
-
- /**
- * Returns a new input stream on this data source. Multiple calls
- * are allowed because the data is stored.
- *
- * @return a new input stream at the start of the data
- */
- public InputStream getInputStream() throws IOException
- {
- if (content != null)
- return new ByteArrayInputStream(content, 0, contentLength);
-
- if (swapFile != null)
- return new FileInputStream(swapFile);
-
- throw new WSException("No content available");
- }
-
- /**
- * This method always returns null.
- *
- * @return null
- */
- public String getName()
- {
- return null;
- }
-
- /**
- * This method always returns null.
- *
- * @return null
- */
- public OutputStream getOutputStream() throws IOException
- {
- return null;
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/core/soap/attachment/SwapableMemoryDataSource.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/SwapableMemoryDataSource.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/soap/attachment/XmlDataContentHandler.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/XmlDataContentHandler.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/soap/attachment/XmlDataContentHandler.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,110 +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.core.soap.attachment;
-
-import java.awt.datatransfer.DataFlavor;
-import java.awt.datatransfer.UnsupportedFlavorException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import javax.activation.ActivationDataFlavor;
-import javax.activation.DataContentHandler;
-import javax.activation.DataSource;
-import javax.xml.transform.stream.StreamSource;
-
-import org.jboss.ws.core.utils.IOUtils;
-
-/**
- * <code>XmlDataContentHandler</code> is a JAF content handler that provides
- * marchalling/unmarshalling between a <code>StreamSource</code> and a
generic
- * stream.
- *
- * @author <a href="mailto:jason@stacksmash.com">Jason T.
Greene</a>
- */
-public class XmlDataContentHandler implements DataContentHandler
-{
- private DataFlavor[] flavors = new ActivationDataFlavor[]
- {
- new ActivationDataFlavor(StreamSource.class, "text/xml",
"XML"),
- new ActivationDataFlavor(StreamSource.class, "application/xml",
"XML")
- };
-
- /**
- * Returns a {@link StreamSource} from the specified
- * data source.
- *
- * @param ds the activation datasource
- * @return an XML stream source
- */
- public Object getContent(DataSource ds) throws IOException
- {
- return new StreamSource(ds.getInputStream());
- }
-
- /**
- * Returns a {@link StreamSource} from the specified
- * data source. The flavor must be one of the ones returned by {@link
#getTransferDataFlavors()}.
- *
- * @param df the flavor specifiying the mime type of ds
- * @param ds the activation data source
- * @return an XML stream source
- */
- public Object getTransferData(DataFlavor df, DataSource ds) throws
UnsupportedFlavorException, IOException
- {
- return getContent(ds);
- }
-
- /**
- * Returns the acceptable data flavors that this content handler supports.
- *
- * @return array of <code>ActivationDataHandlers</code>
- */
- public DataFlavor[] getTransferDataFlavors()
- {
- return flavors;
- }
-
- /**
- * Writes the passed in {@link StreamSource} object using the specified
- * mime type to the specified output stream. The mime type must be text/xml.
- *
- * @param obj an XML stream source
- * @param mimeType the string "text/xml"
- * @param os the output stream to write this xml stream to
- */
- public void writeTo(Object obj, String mimeType, OutputStream os) throws IOException
- {
- if (! mimeType.startsWith(MimeConstants.TYPE_TEXT_XML) && !
mimeType.startsWith("application/xml"))
- throw new IOException("Expected text/xml or application/xml, got " +
mimeType);
-
- if (! (obj instanceof StreamSource))
- throw new IOException("XML Content handler only supports a StreamSource
content object");
-
- // TODO - add support for reader source
- InputStream stream = ((StreamSource) obj).getInputStream();
- if (stream == null)
- throw new IOException("XML Content handler requires an input stream based
StreamSource");
-
- IOUtils.copyStream(os, stream);
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/core/soap/attachment/XmlDataContentHandler.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/XmlDataContentHandler.java)
Copied: trunk/src/main/java/org/jboss/ws/core/utils (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/utils)
Deleted: trunk/src/main/java/org/jboss/ws/core/utils/DOMUtils.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/utils/DOMUtils.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/utils/DOMUtils.java 2006-12-07 10:43:36 UTC (rev
1600)
@@ -1,506 +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.core.utils;
-
-// $Id$
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.jboss.logging.Logger;
-import org.jboss.util.xml.JBossEntityResolver;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-/**
- * DOM2 utilites
- *
- * @author Thomas.Diesler(a)jboss.org
- * @version $Revision$
- */
-public final class DOMUtils
-{
- private static Logger log = Logger.getLogger(DOMUtils.class);
-
- // All elements created by the same thread are created by the same builder and belong
to the same doc
- private static ThreadLocal documentThreadLocal = new ThreadLocal();
- private static ThreadLocal builderThreadLocal = new ThreadLocal() {
- protected Object initialValue() {
- try
- {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- factory.setValidating(false);
- factory.setNamespaceAware(true);
- DocumentBuilder builder = factory.newDocumentBuilder();
- builder.setEntityResolver(new JBossEntityResolver());
- return builder;
- }
- catch (ParserConfigurationException e)
- {
- throw new RuntimeException("Failed to create DocumentBuilder",
e);
- }
- }
- };
-
- // Hide the constructor
- private DOMUtils()
- {
- }
-
- /** Initialise the the DocumentBuilder
- */
- public static DocumentBuilder getDocumentBuilder()
- {
- DocumentBuilder builder = (DocumentBuilder)builderThreadLocal.get();
- return builder;
- }
-
- /** Parse the given XML string and return the root Element
- */
- public static Element parse(String xmlString) throws IOException
- {
- try
- {
- return parse(new
ByteArrayInputStream(xmlString.getBytes("UTF-8")));
- }
- catch (IOException e)
- {
- log.error("Cannot parse: " + xmlString);
- throw e;
- }
- }
-
- /** Parse the given XML stream and return the root Element
- */
- public static Element parse(InputStream xmlStream) throws IOException
- {
- try
- {
- Document doc = getDocumentBuilder().parse(xmlStream);
- Element root = doc.getDocumentElement();
- return root;
- }
- catch (SAXException e)
- {
- throw new IOException(e.toString());
- }
- }
-
- /** Parse the given input source and return the root Element
- */
- public static Element parse(InputSource source) throws IOException
- {
- try
- {
- Document doc = getDocumentBuilder().parse(source);
- Element root = doc.getDocumentElement();
- return root;
- }
- catch (SAXException e)
- {
- throw new IOException(e.toString());
- }
- }
-
- /** Create an Element for a given name
- */
- public static Element createElement(String localPart)
- {
- Document doc = getOwnerDocument();
- log.trace("createElement {}" + localPart);
- return doc.createElement(localPart);
- }
-
- /** Create an Element for a given name and prefix
- */
- public static Element createElement(String localPart, String prefix)
- {
- Document doc = getOwnerDocument();
- log.trace("createElement {}" + prefix + ":" + localPart);
- return doc.createElement(prefix + ":" + localPart);
- }
-
- /** Create an Element for a given name, prefix and uri
- */
- public static Element createElement(String localPart, String prefix, String uri)
- {
- Document doc = getOwnerDocument();
- if (prefix == null || prefix.length() == 0)
- {
- log.trace("createElement {" + uri + "}" + localPart);
- return doc.createElementNS(uri, localPart);
- }
- else
- {
- log.trace("createElement {" + uri + "}" + prefix +
":" + localPart);
- return doc.createElementNS(uri, prefix + ":" + localPart);
- }
- }
-
- /** Create an Element for a given QName
- */
- public static Element createElement(QName qname)
- {
- return createElement(qname.getLocalPart(), qname.getPrefix(),
qname.getNamespaceURI());
- }
-
- /** Create a org.w3c.dom.Text node
- */
- public static Text createTextNode(String value)
- {
- Document doc = getOwnerDocument();
- return doc.createTextNode(value);
- }
-
- /** Get the qname of the given node.
- */
- public static QName getElementQName(Element el)
- {
- String qualifiedName = el.getNodeName();
- return resolveQName(el, qualifiedName);
- }
-
- /** Transform the giveen qualified name into a QName
- */
- public static QName resolveQName(Element el, String qualifiedName)
- {
- QName qname;
- String prefix = "";
- String namespaceURI = "";
- String localPart = qualifiedName;
-
- int colIndex = qualifiedName.indexOf(":");
- if (colIndex > 0)
- {
- prefix = qualifiedName.substring(0, colIndex);
- localPart = qualifiedName.substring(colIndex + 1);
-
- if ("xmlns".equals(prefix))
- {
- namespaceURI = "URI:XML_PREDEFINED_NAMESPACE";
- }
- else
- {
- Element nsElement = el;
- while (namespaceURI.equals("") && nsElement != null)
- {
- namespaceURI = nsElement.getAttribute("xmlns:" + prefix);
- if (namespaceURI.equals(""))
- nsElement = getParentElement(nsElement);
- }
- }
-
- if (namespaceURI.equals(""))
- throw new IllegalArgumentException("Cannot find namespace uri for:
" + qualifiedName);
- }
-
- qname = new QName(namespaceURI, localPart, prefix);
- return qname;
- }
-
- /** Get the value from the given attribute
- *
- * @return null if the attribute value is empty or the attribute is not present
- */
- public static String getAttributeValue(Element el, String attrName)
- {
- return getAttributeValue(el, new QName(attrName));
- }
-
- /** Get the value from the given attribute
- *
- * @return null if the attribute value is empty or the attribute is not present
- */
- public static String getAttributeValue(Element el, QName attrName)
- {
- String attr = null;
- if ("".equals(attrName.getNamespaceURI()))
- attr = el.getAttribute(attrName.getLocalPart());
- else attr = el.getAttributeNS(attrName.getNamespaceURI(),
attrName.getLocalPart());
-
- if ("".equals(attr))
- attr = null;
-
- return attr;
- }
-
- /** Get the qname value from the given attribute
- */
- public static QName getAttributeValueAsQName(Element el, String attrName)
- {
- return getAttributeValueAsQName(el, new QName(attrName));
-
- }
-
- /** Get the qname value from the given attribute
- */
- public static QName getAttributeValueAsQName(Element el, QName attrName)
- {
- QName qname = null;
-
- String qualifiedName = getAttributeValue(el, attrName);
- if (qualifiedName != null)
- {
- qname = resolveQName(el, qualifiedName);
- }
-
- return qname;
- }
-
- /** Get the boolean value from the given attribute
- */
- public static boolean getAttributeValueAsBoolean(Element el, String attrName)
- {
- return getAttributeValueAsBoolean(el, new QName(attrName));
- }
-
- /** Get the boolean value from the given attribute
- */
- public static boolean getAttributeValueAsBoolean(Element el, QName attrName)
- {
- String attrVal = getAttributeValue(el, attrName);
- boolean ret = "true".equalsIgnoreCase(attrVal) ||
"1".equalsIgnoreCase(attrVal);
- return ret;
- }
-
- /** Get the integer value from the given attribute
- */
- public static Integer getAttributeValueAsInteger(Element el, String attrName)
- {
- return getAttributeValueAsInteger(el, new QName(attrName));
- }
-
- /** Get the integer value from the given attribute
- */
- public static Integer getAttributeValueAsInteger(Element el, QName attrName)
- {
- String attrVal = getAttributeValue(el, attrName);
- return (attrVal != null ? new Integer(attrVal) : null);
- }
-
- /** Get the attributes as Map<QName, String>
- */
- public static Map getAttributes(Element el)
- {
- Map attmap = new HashMap();
- NamedNodeMap attribs = el.getAttributes();
- for (int i = 0; i < attribs.getLength(); i++)
- {
- Attr attr = (Attr)attribs.item(i);
- String name = attr.getName();
- QName qname = resolveQName(el, name);
- String value = attr.getNodeValue();
- attmap.put(qname, value);
- }
- return attmap;
- }
-
- /** Copy attributes between elements
- */
- public static void copyAttributes(Element destElement, Element srcElement)
- {
- NamedNodeMap attribs = srcElement.getAttributes();
- for (int i = 0; i < attribs.getLength(); i++)
- {
- Attr attr = (Attr)attribs.item(i);
- String uri = attr.getNamespaceURI();
- String qname = attr.getName();
- String value = attr.getNodeValue();
-
- // Prevent DOMException: NAMESPACE_ERR: An attempt is made to create or
- // change an object in a way which is incorrect with regard to namespaces.
- if (uri == null && qname.startsWith("xmlns"))
- {
- log.trace("Ignore attribute: [uri=" + uri + ",qname="
+ qname + ",value=" + value + "]");
- }
- else
- {
- destElement.setAttributeNS(uri, qname, value);
- }
- }
- }
-
- /** True if the node has child elements
- */
- public static boolean hasChildElements(Node node)
- {
- NodeList nlist = node.getChildNodes();
- for (int i = 0; i < nlist.getLength(); i++)
- {
- Node child = nlist.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE)
- return true;
- }
- return false;
- }
-
- /** Gets child elements
- */
- public static Iterator getChildElements(Node node)
- {
- ArrayList list = new ArrayList();
- NodeList nlist = node.getChildNodes();
- for (int i = 0; i < nlist.getLength(); i++)
- {
- Node child = nlist.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE)
- list.add(child);
- }
- return list.iterator();
- }
-
- /** Get the concatenated text content, or null.
- */
- public static String getTextContent(Node node)
- {
- boolean hasTextContent = false;
- StringBuffer buffer = new StringBuffer();
- NodeList nlist = node.getChildNodes();
- for (int i = 0; i < nlist.getLength(); i++)
- {
- Node child = nlist.item(i);
- if (child.getNodeType() == Node.TEXT_NODE)
- {
- buffer.append(child.getNodeValue());
- hasTextContent = true;
- }
- }
- return (hasTextContent ? buffer.toString() : null);
- }
-
- /** Gets the first child element
- */
- public static Element getFirstChildElement(Node node)
- {
- return getFirstChildElementIntern(node, null);
- }
-
- /** Gets the first child element for a given local name without namespace
- */
- public static Element getFirstChildElement(Node node, String nodeName)
- {
- return getFirstChildElementIntern(node, new QName(nodeName));
- }
-
- /** Gets the first child element for a given qname
- */
- public static Element getFirstChildElement(Node node, QName nodeName)
- {
- return getFirstChildElementIntern(node, nodeName);
- }
-
- private static Element getFirstChildElementIntern(Node node, QName nodeName)
- {
- Element childElement = null;
- Iterator it = getChildElementsIntern(node, nodeName);
- if (it.hasNext())
- {
- childElement = (Element)it.next();
- }
- return childElement;
- }
-
- /** Gets the child elements for a given local name without namespace
- */
- public static Iterator getChildElements(Node node, String nodeName)
- {
- return getChildElementsIntern(node, new QName(nodeName));
- }
-
- /** Gets the child element for a given qname
- */
- public static Iterator getChildElements(Node node, QName nodeName)
- {
- return getChildElementsIntern(node, nodeName);
- }
-
- private static Iterator getChildElementsIntern(Node node, QName nodeName)
- {
- ArrayList list = new ArrayList();
- NodeList nlist = node.getChildNodes();
- for (int i = 0; i < nlist.getLength(); i++)
- {
- Node child = nlist.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE)
- {
- if (nodeName == null)
- {
- list.add(child);
- }
- else
- {
- QName qname;
- if (nodeName.getNamespaceURI().length() > 0)
- {
- qname = new QName(child.getNamespaceURI(),
child.getLocalName());
- }
- else
- {
- qname = new QName(child.getLocalName());
- }
- if (qname.equals(nodeName))
- {
- list.add(child);
- }
- }
- }
- }
- return list.iterator();
- }
-
- /** Gets parent element or null if there is none
- */
- public static Element getParentElement(Node node)
- {
- Node parent = node.getParentNode();
- return (parent instanceof Element ? (Element)parent : null);
- }
-
- /** Get the owner document that is associated with the current thread */
- public static Document getOwnerDocument()
- {
- Document doc = (Document)documentThreadLocal.get();
- if (doc == null)
- {
- doc = getDocumentBuilder().newDocument();
- documentThreadLocal.set(doc);
- }
- return doc;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/utils/DOMUtils.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/utils/DOMUtils.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/utils/DOMWriter.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/utils/DOMWriter.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/utils/DOMWriter.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,587 +0,0 @@
-/*
- * ====================================================================
- *
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 1999 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution, if
- * any, must include the following acknowlegement:
- * "This product includes software developed by the
- * Apache Software Foundation (
http://www.apache.org/)."
- * Alternately, this acknowlegement may appear in the software itself,
- * if and wherever such third-party acknowlegements normally appear.
- *
- * 4. The names "The Jakarta Project", "Tomcat", and "Apache
Software
- * Foundation" must not be used to endorse or promote products derived
- * from this software without prior written permission. For written
- * permission, please contact apache(a)apache.org.
- *
- * 5. Products derived from this software may not be called "Apache"
- * nor may "Apache" appear in their names without prior written
- * permission of the Apache Group.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <
http://www.apache.org/>.
- */
-package org.jboss.ws.core.utils;
-
-// $Id$
-
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.io.UnsupportedEncodingException;
-import java.io.Writer;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.jboss.logging.Logger;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * Traverse a DOM tree in order to print a document that is parsed.
- *
- * @author Andy Clark, IBM
- * @author Thomas.Diesler(a)jboss.org
- * @version $Revision$
- */
-public class DOMWriter
-{
- private static Logger log = Logger.getLogger(DOMWriter.class);
- // Print writer
- private PrintWriter out;
- // True, if canonical output
- private boolean canonical;
- // True, if pretty printing should be used
- private boolean prettyprint;
- // True, if the XML declaration should be written
- private boolean writeXMLDeclaration;
- // Explicit character set encoding
- private String charsetName;
- // indent for the pretty printer
- private int prettyIndent;
- // True, if the XML declaration has been written
- private boolean wroteXMLDeclaration;
- // The node that started the write
- private Node rootNode;
- // True if we want namespace completion
- private boolean completeNamespaces = true;
-
- public DOMWriter(Writer w)
- {
- this.out = new PrintWriter(w);
- }
-
- public DOMWriter(Writer w, String charsetName)
- {
- this.out = new PrintWriter(w);
- this.charsetName = charsetName;
- this.writeXMLDeclaration = true;
- }
-
- public DOMWriter(OutputStream stream)
- {
- try
- {
- this.out = new PrintWriter(new OutputStreamWriter(stream, "UTF-8"));
- }
- catch (UnsupportedEncodingException e)
- {
- // ignore, UTF-8 should be available
- }
- }
-
- public DOMWriter(OutputStream stream, String charsetName)
- {
- try
- {
- this.out = new PrintWriter(new OutputStreamWriter(stream, charsetName));
- this.charsetName = charsetName;
- this.writeXMLDeclaration = true;
- }
- catch (UnsupportedEncodingException e)
- {
- throw new IllegalArgumentException("Unsupported encoding: " +
charsetName);
- }
- }
-
- /**
- * Print a node with explicit prettyprinting.
- * The defaults for all other DOMWriter properties apply.
- *
- */
- public static String printNode(Node node, boolean prettyprint)
- {
- StringWriter strw = new StringWriter();
- new DOMWriter(strw).setPrettyprint(prettyprint).print(node);
- return strw.toString();
- }
-
- public boolean isCanonical()
- {
- return canonical;
- }
-
- /**
- * Set wheter entities should appear in their canonical form.
- * The default is false.
- */
- public DOMWriter setCanonical(boolean canonical)
- {
- this.canonical = canonical;
- return this;
- }
-
- /**
- * Set wheter subelements should have their namespaces completed.
- * Setting this to false may lead to invalid XML fragments.
- * The default is true.
- */
- public DOMWriter setCompleteNamespaces(boolean complete)
- {
- this.completeNamespaces = complete;
- return this;
- }
-
- public boolean isPrettyprint()
- {
- return prettyprint;
- }
-
- /**
- * Set wheter element should be indented.
- * The default is false.
- */
- public DOMWriter setPrettyprint(boolean prettyprint)
- {
- this.prettyprint = prettyprint;
- return this;
- }
-
- public boolean isWriteXMLDeclaration()
- {
- return writeXMLDeclaration;
- }
-
- /**
- * Set wheter the XML declaration should be written.
- * The default is false.
- */
- public DOMWriter setWriteXMLDeclaration(boolean flag)
- {
- this.writeXMLDeclaration = flag;
- return this;
- }
-
- public void print(Node node)
- {
- rootNode = node;
- printInternal(node, false);
- }
-
- private void printInternal(Node node, boolean indentEndMarker)
- {
- // is there anything to do?
- if (node == null)
- {
- return;
- }
-
- // JBAS-2117 - Don't skip the DOCUMENT_NODE
- // if (node instanceof Document) node = ((Document)node).getDocumentElement();
-
- if (wroteXMLDeclaration == false && writeXMLDeclaration == true &&
canonical == false)
- {
- out.print("<?xml version='1.0'");
- if (charsetName != null)
- out.print(" encoding='" + charsetName + "'");
-
- out.print("?>");
- if (prettyprint)
- out.println();
-
- wroteXMLDeclaration = true;
- }
-
- int type = node.getNodeType();
- boolean hasChildNodes = node.getChildNodes().getLength() > 0;
-
- String nodeName = node.getNodeName();
- switch (type)
- {
- // print document
- case Node.DOCUMENT_NODE:
- {
- NodeList children = node.getChildNodes();
- for (int iChild = 0; iChild < children.getLength(); iChild++)
- {
- printInternal(children.item(iChild), false);
- }
- out.flush();
- break;
- }
-
- // print element with attributes
- case Node.ELEMENT_NODE:
- {
- Element element = (Element)node;
- if (prettyprint)
- {
- for (int i = 0; i < prettyIndent; i++)
- {
- out.print(' ');
- }
- prettyIndent++;
- }
-
- out.print('<');
- out.print(nodeName);
-
- Map nsMap = new HashMap();
- String elPrefix = node.getPrefix();
- if (elPrefix != null)
- {
- String nsURI = getNamespaceURI(elPrefix, element, rootNode);
- nsMap.put(elPrefix, nsURI);
- }
-
- Attr attrs[] = sortAttributes(node.getAttributes());
- for (int i = 0; i < attrs.length; i++)
- {
- Attr attr = attrs[i];
- String atPrefix = attr.getPrefix();
- String atName = attr.getNodeName();
- String atValue = normalize(attr.getNodeValue(), canonical);
-
- if (atPrefix != null && !atPrefix.equals("xmlns")
&& !atPrefix.equals("xml"))
- {
- String nsURI = getNamespaceURI(atPrefix, element, rootNode);
- nsMap.put(atPrefix, nsURI);
- // xsi:type='ns1:SubType', xsi:type='xsd:string'
- if (atName.equals(atPrefix + ":type") &&
atValue.indexOf(":") > 0)
- {
- // xsi defined on the envelope
- if (nsURI == null)
- nsURI = getNamespaceURI(atPrefix, element, null);
-
- if
("http://www.w3.org/2001/XMLSchema-instance".equals(nsURI))
- {
- String typePrefix = atValue.substring(0,
atValue.indexOf(":"));
- String typeURI = getNamespaceURI(typePrefix, element, rootNode);
- nsMap.put(typePrefix, typeURI);
- }
- }
- }
-
- out.print(" " + atName + "='" + atValue +
"'");
- }
-
- // Add missing namespace declaration
- if (completeNamespaces)
- {
- Iterator itPrefix = nsMap.keySet().iterator();
- while (itPrefix.hasNext())
- {
- String prefix = (String)itPrefix.next();
- String nsURI = (String)nsMap.get(prefix);
- if (nsURI == null)
- {
- nsURI = getNamespaceURI(prefix, element, null);
- out.print(" xmlns:" + prefix + "='" + nsURI
+ "'");
- }
- }
- }
-
- if (hasChildNodes)
- {
- out.print('>');
- }
-
- // Find out if the end marker is indented
- indentEndMarker = isEndMarkerIndented(node);
-
- if (indentEndMarker)
- {
- out.print('\n');
- }
-
- NodeList childNodes = node.getChildNodes();
- int len = childNodes.getLength();
- for (int i = 0; i < len; i++)
- {
- Node childNode = childNodes.item(i);
- printInternal(childNode, false);
- }
- break;
- }
-
- // handle entity reference nodes
- case Node.ENTITY_REFERENCE_NODE:
- {
- if (canonical)
- {
- NodeList children = node.getChildNodes();
- if (children != null)
- {
- int len = children.getLength();
- for (int i = 0; i < len; i++)
- {
- printInternal(children.item(i), false);
- }
- }
- }
- else
- {
- out.print('&');
- out.print(nodeName);
- out.print(';');
- }
- break;
- }
-
- // print cdata sections
- case Node.CDATA_SECTION_NODE:
- {
- if (canonical)
- {
- out.print(normalize(node.getNodeValue(), canonical));
- }
- else
- {
- out.print("<![CDATA[");
- out.print(node.getNodeValue());
- out.print("]]>");
- }
- break;
- }
-
- // print text
- case Node.TEXT_NODE:
- {
- String text = normalize(node.getNodeValue(), canonical);
- if (prettyprint == false || text.trim().length() > 0)
- out.print(text);
- break;
- }
-
- // print processing instruction
- case Node.PROCESSING_INSTRUCTION_NODE:
- {
- out.print("<?");
- out.print(nodeName);
- String data = node.getNodeValue();
- if (data != null && data.length() > 0)
- {
- out.print(' ');
- out.print(data);
- }
- out.print("?>");
- break;
- }
-
- // print comment
- case Node.COMMENT_NODE:
- {
- for (int i = 0; i < prettyIndent; i++)
- {
- out.print(' ');
- }
-
- out.print("<!--");
- String data = node.getNodeValue();
- if (data != null)
- {
- out.print(data);
- }
- out.print("-->");
-
- if (prettyprint)
- {
- out.print('\n');
- }
-
- break;
- }
- }
-
- if (type == Node.ELEMENT_NODE)
- {
- if (prettyprint)
- prettyIndent--;
-
- if (hasChildNodes == false)
- {
- out.print("/>");
- }
- else
- {
- if (indentEndMarker)
- {
- for (int i = 0; i < prettyIndent; i++)
- {
- out.print(' ');
- }
- }
-
- out.print("</");
- out.print(nodeName);
- out.print('>');
- }
-
- if (prettyIndent > 0)
- {
- out.print('\n');
- }
- }
- out.flush();
- }
-
- private String getNamespaceURI(String prefix, Element element, Node stopNode)
- {
- Node parent = element.getParentNode();
- String nsURI = element.getAttribute("xmlns:" + prefix);
- if (nsURI.length() == 0 && element != stopNode && parent instanceof
Element)
- return getNamespaceURI(prefix, (Element)parent, stopNode);
-
- return (nsURI.length() > 0 ? nsURI : null);
- }
-
- private boolean isEndMarkerIndented(Node node)
- {
- if (prettyprint)
- {
- NodeList childNodes = node.getChildNodes();
- int len = childNodes.getLength();
- for (int i = 0; i < len; i++)
- {
- Node children = childNodes.item(i);
- if (children.getNodeType() == Node.ELEMENT_NODE)
- {
- return true;
- }
- }
- }
- return false;
- }
-
- /** Returns a sorted list of attributes. */
- private Attr[] sortAttributes(NamedNodeMap attrs)
- {
-
- int len = (attrs != null) ? attrs.getLength() : 0;
- Attr array[] = new Attr[len];
- for (int i = 0; i < len; i++)
- {
- array[i] = (Attr)attrs.item(i);
- }
- for (int i = 0; i < len - 1; i++)
- {
- String name = array[i].getNodeName();
- int index = i;
- for (int j = i + 1; j < len; j++)
- {
- String curName = array[j].getNodeName();
- if (curName.compareTo(name) < 0)
- {
- name = curName;
- index = j;
- }
- }
- if (index != i)
- {
- Attr temp = array[i];
- array[i] = array[index];
- array[index] = temp;
- }
- }
- return (array);
- }
-
- /** Normalizes the given string. */
- public static String normalize(String s, boolean canonical)
- {
- StringBuffer str = new StringBuffer();
-
- int len = (s != null) ? s.length() : 0;
- for (int i = 0; i < len; i++)
- {
- char ch = s.charAt(i);
- switch (ch)
- {
- case '<':
- {
- str.append("<");
- break;
- }
- case '>':
- {
- str.append(">");
- break;
- }
- case '&':
- {
- str.append("&");
- break;
- }
- case '"':
- {
- str.append(""");
- break;
- }
- case '\r':
- case '\n':
- {
- if (canonical)
- {
- str.append("&#");
- str.append(Integer.toString(ch));
- str.append(';');
- break;
- }
- // else, default append char
- }
- default:
- {
- str.append(ch);
- }
- }
- }
- return (str.toString());
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/utils/DOMWriter.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/utils/DOMWriter.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/utils/HolderUtils.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/utils/HolderUtils.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/utils/HolderUtils.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,322 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001-2003 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (
http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Axis" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache(a)apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <
http://www.apache.org/>.
- */
-
-package org.jboss.ws.core.utils;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.util.Calendar;
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.holders.BigDecimalHolder;
-import javax.xml.rpc.holders.BigIntegerHolder;
-import javax.xml.rpc.holders.BooleanHolder;
-import javax.xml.rpc.holders.BooleanWrapperHolder;
-import javax.xml.rpc.holders.ByteArrayHolder;
-import javax.xml.rpc.holders.ByteHolder;
-import javax.xml.rpc.holders.ByteWrapperHolder;
-import javax.xml.rpc.holders.CalendarHolder;
-import javax.xml.rpc.holders.DoubleHolder;
-import javax.xml.rpc.holders.DoubleWrapperHolder;
-import javax.xml.rpc.holders.FloatHolder;
-import javax.xml.rpc.holders.FloatWrapperHolder;
-import javax.xml.rpc.holders.IntHolder;
-import javax.xml.rpc.holders.IntegerWrapperHolder;
-import javax.xml.rpc.holders.LongHolder;
-import javax.xml.rpc.holders.LongWrapperHolder;
-import javax.xml.rpc.holders.ObjectHolder;
-import javax.xml.rpc.holders.QNameHolder;
-import javax.xml.rpc.holders.ShortHolder;
-import javax.xml.rpc.holders.ShortWrapperHolder;
-import javax.xml.rpc.holders.StringHolder;
-
-import org.jboss.logging.Logger;
-
-/**
- * HolderUtils provides static utility functions for both JAX-RPC
- * and JAX-WS holders.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
- * @since 22-Dec-2004
- */
-public class HolderUtils
-{
- private static final Logger log = Logger.getLogger(HolderUtils.class);
-
- /** True if the given type is a holder. */
- public static boolean isHolderType(Class javaType)
- {
- return javax.xml.rpc.holders.Holder.class.isAssignableFrom(javaType) ||
javax.xml.ws.Holder.class.isAssignableFrom(javaType);
- }
-
- /** True if the given type is a holder. */
- public static boolean isHolderType(Type javaType)
- {
- return isHolderType(JavaUtils.erasure(javaType));
- }
-
- /**
- * Gets the JAX-RPC holder for a specific value type.
- *
- * @param valueType the value
- * @return the holder, or null if there is no match
- */
- public static Class getJAXRPCHolderType(Class valueType)
- {
- if (valueType == null)
- throw new IllegalArgumentException("Illegal null parameter");
-
- if (javax.xml.rpc.holders.Holder.class.isAssignableFrom(valueType))
- throw new IllegalArgumentException("Is already a holder: " +
valueType.getName());
-
- if (valueType == BigDecimal.class)
- return BigDecimalHolder.class;
- if (valueType == BigInteger.class)
- return BigIntegerHolder.class;
- if (valueType == boolean.class)
- return BooleanHolder.class;
- if (valueType == Boolean.class)
- return BooleanWrapperHolder.class;
- if (valueType == byte[].class)
- return ByteArrayHolder.class;
- if (valueType == byte.class)
- return ByteHolder.class;
- if (valueType == Byte.class)
- return ByteWrapperHolder.class;
- if (valueType == Calendar.class)
- return CalendarHolder.class;
- if (valueType == double.class)
- return DoubleHolder.class;
- if (valueType == Double.class)
- return DoubleWrapperHolder.class;
- if (valueType == float.class)
- return FloatHolder.class;
- if (valueType == Float.class)
- return FloatWrapperHolder.class;
- if (valueType == int.class)
- return IntHolder.class;
- if (valueType == Integer.class)
- return IntegerWrapperHolder.class;
- if (valueType == long.class)
- return LongHolder.class;
- if (valueType == Long.class)
- return LongWrapperHolder.class;
- if (valueType == QName.class)
- return QNameHolder.class;
- if (valueType == short.class)
- return ShortHolder.class;
- if (valueType == Short.class)
- return ShortWrapperHolder.class;
- if (valueType == String.class)
- return StringHolder.class;
- if (valueType == Object.class)
- return ObjectHolder.class;
-
- log.warn("Cannot get holder type for: " + valueType);
-
- return null;
- }
-
- /**
- * Gets the value type of a JAX-WS or JAX-RPC holder.
- *
- * @param holderType the generic type for JAX-WS, a standard class for JAX-RPC
- * @return the value type
- */
- public static Class getValueType(Type holderType)
- {
- Class holderClass = JavaUtils.erasure(holderType);
-
- boolean jaxrpcHolder =
javax.xml.rpc.holders.Holder.class.isAssignableFrom(holderClass);
- boolean jaxwsHolder = javax.xml.ws.Holder.class.isAssignableFrom(holderClass);
- if (!jaxrpcHolder && !jaxwsHolder)
- throw new IllegalArgumentException("Is not a holder: " +
holderClass.getName());
-
- if (jaxwsHolder)
- return JavaUtils.erasure(getGenericValueType(holderType));
-
- // Holder is supposed to have a public value field.
- Field field;
- try
- {
- field = holderClass.getField("value");
- }
- catch (NoSuchFieldException e)
- {
- throw new IllegalArgumentException("Cannot find public value field: "
+ holderClass);
- }
-
- return field.getType();
- }
-
- /**
- * Gets the value object of a JAX-WS or JAX-RPC holder instance.
- *
- * @param holder the holder object instance
- * @return the value object instance
- */
- public static Object getHolderValue(Object holder)
- {
- if (holder == null)
- throw new IllegalArgumentException("Illegal null parameter");
-
- if (!javax.xml.rpc.holders.Holder.class.isInstance(holder) &&
!javax.xml.ws.Holder.class.isInstance(holder))
- throw new IllegalArgumentException("Is not a holder: " + holder);
-
- try
- {
- Field valueField = holder.getClass().getField("value");
- Object obj = valueField.get(holder);
- return obj;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception e)
- {
- throw new IllegalArgumentException("Cannot access public value field:
" + holder);
- }
- }
-
- /**
- * Sets the value object of a JAX-WS or JAX-RPC holder instance. This method
- * will also dynamically convert primitive and wrapper arrays to match the
- * target array type.
- *
- * @param holder the holder instance
- * @param value the value, can be null
- */
- public static void setHolderValue(Object holder, Object value)
- {
- if (holder == null)
- throw new IllegalArgumentException("Holder instance was null");
-
- if (!javax.xml.rpc.holders.Holder.class.isInstance(holder) &&
!javax.xml.ws.Holder.class.isInstance(holder))
- throw new IllegalArgumentException("Is not a holder: " + holder);
-
- Class valueType = getValueType(holder.getClass());
-
- if (value != null && JavaUtils.isAssignableFrom(valueType,
value.getClass()) == false)
- throw new IllegalArgumentException("Holder [" +
holder.getClass().getName() + "] value not assignable: " + value);
-
- if (valueType.isArray())
- value = JavaUtils.syncArray(value, valueType);
-
- try
- {
- Field valueField = holder.getClass().getField("value");
- if (value != null || valueType.isPrimitive() == false)
- valueField.set(holder, value);
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception e)
- {
- throw new IllegalArgumentException("Cannot access public value field:
" + holder);
- }
- }
-
- /**
- * Gets the generic value type of a JAX-WS Holder.
- * If there is no generic information, Object.class will be returned
- *
- * @param holder JAX-WS holder type
- * @return generic value type
- */
- public static Type getGenericValueType(Type holder)
- {
- return (holder instanceof ParameterizedType) ?
((ParameterizedType)holder).getActualTypeArguments()[0] : Object.class;
- }
-
-
- /**
- * Creates a JAX-WS or JAX-RPC holder instance.
- *
- * @param value the value instance
- * @param holderType the holder type
- * @return a new holder
- */
- public static Object createHolderInstance(Object value, Class<?> holderType)
- {
- if (! isHolderType(holderType))
- throw new IllegalArgumentException("Not a holder type:" +
holderType.getName());
-
- Object holder;
-
- try
- {
- holder = holderType.newInstance();
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception e)
- {
- throw new IllegalArgumentException("Cannot instanciate holder: " +
holderType);
- }
-
- setHolderValue(holder, value);
-
- return holder;
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/core/utils/HolderUtils.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/utils/HolderUtils.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/utils/IOUtils.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/utils/IOUtils.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/utils/IOUtils.java 2006-12-07 10:43:36 UTC (rev
1600)
@@ -1,117 +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.core.utils;
-
-// $Id$
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Reader;
-import java.io.Writer;
-
-import javax.activation.DataHandler;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.server.ServerConfig;
-import org.jboss.ws.core.server.ServerConfigFactory;
-
-/**
- * IO utilites
- *
- * @author Thomas.Diesler(a)jboss.org
- */
-public final class IOUtils
-{
- private static Logger log = Logger.getLogger(IOUtils.class);
-
- // Hide the constructor
- private IOUtils()
- {
- }
-
- public static Writer getCharsetFileWriter(File file, String charset) throws
IOException
- {
- return new OutputStreamWriter(new FileOutputStream(file), charset);
- }
-
- /** Copy the input stream to the output stream
- */
- public static void copyStream(OutputStream outs, InputStream ins) throws IOException
- {
- byte[] bytes = new byte[1024];
- int r = ins.read(bytes);
- while (r > 0)
- {
- outs.write(bytes, 0, r);
- r = ins.read(bytes);
- }
- }
-
- public static byte[] convertToBytes(DataHandler dh)
- {
- try
- {
- ByteArrayOutputStream buffOS= new ByteArrayOutputStream();
- dh.writeTo(buffOS);
- return buffOS.toByteArray();
- }
- catch (IOException e)
- {
- throw new WSException("Unable to convert DataHandler to byte[]: " +
e.getMessage());
- }
- }
-
- /**
- * Transform a Reader to an InputStream
- * Background is that DocumentBuilder.parse() cannot take the Reader directly
- */
- public static InputStream transformReader(Reader reader) throws IOException
- {
- int capacity = 1024;
- char[] charBuffer = new char[capacity];
- StringBuffer strBuffer = new StringBuffer(capacity);
-
- int len = reader.read(charBuffer, 0, capacity);
- while (len > 0)
- {
- strBuffer.append(charBuffer, 0, len);
- len = reader.read(charBuffer, 0, capacity);
- }
- return new ByteArrayInputStream(strBuffer.toString().getBytes());
- }
-
- public static File createTempDirectory() throws IOException
- {
- ServerConfigFactory factory = ServerConfigFactory.getInstance();
- ServerConfig config = factory.getServerConfig();
- File tmpdir = new File(config.getServerTempDir().getCanonicalPath() +
"/jbossws");
- tmpdir.mkdirs();
- return tmpdir;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/utils/IOUtils.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/utils/IOUtils.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/utils/JBossWSEntityResolver.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/utils/JBossWSEntityResolver.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/utils/JBossWSEntityResolver.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,82 +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.core.utils;
-
-// $Id$
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.jboss.logging.Logger;
-import org.jboss.util.xml.JBossEntityResolver;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-/**
- * Dynamically register the JBossWS entities.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 02-Aug-2006
- */
-public class JBossWSEntityResolver extends JBossEntityResolver
-{
- // provide logging
- private static final Logger log = Logger.getLogger(JBossWSEntityResolver.class);
-
- public JBossWSEntityResolver()
- {
- registerEntity("urn:jboss:jaxrpc-config:2.0",
"schema/jaxrpc-config_2_0.xsd");
- registerEntity("urn:jboss:jaxws-config:2.0",
"schema/jaxws-config_2_0.xsd");
-
registerEntity("http://java.sun.com/xml/ns/javaee",
"schema/javaee_web_services_1_2.xsd");
-
registerEntity("http://www.w3.org/2005/08/addressing",
"schema/ws-addr.xsd");
-
registerEntity("http://schemas.xmlsoap.org/ws/2004/08/eventing",
"eventing.xsd");
- }
-
- public InputSource resolveEntity(String publicId, String systemId) throws
SAXException, IOException
- {
- log.debug("resolveEntity: [pub=" + publicId + ",sysid=" +
systemId + "]");
- InputSource inputSource = super.resolveEntity(publicId, systemId);
- return inputSource;
- }
-
- public URL resolveNamespaceURI(String nsURI)
- {
- URL url = null;
-
- String resource = (String)getEntityMap().get(nsURI);
- if (resource != null)
- {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- url = loader.getResource(resource);
- if( url == null )
- {
- if( resource.endsWith(".dtd") )
- resource = "dtd/" + resource;
- else if( resource.endsWith(".xsd") )
- resource = "schema/" + resource;
- url = loader.getResource(resource);
- }
- }
-
- return url;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/utils/JBossWSEntityResolver.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/utils/JBossWSEntityResolver.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/utils/JavaUtils.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/utils/JavaUtils.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/utils/JavaUtils.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,637 +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.core.utils;
-
-// $Id$
-
-import java.lang.reflect.Array;
-import java.lang.reflect.GenericArrayType;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.lang.reflect.TypeVariable;
-import java.lang.reflect.WildcardType;
-import java.util.HashMap;
-import java.util.HashSet;
-
-import org.jboss.logging.Logger;
-
-/** Java utilities
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 22-Dec-2004
- */
-public class JavaUtils
-{
- // provide logging
- private static final Logger log = Logger.getLogger(JavaUtils.class);
-
- private static HashMap<String, Class> primitiveNames = new HashMap<String,
Class>(8);
- private static HashMap<String, String> primitiveNameDescriptors = new
HashMap<String, String>(8);
- private static HashSet<String> reservedKeywords = new
HashSet<String>(50);
-
- static
- {
- primitiveNames.put("int", int.class);
- primitiveNames.put("short", short.class);
- primitiveNames.put("boolean", boolean.class);
- primitiveNames.put("byte", byte.class);
- primitiveNames.put("long", long.class);
- primitiveNames.put("double", double.class);
- primitiveNames.put("float", float.class);
- primitiveNames.put("char", char.class);
-
- primitiveNameDescriptors.put("int", "I");
- primitiveNameDescriptors.put("short", "S");
- primitiveNameDescriptors.put("boolean", "Z");
- primitiveNameDescriptors.put("byte", "B");
- primitiveNameDescriptors.put("long", "J");
- primitiveNameDescriptors.put("double", "D");
- primitiveNameDescriptors.put("float", "F");
- primitiveNameDescriptors.put("char", "C");
-
- reservedKeywords.add("abstract");
- reservedKeywords.add("continue");
- reservedKeywords.add("for");
- reservedKeywords.add("new");
- reservedKeywords.add("switch");
- reservedKeywords.add("assert");
- reservedKeywords.add("default");
- reservedKeywords.add("if");
- reservedKeywords.add("package");
- reservedKeywords.add("synchronized");
- reservedKeywords.add("boolean");
- reservedKeywords.add("do");
- reservedKeywords.add("goto");
- reservedKeywords.add("private");
- reservedKeywords.add("this");
- reservedKeywords.add("break");
- reservedKeywords.add("double");
- reservedKeywords.add("implements");
- reservedKeywords.add("protected");
- reservedKeywords.add("throw");
- reservedKeywords.add("byte");
- reservedKeywords.add("else");
- reservedKeywords.add("import");
- reservedKeywords.add("public");
- reservedKeywords.add("throws");
- reservedKeywords.add("case");
- reservedKeywords.add("enum");
- reservedKeywords.add("instanceof");
- reservedKeywords.add("return");
- reservedKeywords.add("transient");
- reservedKeywords.add("catch");
- reservedKeywords.add("extends");
- reservedKeywords.add("int");
- reservedKeywords.add("short");
- reservedKeywords.add("try");
- reservedKeywords.add("char");
- reservedKeywords.add("final");
- reservedKeywords.add("interface");
- reservedKeywords.add("static");
- reservedKeywords.add("void");
- reservedKeywords.add("class");
- reservedKeywords.add("finally");
- reservedKeywords.add("long");
- reservedKeywords.add("strictfp");
- reservedKeywords.add("volatile");
- reservedKeywords.add("const");
- reservedKeywords.add("float");
- reservedKeywords.add("native");
- reservedKeywords.add("super");
- reservedKeywords.add("while");
- }
-
- /**
- * Load a Java type from a given class loader.
- *
- * @param typeName maybe the source notation of a primitve, class name, array of both
- */
- public static Class loadJavaType(String typeName) throws ClassNotFoundException
- {
- return loadJavaType(typeName, null);
- }
-
- /**
- * Load a Java type from a given class loader.
- *
- * @param typeName maybe the source notation of a primitve, class name, array of both
- */
- public static Class loadJavaType(String typeName, ClassLoader classLoader) throws
ClassNotFoundException
- {
- if (classLoader == null)
- classLoader = Thread.currentThread().getContextClassLoader();
-
- Class javaType = primitiveNames.get(typeName);
- if (javaType == null)
- javaType = getArray(typeName, classLoader);
-
- if (javaType == null)
- javaType = classLoader.loadClass(typeName);
-
- return javaType;
- }
-
- /**
- * True if the given type name is the source notation of a primitive or array of
which.
- */
- public static boolean isPrimitive(String javaType)
- {
- return getPrimitiveType(javaType) != null;
- }
-
- /**
- * True if the given class is a primitive or array of which.
- */
- public static boolean isPrimitive(Class javaType)
- {
- return javaType.isPrimitive() || (javaType.isArray() &&
isPrimitive(javaType.getComponentType()));
- }
-
- public static Class getPrimitiveType(String javaType)
- {
- Class type = primitiveNames.get(javaType);
- if (type != null)
- return type;
-
- try
- {
- // null loader = primitive only
- type = getArray(javaType, null);
- }
- catch (ClassNotFoundException e)
- {
- // This will actually never be thrown since is null
- }
-
- return type;
- }
-
- private static Class getArray(String javaType, ClassLoader loader) throws
ClassNotFoundException
- {
- if (javaType.charAt(0) == '[')
- return getArrayFromJVMName(javaType, loader);
-
- if (javaType.endsWith("[]"))
- return getArrayFromSourceName(javaType, loader);
-
- return null;
- }
-
- private static Class getArrayFromJVMName(String javaType, ClassLoader loader) throws
ClassNotFoundException
- {
- Class componentType;
- int componentStart = javaType.lastIndexOf('[') + 1;
- switch (javaType.charAt(componentStart))
- {
- case 'I': componentType = int.class; break;
- case 'S': componentType = short.class; break;
- case 'Z': componentType = boolean.class; break;
- case 'B': componentType = byte.class; break;
- case 'J': componentType = long.class; break;
- case 'D': componentType = double.class; break;
- case 'F': componentType = float.class; break;
- case 'C': componentType = char.class; break;
- case 'L':
- if (loader == null)
- return null;
- String name = javaType.substring(componentStart + 1, javaType.length() - 1);
- componentType = loader.loadClass(name);
- break;
- default:
- throw new IllegalArgumentException("Invalid binary component for array:
" + javaType.charAt(componentStart));
- }
-
- // componentStart doubles as the number of '['s which is the number of
dimensions
- return Array.newInstance(componentType, new int[componentStart]).getClass();
- }
-
- private static Class getArrayFromSourceName(String javaType, ClassLoader loader)
throws ClassNotFoundException
- {
- int arrayStart = javaType.indexOf('[');
- String componentName = javaType.substring(0, arrayStart);
-
- Class componentType = primitiveNames.get(componentName);
- if (componentType == null)
- {
- if (loader == null)
- return null;
-
- componentType = loader.loadClass(componentName);
- }
-
- // [][][][] divided by 2
- int dimensions = (javaType.length() - arrayStart) >> 1;
-
- return Array.newInstance(componentType, new int[dimensions]).getClass();
- }
-
- /**
- * Get the corresponding primitive for a give wrapper type.
- * Also handles arrays of which.
- */
- public static Class getPrimitiveType(Class javaType)
- {
- if (javaType == Integer.class)
- return int.class;
- if (javaType == Short.class)
- return short.class;
- if (javaType == Boolean.class)
- return boolean.class;
- if (javaType == Byte.class)
- return byte.class;
- if (javaType == Long.class)
- return long.class;
- if (javaType == Double.class)
- return double.class;
- if (javaType == Float.class)
- return float.class;
- if (javaType == Character.class)
- return char.class;
-
- if (javaType == Integer[].class)
- return int[].class;
- if (javaType == Short[].class)
- return short[].class;
- if (javaType == Boolean[].class)
- return boolean[].class;
- if (javaType == Byte[].class)
- return byte[].class;
- if (javaType == Long[].class)
- return long[].class;
- if (javaType == Double[].class)
- return double[].class;
- if (javaType == Float[].class)
- return float[].class;
- if (javaType == Character[].class)
- return char[].class;
-
- if (javaType.isArray() && javaType.getComponentType().isArray())
- {
- Class compType = getPrimitiveType(javaType.getComponentType());
- return Array.newInstance(compType, 0).getClass();
- }
-
- return javaType;
- }
-
- /**
- * Converts an n-dimensional array of wrapper types to primitive types
- */
- public static Object getPrimitiveValueArray(Object value)
- {
- if (value == null)
- return null;
-
- Class javaType = value.getClass();
- if (javaType.isArray())
- {
- int length = Array.getLength(value);
- Object destArr =
Array.newInstance(getPrimitiveType(javaType.getComponentType()), length);
- for (int i = 0; i < length; i++)
- {
- Object srcObj = Array.get(value, i);
- Array.set(destArr, i, getPrimitiveValueArray(srcObj));
- }
- return destArr;
- }
-
- return value;
- }
-
- /**
- * Get the corresponding wrapper type for a give primitive.
- * Also handles arrays of which.
- */
- public static Class getWrapperType(Class javaType)
- {
- if (javaType == int.class)
- return Integer.class;
- if (javaType == short.class)
- return Short.class;
- if (javaType == boolean.class)
- return Boolean.class;
- if (javaType == byte.class)
- return Byte.class;
- if (javaType == long.class)
- return Long.class;
- if (javaType == double.class)
- return Double.class;
- if (javaType == float.class)
- return Float.class;
- if (javaType == char.class)
- return Character.class;
-
- if (javaType == int[].class)
- return Integer[].class;
- if (javaType == short[].class)
- return Short[].class;
- if (javaType == boolean[].class)
- return Boolean[].class;
- if (javaType == byte[].class)
- return Byte[].class;
- if (javaType == long[].class)
- return Long[].class;
- if (javaType == double[].class)
- return Double[].class;
- if (javaType == float[].class)
- return Float[].class;
- if (javaType == char[].class)
- return Character[].class;
-
- if (javaType.isArray() && javaType.getComponentType().isArray())
- {
- Class compType = getWrapperType(javaType.getComponentType());
- return Array.newInstance(compType, 0).getClass();
- }
-
- return javaType;
- }
-
- /**
- * Converts an n-dimensional array of primitive types to wrapper types
- */
- public static Object getWrapperValueArray(Object value)
- {
- if (value == null)
- return null;
-
- Class javaType = value.getClass();
- if (javaType.isArray())
- {
- int length = Array.getLength(value);
- Object destArr = Array.newInstance(getWrapperType(javaType.getComponentType()),
length);
- for (int i = 0; i < length; i++)
- {
- Object srcObj = Array.get(value, i);
- Array.set(destArr, i, getWrapperValueArray(srcObj));
- }
- return destArr;
- }
-
- return value;
- }
-
- public static Object syncArray(Object array, Class target)
- {
- return (JavaUtils.isPrimitive(target)) ? JavaUtils.getPrimitiveValueArray(array) :
JavaUtils.getWrapperValueArray(array);
- }
-
- /**
- * Return true if the dest class is assignable from the src.
- * Also handles arrays and primitives.
- */
- public static boolean isAssignableFrom(Class dest, Class src)
- {
- if (dest == null)
- throw new IllegalArgumentException("Destination class cannot be
null");
- if (src == null)
- throw new IllegalArgumentException("Source class cannot be null");
-
- boolean isAssignable = dest.isAssignableFrom(src);
- if (isAssignable == false && dest.getName().equals(src.getName()))
- {
- ClassLoader destLoader = dest.getClassLoader();
- ClassLoader srcLoader = src.getClassLoader();
- log.debug("Not assignable because of conflicting class
loaders:\ndstLoader=" + destLoader + "\nsrcLoader=" + srcLoader);
- }
-
- if (isAssignable == false && isPrimitive(dest))
- {
- dest = getWrapperType(dest);
- isAssignable = dest.isAssignableFrom(src);
- }
- if (isAssignable == false && isPrimitive(src))
- {
- src = getWrapperType(src);
- isAssignable = dest.isAssignableFrom(src);
- }
- return isAssignable;
- }
-
- public static String convertJVMNameToSourceName(String typeName, ClassLoader loader)
- {
- // TODO Don't use a ClassLoader for this, we need to just convert it
- try
- {
- Class javaType = loadJavaType(typeName, loader);
- typeName = getSourceName(javaType);
- }
- catch (Exception e)
- {
- }
-
- return typeName;
- }
-
- /**
- * Converts a JVM external name to a JVM signature name. An external name is
- * that which is returned from {@link Class#getName()} A signature name is
- * the name in class file format.
- * <p>
- * For example:
- * <p>
- * [java.lang.Object
- * <p>
- * becomes:
- * <p>
- * [Ljava/lang/Object;
- *
- * @param externalName
- * @return
- */
- public static String toSignature(String externalName)
- {
- if (externalName == null)
- return null;
-
- String ret = primitiveNameDescriptors.get(externalName);
- if (ret != null)
- return ret;
-
- ret = externalName.replace('.', '/');
- return (ret.charAt(0) == '[') ? ret : "L" + ret + ";";
- }
-
- public static String printArray(Object[] val)
- {
- if (val == null)
- return "null";
-
- StringBuilder out = new StringBuilder("[");
- for (int i = 0; i < val.length; i++)
- {
- if (i > 0)
- {
- out.append(",");
- }
- out.append(val[i].getClass().isArray() ? printArray((Object[])val[i]) :
val[i]);
- }
- return out.append("]").toString();
- }
-
- public static String getSourceName(Class type)
- {
- if (! type.isArray())
- return type.getName();
-
- String arrayNotation = "";
- Class component = type;
- while(component.isArray())
- {
- component = component.getComponentType();
- arrayNotation += "[]";
- }
-
- return component.getName() + arrayNotation;
- }
-
- public static String capitalize(String source)
- {
- if (source == null)
- return null;
-
- if (source.length() == 0)
- return source;
-
- if (Character.isUpperCase(source.charAt(0)))
- return source;
-
- char c = Character.toUpperCase(source.charAt(0));
-
- return c + source.substring(1);
- }
-
- public static boolean isLoaded(String className, ClassLoader loader)
- {
- try
- {
- loadJavaType(className, loader);
- }
- catch (ClassNotFoundException e)
- {
- return false;
- }
-
- return true;
- }
-
- public static String getPackageName(Class<?> clazz)
- {
- String fullName = clazz.getName();
- return fullName.substring(0, fullName.lastIndexOf("."));
- }
-
- public static boolean isReservedKeyword(String keyword)
- {
- return reservedKeywords.contains(keyword);
- }
-
- /**
- * Erases a type according to the JLS type erasure rules
- *
- * @param t type to erase
- * @return erased type
- */
- public static Class erasure(Type type)
- {
- if (type instanceof ParameterizedType)
- {
- return erasure(((ParameterizedType)type).getRawType());
- }
- if (type instanceof TypeVariable)
- {
- return erasure(((TypeVariable)type).getBounds()[0]);
- }
- if (type instanceof WildcardType)
- {
- return erasure(((WildcardType)type).getUpperBounds()[0]);
- }
- if (type instanceof GenericArrayType)
- {
- return
Array.newInstance(erasure(((GenericArrayType)type).getGenericComponentType()),
0).getClass();
- }
-
- // Only type left is class
- return (Class)type;
- }
-
- public static String[] getRawParameterTypeArguments(ParameterizedType type)
- {
- Type[] arguments = type.getActualTypeArguments();
- String[] ret = new String[arguments.length];
- for (int i = 0; i < arguments.length; i++)
- {
- Class raw = erasure(arguments[i]);
- ret[i] = raw.getName();
- }
-
- return ret;
- }
-
- /**
- * Tests if this class loader is a JBoss RepositoryClassLoader
- *
- * @param loader
- * @return
- */
- public static boolean isJBossRepositoryClassLoader(ClassLoader loader)
- {
- Class clazz = loader.getClass();
- while (!clazz.getName().startsWith("java"))
- {
- if
("org.jboss.mx.loading.RepositoryClassLoader".equals(clazz.getName()))
- return true;
- clazz = clazz.getSuperclass();
- }
-
- return false;
- }
-
- /**
- * Clears black lists on a JBoss RepositoryClassLoader. This is somewhat of a hack,
and
- * could be replaced with an integration module. This is needed when the following
order of
- * events occur.
- *
- * <ol>
- * <li>loadClass() returns not found</li>
- * <li>Some call to defineClass()</li>
- * <ol>
- *
- * The CNFE triggers a black list addition, which cause the class never again to be
found.
- *
- * @param loader the loader to clear black lists for
- */
- public static void clearBlacklists(ClassLoader loader)
- {
- if (isJBossRepositoryClassLoader(loader))
- {
- try
- {
- loader.getClass().getMethod("clearBlacklists").invoke(loader);
- }
- catch (Exception e)
- {
- log.debug("Could not clear blacklists on " + loader);
- }
- }
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/core/utils/JavaUtils.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/utils/JavaUtils.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/utils/JavassistUtils.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/utils/JavassistUtils.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/utils/JavassistUtils.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,130 +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.core.utils;
-
-import javassist.CtClass;
-import javassist.CtField;
-import javassist.CtMethod;
-import javassist.bytecode.AnnotationsAttribute;
-import javassist.bytecode.ClassFile;
-import javassist.bytecode.ConstPool;
-import javassist.bytecode.FieldInfo;
-import javassist.bytecode.MethodInfo;
-import javassist.bytecode.SignatureAttribute;
-import javassist.bytecode.annotation.ArrayMemberValue;
-import javassist.bytecode.annotation.EnumMemberValue;
-import javassist.bytecode.annotation.StringMemberValue;
-
-/**
- * Utility functions that simplify Javassist.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class JavassistUtils
-{
- public static void addFieldAnnotation(CtField field,
javassist.bytecode.annotation.Annotation annotation)
- {
- FieldInfo fieldInfo = field.getFieldInfo();
- AnnotationsAttribute attribute = (AnnotationsAttribute)
fieldInfo.getAttribute(AnnotationsAttribute.visibleTag);
- if (attribute == null)
- attribute = new AnnotationsAttribute(fieldInfo.getConstPool(),
AnnotationsAttribute.visibleTag);
- attribute.addAnnotation(annotation);
- fieldInfo.addAttribute(attribute);
- }
-
- public static void addClassAnnotation(CtClass clazz,
javassist.bytecode.annotation.Annotation annotation)
- {
- ClassFile classFile = clazz.getClassFile();
- AnnotationsAttribute attribute = (AnnotationsAttribute)
classFile.getAttribute(AnnotationsAttribute.visibleTag);
- if (attribute == null)
- attribute = new AnnotationsAttribute(classFile.getConstPool(),
AnnotationsAttribute.visibleTag);
- attribute.addAnnotation(annotation);
- classFile.addAttribute(attribute);
- }
-
- public static Annotation createAnnotation(Class<? extends
java.lang.annotation.Annotation> annotation, ConstPool constPool)
- {
- return new Annotation(annotation, constPool);
- }
-
- public static void addSignature(CtField field, String signature)
- {
- FieldInfo fieldInfo = field.getFieldInfo();
- ConstPool constPool = fieldInfo.getConstPool();
- SignatureAttribute signatureAttribute = new SignatureAttribute(constPool,
signature);
- fieldInfo.addAttribute(signatureAttribute);
- }
-
- public static void addSignature(CtMethod method, String signature)
- {
- MethodInfo methodInfo = method.getMethodInfo();
- ConstPool constPool = methodInfo.getConstPool();
- SignatureAttribute signatureAttribute = new SignatureAttribute(constPool,
signature);
- methodInfo.addAttribute(signatureAttribute);
- }
-
- public static class Annotation
- {
- private javassist.bytecode.annotation.Annotation annotation;
- private ConstPool constPool;
-
- public Annotation(Class<? extends java.lang.annotation.Annotation>
annotation, ConstPool constPool)
- {
- this.annotation = new
javassist.bytecode.annotation.Annotation(annotation.getName(), constPool);
- this.constPool = constPool;
- }
-
- public void addParameter(String name, String value)
- {
- annotation.addMemberValue(name, new StringMemberValue(value, constPool));
- }
-
- public void addParameter(String name, Enum value)
- {
- EnumMemberValue enumValue = new EnumMemberValue(constPool);
- enumValue.setType(value.getClass().getName());
- enumValue.setValue(value.name());
- annotation.addMemberValue(name, enumValue);
- }
-
- public void addParameter(String name, String[] values)
- {
- ArrayMemberValue member = new ArrayMemberValue(constPool);
- StringMemberValue[] members = new StringMemberValue[values.length];
- for (int i = 0; i < values.length; i++)
- members[i] = new StringMemberValue(values[i], constPool);
- member.setValue(members);
- annotation.addMemberValue(name, member);
- }
-
- public void markClass(CtClass clazz)
- {
- addClassAnnotation(clazz, annotation);
- }
-
- public void markField(CtField field)
- {
- addFieldAnnotation(field, annotation);
- }
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/core/utils/JavassistUtils.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/utils/JavassistUtils.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/utils/MimeUtils.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/utils/MimeUtils.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/utils/MimeUtils.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,358 +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.core.utils;
-
-// $Id$
-
-
-
-import java.awt.image.BufferedImage;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import javax.mail.internet.ContentType;
-import javax.mail.internet.MimeMultipart;
-import javax.mail.internet.ParseException;
-import javax.xml.namespace.QName;
-import javax.xml.transform.stream.StreamSource;
-
-import org.jboss.ws.Constants;
-import org.jboss.ws.WSException;
-
-import com.sun.image.codec.jpeg.JPEGCodec;
-import com.sun.image.codec.jpeg.JPEGImageDecoder;
-import com.sun.image.codec.jpeg.JPEGImageEncoder;
-
-/**
- * Generic mime utility class.
- *
- * @author <a href="mailto:jason@stacksmash.com">Jason T.
Greene</a>
- */
-public class MimeUtils
-{
-
- private static Map<String, Class> mime2class = new HashMap<String,
Class>();
- private static Map<Class, String> class2mime = new HashMap<Class,
String>();
-
- static {
- mime2class.put("text/plain", java.lang.String.class);
- mime2class.put("image/jpeg", java.awt.Image.class);
- mime2class.put("text/xml", javax.xml.transform.Source.class);
- mime2class.put("application/xml", javax.xml.transform.Source.class);
- mime2class.put("application/octet-stream",
javax.activation.DataHandler.class);
-
- class2mime.put(java.awt.Image.class, "image/jpeg");
- class2mime.put(javax.xml.transform.Source.class, "text/xml");
- class2mime.put(java.lang.String.class, "text/plain");
- }
-
- /**
- * Converts a MIME type into a proprietary JBossWS attachment xml type.
- *
- * @param mimeType the MIME type string to convert
- * @return the xml type that this mime type corresponds to
- */
- public static QName convertMimeTypeToXmlType(String mimeType)
- {
- StringBuilder mimeName = new StringBuilder(mimeType);
-
- int pos = mimeName.indexOf("/");
-
- if (pos == -1)
- return null;
-
- mimeName.setCharAt(pos, '_');
-
- return new QName(Constants.NS_ATTACHMENT_MIME_TYPE, mimeName.toString());
- }
-
- /**
- * Gets the base portion of a MIME type string. This basically just strips
- * off any type parameter elements.
- *
- * @param mimeType any MIME type string
- * @return a reduced MIME string containing no type parameters
- */
- public static String getBaseMimeType(String mimeType)
- {
- ContentType contentType;
-
- if (mimeType == null)
- return null;
- try
- {
- contentType = new ContentType(mimeType);
- }
- catch (ParseException e)
- {
- return null;
- }
-
- return contentType.getBaseType();
- }
-
- /**
- * Checks if there is a matching mime pattern for mimeType in mimeTypes. This
- * will return true if there is an exact match (for example text/plain =
- * text/plain), or if there is a wildcard subtype match (text/plain =
- * text/*).
- *
- * @param mimeType the mime type to search for
- * @param mimeTypes the set of mime types to search
- * @return true if there is a match, false if not
- */
- public static boolean isMemberOf(String mimeType, Set mimeTypes)
- {
- if (mimeTypes.contains(mimeType))
- return true;
-
- try
- {
- if (mimeTypes.contains(new ContentType(mimeType).getPrimaryType() +
"/*"))
- return true;
- }
- catch (ParseException e)
- {
- // eat
- }
-
- return false;
- }
-
- /**
- * Resolve the class for a mype type.
- * Defaults to <code>DataHandler</code> if no mapping could be found.
- */
- public static Class resolveClass(String mimeType) {
- Class cl = mime2class.get(mimeType);
- if(null==cl)
- cl = javax.activation.DataHandler.class;
- return cl;
- }
-
- /**
- * Resolve the mime type for an object.
- * Default to <code>application/octet-stream</code>
- * if no mapping could be found.
- */
- public static String resolveMimeType(Object obj) {
- String mimeType = (obj instanceof MimeMultipart) ?
- ((MimeMultipart)obj).getContentType() :
- resolveMimeType(obj.getClass());
- return mimeType;
- }
-
- public static String resolveMimeType(Class clazz) {
- String mimeType = "application/octet-stream";
- for(Class cl : class2mime.keySet())
- {
- if(JavaUtils.isAssignableFrom(cl, clazz))
- mimeType = class2mime.get(cl);
- }
- return mimeType;
- }
-
- public static ByteArrayConverter getConverterForJavaType(Class targetClazz)
- {
- ByteArrayConverter converter = null;
- if(JavaUtils.isAssignableFrom(java.awt.Image.class, targetClazz))
- converter = new ImageConverter();
- else if (JavaUtils.isAssignableFrom(javax.xml.transform.Source.class,
targetClazz))
- converter = new SourceConverter();
- else if (JavaUtils.isAssignableFrom(java.lang.String.class, targetClazz))
- converter = new StringConverter();
- else if (JavaUtils.isAssignableFrom(java.io.InputStream.class, targetClazz))
- converter = new StreamConverter();
-
- if(null == converter)
- throw new WSException("No ByteArrayConverter for class: " +
targetClazz.getName());
-
- return converter;
- }
-
- public static ByteArrayConverter getConverterForContentType(String contentType)
- {
- ByteArrayConverter converter = null;
-
- if(contentType != null)
- {
- if("image/jpeg".equals(contentType) ||
"image/jpg".equals(contentType))
- converter = new ImageConverter();
- else if("text/xml".equals(contentType) ||
"application/xml".equals(contentType))
- converter = new SourceConverter();
- else if("text/plain".equals(contentType))
- converter = new StringConverter();
- else if("application/octet-stream".equals(contentType))
- converter = new StreamConverter();
- }
-
- if(null == converter)
- throw new WSException("No ByteArrayConverter for content type: " +
contentType);
-
- return converter;
- }
- public static class ImageConverter implements ByteArrayConverter
- {
- public Object readFrom(InputStream in) {
- Object converted = null;
- try
- {
- JPEGImageDecoder dec = JPEGCodec.createJPEGDecoder(in);
- BufferedImage bim = dec.decodeAsBufferedImage();
- converted = bim;
- }
- catch (Exception e)
- {
- // ignore
- }
-
- return converted;
- }
-
- public void writeTo(Object obj, OutputStream out) {
- if(obj instanceof BufferedImage)
- {
- JPEGImageEncoder enc = JPEGCodec.createJPEGEncoder(out);
- try
- {
- enc.encode((BufferedImage)obj);
- }
- catch (IOException e)
- {
- throw new WSException("Failed to convert " + obj.getClass());
- }
- }
- else
- {
- throw new WSException("Unable to convert " + obj.getClass());
- }
-
- }
-
- }
-
- public static class SourceConverter implements ByteArrayConverter
- {
- public Object readFrom(InputStream in) {
- return new StreamSource(in);
- }
-
- public void writeTo(Object obj, OutputStream out) {
- if(obj instanceof StreamSource)
- {
- StreamSource s = (StreamSource)obj;
- try
- {
- IOUtils.copyStream(out, s.getInputStream());
- }
- catch (IOException e)
- {
- throw new WSException("Failed to convert " + obj.getClass());
- }
- }
- else
- {
- throw new WSException("Unable to convert " + obj.getClass());
- }
- }
- }
-
- public static class StringConverter implements ByteArrayConverter
- {
- public Object readFrom(InputStream in) {
- Object converted = null;
- try
- {
- BufferedReader br = new BufferedReader(new InputStreamReader(in));
- StringBuilder sb = new StringBuilder();
- String line = null;
-
- while ((line = br.readLine()) != null) {
- sb.append(line + "\n");
- }
-
- br.close();
-
- converted = sb.toString();
- }
- catch (IOException e)
- {
- throw new WSException("Failed to convert java.lang.String");
- }
-
- return converted;
- }
-
- public void writeTo(Object obj, OutputStream out) {
- if(obj instanceof String)
- {
- String s = (String)obj;
- try
- {
- out.write(s.getBytes("UTF-8"));
- }
- catch (IOException e)
- {
- throw new WSException("Failed to convert " + obj.getClass());
- }
- }
- else
- {
- throw new WSException("Unable to convert " + obj.getClass());
- }
- }
- }
-
- public static class StreamConverter implements ByteArrayConverter
- {
- public Object readFrom(InputStream in) {
- return in;
- }
-
- public void writeTo(Object obj, OutputStream out) {
- if(obj instanceof InputStream)
- {
- try
- {
- IOUtils.copyStream(out, (InputStream)obj);
- }
- catch (IOException e)
- {
- throw new WSException("Failed to convert " + obj.getClass());
- }
- }
- }
- }
- public interface ByteArrayConverter
- {
- Object readFrom(InputStream in);
- void writeTo(Object obj, OutputStream out);
- }
-
-
-}
Copied: trunk/src/main/java/org/jboss/ws/core/utils/MimeUtils.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/utils/MimeUtils.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/utils/ObjectNameFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/utils/ObjectNameFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/utils/ObjectNameFactory.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,72 +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.core.utils;
-
-import java.util.Hashtable;
-
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-
-/**
- * A simple factory for creating safe object names.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 08-May-2006
- */
-public class ObjectNameFactory
-{
- public static ObjectName create(String name)
- {
- try
- {
- return new ObjectName(name);
- }
- catch (MalformedObjectNameException e)
- {
- throw new Error("Invalid ObjectName: " + name + "; " + e);
- }
- }
-
- public static ObjectName create(String domain, String key, String value)
- {
- try
- {
- return new ObjectName(domain, key, value);
- }
- catch (MalformedObjectNameException e)
- {
- throw new Error("Invalid ObjectName: " + domain + "," + key
+ "," + value + "; " + e);
- }
- }
-
- public static ObjectName create(String domain, Hashtable table)
- {
- try
- {
- return new ObjectName(domain, table);
- }
- catch (MalformedObjectNameException e)
- {
- throw new Error("Invalid ObjectName: " + domain + "," +
table + "; " + e);
- }
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/utils/ObjectNameFactory.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/utils/ObjectNameFactory.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/utils/ThreadLocalAssociation.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/utils/ThreadLocalAssociation.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/utils/ThreadLocalAssociation.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,78 +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.core.utils;
-
-// $Id$
-
-import java.util.Stack;
-
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.extensions.security.SecurityStore;
-
-/**
- * Maintain thread locals at a single point.
- *
- * @author Heiko Braun, <heiko(a)openj.net>
- * @author Thomas.Diesler(a)jboss.com
- * @since 10-Apr-2006
- */
-public class ThreadLocalAssociation
-{
-
- /**
- * Handles invocations on MDB endpoints.
- */
- private static ThreadLocal invokerMDBAssoc = new ThreadLocal();
-
- /**
- * SOAP message context
- * @see org.jboss.ws.core.soap.MessageContextAssociation
- */
- private static ThreadLocal<Stack<CommonMessageContext>> msgContextAssoc =
new ThreadLocal<Stack<CommonMessageContext>>();
-
- /**
- * @see org.jboss.ws.extensions.security.STRTransform
- */
- private static ThreadLocal<SecurityStore> strTransformAssoc = new
ThreadLocal<SecurityStore>();
-
- public static ThreadLocal localInvokerMDBAssoc()
- {
- return invokerMDBAssoc;
- }
-
- public static ThreadLocal<Stack<CommonMessageContext>>
localMsgContextAssoc()
- {
- return msgContextAssoc;
- }
-
- public static ThreadLocal<SecurityStore> localStrTransformAssoc()
- {
- return strTransformAssoc;
- }
-
- public static void clear()
- {
- invokerMDBAssoc.set(null);
- msgContextAssoc.set(null);
- strTransformAssoc.set(null);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/core/utils/ThreadLocalAssociation.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/utils/ThreadLocalAssociation.java)
Deleted: trunk/src/main/java/org/jboss/ws/core/utils/UUIDGenerator.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/utils/UUIDGenerator.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/core/utils/UUIDGenerator.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,121 +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.core.utils;
-
-import java.security.SecureRandom;
-
-/**
- * Generates the string form of IETF variant UUIDs.
- *
- * See <a
href="http://www.ietf.org/internet-drafts/draft-mealling-uuid-urn-05...
- * the latest IETF draft</a> for more information about UUID generation.
- *
- * Currently only pseudo random (type 4) UUIDs are supported.
- *
- * @author <a href="mailto:jason@stacksmash.com">Jason T.
Greene</a>
- */
-public class UUIDGenerator
-{
- private static SecureRandom rand;
-
- private static String bytesToHex(byte[] buffer, int offset, int length)
- {
- long value = 0;
- for (int i = 0, countDown = 8 * length; i < length; i++)
- {
- value |= (buffer[offset + i] & 0xffL) << (countDown -= 8);
- }
-
- return Long.toHexString(value);
- }
-
- /**
- * Generates a pseudo random UUID and returns it in byte array form.
- *
- * @return a UUID byte array in network order
- */
- public static byte[] generateRandomUUIDBytes()
- {
- if (rand == null)
- rand = new SecureRandom();
-
- byte[] buffer = new byte[16];
- rand.nextBytes(buffer);
-
- // Set version to 3 (Random)
- buffer[6] = (byte) ((buffer[6] & 0x0f) | 0x40);
- // Set variant to 2 (IETF)
- buffer[8] = (byte) ((buffer[8] & 0x3f) | 0x80);
-
- return buffer;
- }
-
- /**
- * Generates a pseudo random UUID and returns it the IETF specified
- * String form. See {@link #convertToString(byte[])} for a description
- * of the format.
- *
- * @return a UUID in IETF string form.
- */
- public static String generateRandomUUIDString()
- {
- return convertToString(generateRandomUUIDBytes());
- }
-
- /**
- * Converts a UUID in byte array form to the IETF string format.
- *
- * <p>The BNF follows:
- * <pre>
- * UUID = <time_low> "-" <time_mid>
"-"
- * <time_high_and_version> "-"
- * <variant_and_sequence> "-"
- * <node>
- * time_low = 4*<hexOctet>
- * time_mid = 2*<hexOctet>
- * time_high_and_version = 2*<hexOctet>
- * variant_and_sequence = 2*<hexOctet>
- * node = 6*<hexOctet>
- * hexOctet = <hexDigit><hexDigit>
- * hexDigit =
- * "0" | "1" | "2" | "3" |
"4" | "5" | "6" | "7" | "8" |
"9"
- * | "a" | "b" | "c" | "d" |
"e" | "f"
- * | "A" | "B" | "C" | "D" |
"E" | "F"
- * </pre>
- *
- * @param uuid a 16 byte
- * @return the IETF string form of the passed UUID
- */
- public static String convertToString(byte[] uuid)
- {
- if (uuid.length != 16)
- throw new IllegalArgumentException("A UUID must be 16 bytes!");
-
- String string = bytesToHex(uuid, 0, 4) + "-"
- + bytesToHex(uuid, 4, 2) + "-"
- + bytesToHex(uuid, 6, 2) + "-"
- + bytesToHex(uuid, 8, 2) + "-"
- + bytesToHex(uuid, 10, 6);
-
- return string;
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/core/utils/UUIDGenerator.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/utils/UUIDGenerator.java)
Deleted:
trunk/src/main/java/org/jboss/ws/core/utils/XMLPredefinedEntityReferenceResolver.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/utils/XMLPredefinedEntityReferenceResolver.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/core/utils/XMLPredefinedEntityReferenceResolver.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,123 +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.core.utils;
-
-import java.util.HashMap;
-
-/**
- * Utility class for resolving predefined XML entity and character references.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class XMLPredefinedEntityReferenceResolver
-{
- private static HashMap<String, Character> entities = new HashMap<String,
Character>();
-
- static
- {
- entities.put("quot", '"');
- entities.put("amp", '&');
- entities.put("lt", '<');
- entities.put("gt", '>');
- entities.put("apos", '\'');
- }
-
- private static int resolveCharRef(String source, int pos, StringBuilder builder)
- {
- int radix = 10;
- if (source.charAt(pos += 2) == 'x')
- {
- pos++;
- radix = 16;
- }
-
- int end = source.indexOf(';', pos);
- if (end == -1)
- throw new IllegalArgumentException("Invalid character reference");
-
- int c = Integer.parseInt(source.substring(pos, end), radix);
- builder.append((char) c);
-
- return end + 1;
- }
-
- private static int resolveEntityRef(String source, int pos, StringBuilder builder)
- {
- int end = source.indexOf(';', ++pos);
- if (end == -1)
- throw new IllegalArgumentException("Invalid entity reference");
-
- String entity = source.substring(pos, end);
- Character c = entities.get(entity);
- if (c == null)
- throw new IllegalArgumentException("Invalid entity: " + entity);
-
- builder.append(c.charValue());
-
- return end + 1;
- }
-
- /**
- * Transforms an XML normalized string by resolving all predefined character and
entity references
- *
- * @param normalized an XML normalized string
- * @return a standard java string that is no longer XML normalized
- */
- public static String resolve(String normalized)
- {
- StringBuilder builder = new StringBuilder();
- int end = normalized.length();
- int pos = normalized.indexOf('&');
- int last = 0;
-
- // No references
- if (pos == -1)
- return normalized;
-
- while (pos != -1)
- {
- String sub = normalized.subSequence(last, pos).toString();
- builder.append(sub);
-
- int peek = pos + 1;
- if (peek == end)
- throw new IllegalArgumentException("Invalid entity reference");
-
- if (normalized.charAt(peek) == '#')
- pos = resolveCharRef(normalized, pos, builder);
- else
- pos = resolveEntityRef(normalized, pos, builder);
-
- last = pos;
- pos = normalized.indexOf('&', pos);
- }
-
- if (last < end)
- {
- String sub = normalized.subSequence(last, end).toString();
- builder.append(sub);
- }
-
- return builder.toString();
- }
-}
\ No newline at end of file
Copied:
trunk/src/main/java/org/jboss/ws/core/utils/XMLPredefinedEntityReferenceResolver.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/utils/XMLPredefinedEntityReferenceResolver.java)
Copied: trunk/src/main/java/org/jboss/ws/extensions (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/SomeClass.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/SomeClass.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/SomeClass.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,6 +0,0 @@
-package org.jboss.ws.extensions;
-
-public class SomeClass
-{
-
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/SomeClass.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/SomeClass.java)
Copied: trunk/src/main/java/org/jboss/ws/extensions/addressing (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/addressing/AddressingBuilderImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/AddressingBuilderImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/addressing/AddressingBuilderImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,85 +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.extensions.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: trunk/src/main/java/org/jboss/ws/extensions/addressing/AddressingBuilderImpl.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/AddressingBuilderImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/addressing/AddressingClientUtil.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/AddressingClientUtil.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/addressing/AddressingClientUtil.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,121 +0,0 @@
-package org.jboss.ws.extensions.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.core.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: trunk/src/main/java/org/jboss/ws/extensions/addressing/AddressingClientUtil.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/AddressingClientUtil.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/addressing/AddressingConstantsImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/AddressingConstantsImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/addressing/AddressingConstantsImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,207 +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.extensions.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:
trunk/src/main/java/org/jboss/ws/extensions/addressing/AddressingConstantsImpl.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/AddressingConstantsImpl.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/addressing/AddressingPropertiesImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/AddressingPropertiesImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/addressing/AddressingPropertiesImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,282 +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.extensions.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.AddressingBuilder;
-import javax.xml.ws.addressing.AddressingConstants;
-import javax.xml.ws.addressing.AddressingProperties;
-import javax.xml.ws.addressing.AddressingType;
-import javax.xml.ws.addressing.AttributedURI;
-import javax.xml.ws.addressing.EndpointReference;
-import javax.xml.ws.addressing.ReferenceParameters;
-import javax.xml.ws.addressing.Relationship;
-
-// $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:
trunk/src/main/java/org/jboss/ws/extensions/addressing/AddressingPropertiesImpl.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/AddressingPropertiesImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/addressing/AddressingTypeImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/AddressingTypeImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/addressing/AddressingTypeImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,40 +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.extensions.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: trunk/src/main/java/org/jboss/ws/extensions/addressing/AddressingTypeImpl.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/AddressingTypeImpl.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/addressing/AttributeElementExtensibleImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/AttributeElementExtensibleImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/addressing/AttributeElementExtensibleImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,76 +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.extensions.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:
trunk/src/main/java/org/jboss/ws/extensions/addressing/AttributeElementExtensibleImpl.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/AttributeElementExtensibleImpl.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/addressing/AttributeExtensibleImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/AttributeExtensibleImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/addressing/AttributeExtensibleImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,52 +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.extensions.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:
trunk/src/main/java/org/jboss/ws/extensions/addressing/AttributeExtensibleImpl.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/AttributeExtensibleImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/addressing/AttributedQNameImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/AttributedQNameImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/addressing/AttributedQNameImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,49 +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.extensions.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: trunk/src/main/java/org/jboss/ws/extensions/addressing/AttributedQNameImpl.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/AttributedQNameImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/addressing/AttributedURIImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/AttributedURIImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/addressing/AttributedURIImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,62 +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.extensions.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: trunk/src/main/java/org/jboss/ws/extensions/addressing/AttributedURIImpl.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/AttributedURIImpl.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/addressing/ElementExtensibleImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/ElementExtensibleImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/addressing/ElementExtensibleImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,58 +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.extensions.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: trunk/src/main/java/org/jboss/ws/extensions/addressing/ElementExtensibleImpl.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/ElementExtensibleImpl.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/addressing/EndpointReferenceImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/EndpointReferenceImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/addressing/EndpointReferenceImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -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.extensions.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.core.utils.DOMUtils;
-import org.jboss.ws.core.utils.DOMWriter;
-import org.jboss.ws.extensions.addressing.soap.SOAPAddressingBuilderImpl;
-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: trunk/src/main/java/org/jboss/ws/extensions/addressing/EndpointReferenceImpl.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/EndpointReferenceImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/addressing/MetadataImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/MetadataImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/addressing/MetadataImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,36 +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.extensions.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: trunk/src/main/java/org/jboss/ws/extensions/addressing/MetadataImpl.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/MetadataImpl.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/addressing/ReferenceParametersImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/ReferenceParametersImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/addressing/ReferenceParametersImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,41 +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.extensions.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:
trunk/src/main/java/org/jboss/ws/extensions/addressing/ReferenceParametersImpl.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/ReferenceParametersImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/addressing/RelationshipImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/RelationshipImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/addressing/RelationshipImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,67 +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.extensions.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: trunk/src/main/java/org/jboss/ws/extensions/addressing/RelationshipImpl.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/RelationshipImpl.java)
Copied: trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxrpc (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxrpc)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxrpc/WSAddressingClientHandler.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxrpc/WSAddressingClientHandler.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxrpc/WSAddressingClientHandler.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,130 +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.extensions.addressing.jaxrpc;
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.handler.GenericHandler;
-import javax.xml.rpc.handler.HandlerInfo;
-import javax.xml.rpc.handler.MessageContext;
-import javax.xml.rpc.handler.soap.SOAPMessageContext;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.addressing.AddressingBuilder;
-import javax.xml.ws.addressing.AddressingException;
-import javax.xml.ws.addressing.JAXWSAConstants;
-import javax.xml.ws.addressing.soap.SOAPAddressingBuilder;
-import javax.xml.ws.addressing.soap.SOAPAddressingProperties;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.extensions.addressing.soap.SOAPAddressingPropertiesImpl;
-
-/**
- * A client side handler that reads/writes the addressing properties
- * and puts then into the message context.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 24-Nov-2005
- */
-public class WSAddressingClientHandler extends GenericHandler
-{
- // Provide logging
- private static Logger log = Logger.getLogger(WSAddressingClientHandler.class);
-
- // addressing builder & constants
- private AddressingBuilder addrBuilder;
-
- // should the request be normalized according to the specifications
- private boolean normalize;
-
- public WSAddressingClientHandler()
- {
- addrBuilder = AddressingBuilder.getAddressingBuilder();
- }
-
- public QName[] getHeaders()
- {
- return new QName[] {};
- }
-
- public void init(HandlerInfo handlerInfo)
- {
- super.init(handlerInfo);
- normalize =
"true".equals(handlerInfo.getHandlerConfig().get("normalize"));
-
- }
-
- public boolean handleRequest(MessageContext msgContext)
- {
- log.debug("handleRequest");
-
- SOAPAddressingProperties addrProps =
(SOAPAddressingProperties)msgContext.getProperty(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
-
- if (addrProps != null)
- {
- if (normalize)
- normalizeRequest(msgContext, addrProps);
-
- SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
- addrProps.writeHeaders(soapMessage);
- }
- else
- {
- // supply default addressing properties
- addrProps =
(SOAPAddressingPropertiesImpl)addrBuilder.newAddressingProperties();
- msgContext.setProperty(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND,
addrProps);
-
- if (normalize)
- normalizeRequest(msgContext, addrProps);
- }
-
- return true;
- }
-
- /* supply the default addressing properties in case elements are missing */
- private void normalizeRequest(MessageContext msgContext, SOAPAddressingProperties
addrProps)
- {
- // TODO: supply default header
- }
-
- public boolean handleResponse(MessageContext msgContext)
- {
- log.debug("handleResponse");
-
- try
- {
- SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
- if (soapMessage.getSOAPPart().getEnvelope() != null)
- {
- SOAPAddressingBuilder builder =
(SOAPAddressingBuilder)SOAPAddressingBuilder.getAddressingBuilder();
- SOAPAddressingProperties addrProps =
(SOAPAddressingProperties)builder.newAddressingProperties();
- addrProps.readHeaders(soapMessage);
- msgContext.setProperty(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_INBOUND,
addrProps);
- }
- }
- catch (SOAPException ex)
- {
- throw new AddressingException("Cannot handle response", ex);
- }
-
- return true;
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxrpc/WSAddressingClientHandler.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxrpc/WSAddressingClientHandler.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxrpc/WSAddressingServerHandler.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxrpc/WSAddressingServerHandler.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxrpc/WSAddressingServerHandler.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,179 +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.extensions.addressing.jaxrpc;
-
-import java.net.URISyntaxException;
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.handler.GenericHandler;
-import javax.xml.rpc.handler.HandlerInfo;
-import javax.xml.rpc.handler.MessageContext;
-import javax.xml.rpc.handler.soap.SOAPMessageContext;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.addressing.AddressingBuilder;
-import javax.xml.ws.addressing.JAXWSAConstants;
-import javax.xml.ws.addressing.soap.SOAPAddressingBuilder;
-import javax.xml.ws.addressing.soap.SOAPAddressingProperties;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
-import org.jboss.ws.extensions.addressing.AddressingConstantsImpl;
-import org.jboss.ws.extensions.addressing.metadata.AddressingOpMetaExt;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-
-/**
- * A server side handler that reads/writes the addressing properties
- * and puts then into the message context.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 24-Nov-2005
- */
-public class WSAddressingServerHandler extends GenericHandler
-{
- // Provide logging
- private static Logger log = Logger.getLogger(WSAddressingServerHandler.class);
-
- // should the request be validated?
- private boolean validate = true;
-
- private static AddressingBuilder ADDR_BUILDER;
- private static AddressingConstantsImpl ADDR_CONSTANTS;
- static
- {
- ADDR_CONSTANTS = new AddressingConstantsImpl();
- ADDR_BUILDER = AddressingBuilder.getAddressingBuilder();
- }
-
- public QName[] getHeaders()
- {
- return new QName[] {};
- }
-
- public void init(HandlerInfo handlerInfo)
- {
- super.init(handlerInfo);
- String strValidate =
(String)handlerInfo.getHandlerConfig().get("validate");
- validate = "true".equals(strValidate);
- }
-
- /**
- * Read the addressing headers from the incomming message and put a
- * SOAPAddressingProperties object into the message context
- */
- public boolean handleRequest(MessageContext msgContext)
- {
- log.debug("handleRequest");
-
- SOAPAddressingProperties addrProps =
(SOAPAddressingProperties)ADDR_BUILDER.newAddressingProperties();
- SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
- addrProps.readHeaders(soapMessage);
- msgContext.setProperty(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND,
addrProps);
-
- if (validate)
- validateRequest(addrProps);
-
- return true;
- }
-
- /**
- * Get a SOAPAddressingProperties object from the message context
- * and write the adressing headers
- */
- public boolean handleResponse(MessageContext msgContext)
- {
- log.debug("handleResponse");
- handleResponseOrFault(msgContext, false);
- return true;
- }
-
- /**
- * Get a SOAPAddressingProperties object from the message context
- * and write the adressing headers
- */
- public boolean handleFault(MessageContext msgContext)
- {
- log.debug("handleFault");
- handleResponseOrFault(msgContext, true);
- return true;
- }
-
- private void handleResponseOrFault(MessageContext msgContext, boolean isFault)
- {
- SOAPAddressingBuilder builder =
(SOAPAddressingBuilder)SOAPAddressingBuilder.getAddressingBuilder();
- SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
-
- SOAPAddressingProperties inProps =
(SOAPAddressingProperties)msgContext.getProperty(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
- SOAPAddressingProperties outProps =
(SOAPAddressingProperties)msgContext.getProperty(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND);
-
- if (outProps == null)
- {
- // create new response properties
- outProps = (SOAPAddressingProperties)builder.newAddressingProperties();
- msgContext.setProperty(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND,
outProps);
- }
-
- outProps.initializeAsReply(inProps, isFault);
-
- try
- {
- // supply the response action
-
- OperationMetaData opMetaData =
((SOAPMessageContextJAXRPC)msgContext).getOperationMetaData();
-
- if (!isFault && !opMetaData.isOneWay())
- {
-
- AddressingOpMetaExt addrExt =
(AddressingOpMetaExt)opMetaData.getExtension(ADDR_CONSTANTS.getNamespaceURI());
- if (addrExt != null)
- {
- outProps.setAction(ADDR_BUILDER.newURI(addrExt.getOutboundAction()));
- }
- else
- {
- log.warn("Unable to resolve replyAction for " +
opMetaData.getQName());
- }
-
- }
- else if (isFault)
- {
-
outProps.setAction(ADDR_BUILDER.newURI(ADDR_CONSTANTS.getDefaultFaultAction()));
- }
-
- }
- catch (URISyntaxException e)
- {
- log.error("Error setting response action", e);
- }
-
- outProps.writeHeaders(soapMessage);
- }
-
- /* check wsa formal constraints */
- private void validateRequest(SOAPAddressingProperties addrProps)
- {
-
- // If wsa:ReplyTo is supplied and the message lacks a [message id] property, the
processor MUST fault.
- if (addrProps.getReplyTo() != null && addrProps.getMessageID() == null)
- throw new IllegalArgumentException("wsa:MessageId is required when
wsa:ReplyTo is supplied");
-
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxrpc/WSAddressingServerHandler.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxrpc/WSAddressingServerHandler.java)
Copied: trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxws (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxws)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingClientHandler.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingClientHandler.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingClientHandler.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,115 +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.extensions.addressing.jaxws;
-
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.addressing.AddressingBuilder;
-import javax.xml.ws.addressing.AddressingException;
-import javax.xml.ws.addressing.JAXWSAConstants;
-import javax.xml.ws.addressing.soap.SOAPAddressingBuilder;
-import javax.xml.ws.addressing.soap.SOAPAddressingProperties;
-import javax.xml.ws.handler.MessageContext;
-import javax.xml.ws.handler.soap.SOAPMessageContext;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
-import org.jboss.ws.extensions.addressing.soap.SOAPAddressingPropertiesImpl;
-
-/**
- * A client side handler that reads/writes the addressing properties
- * and puts then into the message context.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 24-Nov-2005
- */
-public class WSAddressingClientHandler extends GenericSOAPHandler
-{
- // Provide logging
- private static Logger log = Logger.getLogger(WSAddressingClientHandler.class);
-
- // addressing builder & constants
- private AddressingBuilder addrBuilder;
-
- // should the request be normalized according to the specifications
- private boolean normalize;
-
- public WSAddressingClientHandler()
- {
- addrBuilder = AddressingBuilder.getAddressingBuilder();
- }
-
- protected boolean handleOutbound(MessageContext msgContext)
- {
- log.debug("handleOutbound");
-
- SOAPAddressingProperties addrProps =
(SOAPAddressingProperties)msgContext.get(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
- if (addrProps != null)
- {
- if (normalize)
- normalizeRequest(msgContext, addrProps);
-
- SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
- addrProps.writeHeaders(soapMessage);
- }
- else
- {
- // supply default addressing properties
- addrProps =
(SOAPAddressingPropertiesImpl)addrBuilder.newAddressingProperties();
- msgContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND,
addrProps);
-
- if (normalize)
- normalizeRequest(msgContext, addrProps);
- }
-
- return true;
- }
-
- protected boolean handleInbound(MessageContext msgContext)
- {
- log.debug("handleInbound");
-
- try
- {
- SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
- if (soapMessage.getSOAPPart().getEnvelope() != null)
- {
- SOAPAddressingBuilder builder =
(SOAPAddressingBuilder)SOAPAddressingBuilder.getAddressingBuilder();
- SOAPAddressingProperties addrProps =
(SOAPAddressingProperties)builder.newAddressingProperties();
- addrProps.readHeaders(soapMessage);
- msgContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_INBOUND,
addrProps);
- }
- }
- catch (SOAPException ex)
- {
- throw new AddressingException("Cannot handle response", ex);
- }
-
- return true;
- }
-
- /* supply the default addressing properties in case elements are missing */
- private void normalizeRequest(MessageContext msgContext, SOAPAddressingProperties
addrProps)
- {
- // TODO: supply default header
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingClientHandler.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingClientHandler.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingServerHandler.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingServerHandler.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingServerHandler.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,156 +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.extensions.addressing.jaxws;
-
-import java.net.URISyntaxException;
-
-import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.addressing.AddressingBuilder;
-import javax.xml.ws.addressing.JAXWSAConstants;
-import javax.xml.ws.addressing.soap.SOAPAddressingBuilder;
-import javax.xml.ws.addressing.soap.SOAPAddressingProperties;
-import javax.xml.ws.handler.MessageContext;
-import javax.xml.ws.handler.soap.SOAPMessageContext;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
-import org.jboss.ws.extensions.addressing.AddressingConstantsImpl;
-import org.jboss.ws.extensions.addressing.metadata.AddressingOpMetaExt;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-
-/**
- * A server side handler that reads/writes the addressing properties
- * and puts then into the message context.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 24-Nov-2005
- */
-public class WSAddressingServerHandler extends GenericSOAPHandler
-{
- // Provide logging
- private static Logger log = Logger.getLogger(WSAddressingServerHandler.class);
-
- private static AddressingBuilder ADDR_BUILDER;
- private static AddressingConstantsImpl ADDR_CONSTANTS;
- static
- {
- ADDR_CONSTANTS = new AddressingConstantsImpl();
- ADDR_BUILDER = AddressingBuilder.getAddressingBuilder();
- }
-
- // should the request be validated?
- private boolean validate = true;
-
- protected boolean handleInbound(MessageContext msgContext)
- {
- log.debug("handleInbound");
-
- SOAPAddressingProperties addrProps =
(SOAPAddressingProperties)ADDR_BUILDER.newAddressingProperties();
- SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
- addrProps.readHeaders(soapMessage);
- msgContext.put(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND, addrProps);
-
- if (validate)
- validateRequest(addrProps);
-
- return true;
- }
-
- protected boolean handleOutbound(MessageContext msgContext)
- {
- log.debug("handleOutbound");
- handleResponseOrFault(msgContext, false);
- return true;
- }
-
- /**
- * Get a SOAPAddressingProperties object from the message context
- * and write the adressing headers
- */
- public boolean handleFault(MessageContext msgContext)
- {
- log.debug("handleFault");
- handleResponseOrFault(msgContext, true);
- return true;
- }
-
- private void handleResponseOrFault(MessageContext msgContext, boolean isFault)
- {
- SOAPAddressingBuilder builder =
(SOAPAddressingBuilder)SOAPAddressingBuilder.getAddressingBuilder();
- SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
-
- SOAPAddressingProperties inProps =
(SOAPAddressingProperties)msgContext.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
- SOAPAddressingProperties outProps =
(SOAPAddressingProperties)msgContext.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND);
-
- if (outProps == null)
- {
- // create new response properties
- outProps = (SOAPAddressingProperties)builder.newAddressingProperties();
- msgContext.put(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND,
outProps);
- }
-
- outProps.initializeAsReply(inProps, isFault);
-
- try
- {
- // supply the response action
-
- OperationMetaData opMetaData =
((CommonMessageContext)msgContext).getOperationMetaData();
-
- if (!isFault && !opMetaData.isOneWay())
- {
-
- AddressingOpMetaExt addrExt =
(AddressingOpMetaExt)opMetaData.getExtension(ADDR_CONSTANTS.getNamespaceURI());
- if (addrExt != null)
- {
- outProps.setAction(ADDR_BUILDER.newURI(addrExt.getOutboundAction()));
- }
- else
- {
- log.warn("Unable to resolve replyAction for " +
opMetaData.getQName());
- }
-
- }
- else if (isFault)
- {
-
outProps.setAction(ADDR_BUILDER.newURI(ADDR_CONSTANTS.getDefaultFaultAction()));
- }
-
- }
- catch (URISyntaxException e)
- {
- log.error("Error setting response action", e);
- }
-
- outProps.writeHeaders(soapMessage);
- }
-
- /* check wsa formal constraints */
- private void validateRequest(SOAPAddressingProperties addrProps)
- {
- // If wsa:ReplyTo is supplied and the message lacks a [message id] property, the
processor MUST fault.
- if (addrProps.getReplyTo() != null && addrProps.getMessageID() == null)
- throw new IllegalArgumentException("wsa:MessageId is required when
wsa:ReplyTo is supplied");
-
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingServerHandler.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingServerHandler.java)
Copied: trunk/src/main/java/org/jboss/ws/extensions/addressing/metadata (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/metadata)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/addressing/metadata/AddressingOpMetaExt.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/metadata/AddressingOpMetaExt.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/addressing/metadata/AddressingOpMetaExt.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,66 +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.extensions.addressing.metadata;
-
-// $Id$
-
-import org.jboss.ws.metadata.umdm.MetaDataExtension;
-
-/**
- * Addressing meta data extensions:
- * <ul>
- * <li>wsa:Action attribute
- * </ul>
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 17-Mar-2006
- */
-public class AddressingOpMetaExt extends MetaDataExtension
-{
- private String inboundAction;
- private String outboundAction;
-
- public AddressingOpMetaExt(String extensionNameSpace)
- {
- super(extensionNameSpace);
- }
-
- public String getInboundAction()
- {
- return inboundAction;
- }
-
- public void setInboundAction(String inboundAction)
- {
- this.inboundAction = inboundAction;
- }
-
- public String getOutboundAction()
- {
- return outboundAction;
- }
-
- public void setOutboundAction(String outboundAction)
- {
- this.outboundAction = outboundAction;
- }
-
-}
Copied:
trunk/src/main/java/org/jboss/ws/extensions/addressing/metadata/AddressingOpMetaExt.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/metadata/AddressingOpMetaExt.java)
Copied: trunk/src/main/java/org/jboss/ws/extensions/addressing/soap (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/soap)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/addressing/soap/SOAPAddressingBuilderImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/soap/SOAPAddressingBuilderImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/addressing/soap/SOAPAddressingBuilderImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,92 +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.extensions.addressing.soap;
-
-//$Id$
-
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import javax.xml.namespace.QName;
-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;
-import javax.xml.ws.addressing.soap.SOAPAddressingBuilder;
-
-import org.jboss.ws.extensions.addressing.AddressingConstantsImpl;
-import org.jboss.ws.extensions.addressing.AddressingTypeImpl;
-import org.jboss.ws.extensions.addressing.AttributedQNameImpl;
-import org.jboss.ws.extensions.addressing.AttributedURIImpl;
-import org.jboss.ws.extensions.addressing.EndpointReferenceImpl;
-import org.jboss.ws.extensions.addressing.RelationshipImpl;
-
-/**
- * Factory for <code>AddressingElements</code>.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 14-Nov-2005
- */
-public class SOAPAddressingBuilderImpl extends SOAPAddressingBuilder
-{
- 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 SOAPAddressingPropertiesImpl();
- }
-
- public AddressingConstants newAddressingConstants()
- {
- return new AddressingConstantsImpl();
- }
-
- public String getNamespaceURI()
- {
- return new AddressingTypeImpl().getNamespaceURI();
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/extensions/addressing/soap/SOAPAddressingBuilderImpl.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/soap/SOAPAddressingBuilderImpl.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/addressing/soap/SOAPAddressingPropertiesImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/soap/SOAPAddressingPropertiesImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/addressing/soap/SOAPAddressingPropertiesImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,337 +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.extensions.addressing.soap;
-
-//$Id$
-
-import java.lang.reflect.Array;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPFactory;
-import javax.xml.soap.SOAPHeader;
-import javax.xml.soap.SOAPHeaderElement;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.addressing.AddressingConstants;
-import javax.xml.ws.addressing.AddressingException;
-import javax.xml.ws.addressing.ReferenceParameters;
-import javax.xml.ws.addressing.Relationship;
-import javax.xml.ws.addressing.soap.SOAPAddressingBuilder;
-import javax.xml.ws.addressing.soap.SOAPAddressingProperties;
-
-import org.jboss.util.NotImplementedException;
-import org.jboss.ws.core.soap.NameImpl;
-import org.jboss.ws.core.soap.SOAPElementImpl;
-import org.jboss.ws.core.soap.SOAPFactoryImpl;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.extensions.addressing.AddressingConstantsImpl;
-import org.jboss.ws.extensions.addressing.AddressingPropertiesImpl;
-import org.jboss.ws.extensions.addressing.EndpointReferenceImpl;
-import org.jboss.xb.binding.NamespaceRegistry;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-
-/**
- * Subimplementation of <code>AddressingProperties</code> includes methods
that
- * read and write the Message Addressing Properties to a
<code>SOAPMessage</code>.
- * All individual properties must implement
<code>SOAPAddressingElement</code>.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 15-Nov-2005
- */
-public class SOAPAddressingPropertiesImpl extends AddressingPropertiesImpl implements
SOAPAddressingProperties
-{
- private static AddressingConstants ADDR = new AddressingConstantsImpl();
-
- private NamespaceRegistry nsRegistry = new NamespaceRegistry();
-
- public void readHeaders(SOAPMessage message) throws AddressingException
- {
- try
- {
- SOAPHeader soapHeader = message.getSOAPHeader();
-
- SOAPAddressingBuilder builder = new SOAPAddressingBuilderImpl();
- AddressingConstants ADDR = builder.newAddressingConstants();
-
- Element wsaAction = DOMUtils.getFirstChildElement(soapHeader,
ADDR.getActionQName());
- if (wsaAction != null)
- {
- // Register wsa namespace
- nsRegistry.registerURI(ADDR.getNamespaceURI(), ADDR.getNamespacePrefix());
-
- // Register namespaces
- NamedNodeMap attribs = soapHeader.getAttributes();
- for (int i = 0; i < attribs.getLength(); i++)
- {
- Attr attr = (Attr)attribs.item(i);
- String attrName = attr.getName();
- String attrValue = attr.getValue();
- if (attrName.startsWith("xmlns:"))
- {
- String prefix = attrName.substring(6);
- nsRegistry.registerURI(attrValue, prefix);
- }
- }
-
- // Read wsa:To
- Element wsaTo = DOMUtils.getFirstChildElement(soapHeader,
ADDR.getToQName());
- if (wsaTo != null)
- {
- String to = DOMUtils.getTextContent(wsaTo);
- setTo(builder.newURI(to));
- }
-
- // Read wsa:From
- Element wsaFrom = DOMUtils.getFirstChildElement(soapHeader,
ADDR.getFromQName());
- if (wsaFrom != null)
- {
- EndpointReferenceImpl ref = new EndpointReferenceImpl(wsaFrom);
- setReplyTo(ref);
- }
-
- // Read wsa:ReplyTo
- Element wsaReplyTo = DOMUtils.getFirstChildElement(soapHeader,
ADDR.getReplyToQName());
- if (wsaReplyTo != null)
- {
- EndpointReferenceImpl ref = new EndpointReferenceImpl(wsaReplyTo);
- setReplyTo(ref);
- }
-
- // Read wsa:FaultTo
- Element wsaFaultTo = DOMUtils.getFirstChildElement(soapHeader,
ADDR.getFaultToQName());
- if (wsaFaultTo != null)
- {
- EndpointReferenceImpl ref = new EndpointReferenceImpl(wsaFaultTo);
- setFaultTo(ref);
- }
-
- // Read wsa:Action
- String action = DOMUtils.getTextContent(wsaAction);
- setAction(builder.newURI(action));
-
- // Read wsa:MessageID
- Element wsaMessageId = DOMUtils.getFirstChildElement(soapHeader,
ADDR.getMessageIDQName());
- if (wsaMessageId != null)
- {
- String messageID = DOMUtils.getTextContent(wsaMessageId);
- setMessageID(builder.newURI(messageID));
- }
-
- // Read wsa:RelatesTo
- Iterator itRelatesTo = DOMUtils.getChildElements(soapHeader,
ADDR.getRelatesToQName());
- List<Relationship> relList = new ArrayList<Relationship>();
- while (itRelatesTo.hasNext())
- {
- Element wsaRelatesTo = (Element)itRelatesTo.next();
- QName type = DOMUtils.getAttributeValueAsQName(wsaRelatesTo,
ADDR.getRelationshipTypeName());
- String uri = DOMUtils.getTextContent(wsaRelatesTo);
- Relationship rel = builder.newRelationship(new URI(uri));
- rel.setType(type);
- relList.add(rel);
- }
- Relationship[] relArr = (Relationship[])Array.newInstance(Relationship.class,
relList.size());
- relList.toArray(relArr);
- setRelatesTo(relArr);
- }
-
- // Read wsa:ReferenceParameters
- QName refQName = new QName(getNamespaceURI(),
"IsReferenceParameter");
- ReferenceParameters refParams = getReferenceParameters();
- Iterator it = soapHeader.examineAllHeaderElements();
- while (it.hasNext())
- {
- SOAPHeaderElement headerElement = (SOAPHeaderElement)it.next();
- if ("true".equals(DOMUtils.getAttributeValue(headerElement,
refQName)))
- {
- refParams.addElement(headerElement);
- }
- }
- }
- catch (SOAPException ex)
- {
- throw new AddressingException("Cannot read headers", ex);
- }
- catch (URISyntaxException ex)
- {
- throw new AddressingException("Cannot read headers", ex);
- }
- }
-
- public void writeHeaders(SOAPMessage message) throws AddressingException
- {
- try
- {
- SOAPFactoryImpl factory = (SOAPFactoryImpl)SOAPFactory.newInstance();
-
- SOAPHeader soapHeader = message.getSOAPHeader();
-
- if (getAction() == null)
- throw new AddressingException("Required addressing property
wsa:Action");
-
- // Add the xmlns:wsa declaration
- soapHeader.addNamespaceDeclaration(ADDR.getNamespacePrefix(),
ADDR.getNamespaceURI());
-
- // Write wsa:To
- if (getTo() != null)
- {
- SOAPElement wsaTo = soapHeader.addChildElement(new
NameImpl(ADDR.getToQName()));
- wsaTo.addTextNode(getTo().getURI().toString());
- }
-
- // Write wsa:From
- if (getFrom() != null)
- {
- EndpointReferenceImpl epr = (EndpointReferenceImpl)getFrom();
- epr.setRootQName(ADDR.getFromQName());
- SOAPElement soapElement = factory.createElement(epr.toElement(), true);
- soapElement.removeNamespaceDeclaration(ADDR.getNamespacePrefix());
- soapHeader.addChildElement(soapElement);
- }
-
- // Write wsa:ReplyTo
- if (getReplyTo() != null)
- {
- EndpointReferenceImpl epr = (EndpointReferenceImpl)getReplyTo();
- epr.setRootQName(ADDR.getReplyToQName());
- SOAPElement soapElement = factory.createElement(epr.toElement(), true);
- soapElement.removeNamespaceDeclaration(ADDR.getNamespacePrefix());
- soapHeader.addChildElement(soapElement);
- }
-
- // Write wsa:FaultTo
- if (getFaultTo() != null)
- {
- EndpointReferenceImpl epr = (EndpointReferenceImpl)getFaultTo();
- epr.setRootQName(ADDR.getFaultToQName());
- SOAPElement soapElement = factory.createElement(epr.toElement(), true);
- soapElement.removeNamespaceDeclaration(ADDR.getNamespacePrefix());
- soapHeader.addChildElement(soapElement);
- }
-
- // Write wsa:Action
- SOAPElement wsaAction = soapHeader.addChildElement(new
NameImpl(ADDR.getActionQName()));
- wsaAction.addTextNode(getAction().getURI().toString());
-
- // Write wsa:MessageID
- if (getMessageID() != null)
- {
- SOAPElement wsaMessageId = soapHeader.addChildElement(new
NameImpl(ADDR.getMessageIDQName()));
- wsaMessageId.addTextNode(getMessageID().getURI().toString());
- }
-
- // Write wsa:RelatesTo
- if (getRelatesTo() != null)
- {
- for (Relationship rel : getRelatesTo())
- {
- SOAPElement wsaRelatesTo = soapHeader.addChildElement(new
NameImpl(ADDR.getRelatesToQName()));
- if (rel.getType() != null)
- {
- wsaRelatesTo.setAttribute(ADDR.getRelationshipTypeName(),
getPrefixedName(rel.getType()));
- }
- wsaRelatesTo.addTextNode(rel.getID().toString());
- }
- }
-
- // Write wsa:ReferenceParameters
- ReferenceParameters refParams = getReferenceParameters();
- if (refParams.getElements().size() > 0 || refParams.getAttributes().size()
> 0)
- {
- SOAPElement wsaRefParams = soapHeader.addChildElement(new
NameImpl(ADDR.getReferenceParametersQName()));
- appendAttributes(wsaRefParams, refParams.getAttributes());
- appendElements(wsaRefParams, refParams.getElements());
- }
-
- appendElements(soapHeader, getElements());
- }
- catch (SOAPException ex)
- {
- throw new AddressingException("Cannot read headers", ex);
- }
- }
-
- public void setMu(boolean mu)
- {
- throw new NotImplementedException();
- }
-
- private void appendAttributes(SOAPElement soapElement, Map<QName, String>
attributes)
- {
- for (QName qname : attributes.keySet())
- {
- String qualname = getPrefixedName(qname);
- String value = attributes.get(qname);
- soapElement.setAttribute(qualname, value);
- }
- }
-
- private void appendElements(SOAPElement soapElement, List<Object> elements)
- {
- try
- {
- SOAPFactoryImpl factory = (SOAPFactoryImpl)SOAPFactory.newInstance();
- for (Object obj : elements)
- {
- if (obj instanceof Element)
- {
- SOAPElementImpl child = factory.createElement((Element)obj, true);
- soapElement.addChildElement(child);
- }
- else if (obj instanceof String)
- {
- Element el = DOMUtils.parse((String)obj);
- SOAPElementImpl child = factory.createElement(el, true);
- soapElement.addChildElement(child);
- }
- else
- {
- throw new AddressingException("Unsupported element: " +
obj.getClass().getName());
- }
- }
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new AddressingException("Cannot append elements", ex);
- }
- }
-
- 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;
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/extensions/addressing/soap/SOAPAddressingPropertiesImpl.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/addressing/soap/SOAPAddressingPropertiesImpl.java)
Copied: trunk/src/main/java/org/jboss/ws/extensions/eventing (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/eventing/EventSourceEndpoint.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/EventSourceEndpoint.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/eventing/EventSourceEndpoint.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -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.extensions.eventing;
-
-// $Id$
-
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-
-import org.jboss.ws.extensions.eventing.element.SubscribeRequest;
-import org.jboss.ws.extensions.eventing.element.SubscribeResponse;
-import org.jboss.ws.extensions.eventing.element.SubscriptionEndRequest;
-
-/**
- * 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: trunk/src/main/java/org/jboss/ws/extensions/eventing/EventSourceEndpoint.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/EventSourceEndpoint.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/eventing/EventSourceEndpointImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/EventSourceEndpointImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/eventing/EventSourceEndpointImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -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.extensions.eventing;
-
-// $Id$
-
-import java.rmi.RemoteException;
-
-import javax.xml.rpc.soap.SOAPFaultException;
-import javax.xml.ws.addressing.AddressingProperties;
-import javax.xml.ws.addressing.AttributedURI;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.extensions.eventing.element.EndpointReference;
-import org.jboss.ws.extensions.eventing.element.SubscribeRequest;
-import org.jboss.ws.extensions.eventing.element.SubscribeResponse;
-import org.jboss.ws.extensions.eventing.element.SubscriptionEndRequest;
-import org.jboss.ws.extensions.eventing.mgmt.Filter;
-import org.jboss.ws.extensions.eventing.mgmt.SubscriptionError;
-import org.jboss.ws.extensions.eventing.mgmt.SubscriptionManagerMBean;
-import org.jboss.ws.extensions.eventing.mgmt.SubscriptionTicket;
-
-/**
- * Event source endpoint implementation.<br>
- * Delegates to {@link org.jboss.ws.extensions.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: trunk/src/main/java/org/jboss/ws/extensions/eventing/EventSourceEndpointImpl.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/EventSourceEndpointImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/eventing/EventingConstants.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/EventingConstants.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/eventing/EventingConstants.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,161 +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.extensions.eventing;
-
-// $Id$
-
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import javax.xml.ws.addressing.AddressingBuilder;
-import javax.xml.ws.addressing.AddressingConstants;
-
-import org.jboss.ws.WSException;
-
-/**
- * @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: trunk/src/main/java/org/jboss/ws/extensions/eventing/EventingConstants.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/EventingConstants.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/eventing/EventingEndpointBase.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/EventingEndpointBase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/eventing/EventingEndpointBase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,99 +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.extensions.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.core.soap.MessageContextAssociation;
-import org.jboss.ws.extensions.eventing.mgmt.SubscriptionManagerFactory;
-import org.jboss.ws.extensions.eventing.mgmt.SubscriptionManagerMBean;
-
-/**
- * @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: trunk/src/main/java/org/jboss/ws/extensions/eventing/EventingEndpointBase.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/EventingEndpointBase.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/eventing/EventingService.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/EventingService.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/eventing/EventingService.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,34 +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.extensions.eventing;
-
-// $Id$
-
-import javax.xml.rpc.Service;
-
-/**
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 24-Nov-2005
- */
-public interface EventingService extends Service
-{
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/eventing/EventingService.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/EventingService.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/eventing/SubscriptionManagerEndpoint.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/SubscriptionManagerEndpoint.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/eventing/SubscriptionManagerEndpoint.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,49 +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.extensions.eventing;
-
-// $Id$
-
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-
-import org.jboss.ws.extensions.eventing.element.RenewRequest;
-import org.jboss.ws.extensions.eventing.element.RenewResponse;
-import org.jboss.ws.extensions.eventing.element.StatusRequest;
-import org.jboss.ws.extensions.eventing.element.StatusResponse;
-import org.jboss.ws.extensions.eventing.element.UnsubscribeRequest;
-
-/**
- * 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:
trunk/src/main/java/org/jboss/ws/extensions/eventing/SubscriptionManagerEndpoint.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/SubscriptionManagerEndpoint.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/eventing/SubscriptionManagerEndpointImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/SubscriptionManagerEndpointImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/eventing/SubscriptionManagerEndpointImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,194 +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.extensions.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.Constants;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.extensions.eventing.element.RenewRequest;
-import org.jboss.ws.extensions.eventing.element.RenewResponse;
-import org.jboss.ws.extensions.eventing.element.StatusRequest;
-import org.jboss.ws.extensions.eventing.element.StatusResponse;
-import org.jboss.ws.extensions.eventing.element.UnsubscribeRequest;
-import org.jboss.ws.extensions.eventing.mgmt.SubscriptionError;
-import org.w3c.dom.Element;
-
-/**
- * SubscriptionManager endpoint implementation.<br>
- * Delegates to {@link org.jboss.ws.extensions.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:
trunk/src/main/java/org/jboss/ws/extensions/eventing/SubscriptionManagerEndpointImpl.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/SubscriptionManagerEndpointImpl.java)
Copied: trunk/src/main/java/org/jboss/ws/extensions/eventing/deployment (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/deployment)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/eventing/deployment/EventingEndpoint.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/deployment/EventingEndpoint.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/eventing/deployment/EventingEndpoint.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,70 +0,0 @@
-package org.jboss.ws.extensions.eventing.deployment;
-
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.server.ServiceEndpoint;
-import org.jboss.ws.core.server.ServiceEndpointInfo;
-import org.jboss.ws.extensions.eventing.EventingConstants;
-import org.jboss.ws.extensions.eventing.metadata.EventingEpMetaExt;
-import org.jboss.ws.extensions.eventing.mgmt.SubscriptionManagerFactory;
-import org.jboss.ws.extensions.eventing.mgmt.SubscriptionManagerMBean;
-import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-
-/**
- * EventingEndpointLifecycle is responsible to create event sources
- * and register them with the subscripion manager when a service endpoint is created.
- *
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 22-Mar-2006
- */
-public class EventingEndpoint extends ServiceEndpoint
-{
- // encupsulates access to subscription manager
- private SubscriptionManagerFactory factory =
SubscriptionManagerFactory.getInstance();
-
- public EventingEndpoint(ServiceEndpointInfo seInfo)
- {
- super(seInfo);
- }
-
- /**
- * Register event source with subscription manager.
- */
- public void create() throws Exception
- {
- super.create();
-
- ServerEndpointMetaData epMetaData = seInfo.getServerEndpointMetaData();
- EventingEpMetaExt ext =
(EventingEpMetaExt)epMetaData.getExtension(EventingConstants.NS_EVENTING);
- if (null == ext)
- throw new WSException("Cannot obtain eventing meta data");
-
- // Currently several endpoints may belong to an event source deployment.
- // Therefore we have to avoid duplicate registrations
- // Actually there should be a 1:n mapping of event source NS to endpoints.
- // See also
http://jira.jboss.org/jira/browse/JBWS-770
-
- // create pending incomplete event source
- EventingEndpointDI desc = new EventingEndpointDI(ext.getEventSourceNS(),
ext.getNotificationSchema());
- desc.setEndpointAddress(epMetaData.getEndpointAddress());
- desc.setPortName(epMetaData.getPortComponentName());
-
- SubscriptionManagerMBean manager = factory.getSubscriptionManager();
- manager.registerEventSource(desc);
- }
-
- /**
- * Unregister event source with subscription manager.
- */
- public void destroy()
- {
- ServerEndpointMetaData epMetaData = seInfo.getServerEndpointMetaData();
- EventingEpMetaExt ext =
(EventingEpMetaExt)epMetaData.getExtension(EventingConstants.NS_EVENTING);
- if (null == ext)
- throw new WSException("Cannot obtain eventing meta data");
-
- SubscriptionManagerMBean manager = factory.getSubscriptionManager();
- manager.removeEventSource(ext.getEventSourceURI());
-
- super.destroy();
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/extensions/eventing/deployment/EventingEndpoint.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/deployment/EventingEndpoint.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/eventing/deployment/EventingEndpointDI.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/deployment/EventingEndpointDI.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/eventing/deployment/EventingEndpointDI.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,72 +0,0 @@
-package org.jboss.ws.extensions.eventing.deployment;
-
-import java.io.IOException;
-
-import org.jboss.ws.core.utils.DOMUtils;
-import org.w3c.dom.Element;
-
-/**
- * Eventsource endpoint deployment info.
- *
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 18-Jan-2006
- */
-public class EventingEndpointDI {
-
- /* event source URI */
- private String name;
-
- /* notification schema */
- private Object schema;
-
- private Element schemaElement;
-
- private String portName;
-
- // event source endpoint address
- private String endpointAddress;
-
- public EventingEndpointDI(String name, Object schema) {
- this.name = name;
- this.schema = schema;
- }
-
- public String getPortName() {
- return portName;
- }
-
- public void setPortName(String portName) {
- this.portName = portName;
- }
-
- public String getName() {
- return name;
- }
-
- public Object getSchema() {
- return schema;
- }
-
- public String getEndpointAddress() {
- return endpointAddress;
- }
-
- public void setEndpointAddress(String endpointAddress) {
- this.endpointAddress = endpointAddress;
- }
-
- Element getSchemaElement() {
- try
- {
- if(null == this.schemaElement)
- this.schemaElement = DOMUtils.parse((String)getSchema());
- }
- catch (IOException e)
- {
- throw new IllegalArgumentException("Failed to parse notification
schema:" +e.getMessage());
- }
-
- return this.schemaElement;
- }
-
-}
Copied:
trunk/src/main/java/org/jboss/ws/extensions/eventing/deployment/EventingEndpointDI.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/deployment/EventingEndpointDI.java)
Copied: trunk/src/main/java/org/jboss/ws/extensions/eventing/element (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/element)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/eventing/element/DeliveryType.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/element/DeliveryType.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/DeliveryType.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,101 +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.extensions.eventing.element;
-
-// $Id$
-
-import java.net.URI;
-
-import javax.xml.soap.SOAPElement;
-
-/**
- * A delivery element states where and how to send notifications.
- * It can contain an EPR where the notifications should be delivered to:
- * <p/>
- * <pre>
- * <wse:Delivery>
- * <wse:NotifyTo>
- * <wsa:Address>
- *
http://www.other.example.com/OnStormWarning
- * </wsa:Address>
- * <wsa:ReferenceParameters>
- * <ew:MySubscription>2597</ew:MySubscription>
- * </wsa:ReferenceParameters>
- * </wse:NotifyTo>
- * </wse:Delivery>
- * </pre>
- * <p/>
- * NOTE: In case the NotifyTo is missing, the subscribers EPR should be used
- * (denoted by soap:Header/wsa:ReplyTo).<p>
- * <p/>
- * The specification defines single delivery mode,
- * Push Mode, which is simple asynchronous messaging.
- *
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 24-Nov-2005
- */
-public class DeliveryType
-{
- private URI mode;
- private SOAPElement[] _any;
- public String _value;
- private EndpointReference notifyTo;
-
- public URI getMode()
- {
- return mode;
- }
-
- public void setMode(URI mode)
- {
- this.mode = mode;
- }
-
- public SOAPElement[] get_any()
- {
- return _any;
- }
-
- public void set_any(SOAPElement[] _any)
- {
- this._any = _any;
- }
-
- public EndpointReference getNotifyTo()
- {
- return notifyTo;
- }
-
- public void setNotifyTo(EndpointReference notifyTo)
- {
- this.notifyTo = notifyTo;
- }
- public String get_value()
- {
- return _value;
- }
-
- public void set_value(String _value)
- {
- this._value = _value;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/eventing/element/DeliveryType.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/element/DeliveryType.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/EndpointReference.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/element/EndpointReference.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/EndpointReference.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,98 +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.extensions.eventing.element;
-
-// $Id$
-
-import java.net.URI;
-
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPFactory;
-
-import org.jboss.ws.core.soap.SOAPFactoryImpl;
-import org.jboss.ws.extensions.addressing.EndpointReferenceImpl;
-import org.jboss.ws.extensions.eventing.EventingConstants;
-
-/**
- * Simplified endpoint representation.
- *
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 29-Nov-2005
- */
-public class EndpointReference
-{
- private URI address;
- private ReferenceParameters referenceParams;
- private MetaData metadata;
-
- public EndpointReference()
- {
- }
-
- public URI getAddress()
- {
- return address;
- }
-
- public void setAddress(URI address)
- {
- this.address = address;
- }
-
- public ReferenceParameters getReferenceParams()
- {
- return referenceParams;
- }
-
- public void setReferenceParams(ReferenceParameters referenceParams)
- {
- this.referenceParams = referenceParams;
- }
-
- public MetaData getMetadata()
- {
- return metadata;
- }
-
- public void setMetadata(MetaData metadata)
- {
- this.metadata = metadata;
- }
-
- public EndpointReferenceImpl toWsaEndpointReference() {
-
- try
- {
- EndpointReferenceImpl epr = new EndpointReferenceImpl(this.address);
- SOAPFactoryImpl factory = (SOAPFactoryImpl) SOAPFactory.newInstance();
- SOAPElement idEl = factory.createElement("Identifier",
"wse", EventingConstants.NS_EVENTING);
- idEl.setValue(this.referenceParams.getIdentifier().toString());
- epr.getReferenceParameters().addElement(idEl);
- return epr;
- }
- catch (SOAPException e)
- {
- throw new RuntimeException(e);
- }
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/EndpointReference.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/element/EndpointReference.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/eventing/element/FilterType.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/element/FilterType.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/FilterType.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,80 +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.extensions.eventing.element;
-
-// $Id$
-
-import java.net.URI;
-
-import javax.xml.soap.SOAPElement;
-
-/**
- * A Boolean expression in some dialect,
- * either as a string or as an XML fragment. If the expression evaluates to false
- * for a notification, the notification MUST NOT be sent to the event sink.
- * <p/>
- * The value must be a XPath predicate expression (PredicateExpr).
- * <p/>
- * <br>
- * For further information see
<
code>http://www.w3.org/TR/xpath#predicates</code>.
- *
- * @see org.jboss.ws.extensions.eventing.mgmt.Filter
- *
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 24-Nov-2005
- */
-public class FilterType
-{
- private URI dialect;
- private SOAPElement[] _any;
- public String _value;
-
- public URI getDialect()
- {
- return dialect;
- }
-
- public void setDialect(URI dialect)
- {
- this.dialect = dialect;
- }
-
- public SOAPElement[] get_any()
- {
- return _any;
- }
-
- public void set_any(SOAPElement[] _any)
- {
- this._any = _any;
- }
-
- public String get_value()
- {
- return _value;
- }
-
- public void set_value(String _value)
- {
- this._value = _value;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/eventing/element/FilterType.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/element/FilterType.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/eventing/element/MetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/element/MetaData.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/eventing/element/MetaData.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,47 +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.extensions.eventing.element;
-
-// $Id$
-
-import javax.xml.soap.SOAPElement;
-
-/**
- * Endpoint meta data.
- *
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 29-Nov-2005
- */
-public class MetaData
-{
- private SOAPElement[] _any;
-
- public SOAPElement[] get_any()
- {
- return _any;
- }
-
- public void set_any(SOAPElement[] _any)
- {
- this._any = _any;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/eventing/element/MetaData.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/element/MetaData.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/ReferenceParameters.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/element/ReferenceParameters.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/ReferenceParameters.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,56 +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.extensions.eventing.element;
-
-// $Id$
-
-import java.net.URI;
-
-/**
- * A hack that makes eventing work without support for xml wildcards.
- *
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 16-Dec-2005
- */
-public class ReferenceParameters
-{
- private URI identifier;
-
- public ReferenceParameters()
- {
- }
-
- public ReferenceParameters(URI identifier)
- {
- this.identifier = identifier;
- }
-
- public URI getIdentifier()
- {
- return identifier;
- }
-
- public void setIdentifier(URI identifier)
- {
- this.identifier = identifier;
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/ReferenceParameters.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/element/ReferenceParameters.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/eventing/element/RenewRequest.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/element/RenewRequest.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/RenewRequest.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -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.extensions.eventing.element;
-
-// $Id$
-
-import java.util.Date;
-
-/**
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 02-Dec-2005
- */
-public class RenewRequest
-{
- private Date expires;
-
- public Date getExpires()
- {
- return expires;
- }
-
- public void setExpires(Date expires)
- {
- this.expires = expires;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/eventing/element/RenewRequest.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/element/RenewRequest.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/eventing/element/RenewResponse.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/element/RenewResponse.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/RenewResponse.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -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.extensions.eventing.element;
-
-// $Id$
-
-import java.util.Date;
-
-/**
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 19-Dec-2005
- */
-public class RenewResponse
-{
- private Date expires;
-
- public Date getExpires()
- {
- return expires;
- }
-
- public void setExpires(Date expires)
- {
- this.expires = expires;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/eventing/element/RenewResponse.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/element/RenewResponse.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/eventing/element/StatusRequest.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/element/StatusRequest.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/StatusRequest.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,41 +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.extensions.eventing.element;
-
-import javax.xml.soap.SOAPElement;
-
-/**
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 19-Dec-2005
- */
-public class StatusRequest
-{
- private SOAPElement _any;
-
- public SOAPElement get_any() {
- return _any;
- }
-
- public void set_any(SOAPElement _any) {
- this._any = _any;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/eventing/element/StatusRequest.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/element/StatusRequest.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/eventing/element/StatusResponse.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/element/StatusResponse.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/StatusResponse.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -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.extensions.eventing.element;
-
-// $Id$
-
-import java.util.Date;
-
-/**
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 19-Dec-2005
- */
-public class StatusResponse
-{
- private Date expires;
-
- public Date getExpires()
- {
- return expires;
- }
-
- public void setExpires(Date expires)
- {
- this.expires = expires;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/eventing/element/StatusResponse.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/element/StatusResponse.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/SubscribeRequest.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/element/SubscribeRequest.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/SubscribeRequest.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,97 +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.extensions.eventing.element;
-
-// $Id$
-
-import java.util.Date;
-
-import javax.xml.soap.SOAPElement;
-
-/**
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 24-Nov-2005
- */
-public class SubscribeRequest
-{
- private EndpointReference endTo;
- private DeliveryType delivery;
- private Date expires;
- private FilterType filter;
-
- private SOAPElement[] _any;
-
- public EndpointReference getEndTo()
- {
- return endTo;
- }
-
- public void setEndTo(EndpointReference endTo)
- {
- this.endTo = endTo;
- }
-
- public org.jboss.ws.extensions.eventing.element.DeliveryType getDelivery()
- {
- return delivery;
- }
-
- public void setDelivery(DeliveryType delivery)
- {
- this.delivery = delivery;
- }
-
- public Date getExpires()
- {
- return expires;
- }
-
- public void setExpires(Date expires)
- {
- this.expires = expires;
- }
-
- public FilterType getFilter()
- {
- return filter;
- }
-
- public void setFilter(FilterType filter)
- {
- this.filter = filter;
- }
-
- public SOAPElement[] get_any()
- {
- return _any;
- }
-
- public void set_any(SOAPElement[] _any)
- {
- this._any = _any;
- }
-
- public String toString()
- {
- return "SubscribeRequest{" + "delivery=" + getDelivery() +
"}";
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/eventing/element/SubscribeRequest.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/element/SubscribeRequest.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/SubscribeResponse.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/element/SubscribeResponse.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/SubscribeResponse.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,57 +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.extensions.eventing.element;
-
-// $Id$
-
-import java.util.Date;
-
-/**
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 24-Nov-2005
- */
-public class SubscribeResponse
-{
- private org.jboss.ws.extensions.eventing.element.EndpointReference
subscriptionManager;
- private Date expires;
-
- public EndpointReference getSubscriptionManager()
- {
- return subscriptionManager;
- }
-
- public void setSubscriptionManager(EndpointReference subscriptionManager)
- {
- this.subscriptionManager = subscriptionManager;
- }
-
- public Date getExpires()
- {
- return expires;
- }
-
- public void setExpires(Date expires)
- {
- this.expires = expires;
- }
-
-}
Copied:
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/SubscribeResponse.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/element/SubscribeResponse.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/SubscriptionEndRequest.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/element/SubscriptionEndRequest.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/SubscriptionEndRequest.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,74 +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.extensions.eventing.element;
-
-// $Id$
-
-import java.net.URI;
-
-import org.jboss.ws.extensions.addressing.EndpointReferenceImpl;
-
-/**
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 25-Nov-2005
- */
-public class SubscriptionEndRequest
-{
- EndpointReferenceImpl subscriptionManager;
- URI code;
- String reason;
-
- public EndpointReferenceImpl getSubscriptionManager()
- {
- return subscriptionManager;
- }
-
- /**
- * todo: remove, since this is one-way op
- *
- * @param subscriptionManager
- */
- public void setSubscriptionManager(EndpointReferenceImpl subscriptionManager)
- {
- this.subscriptionManager = subscriptionManager;
- }
-
- public URI getCode()
- {
- return code;
- }
-
- public void setCode(URI code)
- {
- this.code = code;
- }
-
- public String getReason()
- {
- return reason;
- }
-
- public void setReason(String reason)
- {
- this.reason = reason;
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/SubscriptionEndRequest.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/element/SubscriptionEndRequest.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/UnsubscribeRequest.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/element/UnsubscribeRequest.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/UnsubscribeRequest.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,61 +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.extensions.eventing.element;
-
-// $Id$
-
-import java.net.URI;
-
-import javax.xml.soap.SOAPElement;
-
-/**
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 19-Dec-2005
- */
-public class UnsubscribeRequest
-{
- private URI identifier;
- private SOAPElement _any;
-
- public UnsubscribeRequest() {
- }
-
- public UnsubscribeRequest(URI identifier) {
- this.identifier = identifier;
- }
- public URI getIdentifier()
- {
- return identifier;
- }
-
- public void setIdentifier(URI identifier)
- {
- this.identifier = identifier;
- }
- public SOAPElement get_any() {
- return _any;
- }
-
- public void set_any(SOAPElement _any) {
- this._any = _any;
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/extensions/eventing/element/UnsubscribeRequest.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/element/UnsubscribeRequest.java)
Copied: trunk/src/main/java/org/jboss/ws/extensions/eventing/metadata (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/metadata)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/eventing/metadata/EventingEpMetaExt.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/metadata/EventingEpMetaExt.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/eventing/metadata/EventingEpMetaExt.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,59 +0,0 @@
-package org.jboss.ws.extensions.eventing.metadata;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import org.jboss.ws.metadata.umdm.MetaDataExtension;
-
-/**
- * Eventing specific endpoint meta data extensions.
- *
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 21-Mar-2006
- */
-public class EventingEpMetaExt extends MetaDataExtension {
-
- private boolean isEventSource = true;
- private String eventSourceNS;
- private Object notificationSchema;
-
- public EventingEpMetaExt(String extensionNameSpace) {
- super(extensionNameSpace);
- }
-
- public boolean isEventSource() {
- return isEventSource;
- }
-
- public void setEventSource(boolean eventSource) {
- isEventSource = eventSource;
- }
-
- public String getEventSourceNS() {
- return eventSourceNS;
- }
-
- public void setEventSourceNS(String eventSourceNS) {
- this.eventSourceNS = eventSourceNS;
- }
-
- public URI getEventSourceURI()
- {
- try
- {
- return new URI(eventSourceNS);
- }
- catch (URISyntaxException e)
- {
- throw new IllegalArgumentException("Illegal event source URI: " +
eventSourceNS);
- }
- }
-
- public Object getNotificationSchema() {
- return notificationSchema;
- }
-
- public void setNotificationSchema(Object notificationSchema) {
- this.notificationSchema = notificationSchema;
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/extensions/eventing/metadata/EventingEpMetaExt.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/metadata/EventingEpMetaExt.java)
Copied: trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatchJob.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatchJob.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatchJob.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,62 +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.extensions.eventing.mgmt;
-
-// $Id$
-
-import java.net.URI;
-import java.util.List;
-import java.util.concurrent.ConcurrentMap;
-
-import org.w3c.dom.Element;
-
-/**
- * Event dispatch job implementation.
- */
-public final class DispatchJob implements Runnable
-{
- public Element event;
- public URI eventSourceNS;
- public ConcurrentMap<URI, List<Subscription>> mapping;
-
- public DispatchJob(URI eventSourceNS, Element event, ConcurrentMap<URI,
List<Subscription>> mapping)
- {
- this.event = event;
- this.eventSourceNS = eventSourceNS;
- this.mapping = mapping;
- }
-
- public void run()
- {
- List<Subscription> subscriptions = mapping.get(eventSourceNS);
- for (Subscription s : subscriptions) // iterator is a snapshot
- {
- if (s.accepts(event) && !s.isExpired())
- s.notify(event);
- }
- }
-
- public String toString()
- {
- return "DispatchJob {" + "source=" + eventSourceNS + ",
event=" + event + "}";
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatchJob.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatchJob.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatcherDelegate.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatcherDelegate.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatcherDelegate.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,103 +0,0 @@
-package org.jboss.ws.extensions.eventing.mgmt;
-
-import java.net.URI;
-import java.util.Properties;
-
-import javax.management.MBeanServerConnection;
-import javax.management.MBeanServerInvocationHandler;
-import javax.management.ObjectName;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.naming.Reference;
-import javax.naming.Referenceable;
-import javax.naming.StringRefAddr;
-
-import org.jboss.ws.WSException;
-import org.w3c.dom.Element;
-
-/**
- * Event dispatching delegate that will be bound to JNDI.
- *
- * @see DispatcherFactory
- *
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 11-Jan-2006
- */
-public class DispatcherDelegate implements EventDispatcher, Referenceable
-{
- private String hostname;
- public final static String MANAGER_HOSTNAME = "manager.hostname";
- private SubscriptionManagerMBean subscriptionManager = null;
-
- public DispatcherDelegate()
- {
- }
-
- public DispatcherDelegate(String hostname)
- {
- setHostname(hostname);
- }
-
- public void dispatch(URI eventSourceNS, Element payload)
- {
- getSubscriptionManager().dispatch(eventSourceNS, payload);
- }
-
- public Reference getReference() throws NamingException
- {
-
- Reference myRef = new Reference(DispatcherDelegate.class.getName(),
DispatcherFactory.class.getName(), null);
-
- // let the delegate now where to find the subscription manager
- myRef.add(new StringRefAddr(MANAGER_HOSTNAME, hostname));
-
- return myRef;
- }
-
- private SubscriptionManagerMBean getSubscriptionManager()
- {
- if (null == subscriptionManager)
- {
- try
- {
- ObjectName objectName = SubscriptionManager.OBJECT_NAME;
- subscriptionManager = (SubscriptionManagerMBean)
- MBeanServerInvocationHandler.newProxyInstance(
- getServer(), objectName,
- SubscriptionManagerMBean.class, false
- );
- }
- catch (Exception e)
- {
- throw new WSException("Failed to access subscription manager: " +
e.getMessage());
- }
- }
-
- return subscriptionManager;
- }
-
- private MBeanServerConnection getServer() throws NamingException
- {
- // todo: bypass rmi adapter when used locally
- InitialContext iniCtx = getInitialContext();
- MBeanServerConnection server =
(MBeanServerConnection)iniCtx.lookup("jmx/invoker/RMIAdaptor");
- return server;
- }
-
- private InitialContext getInitialContext() throws NamingException
- {
- Properties env = new Properties();
- env.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
- env.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming.client");
- env.setProperty(Context.PROVIDER_URL,
"jnp://"+hostname+":1099");
- return new InitialContext(env);
- }
-
- void setHostname(String hostname)
- {
- if (null == hostname)
- throw new IllegalArgumentException("Hostname may not be null");
- this.hostname = hostname;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatcherDelegate.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatcherDelegate.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatcherFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatcherFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatcherFactory.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,29 +0,0 @@
-package org.jboss.ws.extensions.eventing.mgmt;
-
-import java.util.Hashtable;
-
-import javax.naming.Context;
-import javax.naming.Name;
-import javax.naming.Reference;
-import javax.naming.spi.ObjectFactory;
-
-/**
- * Creates event dispatcher delegates.
- *
- * @see DispatcherDelegate
- *
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 11-Jan-2006
- */
-public class DispatcherFactory implements ObjectFactory {
- public Object getObjectInstance(Object object, Name name, Context context,
Hashtable<?, ?> hashtable) throws Exception {
-
- Reference ref = (Reference)object;
- String hostname =
(String)ref.get(DispatcherDelegate.MANAGER_HOSTNAME).getContent();
-
- Class cls =
Thread.currentThread().getContextClassLoader().loadClass(ref.getClassName());
- DispatcherDelegate delegate = (DispatcherDelegate)cls.newInstance();
- delegate.setHostname(hostname);
- return delegate;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatcherFactory.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatcherFactory.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/EventDispatcher.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/EventDispatcher.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/EventDispatcher.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,37 +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.extensions.eventing.mgmt;
-
-// $Id$
-
-import java.net.URI;
-
-import org.w3c.dom.Element;
-
-/**
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 07-Dec-2005
- */
-public interface EventDispatcher
-{
- void dispatch(URI eventSourceNS, Element payload);
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/EventDispatcher.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/EventDispatcher.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/EventSource.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/EventSource.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/EventSource.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,131 +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.extensions.eventing.mgmt;
-
-// $Id$
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 02-Dec-2005
- */
-class EventSource implements java.io.Serializable
-{
- enum State
- {
- CREATED, STARTED, STOPED, DESTROYED
- }
-
- private State state;
- private long maxExpirationTime = -1;
-
- private String name;
- private URI nameSpace;
- private String notificationSchema;
-
- private URI managerAddress;
- private List<URI> supportedFilter = new ArrayList<URI>();
-
- public EventSource(String name, URI nameSpace) {
- this.name = name;
- this.nameSpace = nameSpace;
- this.state = State.CREATED;
- }
-
- public EventSource(String name, URI nameSpace, String schema)
- {
- this.name = name;
- this.nameSpace = nameSpace;
- this.notificationSchema = schema;
- this.state = State.CREATED;
- }
-
- State getState()
- {
- return state;
- }
-
- void setState(State state)
- {
- if(state == EventSource.State.STARTED)
- {
- assertConfiguration();
- }
- this.state = state;
- }
-
- private void assertConfiguration() {
- if(this.getManagerAddress() == null)
- throw new IllegalArgumentException("SubscriptionManager address unknown.
Unable to start event source.");
- }
-
- long getMaxExpirationTime()
- {
- return maxExpirationTime;
- }
-
- void setMaxExpirationTime(long maxExpirationTime)
- {
- this.maxExpirationTime = maxExpirationTime;
- }
-
- public List<URI> getSupportedFilterDialects()
- {
- return supportedFilter;
- }
-
- public String getNotificationSchema() {
- return notificationSchema;
- }
-
- public String getName() {
- return name;
- }
-
- public URI getNameSpace() {
- return nameSpace;
- }
-
- public URI getManagerAddress() {
- return managerAddress;
- }
-
- public void setManagerAddress(String managerAddress) {
- try
- {
- if(managerAddress!=null)
- this.managerAddress = new URI(managerAddress);
- }
- catch (URISyntaxException e)
- {
- throw new IllegalArgumentException("Illegal subscription manager endpoint
address: " + e.getMessage());
- }
- }
- public String toString()
- {
- return "EventSource {" + "nameSpace=" + nameSpace + ",
state=" + state + "}";
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/EventSource.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/EventSource.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/EventingBuilder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/EventingBuilder.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/EventingBuilder.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,43 +0,0 @@
-package org.jboss.ws.extensions.eventing.mgmt;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import org.jboss.ws.WSException;
-import org.jboss.ws.extensions.eventing.EventingConstants;
-import org.jboss.ws.extensions.eventing.deployment.EventingEndpointDI;
-
-/**
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 24-Jan-2006
- */
-public class EventingBuilder {
-
- private EventingBuilder() {
- }
-
- public static EventingBuilder createEventingBuilder() {
- return new EventingBuilder();
- }
-
- public EventSource newEventSource(EventingEndpointDI desc) {
- URI eventSourceNS = newEventSourceURI(desc.getName());
- EventSource eventSource = new EventSource(desc.getName(), eventSourceNS,
(String)desc.getSchema());
-
eventSource.getSupportedFilterDialects().add(EventingConstants.getDefaultFilterDialect());
- return eventSource;
- }
-
-
- public URI newEventSourceURI(String name) {
- try
- {
- return new URI(name);
- }
- catch (URISyntaxException e)
- {
- throw new WSException("Failed to create eventsource URI: " +
e.getMessage());
- }
- }
-
-
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/EventingBuilder.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/EventingBuilder.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/Filter.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/Filter.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/Filter.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,61 +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.extensions.eventing.mgmt;
-
-// $Id$
-
-import java.net.URI;
-
-/**
- * A local filter representation.
- *
- * @see org.jboss.ws.extensions.eventing.element.FilterType
- *
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 08-Dec-2005
- */
-public final class Filter
-{
- private URI dialect;
- private String expression;
-
- public Filter(URI dialect, String expression)
- {
- this.dialect = dialect;
- this.expression = expression;
- }
-
- public URI getDialect()
- {
- return dialect;
- }
-
- public String getExpression()
- {
- return expression;
- }
-
- public String toString()
- {
- return "Filter{dialect='" + dialect + "', expr='" +
expression + "'}";
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/Filter.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/Filter.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/Subscription.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/Subscription.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/Subscription.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,221 +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.extensions.eventing.mgmt;
-
-// $Id$
-
-import java.io.ByteArrayInputStream;
-import java.net.URI;
-import java.net.URL;
-import java.util.Date;
-
-import javax.xml.soap.MessageFactory;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.transform.TransformerException;
-
-import org.apache.xpath.XPathAPI;
-import org.apache.xpath.objects.XObject;
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.soap.SOAPConnectionImpl;
-import org.jboss.ws.core.utils.DOMWriter;
-import org.jboss.ws.extensions.eventing.EventingConstants;
-import org.jboss.ws.extensions.eventing.element.EndpointReference;
-import org.w3c.dom.Element;
-
-/**
- * Represents a subscription.
- *
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 05-Jan-2006
- */
-class Subscription
-{
- final private static Logger log = Logger.getLogger(Subscription.class);
-
- final private EndpointReference notifyTo;
- final private EndpointReference endTo;
- private Date expires;
- final private Filter filter;
- final private EndpointReference endpointReference;
- final private URI eventSourceNS;
-
- public Subscription(URI eventSourceNS, EndpointReference endpointReference,
EndpointReference notifyTo, EndpointReference endTo, Date expires, Filter filter)
- {
- this.eventSourceNS = eventSourceNS;
- this.notifyTo = notifyTo;
- this.endTo = endTo; // is optional, can be null
- this.expires = expires;
- this.filter = filter;
- this.endpointReference = endpointReference;
- }
-
- public void notify(Element event)
- {
- log.debug(getIdentifier() + " dispatching " + event);
-
- try
- {
- String eventXML = DOMWriter.printNode(event, false);
- MessageFactory msgFactory = MessageFactory.newInstance();
-
- // notification elements need to declare their namespace locally
- StringBuilder sb = new StringBuilder();
- sb.append("<env:Envelope
xmlns:env='http://www.w3.org/2003/05/soap-envelope' ");
-
sb.append("xmlns:wse='").append(EventingConstants.NS_EVENTING).append("'
");
-
sb.append("xmlns:wsa='").append(EventingConstants.NS_ADDRESSING).append("'>");
- sb.append("<env:Header>");
-
sb.append("<wsa:Action>").append(getNotificationAction()).append("</wsa:Action>");
- // todo: add reference parameters when wildcards are supported
-
sb.append("<wsa:To>").append(notifyTo.getAddress().toString()).append("</wsa:To>");
- sb.append("</env:Header>");
- sb.append("<env:Body>");
- sb.append(eventXML);
- sb.append("</env:Body>");
- sb.append("</env:Envelope>");
-
- SOAPMessage reqMsg = msgFactory.createMessage(null, new
ByteArrayInputStream(sb.toString().getBytes()));
- URL epURL = notifyTo.getAddress().toURL();
- new SOAPConnectionImpl().callOneWay(reqMsg, epURL);
- }
- catch (Exception e)
- {
- // todo: this should get back to manager
- log.error("Failed to send notification message", e);
- }
- }
-
- public boolean accepts(Element event)
- {
-
- boolean b = true;
- if (filter != null)
- {
-
- try
- {
- XObject o = XPathAPI.eval(event, filter.getExpression());
- b = o.bool();
- }
- catch (TransformerException e)
- {
- log.error("Failed to evalute xpath expression", e);
- }
-
- }
- return b;
- }
-
- public void end(String status)
- {
- if (null == endTo) // it's an optional field.
- return;
-
- log.debug("Ending subscription " + getIdentifier());
-
- StringBuffer sb = new StringBuffer();
- sb.append("<env:Envelope
xmlns:env='http://www.w3.org/2003/05/soap-envelope' ");
-
sb.append("xmlns:wse='").append(EventingConstants.NS_EVENTING).append("'
");
-
sb.append("xmlns:wsa='").append(EventingConstants.NS_ADDRESSING).append("'>");
- sb.append("<env:Header>");
-
sb.append("<wsa:Action>").append(EventingConstants.SUBSCRIPTION_END_ACTION).append("</wsa:Action>");
-
sb.append("<wsa:To>").append(endTo.getAddress().toString()).append("</wsa:To>");
- sb.append("</env:Header>");
- sb.append("<env:Body>");
-
- sb.append("<wse:SubscriptionEnd>");
- sb.append("<wse:SubscriptionManager>");
- sb.append("<wsa:Address>");
- sb.append(endpointReference.getAddress().toString());
- sb.append("</wsa:Address>");
- sb.append("<wsa:ReferenceParameters>");
- sb.append("<wse:Identifier>");
- sb.append(getIdentifier().toString());
- sb.append("</wse:Identifier>");
- sb.append("</wsa:ReferenceParameters>");
- sb.append("</wse:SubscriptionManager>");
-
-
sb.append("<wse:Status>").append(status).append("</wse:Status>");
- sb.append("<wse:Reason/>");
- sb.append("</wse:SubscriptionEnd>");
-
- sb.append("</env:Body>");
- sb.append("</env:Envelope>");
-
- try
- {
- MessageFactory msgFactory = MessageFactory.newInstance();
- SOAPMessage reqMsg = msgFactory.createMessage(null, new
ByteArrayInputStream(sb.toString().getBytes()));
- URL epURL = endTo.getAddress().toURL();
- new SOAPConnectionImpl().callOneWay(reqMsg, epURL);
- }
- catch (Exception e)
- {
- log.warn("Failed to send subscription end message", e);
- }
-
- }
-
- private String getNotificationAction()
- {
- return this.eventSourceNS.toString() + "/Notification";
- }
-
- public boolean isExpired()
- {
- return System.currentTimeMillis() > expires.getTime();
- }
-
- public EndpointReference getNotifyTo()
- {
- return notifyTo;
- }
-
- public EndpointReference getEndTo()
- {
- return endTo;
- }
-
- public Date getExpires()
- {
- return expires;
- }
-
- public Filter getFilter()
- {
- return filter;
- }
-
- public EndpointReference getEndpointReference()
- {
- return endpointReference;
- }
-
- public URI getIdentifier()
- {
- return endpointReference.getReferenceParams().getIdentifier();
- }
-
- public void setExpires(Date expires)
- {
- this.expires = expires;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/Subscription.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/Subscription.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionError.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionError.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionError.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,30 +0,0 @@
-package org.jboss.ws.extensions.eventing.mgmt;
-
-/**
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 24-Jan-2006
- */
-public final class SubscriptionError extends Exception {
-
- private String subcode;
- private String reason;
-
- public SubscriptionError(String subscode, String reason) {
- super();
- this.subcode = subscode;
- this.reason = reason;
- }
-
- public String getMessage() {
- return getReason();
- }
-
- public String getSubcode() {
- return subcode;
- }
-
- public String getReason() {
- return reason;
- }
-
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionError.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionError.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManager.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManager.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManager.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,569 +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.extensions.eventing.mgmt;
-
-// $Id$
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
-
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.management.ObjectName;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-import org.jboss.logging.Logger;
-import org.jboss.util.naming.Util;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.utils.ObjectNameFactory;
-import org.jboss.ws.core.utils.UUIDGenerator;
-import org.jboss.ws.extensions.eventing.EventingConstants;
-import org.jboss.ws.extensions.eventing.deployment.EventingEndpointDI;
-import org.jboss.ws.extensions.eventing.element.EndpointReference;
-import org.jboss.ws.extensions.eventing.element.ReferenceParameters;
-import org.w3c.dom.Element;
-
-/**
- * The SubscriptionManager maintains event sources and subscriptions.<br>
- * It is interfaced through the EventSourceEndpoint and SubscriptionManagerEndpoint SOAP
endpoints.
- * <p>
- * Applications can use the EventDispatcher interface to dispatch
- * event messages to subscribers. The current implementation is backed by a
ThreadPoolExecutor,
- * that asynchronously delivers messages to event sink endpoints.
- * It can be configurd through the following attributes:
- * <ul>
- * <li>corePoolSize - average number of idle threads
- * <li>maximumPoolSize - maximum number of threads
- * <li>eventKeepAlive - keep alive before an undelivered event message is
discarded.
- * </ul>
- * Event filtering is supported on subscription level based on XPath expressions.
- * For further information see
<
code>http://www.w3.org/TR/xpath#predicates</code>.
- * <p>
- * Currently only event push is supported.
- *
- * @see org.jboss.ws.extensions.eventing.EventSourceEndpoint
- * @see org.jboss.ws.extensions.eventing.SubscriptionManagerEndpoint
- * @see org.jboss.ws.extensions.eventing.element.FilterType
- *
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 02-Dec-2005
- */
-public class SubscriptionManager implements SubscriptionManagerMBean, EventDispatcher
-{
-
- private static final Logger log = Logger.getLogger(SubscriptionManager.class);
-
- public static final ObjectName OBJECT_NAME =
ObjectNameFactory.create("jboss.ws:service=SubscriptionManager,module=eventing");
-
- /**
- * Maps event source namespaces to event source instances.
- */
- private ConcurrentMap<URI, EventSource> eventSourceMapping = new
ConcurrentHashMap<URI, EventSource>();
-
- /**
- * Maps subscriptions to event sources
- */
- private ConcurrentMap<URI, List<Subscription>> subscriptionMapping = new
ConcurrentHashMap<URI, List<Subscription>>();
-
- /**
- * Buffers notifications. FIFO ordering.
- */
- private BlockingQueue<Runnable> eventQueue = new
LinkedBlockingQueue<Runnable>();
-
- /**
- * Event dispatcher thread pool.
- */
- private ThreadPoolExecutor threadPool;
-
- private boolean isDispatcherBound = false;
-
- /**
- * subscription watchdog that maintains expirations
- */
- private WatchDog watchDog;
-
- private static EventingBuilder builder = EventingBuilder.createEventingBuilder();
-
- public void create() throws Exception
- {
- MBeanServer server = getJMXServer();
- if (server != null)
- {
- log.debug("Create subscription manager");
- server.registerMBean(this, OBJECT_NAME);
- }
- }
-
- public void destroy() throws Exception
- {
- MBeanServer server = getJMXServer();
- if (server != null)
- {
- log.debug("Destroy subscription manager");
- server.unregisterMBean(OBJECT_NAME);
- }
- }
-
- public void start() throws Exception
- {
- log.debug("Start subscription manager");
-
- // setup thread pool
- threadPool = new ThreadPoolExecutor(5, 15, // core/max num threads
- 5000, TimeUnit.MILLISECONDS, // 5 seconds keepalive
- eventQueue);
-
- // start the subscription watchdog
- watchDog = new WatchDog(subscriptionMapping);
- watchDog.startup();
- }
-
- public void stop()
- {
- log.debug("Stop subscription manager");
- try
- {
- // remove event dispatcher
- Util.unbind(new InitialContext(), EventingConstants.DISPATCHER_JNDI_NAME);
-
- // stop thread pool
- threadPool.shutdown();
-
- // stop the watchdog
- watchDog.shutdown();
-
- for (URI eventSourceNS : eventSourceMapping.keySet())
- {
- removeEventSource(eventSourceNS);
- }
- }
- catch (NamingException e)
- {
- // ignore
- }
- }
-
- private static URI generateSubscriptionID()
- {
- try
- {
- return new URI("urn:jbwse:" +
UUIDGenerator.generateRandomUUIDString());
- }
- catch (URISyntaxException e)
- {
- throw new WSException(e.getMessage());
- }
- }
-
- /**
- * A two phase deployment process.
- */
- public void registerEventSource(EventingEndpointDI deploymentInfo)
- {
- // workaround for JBWS-1006
- lazyBindEventDispatcher();
-
- EventSource eventSource = builder.newEventSource(deploymentInfo);
- if (eventSourceMapping.containsKey(eventSource.getNameSpace()) == false)
- {
- eventSourceMapping.put(eventSource.getNameSpace(), eventSource);
- updateManagerAddress(deploymentInfo, eventSource);
-
- eventSource.setState(EventSource.State.CREATED);
- log.debug("Created: " + eventSource);
- }
- else
- {
- eventSource = eventSourceMapping.get(eventSource.getNameSpace());
- updateManagerAddress(deploymentInfo, eventSource);
- subscriptionMapping.put(eventSource.getNameSpace(), new
CopyOnWriteArrayList<Subscription>());
-
- eventSource.setState(EventSource.State.STARTED);
- log.debug("Started: " + eventSource);
- }
- }
-
- private void lazyBindEventDispatcher()
- {
- if(!isDispatcherBound)
- {
- try
- {
- // bind dispatcher to JNDI
- Util.rebind(new InitialContext(), EventingConstants.DISPATCHER_JNDI_NAME, new
DispatcherDelegate("localhost"));
- log.info("Bound event dispatcher to java:/" +
EventingConstants.DISPATCHER_JNDI_NAME);
- isDispatcherBound = true;
- }
- catch (NamingException e)
- {
- throw new WSException("Unable to bind EventDispatcher ", e);
- }
- }
- }
-
- /**
- * the of deployment info's is unknown therefore we try to
- * update the event source manager EPR anytime.
- * @param deploymentInfo
- * @param eventSource
- */
- private static void updateManagerAddress(EventingEndpointDI deploymentInfo,
EventSource eventSource)
- {
- String addr = null;
- if(deploymentInfo.getPortName().equals("SubscriptionManagerPort")) //
hackalert
- addr = deploymentInfo.getEndpointAddress();
-
- if(addr!=null)
- eventSource.setManagerAddress(addr);
- }
-
- public void removeEventSource(URI eventSourceNS)
- {
- if (eventSourceMapping.containsKey(eventSourceNS))
- {
- List<Subscription> subscriptions =
subscriptionMapping.get(eventSourceNS);
- for (Subscription s : subscriptions) // iterator is a snapshot
- {
- s.end(EventingConstants.SOURCE_SHUTTING_DOWN);
- }
-
- subscriptions.clear();
- eventSourceMapping.remove(eventSourceNS);
- log.debug("Event source " + eventSourceNS + " removed");
- }
- }
-
- /**
- * Subscribe to an event source.
- */
- public SubscriptionTicket subscribe(URI eventSourceNS, EndpointReference notifyTo,
EndpointReference endTo, Date expires, Filter filter) throws SubscriptionError
- {
-
- log.debug("Subscription request for " + eventSourceNS);
-
- EventSource eventSource = eventSourceMapping.get(eventSourceNS);
- if (null == eventSource)
- throw new SubscriptionError(EventingConstants.CODE_UNABLE_TO_PROCESS,
"EventSource '" + eventSourceNS + "' not registered");
-
- // expiry constraints
- if (expires != null)
- {
- assertLeaseConstraints(expires);
- }
- else
- {
- expires = new Date((System.currentTimeMillis() +
EventingConstants.DEFAULT_LEASE));
- }
-
- // filter constraints
- if (filter != null)
- {
- if (eventSource.getSupportedFilterDialects().isEmpty())
- throw new SubscriptionError(EventingConstants.CODE_FILTER_NOT_SUPPORTED,
"Filtering is not supported.");
- else
- {
- boolean filterAvailable = false;
- for (URI supportedDialect : eventSource.getSupportedFilterDialects())
- {
- if (filter.getDialect().equals(supportedDialect))
- {
- filterAvailable = true;
- break;
- }
- }
-
- if (!filterAvailable)
- throw new
SubscriptionError(EventingConstants.CODE_REQUESTED_FILTER_UNAVAILABLE, "The requested
filter dialect is not supported.");
- }
- }
-
- // create subscription
- EndpointReference endpointReference = new EndpointReference();
- endpointReference.setAddress(eventSource.getManagerAddress());
- endpointReference.setReferenceParams(new
ReferenceParameters(generateSubscriptionID()));
-
- Subscription subscription = new Subscription(eventSource.getNameSpace(),
endpointReference, notifyTo, endTo, expires, filter);
-
- subscriptionMapping.get(eventSourceNS).add(subscription);
- log.debug("Registered subscription " + subscription.getIdentifier());
-
- return new SubscriptionTicket(endpointReference, subscription.getExpires());
- }
-
- private void assertLeaseConstraints(Date expireDate) throws SubscriptionError
- {
- long expires = expireDate.getTime() - System.currentTimeMillis();
- if (expires < 0 || EventingConstants.MAX_LEASE_TIME < expires)
- throw new SubscriptionError(EventingConstants.CODE_INVALID_EXPIRATION_TIME,
"The expiration time requested is invalid: " + expires + "ms");
- }
-
- /**
- * Renew a subscription.
- *
- * @param identifier
- * @param lease
- * @return the new lease date
- * @throws SubscriptionError
- */
- public Date renew(URI identifier, Date lease) throws SubscriptionError
- {
- Subscription subscription = subscriberForID(identifier);
- if (null == subscription)
- throw new SubscriptionError(EventingConstants.CODE_UNABLE_TO_RENEW,
"Subscription " + identifier + " does not exist");
-
- if (lease != null)
- assertLeaseConstraints(lease);
- else lease = new Date((System.currentTimeMillis() +
EventingConstants.DEFAULT_LEASE));
-
- subscription.setExpires(lease);
- return lease;
- }
-
- /**
- * Get status for subscription.
- *
- * @param identifier
- * @return the actual lease date.
- * @throws SubscriptionError when the subscriber does not exist
- */
- public final Date getStatus(URI identifier) throws SubscriptionError
- {
- Subscription subscription = subscriberForID(identifier);
- if (null == subscription)
- throw new SubscriptionError(EventingConstants.CODE_UNABLE_TO_PROCESS,
"Subscription " + identifier + " does not exist");
-
- return subscription.getExpires();
- }
-
- /**
- * Release a subscription.
- *
- * @param identifier
- * @throws SubscriptionError when the subscriber does not exist
- */
- public void unsubscribe(URI identifier) throws SubscriptionError
- {
- for (List<Subscription> subscriptions : subscriptionMapping.values())
- {
- for (Subscription s : subscriptions)
- {
- if (identifier.equals(s.getIdentifier()))
- {
- subscriptions.remove(s);
- log.debug("Removed subscription " + s);
- break;
- }
- }
- }
- }
-
- public String showEventsourceTable()
- {
-
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
-
- pw.println("<h3>Deployed Eventsources</h3>");
-
- pw.println("<table>");
-
pw.println("<tr><td>Name</td><td>NS</td></tr>");
-
- for (EventSource source : eventSourceMapping.values())
- {
- pw.println("<tr><td>" + source.getName() +
"</td><td>" + source.getNameSpace() +
"</td></tr>");
- }
-
- pw.println("</table>");
- pw.close();
-
- return sw.toString();
- }
-
- public String showSubscriptionTable()
- {
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
-
- pw.println("<h3>Registered Subscriptions</h3>");
-
- pw.println("<table>");
-
pw.println("<tr><td>Identifier</td><td>Expires</td><td>Filter</td></tr>");
-
- for (List<Subscription> subscriptions : subscriptionMapping.values())
- {
- for (Subscription s : subscriptions)
- {
- pw.println("<tr><td>" + s.getIdentifier() +
"</td><td>" + s.getExpires() + "</td><td>" +
s.getFilter().getExpression() + "</td></tr>");
- }
- }
- pw.println("</table>");
- pw.close();
-
- return sw.toString();
- }
-
- private Subscription subscriberForID(URI id)
- {
- Subscription subscription = null;
- for (List<Subscription> subscriptions : subscriptionMapping.values())
- {
- for (Subscription s : subscriptions)
- {
- if (id.equals(s.getIdentifier()))
- {
- subscription = s;
- break;
- }
- }
- }
- return subscription;
- }
-
- public void dispatch(URI eventSourceNS, Element payload)
- {
- DispatchJob dispatchJob = new DispatchJob(eventSourceNS, payload,
subscriptionMapping);
- threadPool.execute(dispatchJob);
- }
-
- // ----------------------------------------------------------------------
- // MBean support
-
- public int getCorePoolSize()
- {
- return threadPool.getCorePoolSize();
- }
-
- public int getMaximumPoolSize()
- {
- return threadPool.getMaximumPoolSize();
- }
-
- public int getLargestPoolSize()
- {
- return threadPool.getLargestPoolSize();
- }
-
- public int getActiveCount()
- {
- return threadPool.getActiveCount();
- }
-
- public long getCompletedTaskCount()
- {
- return threadPool.getCompletedTaskCount();
- }
-
- public void setCorePoolSize(int corePoolSize)
- {
- threadPool.setCorePoolSize(corePoolSize);
- }
-
- public void setMaxPoolSize(int maxPoolSize)
- {
- threadPool.setMaximumPoolSize(maxPoolSize);
- }
-
- public void setEventKeepAlive(long millies)
- {
- threadPool.setKeepAliveTime(millies, TimeUnit.MILLISECONDS);
- }
-
- /**
- * The watchdog maintains subscription expirations.
- */
- private class WatchDog implements Runnable
- {
-
- private ConcurrentMap<URI, List<Subscription>> subscriptions;
- private boolean active = true;
- private Thread worker;
-
- public WatchDog(ConcurrentMap<URI, List<Subscription>> subscriptions)
- {
- this.subscriptions = subscriptions;
- }
-
- public void run()
- {
- while (active)
- {
-
- for (List<Subscription> subscriptions : subscriptionMapping.values())
- {
- for (Subscription s : subscriptions)
- {
- if (s.isExpired())
- {
- s.end(EventingConstants.SOURCE_CANCELING);
- subscriptions.remove(s);
- }
- }
- }
-
- try
- {
- Thread.sleep(1000 * 60);
- }
- catch (InterruptedException e)
- {
- log.error(e);
- }
- }
- }
-
- public void startup()
- {
- worker = new Thread(this, "SubscriptionWatchDog");
- worker.start();
- }
-
- public void shutdown()
- {
- this.active = false;
- }
-
- }
-
- private MBeanServer getJMXServer()
- {
- MBeanServer server = null;
- ArrayList servers = MBeanServerFactory.findMBeanServer(null);
- if (servers.size() > 0)
- {
- server = (MBeanServer)servers.get(0);
- }
- return server;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManager.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManager.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManagerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManagerFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManagerFactory.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,31 +0,0 @@
-package org.jboss.ws.extensions.eventing.mgmt;
-
-import org.jboss.kernel.spi.registry.KernelRegistry;
-import org.jboss.kernel.spi.registry.KernelRegistryEntry;
-import org.jboss.ws.core.server.KernelLocator;
-
-/**
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 22-Mar-2006
- */
-public class SubscriptionManagerFactory
-{
- private static SubscriptionManagerFactory instance = new
SubscriptionManagerFactory();
-
- // Hide ctor
- protected SubscriptionManagerFactory()
- {
- }
-
- public static SubscriptionManagerFactory getInstance()
- {
- return instance;
- }
-
- public SubscriptionManagerMBean getSubscriptionManager()
- {
- KernelRegistry registry = KernelLocator.getKernel().getRegistry();
- KernelRegistryEntry entry = registry.getEntry(SubscriptionManagerMBean.BEAN_NAME);
- return (SubscriptionManagerMBean)entry.getTarget();
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManagerFactory.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManagerFactory.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManagerMBean.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManagerMBean.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManagerMBean.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,101 +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.extensions.eventing.mgmt;
-
-// $Id$
-
-import java.net.URI;
-import java.util.Date;
-
-import org.jboss.ws.extensions.eventing.deployment.EventingEndpointDI;
-import org.jboss.ws.extensions.eventing.element.EndpointReference;
-import org.w3c.dom.Element;
-
-/**
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 12-Dec-2005
- */
-public interface SubscriptionManagerMBean
-{
- public static final String BEAN_NAME = "SubscriptionManager";
-
- /**
- * Returns the core number of threads.
- *
- * @return long
- */
- int getCorePoolSize();
-
- /**
- * Returns the maximum allowed number of threads.
- *
- * @return int
- */
- int getMaximumPoolSize();
-
- /**
- * Returns the largest number of threads that have ever simultaneously been in the
pool.
- *
- * @return int
- */
- int getLargestPoolSize();
-
- /**
- * Returns the approximate number of threads that are actively executing tasks.
- *
- * @return int
- */
- int getActiveCount();
-
- /**
- * Returns the approximate total number of tasks that have completed execution.
- *
- * @return long
- */
- long getCompletedTaskCount();
-
- public void setCorePoolSize(int corePoolSize);
-
- public void setMaxPoolSize(int maxPoolSize);
-
- public void setEventKeepAlive(long millies);
-
- // subscription endpointReference business
- SubscriptionTicket subscribe(URI eventSourceNS, EndpointReference notifyTo,
EndpointReference endTo, Date expires, Filter filter) throws SubscriptionError;
-
- Date renew(URI identifier, Date lease) throws SubscriptionError;
-
- Date getStatus(URI identifier) throws SubscriptionError;
-
- void unsubscribe(URI identifier) throws SubscriptionError;
-
- // notification API
- void dispatch(URI eventSourceNS, Element payload);
-
- void registerEventSource(EventingEndpointDI deploymentInfo);
-
- void removeEventSource(URI eventSourceNS);
-
- String showSubscriptionTable();
-
- String showEventsourceTable();
-}
Copied:
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManagerMBean.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManagerMBean.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionTicket.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionTicket.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionTicket.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,63 +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.extensions.eventing.mgmt;
-
-// $Id$
-
-import java.net.URI;
-import java.util.Date;
-
-import org.jboss.ws.extensions.eventing.element.EndpointReference;
-
-/**
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 02-Dec-2005
- */
-public final class SubscriptionTicket
-{
-
- private URI identifier;
- private EndpointReference subscriptionManager;
- private Date expires;
-
- public SubscriptionTicket(EndpointReference subscriptionManager, Date expires)
- {
- this.identifier = subscriptionManager.getReferenceParams().getIdentifier();
- this.subscriptionManager = subscriptionManager;
- this.expires = expires;
- }
-
- public URI getIdentifier()
- {
- return identifier;
- }
-
- public org.jboss.ws.extensions.eventing.element.EndpointReference
getSubscriptionManager()
- {
- return subscriptionManager;
- }
-
- public Date getExpires()
- {
- return expires;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionTicket.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionTicket.java)
Copied: trunk/src/main/java/org/jboss/ws/extensions/policy (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/policy)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/policy/Policy.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/policy/Policy.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/policy/Policy.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,182 +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.extensions.policy;
-
-// $Id$
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.core.utils.DOMWriter;
-import org.jboss.xb.binding.NamespaceRegistry;
-import org.w3c.dom.Element;
-
-/**
- * At the abstract level a policy is a potentially empty collection of policy
alternatives. A
- * policy with zero alternatives contains no choices; a policy with one or more
alternatives
- * indicates choice in requirements (or capabilities) within the policy.
- *
- * Alternatives are not ordered, and thus aspects such as preferences between
alternatives
- * in a given context are beyond the scope of this specification.
- *
- * Alternatives within a policy may differ significantly in terms of the behaviors they
- * indicate. Conversely, alternatives within a policy may be very similar. In either
case, the
- * value or suitability of an alternative is generally a function of the semantics of
assertions
- * within the alternative.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 13-Nov-2005
- */
-public class Policy
-{
- public static final String URI_POLICY =
"http://schemas.xmlsoap.org/ws/2004/09/policy";
- public static final String URI_SECURITY_UTILITY =
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
-
- // The target namespace
- private String targetNamespace;
- // The optional base URI
- private String baseURI;
- // The optional ID
- private String id;
- // The policy alternatives
- private Collection<PolicyAlternative> alternatives = new
ArrayList<PolicyAlternative>();
- // The namespace registry for the policy
- private NamespaceRegistry nsRegistry = new NamespaceRegistry();
-
- // Hide constructor
- Policy()
- {
- }
-
- public NamespaceRegistry getNamespaceRegistry()
- {
- return nsRegistry;
- }
-
- public String getTargetNamespace()
- {
- return targetNamespace;
- }
-
- public void setTargetNamespace(String targetNamespace)
- {
- this.targetNamespace = targetNamespace;
- }
-
- public String getBaseURI()
- {
- return baseURI;
- }
-
- public void setBaseURI(String baseURI)
- {
- this.baseURI = baseURI;
- }
-
- public String getID()
- {
- return id;
- }
-
- public void setID(String id)
- {
- this.id = id;
- }
-
- public void addPolicyAlternative(PolicyAlternative polAlternative)
- {
- alternatives.add(polAlternative);
- }
-
- public Collection<PolicyAlternative> getPolicyAlternatives()
- {
- return new ArrayList<PolicyAlternative>(alternatives);
- }
-
- 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 elPolicy = toElement();
- return DOMWriter.printNode(elPolicy, true);
- }
-
- StringBuilder xmlBuffer = new StringBuilder("<wsp:Policy");
-
- Iterator it = nsRegistry.getRegisteredURIs();
- while (it.hasNext())
- {
- String nsURI = (String)it.next();
- String prefix = nsRegistry.getPrefix(nsURI);
- xmlBuffer.append(" xmlns:" + prefix + "='" + nsURI +
"'");
- }
-
- if (id != null)
- {
- xmlBuffer.append(" xmlns:wsu='" + URI_SECURITY_UTILITY +
"'");
- xmlBuffer.append(" wsu:Id='" + id + "'");
- }
- if (baseURI != null)
- {
- xmlBuffer.append(" xml:base='" + baseURI + "'");
- }
- if (targetNamespace != null)
- {
- xmlBuffer.append(" TargetNamespace='" + targetNamespace +
"'");
- }
- xmlBuffer.append(">");
-
- xmlBuffer.append("<wsp:ExactlyOne>");
- for (PolicyAlternative polAlternative : alternatives)
- {
- xmlBuffer.append(polAlternative.toXMLString(false));
- }
- xmlBuffer.append("</wsp:ExactlyOne>");
-
- xmlBuffer.append("</wsp:Policy>");
-
- String xmlString = xmlBuffer.toString();
- return xmlString;
- }
-
- public String toString()
- {
- return toXMLString(true);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/policy/Policy.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/policy/Policy.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/policy/PolicyAlternative.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/policy/PolicyAlternative.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/policy/PolicyAlternative.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,125 +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.extensions.policy;
-
-//$Id$
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.core.utils.DOMWriter;
-import org.w3c.dom.Element;
-
-/**
- * A policy alternative is a potentially empty collection of policy assertions. An
alternative
- * with zero assertions indicates no behaviors. An alternative with one or more
assertions
- * indicates behaviors implied by those, and only those assertions.
- *
- * The vocabulary of a policy alternative is the set of all assertion types within the
- * alternative. The vocabulary of a policy is the set of all assertion types used in the
policy.
- * An assertion whose type is part of the policy's vocabulary but is not included in
an
- * alternative is explicitly prohibited by the alternative.
- *
- * Assertions within an alternative are not ordered, and thus aspects such as the order
in
- * which behaviors (indicated by assertions) are applied to a subject are beyond the
scope
- * of this specification.
- *
- * A policy alternative MAY contain multiple instances of an assertion type. Mechanisms
for
- * determining the aggregate behavior indicated by the assertion instances (and their
Post-
- * Schema-Validation Infoset (PSVI) content, if any) are specific to the assertion type.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 13-Nov-2005
- */
-public class PolicyAlternative
-{
- private Collection<PolicyAssertion> assertions = new
ArrayList<PolicyAssertion>();
-
- // Hide constructor
- PolicyAlternative()
- {
- }
-
- static PolicyAlternative parse(Element elAll)
- {
- // Work with a cloned copy, so parsing does not effect in input node
- elAll = (Element)elAll.cloneNode(true);
-
- PolicyAlternative all = new PolicyAlternative();
- Iterator it = DOMUtils.getChildElements(elAll);
- while (it.hasNext())
- {
- Element el = (Element)it.next();
- all.addPolicyAssertion(new PolicyAssertion(el));
- }
- return all;
- }
-
- public void addPolicyAssertion(PolicyAssertion polAssertion)
- {
- assertions.add(polAssertion);
- }
-
- public Collection<PolicyAssertion> getPolicyAssertions()
- {
- return new ArrayList<PolicyAssertion>(assertions);
- }
-
- 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 elAll = toElement();
- return DOMWriter.printNode(elAll, true);
- }
-
- StringBuilder xmlBuffer = new StringBuilder("<wsp:All>");
- for (PolicyAssertion assertion : assertions)
- {
- xmlBuffer.append(assertion.toXMLString(false));
- }
- xmlBuffer.append("</wsp:All>");
- return xmlBuffer.toString();
- }
-
- public String toString()
- {
- return toXMLString(true);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/policy/PolicyAlternative.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/policy/PolicyAlternative.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/policy/PolicyAssertion.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/policy/PolicyAssertion.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/policy/PolicyAssertion.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,76 +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.extensions.policy;
-
-//$Id$
-
-import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.core.utils.DOMWriter;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- * A policy assertion identifies a behavior that is a requirement (or capability) of a
policy
- * subject. Assertions indicate domain-specific (e.g., security, transactions) semantics
and
- * are expected to be defined in separate, domain-specific specifications.
- *
- * Assertions are strongly typed. The type is identified only by the XML Infoset
- * [namespace name] and [local name] properties (that is, the qualified name or
- * QName) of the root Element Information Item representing the assertion. Assertions of
- * a given type MUST be consistently interpreted independent of their policy subjects.
- *
- * The XML Infoset of an assertion MAY contain a non-empty [attributes] property and/or
- * a non-empty [children] property. Such content MAY be used to parameterize the
- * behavior indicated by the assertion. For example, an assertion identifying support for
a
- * specific reliable messaging mechanism might include an Attribute Information Item to
- * indicate how long an endpoint will wait before sending an acknowledgement. However,
- * additional assertion content is not required when the identity of the root Element
- * Information Item alone is enough to convey the requirement (capability).
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 13-Nov-2005
- */
-public class PolicyAssertion
-{
- private Element assertionElement;
-
- PolicyAssertion(Element element)
- {
- Document doc = DOMUtils.getOwnerDocument();
- this.assertionElement = (Element)doc.adoptNode(element);
- }
-
- public Element getElement()
- {
- return assertionElement;
- }
-
- public String toXMLString(boolean pretty)
- {
- return DOMWriter.printNode(assertionElement, pretty);
- }
-
- public String toString()
- {
- return toXMLString(true);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/policy/PolicyAssertion.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/policy/PolicyAssertion.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/policy/PolicyFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/policy/PolicyFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/policy/PolicyFactory.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,116 +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.extensions.policy;
-
-// $Id$
-
-import java.io.IOException;
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-
-/**
- * A factory for Policy construction
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 13-Nov-2005
- */
-public class PolicyFactory
-{
- // PolicyFactory Singelton
- private static PolicyFactory factory = new PolicyFactory();
-
- // Hide constructor
- private PolicyFactory()
- {
- }
-
- public static PolicyFactory newInstance()
- {
- return factory;
- }
-
- public Policy createPolicy(String strPolicy)
- {
- try
- {
- return createPolicy(DOMUtils.parse(strPolicy));
- }
- catch (IOException ex)
- {
- throw new IllegalArgumentException("Cannot parse: " + strPolicy, ex);
- }
- }
-
- public Policy createPolicy(Element elPolicy)
- {
- // Work with a cloned copy, so parsing does not effect in input node
- elPolicy = (Element)elPolicy.cloneNode(true);
-
- Policy policy = new Policy();
- policy.setTargetNamespace(DOMUtils.getAttributeValue(elPolicy,
"TargetNamespace"));
- policy.setBaseURI(DOMUtils.getAttributeValue(elPolicy, "xml:base"));
- policy.setID(DOMUtils.getAttributeValue(elPolicy, new
QName(Policy.URI_SECURITY_UTILITY, "Id")));
-
- // Register namespaces
- NamedNodeMap attribs = elPolicy.getAttributes();
- for (int i = 0; i < attribs.getLength(); i++)
- {
- Attr attr = (Attr)attribs.item(i);
- String attrName = attr.getName();
- String attrValue = attr.getValue();
- if (attrName.startsWith("xmlns:"))
- {
- String prefix = attrName.substring(6);
- policy.getNamespaceRegistry().registerURI(attrValue, prefix);
- }
- }
-
- // Parse wsp:ExactlyOne
- QName oneQName = new QName(Policy.URI_POLICY, "ExactlyOne");
- Element elExactlyOne = DOMUtils.getFirstChildElement(elPolicy, oneQName);
- if (elExactlyOne == null)
- throw new WSException("Cannot find child element: " + oneQName);
-
- // Parse wsp:All
- QName allQName = new QName(Policy.URI_POLICY, "All");
- Element elAll = DOMUtils.getFirstChildElement(elExactlyOne, allQName);
- if (elAll == null)
- throw new WSException("Cannot find child element: " + allQName);
-
- Iterator it = DOMUtils.getChildElements(elExactlyOne, allQName);
- while (it.hasNext())
- {
- elAll = (Element)it.next();
- PolicyAlternative all = PolicyAlternative.parse(elAll);
- policy.addPolicyAlternative(all);
- }
-
- return policy;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/policy/PolicyFactory.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/policy/PolicyFactory.java)
Copied: trunk/src/main/java/org/jboss/ws/extensions/security (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/security/BinarySecurityTokenValidator.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/BinarySecurityTokenValidator.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/BinarySecurityTokenValidator.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,48 +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.extensions.security;
-
-import org.jboss.ws.extensions.security.element.BinarySecurityToken;
-import org.jboss.ws.extensions.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:
trunk/src/main/java/org/jboss/ws/extensions/security/BinarySecurityTokenValidator.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/BinarySecurityTokenValidator.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/Constants.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/Constants.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/security/Constants.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,70 +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.extensions.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: trunk/src/main/java/org/jboss/ws/extensions/security/Constants.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/Constants.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/DecodingOperation.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/DecodingOperation.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/security/DecodingOperation.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,40 +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.extensions.security;
-
-import java.util.Collection;
-
-import org.jboss.ws.extensions.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: trunk/src/main/java/org/jboss/ws/extensions/security/DecodingOperation.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/DecodingOperation.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/DecryptionOperation.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/DecryptionOperation.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/DecryptionOperation.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,145 +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.extensions.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.extensions.security.element.EncryptedKey;
-import org.jboss.ws.extensions.security.element.ReferenceList;
-import org.jboss.ws.extensions.security.element.SecurityHeader;
-import org.jboss.ws.extensions.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: trunk/src/main/java/org/jboss/ws/extensions/security/DecryptionOperation.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/DecryptionOperation.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/EncodingOperation.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/EncodingOperation.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/security/EncodingOperation.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,39 +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.extensions.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: trunk/src/main/java/org/jboss/ws/extensions/security/EncodingOperation.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/EncodingOperation.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/EncryptionOperation.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/EncryptionOperation.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/EncryptionOperation.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,172 +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.extensions.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.extensions.security.element.EncryptedKey;
-import org.jboss.ws.extensions.security.element.ReferenceList;
-import org.jboss.ws.extensions.security.element.SecurityHeader;
-import org.jboss.ws.extensions.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: trunk/src/main/java/org/jboss/ws/extensions/security/EncryptionOperation.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/EncryptionOperation.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/security/FailedAuthenticationException.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/FailedAuthenticationException.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/FailedAuthenticationException.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,64 +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.extensions.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:
trunk/src/main/java/org/jboss/ws/extensions/security/FailedAuthenticationException.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/FailedAuthenticationException.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/FailedCheckException.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/FailedCheckException.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/FailedCheckException.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,64 +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.extensions.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: trunk/src/main/java/org/jboss/ws/extensions/security/FailedCheckException.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/FailedCheckException.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/security/InvalidSecurityHeaderException.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/InvalidSecurityHeaderException.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/InvalidSecurityHeaderException.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,64 +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.extensions.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:
trunk/src/main/java/org/jboss/ws/extensions/security/InvalidSecurityHeaderException.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/InvalidSecurityHeaderException.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/security/InvalidSecurityTokenException.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/InvalidSecurityTokenException.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/InvalidSecurityTokenException.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,64 +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.extensions.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:
trunk/src/main/java/org/jboss/ws/extensions/security/InvalidSecurityTokenException.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/InvalidSecurityTokenException.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/KeyResolver.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/KeyResolver.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/security/KeyResolver.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,166 +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.extensions.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.extensions.security.element.BinarySecurityToken;
-import org.jboss.ws.extensions.security.element.DirectReference;
-import org.jboss.ws.extensions.security.element.KeyIdentifier;
-import org.jboss.ws.extensions.security.element.Reference;
-import org.jboss.ws.extensions.security.element.SecurityTokenReference;
-import org.jboss.ws.extensions.security.element.X509IssuerSerial;
-import org.jboss.ws.extensions.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: trunk/src/main/java/org/jboss/ws/extensions/security/KeyResolver.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/KeyResolver.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/Operation.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/Operation.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/security/Operation.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,33 +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.extensions.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: trunk/src/main/java/org/jboss/ws/extensions/security/Operation.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/Operation.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/OperationDescription.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/OperationDescription.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/OperationDescription.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,105 +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.extensions.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: trunk/src/main/java/org/jboss/ws/extensions/security/OperationDescription.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/OperationDescription.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/QNameTarget.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/QNameTarget.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/security/QNameTarget.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,59 +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.extensions.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: trunk/src/main/java/org/jboss/ws/extensions/security/QNameTarget.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/QNameTarget.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/security/ReceiveUsernameOperation.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/ReceiveUsernameOperation.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/ReceiveUsernameOperation.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,50 +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.extensions.security;
-
-import org.jboss.ws.extensions.security.element.SecurityHeader;
-import org.jboss.ws.extensions.security.element.Token;
-import org.jboss.ws.extensions.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: trunk/src/main/java/org/jboss/ws/extensions/security/ReceiveUsernameOperation.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/ReceiveUsernameOperation.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/security/RequireEncryptionOperation.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/RequireEncryptionOperation.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/RequireEncryptionOperation.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,33 +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.extensions.security;
-
-import org.jboss.ws.extensions.security.element.SecurityHeader;
-
-
-public class RequireEncryptionOperation extends RequireTargetableOperation
-{
- public RequireEncryptionOperation(SecurityHeader header, SecurityStore store) throws
WSSecurityException
- {
- super(header, store);
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/extensions/security/RequireEncryptionOperation.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/RequireEncryptionOperation.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/RequireOperation.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/RequireOperation.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/security/RequireOperation.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,38 +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.extensions.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: trunk/src/main/java/org/jboss/ws/extensions/security/RequireOperation.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/RequireOperation.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/security/RequireSignatureOperation.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/RequireSignatureOperation.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/RequireSignatureOperation.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,33 +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.extensions.security;
-
-import org.jboss.ws.extensions.security.element.SecurityHeader;
-
-
-public class RequireSignatureOperation extends RequireTargetableOperation
-{
- public RequireSignatureOperation(SecurityHeader header, SecurityStore store) throws
WSSecurityException
- {
- super(header, store);
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/extensions/security/RequireSignatureOperation.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/RequireSignatureOperation.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/security/RequireTargetableOperation.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/RequireTargetableOperation.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/RequireTargetableOperation.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,90 +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.extensions.security;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.ws.extensions.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:
trunk/src/main/java/org/jboss/ws/extensions/security/RequireTargetableOperation.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/RequireTargetableOperation.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/security/RequireTimestampOperation.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/RequireTimestampOperation.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/RequireTimestampOperation.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,60 +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.extensions.security;
-
-import java.util.Calendar;
-import java.util.Collection;
-import java.util.List;
-
-import org.jboss.ws.extensions.security.element.SecurityHeader;
-import org.jboss.ws.extensions.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:
trunk/src/main/java/org/jboss/ws/extensions/security/RequireTimestampOperation.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/RequireTimestampOperation.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/STRTransform.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/STRTransform.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/security/STRTransform.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,173 +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.extensions.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.core.utils.ThreadLocalAssociation;
-import org.jboss.ws.extensions.security.element.BinarySecurityToken;
-import org.jboss.ws.extensions.security.element.SecurityTokenReference;
-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: trunk/src/main/java/org/jboss/ws/extensions/security/STRTransform.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/STRTransform.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/SecurityAdaptor.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityAdaptor.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/security/SecurityAdaptor.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,38 +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.extensions.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: trunk/src/main/java/org/jboss/ws/extensions/security/SecurityAdaptor.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityAdaptor.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/SecurityAdaptorFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityAdaptorFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/SecurityAdaptorFactory.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,70 +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.extensions.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: trunk/src/main/java/org/jboss/ws/extensions/security/SecurityAdaptorFactory.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityAdaptorFactory.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/SecurityDecoder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityDecoder.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/security/SecurityDecoder.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,194 +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.extensions.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.extensions.security.element.EncryptedKey;
-import org.jboss.ws.extensions.security.element.SecurityHeader;
-import org.jboss.ws.extensions.security.element.SecurityProcess;
-import org.jboss.ws.extensions.security.element.Signature;
-import org.jboss.ws.extensions.security.element.Timestamp;
-import org.jboss.ws.extensions.security.element.Token;
-import org.jboss.ws.extensions.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: trunk/src/main/java/org/jboss/ws/extensions/security/SecurityDecoder.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityDecoder.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/SecurityEncoder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityEncoder.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/security/SecurityEncoder.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,86 +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.extensions.security;
-
-import java.lang.reflect.Constructor;
-import java.util.List;
-
-import org.jboss.ws.extensions.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: trunk/src/main/java/org/jboss/ws/extensions/security/SecurityEncoder.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityEncoder.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/SecurityStore.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityStore.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/security/SecurityStore.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,488 +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.extensions.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: trunk/src/main/java/org/jboss/ws/extensions/security/SecurityStore.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityStore.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/security/SecurityTokenUnavailableException.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityTokenUnavailableException.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/SecurityTokenUnavailableException.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,64 +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.extensions.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:
trunk/src/main/java/org/jboss/ws/extensions/security/SecurityTokenUnavailableException.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityTokenUnavailableException.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/SendUsernameOperation.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/SendUsernameOperation.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/SendUsernameOperation.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,46 +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.extensions.security;
-
-import java.util.List;
-
-import org.jboss.ws.extensions.security.element.SecurityHeader;
-import org.jboss.ws.extensions.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: trunk/src/main/java/org/jboss/ws/extensions/security/SendUsernameOperation.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/SendUsernameOperation.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/SignatureOperation.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/SignatureOperation.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/SignatureOperation.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,178 +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.extensions.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.extensions.security.element.DirectReference;
-import org.jboss.ws.extensions.security.element.SecurityHeader;
-import org.jboss.ws.extensions.security.element.SecurityTokenReference;
-import org.jboss.ws.extensions.security.element.Signature;
-import org.jboss.ws.extensions.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: trunk/src/main/java/org/jboss/ws/extensions/security/SignatureOperation.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/SignatureOperation.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/security/SignatureVerificationOperation.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/SignatureVerificationOperation.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/SignatureVerificationOperation.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,89 +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.extensions.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.extensions.security.element.SecurityHeader;
-import org.jboss.ws.extensions.security.element.SecurityProcess;
-import org.jboss.ws.extensions.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:
trunk/src/main/java/org/jboss/ws/extensions/security/SignatureVerificationOperation.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/SignatureVerificationOperation.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/SimplePrincipal.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/SimplePrincipal.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/security/SimplePrincipal.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,65 +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.extensions.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: trunk/src/main/java/org/jboss/ws/extensions/security/SimplePrincipal.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/SimplePrincipal.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/Target.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/Target.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/security/Target.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,33 +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.extensions.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: trunk/src/main/java/org/jboss/ws/extensions/security/Target.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/Target.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/TimestampOperation.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/TimestampOperation.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/TimestampOperation.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,58 +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.extensions.security;
-
-import java.util.List;
-
-import org.jboss.ws.extensions.security.element.SecurityHeader;
-import org.jboss.ws.extensions.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: trunk/src/main/java/org/jboss/ws/extensions/security/TimestampOperation.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/TimestampOperation.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/security/TimestampVerificationOperation.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/TimestampVerificationOperation.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/TimestampVerificationOperation.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,61 +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.extensions.security;
-
-import java.util.Calendar;
-
-import org.jboss.ws.extensions.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:
trunk/src/main/java/org/jboss/ws/extensions/security/TimestampVerificationOperation.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/TimestampVerificationOperation.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/TokenOperation.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/TokenOperation.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/security/TokenOperation.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,38 +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.extensions.security;
-
-import org.jboss.ws.extensions.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: trunk/src/main/java/org/jboss/ws/extensions/security/TokenOperation.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/TokenOperation.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/security/UnsupportedAlgorithmException.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/UnsupportedAlgorithmException.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/UnsupportedAlgorithmException.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,65 +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.extensions.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:
trunk/src/main/java/org/jboss/ws/extensions/security/UnsupportedAlgorithmException.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/UnsupportedAlgorithmException.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/security/UnsupportedSecurityTokenException.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/UnsupportedSecurityTokenException.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/UnsupportedSecurityTokenException.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,64 +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.extensions.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:
trunk/src/main/java/org/jboss/ws/extensions/security/UnsupportedSecurityTokenException.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/UnsupportedSecurityTokenException.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/Util.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/Util.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/security/Util.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,217 +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.extensions.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: trunk/src/main/java/org/jboss/ws/extensions/security/Util.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/Util.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,303 +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.extensions.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.WSException;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.jaxrpc.StubExt;
-import org.jboss.ws.core.soap.SOAPMessageImpl;
-import org.jboss.ws.core.utils.DOMWriter;
-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.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: trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityException.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityException.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityException.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,74 +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.extensions.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: trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityException.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityException.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/WsuIdResolver.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/WsuIdResolver.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/security/WsuIdResolver.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,89 +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.extensions.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: trunk/src/main/java/org/jboss/ws/extensions/security/WsuIdResolver.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/WsuIdResolver.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/WsuIdTarget.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/WsuIdTarget.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/security/WsuIdTarget.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,56 +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.extensions.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: trunk/src/main/java/org/jboss/ws/extensions/security/WsuIdTarget.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/WsuIdTarget.java)
Copied: trunk/src/main/java/org/jboss/ws/extensions/security/element (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/element)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/security/element/BinarySecurityToken.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/element/BinarySecurityToken.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/element/BinarySecurityToken.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,100 +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.extensions.security.element;
-
-import org.jboss.ws.extensions.security.Constants;
-import org.jboss.ws.extensions.security.Util;
-import org.jboss.ws.extensions.security.WSSecurityException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-
-/**
- * @author Jason T. Greene
- * @version $Id$
- */
-abstract public class BinarySecurityToken implements Token
-{
- private Document doc;
-
- private String id;
-
- private Element cachedElement;
-
- public static BinarySecurityToken createBinarySecurityToken(Element element) throws
WSSecurityException
- {
- String valueType = element.getAttribute("ValueType");
- if (X509Token.TYPE.equals(valueType))
- return new X509Token(element);
- else
- throw new WSSecurityException("Unkown Binary Security Token!!!");
- }
-
- public BinarySecurityToken(Document doc)
- {
- this.doc = doc;
- }
-
- abstract public String getValueType();
-
- abstract public String getEncodingType();
-
- abstract public String getEncodedValue(boolean noWhitespace);
-
- public String getId()
- {
- if (id == null)
- id = Util.generateId("token");
-
- return id;
- }
-
- public void setId(String id)
- {
- this.id = id;
- }
-
- public Element getElement()
- {
- if (cachedElement != null)
- return cachedElement;
-
- Element element = doc.createElementNS(Constants.WSSE_NS, Constants.WSSE_PREFIX +
":" + "BinarySecurityToken");
- element.setAttributeNS(Constants.WSU_NS, Constants.WSU_ID, getId());
- element.setAttribute("ValueType", getValueType());
- element.setAttribute("EncodingType", getEncodingType());
- element.appendChild(doc.createTextNode(getEncodedValue(false)));
-
- cachedElement = element;
- return cachedElement;
- }
-
- public Element getSTRTransformElement()
- {
- Element element = doc.createElementNS(Constants.WSSE_NS, Constants.WSSE_PREFIX +
":" + "BinarySecurityToken");
- Util.addNamespace(element, Constants.WSSE_PREFIX, Constants.WSSE_NS);
- element.setAttribute("ValueType", getValueType());
- element.appendChild(doc.createTextNode(getEncodedValue(true)));
-
- return element;
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/extensions/security/element/BinarySecurityToken.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/element/BinarySecurityToken.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/security/element/DirectReference.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/element/DirectReference.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/element/DirectReference.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,121 +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.extensions.security.element;
-
-import org.jboss.ws.extensions.security.Constants;
-import org.jboss.ws.extensions.security.WSSecurityException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- * <code>DirectReference</code> is a reference type within a
- * <code>SecurityTokenReference</code> that referes to a token that is
- * 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.extensions.security.element.SecurityTokenReference
- * @see org.jboss.ws.extensions.security.element.BinarySecurityToken
- *
- * @author Jason T. Greene
- * @version $Id$
- */
-public class DirectReference extends Reference
-{
-
- private Document doc;
-
- private String uri;
-
- private String valueType;
-
- private Element cachedElement;
-
- public DirectReference(Document doc)
- {
- this.doc = doc;
- }
-
- public DirectReference(Document doc, BinarySecurityToken token)
- {
- this.doc = doc;
- referenceToken(token);
- }
-
- public DirectReference(Element element) throws WSSecurityException
- {
- this.doc = element.getOwnerDocument();
-
- if (!"Reference".equals(element.getLocalName()))
- throw new WSSecurityException("Invalid message, invalid local name on a
DirectReference");
-
- String uri = element.getAttribute("URI");
- if (uri == null || uri.length() == 0)
- throw new WSSecurityException("Inavliad message, Reference element is
missing a URI");
-
- setUri(uri);
-
- String valueType = element.getAttribute("ValueType");
- if (valueType == null || valueType.length() == 0)
- throw new WSSecurityException("Inavliad message, Reference element is
missing a ValueType");
-
- setValueType(valueType);
- }
-
- public String getUri()
- {
- return uri;
- }
-
- public void referenceToken(BinarySecurityToken token)
- {
- setUri("#" + token.getId());
- setValueType(token.getValueType());
- }
-
- public void setUri(String uri)
- {
- this.uri = uri;
- }
-
- public String getValueType()
- {
- return valueType;
- }
-
- public void setValueType(String valueType)
- {
- this.valueType = valueType;
- }
-
- public Element getElement()
- {
- if (cachedElement != null)
- return cachedElement;
-
- Element element = doc.createElementNS(Constants.WSSE_NS, Constants.WSSE_PREFIX +
":" + "Reference");
- element.setAttribute("ValueType", getValueType());
- element.setAttribute("URI", getUri());
-
- cachedElement = element;
- return cachedElement;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/security/element/DirectReference.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/element/DirectReference.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/element/EncryptedKey.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/element/EncryptedKey.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/element/EncryptedKey.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,192 +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.extensions.security.element;
-
-import java.security.PrivateKey;
-
-import javax.crypto.SecretKey;
-
-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.extensions.security.Constants;
-import org.jboss.ws.extensions.security.InvalidSecurityHeaderException;
-import org.jboss.ws.extensions.security.KeyResolver;
-import org.jboss.ws.extensions.security.Util;
-import org.jboss.ws.extensions.security.WSSecurityException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- * <code>EncryptedKey</code> represents the am XMLSecurity encrypted key.
- *
- * @author Jason T. Greene
- * @version $Id$
- */
-public class EncryptedKey implements SecurityProcess
-{
- private Document document;
-
- private SecretKey secretKey;
-
- private X509Token token;
-
- private ReferenceList list;
-
- private Element cachedElement;
-
- public EncryptedKey(Document document, SecretKey secretKey, X509Token token)
- {
- this(document, secretKey, token, new ReferenceList());
- }
-
- public EncryptedKey(Document document, SecretKey secretKey, X509Token token,
ReferenceList list)
- {
- this.document = document;
- this.secretKey = secretKey;
- this.token = token;
- this.list = list;
- }
-
- public EncryptedKey(Element element, KeyResolver resolver) throws WSSecurityException
- {
- org.apache.xml.security.encryption.EncryptedKey key;
- XMLCipher cipher;
-
- try
- {
- cipher = XMLCipher.getInstance();
- key = cipher.loadEncryptedKey(element);
- }
- catch (XMLSecurityException e)
- {
- throw new WSSecurityException("Could not parse encrypted key: " +
e.getMessage(), e);
- }
-
- KeyInfo info = key.getKeyInfo();
-
- if (info == null)
- throw new WSSecurityException("EncryptedKey element did not contain
KeyInfo");
-
- PrivateKey privateKey = resolver.resolvePrivateKey(info);
-
- // Locate the reference list. We have to manually parse this because xml security
doesn't handle
- // shorthand xpointer references (URI="#fooid")
-
- Element referenceList = Util.findElement(element, Constants.XENC_REFERENCELIST,
Constants.XML_ENCRYPTION_NS);
- if (referenceList == null)
- throw new WSSecurityException("Encrypted key did not contain a reference
list");
-
- this.list = new ReferenceList(referenceList);
-
- // Now use the element list to determine the encryption alg
- String alg = getKeyAlgorithm(element);
- if (alg == null)
- throw new WSSecurityException("Could not determine encrypted key
algorithm!");
-
- try
- {
- cipher.init(XMLCipher.UNWRAP_MODE, privateKey);
- this.secretKey = (SecretKey) cipher.decryptKey(key, alg);
- }
- catch (XMLSecurityException e)
- {
- throw new WSSecurityException("Could not parse encrypted key: " +
e.getMessage(), e);
- }
-
- this.document = element.getOwnerDocument();
- this.token = new X509Token(resolver.resolveCertificate(info), this.document);
- }
-
- private String getKeyAlgorithm(Element element) throws WSSecurityException
- {
- // We obtain the keys algorithm by looking at the first data element in our
reference list
- String id = this.list.getAllReferences().iterator().next();
- if (id == null)
- return null;
-
- Element dataElement =
Util.findElementByWsuId(element.getOwnerDocument().getDocumentElement(), id);
- if (dataElement == null)
- return null;
-
- return getEncryptionAlgorithm(dataElement);
- }
-
- 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;
- }
-
- public Element getElement() throws WSSecurityException
- {
- if (cachedElement != null)
- return cachedElement;
-
- XMLCipher cipher;
- org.apache.xml.security.encryption.EncryptedKey key;
-
- try
- {
- cipher = XMLCipher.getInstance(XMLCipher.RSA_v1dot5);
- cipher.init(XMLCipher.WRAP_MODE, token.getCert().getPublicKey());
- key = cipher.encryptKey(document, secretKey);
- }
- catch (XMLSecurityException e)
- {
- throw new WSSecurityException("Error encrypting key: " +
e.getMessage(), e);
- }
-
- SecurityTokenReference reference = new SecurityTokenReference(new
DirectReference(document, token));
- KeyInfo keyInfo = new KeyInfo(document);
- keyInfo.addUnknownElement(reference.getElement());
- key.setKeyInfo(keyInfo);
-
-
key.setReferenceList(cipher.createReferenceList(org.apache.xml.security.encryption.ReferenceList.DATA_REFERENCE));
- list.populateRealReferenceList(key.getReferenceList());
-
- cachedElement = cipher.martial(key);
- return cachedElement;
- }
-
- public void addReference(String id)
- {
- list.add(id);
- }
-
- public SecretKey getSecretKey()
- {
- return secretKey;
- }
-
- public ReferenceList getReferenceList()
- {
- return list;
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/extensions/security/element/EncryptedKey.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/element/EncryptedKey.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/element/KeyIdentifier.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/element/KeyIdentifier.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/element/KeyIdentifier.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,146 +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.extensions.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.extensions.security.Constants;
-import org.jboss.ws.extensions.security.WSSecurityException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- * <code>KeyIdentifier</code> is a reference type within a
- * <code>SecurityTokenReference</code> that referes to a token that
- * using some uniquely identifying characteristic. An example is an
- * X.509v3 Subject Key Identifier, which is the only currently
- * supported key identifier by this class.
- *
- * @see org.jboss.ws.extensions.security.element.SecurityTokenReference
- * @see org.jboss.ws.extensions.security.element.BinarySecurityToken
- *
- * @author Jason T. Greene
- * @version $Id$
- */
-public class KeyIdentifier extends Reference
-{
- public static final String SKI_TYPE =
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509SubjectKeyIdentifier";
-
- private Document doc;
-
- private String value;
-
- private Element cachedElement;
-
- public KeyIdentifier(Document doc, BinarySecurityToken token) throws
WSSecurityException
- {
- this.doc = doc;
- referenceToken(token);
- }
-
- public KeyIdentifier(Element element) throws WSSecurityException
- {
- this.doc = element.getOwnerDocument();
-
- if (! "KeyIdentifier".equals(element.getLocalName()))
- throw new WSSecurityException("Invalid message, invalid local name on a
KeyIdentifier");
-
- String valueType = element.getAttribute("ValueType");
- if (valueType == null || valueType.length() == 0)
- throw new WSSecurityException("Inavliad message, KeyIdentifier element is
missing an ValueType");
-
- if (! SKI_TYPE.equals(valueType))
- throw new WSSecurityException("Currently only SubjectKeyIdentifiers are
supported, was passed: " + valueType);
-
- // Lets be soft on encoding type since other clients don't properly use it
- this.value = XMLUtils.getFullTextChildrenFromElement(element);
- }
-
- public void referenceToken(BinarySecurityToken token) throws WSSecurityException
- {
- if (! (token instanceof X509Token))
- throw new WSSecurityException("KeyIdentifier tried to reference something
besides an X509 token");
-
- X509Token x509 = (X509Token) token;
- X509Certificate cert = x509.getCert();
-
- // Maybee we should make one ourselves if it isn't there?
- byte[] encoded = cert.getExtensionValue("2.5.29.14");
- if (encoded == null)
- throw new WSSecurityException("Certificate did not contain a subject key
identifier!");
-
- // 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(identifier, 4, encoded, 0, trunc);
-
- value = Base64.encode(identifier);
- }
-
- public String getValue()
- {
- return value;
- }
-
- public String getValueType()
- {
- // Support only SKI at the moment
- return SKI_TYPE;
- }
-
- public Document getDocument()
- {
- return doc;
- }
-
- public byte[] getIdentifier() throws WSSecurityException
- {
- if (value == null)
- return null;
-
- try
- {
- return Base64.decode(value);
- }
- catch (Base64DecodingException e)
- {
- throw new WSSecurityException("Error decoding key identifier", e);
- }
- }
-
- public Element getElement()
- {
- if (cachedElement != null)
- return cachedElement;
-
- Element element = doc.createElementNS(Constants.WSSE_NS, Constants.WSSE_PREFIX +
":" + "KeyIdentifier");
- element.setAttribute("ValueType", getValueType());
- element.setAttribute("EncodingType", Constants.BASE64_ENCODING_TYPE);
-
- cachedElement = element;
- return cachedElement;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/security/element/KeyIdentifier.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/element/KeyIdentifier.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/element/Reference.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/element/Reference.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/security/element/Reference.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,49 +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.extensions.security.element;
-
-import org.jboss.ws.extensions.security.WSSecurityException;
-import org.w3c.dom.Element;
-
-abstract public class Reference implements SecurityElement
-{
- public static Reference getReference(Element element) throws WSSecurityException
- {
- String name = element.getLocalName();
- if ("Reference".equals(name))
- {
- return new DirectReference(element);
- }
- else if ("KeyIdentifier".equals(name))
- {
- return new KeyIdentifier(element);
- }
- else if ("X509Data".equals(name))
- {
- return new X509IssuerSerial(element);
- }
- else
- {
- throw new WSSecurityException("Unkown reference element: " + name);
- }
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/security/element/Reference.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/element/Reference.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/element/ReferenceList.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/element/ReferenceList.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/element/ReferenceList.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,94 +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.extensions.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.extensions.security.Constants;
-import org.jboss.ws.extensions.security.Util;
-import org.w3c.dom.Element;
-
-/**
- * @author Jason T. Greene
- * @version $Id$
- */
-public class ReferenceList
-{
-
- private LinkedList<String> references = new LinkedList<String>();
-
- public ReferenceList()
- {
- }
-
- public ReferenceList(Element element)
- {
- Element child = Util.getFirstChildElement(element);
- while (child != null)
- {
- // Skip key references, they aren't used by WS-Security
- if (Constants.XML_ENCRYPTION_NS.equals(child.getNamespaceURI())
- && Constants.XENC_DATAREFERENCE.equals(child.getLocalName()))
- {
- String uri = child.getAttribute("URI");
- if (uri != null && uri.length() > 1 && uri.charAt(0) ==
'#')
- references.add(uri.substring(1));
- }
-
- child = Util.getNextSiblingElement(child);
- }
- }
-
- public ReferenceList(org.apache.xml.security.encryption.ReferenceList list)
- {
- Iterator i = list.getReferences();
-
- while (i.hasNext())
- {
- Reference r = (Reference) i.next();
- references.add(r.getURI());
- }
- }
-
- public void add(String id)
- {
- // We prepend so that decryption can handle nested elements by just
- // following the order
- references.addFirst(id);
- }
-
- public void populateRealReferenceList(org.apache.xml.security.encryption.ReferenceList
list)
- {
- for (String i : references)
- {
- list.add(list.newDataReference("#" + i));
- }
- }
-
- public Collection<String> getAllReferences()
- {
- return references;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/security/element/ReferenceList.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/element/ReferenceList.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityElement.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityElement.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityElement.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,35 +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.extensions.security.element;
-
-import org.jboss.ws.extensions.security.WSSecurityException;
-import org.w3c.dom.Element;
-
-
-/**
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public interface SecurityElement
-{
- public Element getElement() throws WSSecurityException;
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityElement.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityElement.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityHeader.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityHeader.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityHeader.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,190 +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.extensions.security.element;
-
-import java.util.HashMap;
-import java.util.LinkedList;
-
-import org.jboss.ws.extensions.security.BinarySecurityTokenValidator;
-import org.jboss.ws.extensions.security.Constants;
-import org.jboss.ws.extensions.security.KeyResolver;
-import org.jboss.ws.extensions.security.SecurityStore;
-import org.jboss.ws.extensions.security.UnsupportedSecurityTokenException;
-import org.jboss.ws.extensions.security.Util;
-import org.jboss.ws.extensions.security.WSSecurityException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-
-/**
- * <code>SecurityHeader</code> represents the wsse:security element of
WS-Security,
- * and is responsible for storing the processing state of a message.
- *
- * @author Jason T. Greene
- * @version $Id$
- */
-public class SecurityHeader implements SecurityElement
-{
- private Document document;
-
- private Timestamp timestamp;
-
- private LinkedList<Token> tokens = new LinkedList<Token>();
-
- private HashMap<Object, Token> sharedTokens = new HashMap<Object,
Token>();
-
- private LinkedList<SecurityProcess> securityProcesses = new
LinkedList<SecurityProcess>();
-
- // Looks like this is only for embedded tokens
- private LinkedList<SecurityTokenReference> securityTokenReferences = new
LinkedList<SecurityTokenReference>();
-
- public SecurityHeader(Document document)
- {
- this.document = document;
- }
-
- public SecurityHeader(Element element, SecurityStore store) throws
WSSecurityException
- {
- document = element.getOwnerDocument();
- KeyResolver resolver = new KeyResolver(store);
- BinarySecurityTokenValidator validator = new BinarySecurityTokenValidator(store);
- Element child = Util.getFirstChildElement(element);
- while (child != null)
- {
- String tag = child.getLocalName();
-
- if (tag.equals("BinarySecurityToken"))
- {
- BinarySecurityToken token =
BinarySecurityToken.createBinarySecurityToken(child);
- validator.validateToken(token);
- resolver.cacheToken(token);
- tokens.add(token);
- }
- else if (tag.equals("UsernameToken"))
- tokens.add(new UsernameToken(child));
- else if (tag.equals("Timestamp"))
- timestamp = new Timestamp(child);
- else if (tag.equals("Signature"))
- securityProcesses.add(new Signature(child, resolver));
- else if (tag.equals("EncryptedKey"))
- securityProcesses.add(new EncryptedKey(child, resolver));
- else if (tag.equals("ReferenceList"))
- throw new UnsupportedSecurityTokenException("ReferenceLists outside of
encrypted keys (shared secrets) are not supported.");
-
- child = Util.getNextSiblingElement(child);
- }
- }
-
- public Timestamp getTimestamp()
- {
- return timestamp;
- }
-
- public void setTimestamp(Timestamp timestamp)
- {
- this.timestamp = timestamp;
- }
-
- /**
- * @return Returns the securityTokenReferences.
- */
- public LinkedList getSecurityTokenReferences()
- {
- return securityTokenReferences;
- }
- /**
- * @param securityTokenReferences The securityTokenReferences to set.
- */
- public void setSecurityTokenReferences(LinkedList<SecurityTokenReference>
securityTokenReferences)
- {
- this.securityTokenReferences = securityTokenReferences;
- }
- /**
- * @return Returns the securityProcesses.
- */
- public LinkedList<SecurityProcess> getSecurityProcesses()
- {
- return securityProcesses;
- }
-
- /**
- * @param securityProcesses The securityProcesses to set.
- */
- public void setSecurityProcesses(LinkedList<SecurityProcess> securityProcesses)
- {
- this.securityProcesses = securityProcesses;
- }
- /**
- * @return the tokens.
- */
- public LinkedList<Token> getTokens()
- {
- return tokens;
- }
-
- public void addToken(Token token)
- {
- tokens.addFirst(token);
- Object content = token.getUniqueContent();
- if (content != null)
- sharedTokens.put(content, token);
- }
-
- public Token getSharedToken(Object uniqueContent)
- {
- if (uniqueContent == null)
- return null;
-
- return sharedTokens.get(uniqueContent);
- }
-
- public void addSecurityProcess(SecurityProcess process)
- {
- securityProcesses.addFirst(process);
- }
-
- public void addSecurityTokenReference(SecurityTokenReference reference)
- {
- securityTokenReferences.addFirst(reference);
- }
-
- public Element getElement() throws WSSecurityException
- {
- Element element = document.createElementNS(Constants.WSSE_NS,
Constants.WSSE_HEADER);
- Util.addNamespace(element, Constants.WSSE_PREFIX, Constants.WSSE_NS);
- Util.addNamespace(element, Constants.WSU_PREFIX, Constants.WSU_NS);
-
- if (timestamp != null)
- element.appendChild(timestamp.getElement());
-
- for (Token t : tokens)
- element.appendChild(t.getElement());
-
- for (SecurityTokenReference r : securityTokenReferences)
- element.appendChild(r.getElement());
-
- for (SecurityProcess p : securityProcesses)
- element.appendChild(p.getElement());
-
- return element;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityHeader.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityHeader.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityProcess.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityProcess.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityProcess.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,31 +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.extensions.security.element;
-
-
-/**
- * @author Jason T. Greene
- * @version $Id$
- */
-public interface SecurityProcess extends SecurityElement
-{
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityProcess.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityProcess.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityTokenReference.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityTokenReference.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityTokenReference.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,96 +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.extensions.security.element;
-
-import org.jboss.ws.extensions.security.Constants;
-import org.jboss.ws.extensions.security.Util;
-import org.jboss.ws.extensions.security.WSSecurityException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-
-/**
- * @author Jason T. Greene
- * @version $Id$
- */
-public class SecurityTokenReference
-{
- private String id;
-
- private Reference reference;
-
- private Element cachedElement;
-
- public SecurityTokenReference(Reference reference)
- {
- this.reference = reference;
- }
-
- public SecurityTokenReference(Element element) throws WSSecurityException
- {
- if (! "SecurityTokenReference".equals(element.getLocalName()))
- throw new WSSecurityException("SecurityTokenReference was passed an invalid
local name");
-
- String id = element.getAttributeNS(Constants.WSU_NS, Constants.ID);
- if (id == null || id.length() == 0)
- setId(id);
-
- Element child = Util.getFirstChildElement(element);
- if (child == null)
- throw new WSSecurityException("Invalid message, SecurityTokenRefence is
empty: " + id);
-
- this.reference = Reference.getReference(child);
- }
-
- public Reference getReference()
- {
- return reference;
- }
-
- public String getId()
- {
- if (id == null)
- id = Util.generateId("reference");
-
- return id;
- }
-
- public void setId(String id)
- {
- this.id = id;
- }
-
- public Element getElement() throws WSSecurityException
- {
- if (cachedElement != null)
- return cachedElement;
-
- Element referenceElement = reference.getElement();
- Document doc = referenceElement.getOwnerDocument();
- Element element = doc.createElementNS(Constants.WSSE_NS, Constants.WSSE_PREFIX +
":" + "SecurityTokenReference");
- element.setAttributeNS(Constants.WSU_NS, Constants.WSU_ID, getId());
- element.appendChild(referenceElement);
-
- cachedElement = element;
- return cachedElement;
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityTokenReference.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/element/SecurityTokenReference.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/element/Signature.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/element/Signature.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/security/element/Signature.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,87 +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.extensions.security.element;
-
-import java.security.PublicKey;
-
-import org.apache.xml.security.exceptions.XMLSecurityException;
-import org.apache.xml.security.signature.XMLSignature;
-import org.jboss.ws.extensions.security.KeyResolver;
-import org.jboss.ws.extensions.security.WSSecurityException;
-import org.w3c.dom.Element;
-
-
-/**
- * @author Jason T. Greene
- * @version $Id$
- */
-public class Signature implements SecurityProcess
-{
- private XMLSignature signature;
-
- /* Used only for decoding */
- private PublicKey publicKey;
-
- private Element cachedElement;
-
- public Signature(XMLSignature signature)
- {
- this.signature = signature;
- }
-
- public Signature(Element element, KeyResolver resolver) throws WSSecurityException
- {
- try
- {
- signature = new XMLSignature(element, null);
- publicKey = resolver.resolvePublicKey(signature.getKeyInfo());
- }
- catch (XMLSecurityException e)
- {
- throw new WSSecurityException("Error decoding xml signature: " +
e.getMessage(), e);
- }
- }
-
- public XMLSignature getSignature()
- {
- return signature;
- }
-
- public void setSignature(XMLSignature signature)
- {
- this.signature = signature;
- }
-
- public Element getElement()
- {
- if (cachedElement != null)
- return cachedElement;
-
- cachedElement = signature.getElement();
- return cachedElement;
- }
-
- public PublicKey getPublicKey()
- {
- return publicKey;
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/extensions/security/element/Signature.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/element/Signature.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/element/Timestamp.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/element/Timestamp.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/security/element/Timestamp.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,131 +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.extensions.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.extensions.security.Constants;
-import org.jboss.ws.extensions.security.Util;
-import org.jboss.ws.extensions.security.WSSecurityException;
-import org.jboss.xb.binding.SimpleTypeBindings;
-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 Timestamp implements SecurityElement
-{
-
- private String id = "timestamp";
-
- private Integer ttl;
-
- private Document doc;
-
- private Calendar created;
-
- private Calendar expires;
-
- private Element cachedElement;
-
- public Timestamp(Integer ttl, Document doc)
- {
- this.doc = doc;
- this.ttl = ttl;
- }
-
- public Timestamp(Element element) throws WSSecurityException
- {
- this.doc = element.getOwnerDocument();
- String id = element.getAttributeNS(Constants.WSU_NS, Constants.ID);
- if (id == null || id.length() == 0)
- throw new WSSecurityException("Invalid message, Timestamp is missing an
id");
-
- this.id = id;
-
- Element child = Util.getFirstChildElement(element);
- if (child == null || !Constants.WSU_NS.equals(child.getNamespaceURI()) ||
!"Created".equals(child.getLocalName()))
- throw new WSSecurityException("Created child expected in Timestamp
element");
-
- this.created =
SimpleTypeBindings.unmarshalDateTime(XMLUtils.getFullTextChildrenFromElement(child));
-
- child = Util.getNextSiblingElement(child);
- if (child == null)
- return;
-
- this.expires =
SimpleTypeBindings.unmarshalDateTime(XMLUtils.getFullTextChildrenFromElement(child));
- }
-
- private void setupTime()
- {
- created = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
- if (ttl != null)
- {
- expires = (Calendar) created.clone();
- expires.add(Calendar.SECOND, ttl.intValue());
- }
- }
-
- private String getId()
- {
- return id;
- }
-
- public Calendar getCreated()
- {
- return created;
- }
-
- public Calendar getExpires()
- {
- return expires;
- }
-
- public Element getElement() throws WSSecurityException
- {
- if (cachedElement != null)
- return cachedElement;
-
- setupTime();
-
- Element element = doc.createElementNS(Constants.WSU_NS, Constants.WSU_PREFIX +
":" + "Timestamp");
- element.setAttributeNS(Constants.WSU_NS, Constants.WSU_ID, getId());
- Element child = doc.createElementNS(Constants.WSU_NS, Constants.WSU_PREFIX +
":" + "Created");
-
child.appendChild(doc.createTextNode(SimpleTypeBindings.marshalDateTime(created)));
- element.appendChild(child);
-
- if (expires != null)
- {
- child = doc.createElementNS(Constants.WSU_NS, Constants.WSU_PREFIX +
":" + "Expires");
-
child.appendChild(doc.createTextNode(SimpleTypeBindings.marshalDateTime(expires)));
- element.appendChild(child);
- }
-
- cachedElement = element;
- return cachedElement;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/security/element/Timestamp.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/element/Timestamp.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/element/Token.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/element/Token.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/security/element/Token.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,41 +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.extensions.security.element;
-
-/**
- * <code>Token</code> represnts an authenticated identifier contained in a
- * WS-Security message.
- *
- * @author Jason T. Greene
- * @version $Id$
- */
-public interface Token extends SecurityElement
-{
-
- /**
- * Returns a uniquely identifying content that facilitates reuse of that token
- * (by making an additional reference instead of copying).
- *
- * @return the unique content
- */
- public Object getUniqueContent();
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/security/element/Token.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/element/Token.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/element/UsernameToken.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/element/UsernameToken.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/element/UsernameToken.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,134 +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.extensions.security.element;
-
-import org.apache.xml.security.utils.XMLUtils;
-import org.jboss.ws.extensions.security.Constants;
-import org.jboss.ws.extensions.security.Util;
-import org.jboss.ws.extensions.security.WSSecurityException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-
-/**
- * @author Jason T. Greene
- * @version $Id$
- */
-public class UsernameToken implements Token
-{
- private String username;
-
- private String password;
-
- private Document doc;
-
- private String id;
-
- private Element cachedElement;
-
- public UsernameToken(String username, String password, Document doc)
- {
- this.username = username;
- this.password = password;
- this.doc = doc;
- }
-
- public UsernameToken(Element element) throws WSSecurityException
- {
- this.doc = element.getOwnerDocument();
- String id = element.getAttributeNS(Constants.WSU_NS, Constants.ID);
- if (id == null || id.length() == 0)
- throw new WSSecurityException("Invalid message, UsernameToken is missing an
id");
-
- setId(id);
-
- Element child = Util.getFirstChildElement(element);
- if (child == null || ! Constants.WSSE_NS.equals(child.getNamespaceURI()) || !
"Username".equals(child.getLocalName()))
- throw new WSSecurityException("Username child expected in UsernameToken
element");
-
- this.username = XMLUtils.getFullTextChildrenFromElement(child);
-
- child = Util.getNextSiblingElement(child);
- if (child == null || ! Constants.WSSE_NS.equals(child.getNamespaceURI()) || !
"Password".equals(child.getLocalName()))
- throw new WSSecurityException("Password child expected in UsernameToken
element");
-
- this.password = XMLUtils.getFullTextChildrenFromElement(child);
- }
-
- public String getId()
- {
- if (id == null)
- id = Util.generateId("token");
-
- return id;
- }
-
- public void setId(String id)
- {
- this.id = id;
- }
-
-
- public String getPassword()
- {
- return password;
- }
-
-
- public void setPassword(String password)
- {
- this.password = password;
- }
-
- public String getUsername()
- {
- return username;
- }
-
- public void setUsername(String username)
- {
- this.username = username;
- }
-
- public Element getElement()
- {
- if (cachedElement != null)
- return cachedElement;
-
- Element element = doc.createElementNS(Constants.WSSE_NS, Constants.WSSE_PREFIX +
":" + "UsernameToken");
- element.setAttributeNS(Constants.WSU_NS, Constants.WSU_ID, getId());
- Element child = doc.createElementNS(Constants.WSSE_NS, Constants.WSSE_PREFIX +
":" + "Username");
- child.appendChild(doc.createTextNode(username));
- element.appendChild(child);
- child = doc.createElementNS(Constants.WSSE_NS, Constants.WSSE_PREFIX +
":" + "Password");
- child.appendChild(doc.createTextNode(password));
- element.appendChild(child);
-
- cachedElement = element;
- return cachedElement;
- }
-
- public Object getUniqueContent()
- {
- return null;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/security/element/UsernameToken.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/element/UsernameToken.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/security/element/X509IssuerSerial.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/element/X509IssuerSerial.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/element/X509IssuerSerial.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,145 +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.extensions.security.element;
-
-import java.security.cert.X509Certificate;
-
-import org.apache.xml.security.utils.XMLUtils;
-import org.jboss.ws.extensions.security.Constants;
-import org.jboss.ws.extensions.security.InvalidSecurityHeaderException;
-import org.jboss.ws.extensions.security.Util;
-import org.jboss.ws.extensions.security.WSSecurityException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- * <code>X509IssuerSerial</code> is a reference type within a
- * <code>SecurityTokenReference</code> that referes to a token that
- * using the Issuer's DN, and certificate serial number.
- *
- * @see org.jboss.ws.extensions.security.element.SecurityTokenReference
- * @see org.jboss.ws.extensions.security.element.BinarySecurityToken
- *
- * @author Jason T. Greene
- * @version $Id$
- */
-public class X509IssuerSerial extends Reference
-{
- private Document doc;
-
- private String issuer;
-
- private String serial;
-
- private Element cachedElement;
-
- public X509IssuerSerial(Document doc, BinarySecurityToken token) throws
WSSecurityException
- {
- this.doc = doc;
- referenceToken(token);
- }
-
- public X509IssuerSerial(Element element) throws WSSecurityException
- {
- this.doc = element.getOwnerDocument();
-
- if (! "X509Data".equals(element.getLocalName()))
- throw new InvalidSecurityHeaderException("Invalid message, invalid local
name on a X509Data element");
-
- element = Util.getFirstChildElement(element);
- if (element == null)
- throw new InvalidSecurityHeaderException("X509DataElement empty");
-
- if (! element.getLocalName().equals("X509IssuerSerial"))
- throw new InvalidSecurityHeaderException("Only X509IssuerSerial is
supported for an X509Data element");
-
- element = Util.getFirstChildElement(element);
- if (element == null)
- throw new InvalidSecurityHeaderException("X509IssuerSerial empty");
-
-
- while (element != null)
- {
- String name = element.getLocalName();
- if (name.equals("X509IssuerName"))
- issuer = XMLUtils.getFullTextChildrenFromElement(element);
- else if (name.equals("X509SerialNumber"))
- serial = XMLUtils.getFullTextChildrenFromElement(element);
-
- element = Util.getNextSiblingElement(element);
- }
-
- if (serial == null)
- throw new InvalidSecurityHeaderException("X509SerialNumber missing from
X509IssuerSerial");
-
- if (issuer == null)
- throw new InvalidSecurityHeaderException("X509IssuerName missing from
X509IssuerSerial");
- }
-
- public void referenceToken(BinarySecurityToken token) throws WSSecurityException
- {
- if (! (token instanceof X509Token))
- throw new WSSecurityException("X509IssuerSerial tried to reference
something besides an X509 token");
-
- X509Token x509 = (X509Token) token;
- X509Certificate cert = x509.getCert();
-
- this.issuer = cert.getIssuerDN().toString();
- this.serial = cert.getSerialNumber().toString();
- }
-
- public String getIssuer()
- {
- return issuer;
- }
-
- public String getSerial()
- {
- return serial;
- }
-
- public Document getDocument()
- {
- return doc;
- }
-
- public Element getElement()
- {
- if (cachedElement != null)
- return cachedElement;
-
- Element element = doc.createElementNS(Constants.XML_SIGNATURE_NS,
"ds:X509Data");
- Element issuerSerial = doc.createElementNS(Constants.XML_SIGNATURE_NS,
"ds:X509IssuerSerial");
- element.appendChild(issuerSerial);
-
- element = doc.createElementNS(Constants.XML_SIGNATURE_NS,
"ds:X509IssuerName");
- element.appendChild(doc.createTextNode(issuer));
- issuerSerial.appendChild(element);
-
- element = doc.createElementNS(Constants.XML_SIGNATURE_NS,
"ds:X509SerialNumber");
- element.appendChild(doc.createTextNode(serial));
- issuerSerial.appendChild(element);
-
- cachedElement = element;
- return cachedElement;
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/extensions/security/element/X509IssuerSerial.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/element/X509IssuerSerial.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/security/element/X509Token.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/element/X509Token.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/security/element/X509Token.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,117 +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.extensions.security.element;
-
-import java.io.ByteArrayInputStream;
-import java.security.cert.CertificateEncodingException;
-import java.security.cert.CertificateFactory;
-import java.security.cert.X509Certificate;
-
-import org.apache.xml.security.utils.XMLUtils;
-import org.jboss.util.Base64;
-import org.jboss.ws.extensions.security.Constants;
-import org.jboss.ws.extensions.security.WSSecurityException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-
-public class X509Token extends BinarySecurityToken
-{
- private X509Certificate cert;
-
- public static final String TYPE =
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3";
-
- public X509Token(X509Certificate cert, Document doc)
- {
- super(doc);
- this.cert = cert;
- }
-
- public X509Token(Element element) throws WSSecurityException
- {
- super(element.getOwnerDocument());
-
- String id = element.getAttributeNS(Constants.WSU_NS, Constants.ID);
- if (id == null || id.length() == 0)
- throw new WSSecurityException("Invalid message, BinarySecurityToken is
missing an id");
-
- setId(id);
-
- if (!
Constants.BASE64_ENCODING_TYPE.equals(element.getAttribute("EncodingType")))
- throw new WSSecurityException("Invalid encoding type (only base64 is
supported) for token:" + id);
-
- setCert(decodeCert(XMLUtils.getFullTextChildrenFromElement(element)));
- }
-
- @Override
- public String getEncodingType()
- {
- return Constants.BASE64_ENCODING_TYPE;
- }
-
- @Override
- public String getValueType()
- {
- return TYPE;
- }
-
- @Override
- public String getEncodedValue(boolean noWhitespace)
- {
- try
- {
- return Base64.encodeBytes(cert.getEncoded(), (noWhitespace) ?
Base64.DONT_BREAK_LINES : 0);
- }
- catch (CertificateEncodingException e)
- {
- throw new RuntimeException("Could not encode X509 token", e);
- }
- }
-
- public X509Certificate getCert()
- {
- return cert;
- }
-
- public void setCert(X509Certificate cert)
- {
- this.cert = cert;
- }
-
- public X509Certificate decodeCert(String data) throws WSSecurityException
- {
- try
- {
- CertificateFactory factory = CertificateFactory.getInstance("X.509");
- return (X509Certificate)factory.generateCertificate(new
ByteArrayInputStream(Base64.decode(data)));
- }
- catch(Exception e)
- {
- throw new WSSecurityException("Error decoding BinarySecurityToken: " +
e.getMessage());
- }
- }
-
- public Object getUniqueContent()
- {
- return cert;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/security/element/X509Token.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/element/X509Token.java)
Copied: trunk/src/main/java/org/jboss/ws/extensions/security/jaxrpc (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/jaxrpc)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandler.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandler.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandler.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,96 +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.extensions.security.jaxrpc;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.handler.GenericHandler;
-import javax.xml.rpc.handler.MessageContext;
-import javax.xml.soap.SOAPException;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
-import org.jboss.ws.extensions.security.WSSecurityDispatcher;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
-
-/**
- * An abstract JAXRPC handler that delegates to the WSSecurityDispatcher
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-Nov-2005
- */
-public abstract class WSSecurityHandler extends GenericHandler
-{
- // provide logging
- private static Logger log = Logger.getLogger(WSSecurityHandler.class);
-
- public QName[] getHeaders()
- {
- return null;
- }
-
- protected boolean handleInboundSecurity(MessageContext msgContext)
- {
- try
- {
- if (getSecurityConfiguration(msgContext) != null)
- {
- WSSecurityDispatcher.handleInbound((SOAPMessageContextJAXRPC)msgContext);
- }
- }
- catch (SOAPException ex)
- {
- log.error("Cannot handle inbound ws-security", ex);
- return false;
- }
- return true;
- }
-
- protected boolean handleOutboundSecurity(MessageContext msgContext)
- {
- try
- {
- if (getSecurityConfiguration(msgContext) != null)
- {
- WSSecurityDispatcher.handleOutbound((SOAPMessageContextJAXRPC)msgContext);
- }
- }
- catch (SOAPException ex)
- {
- log.error("Cannot handle outbound ws-security", ex);
- return false;
- }
- return true;
- }
-
- private WSSecurityConfiguration getSecurityConfiguration(MessageContext msgContext)
- {
- EndpointMetaData epMetaData =
((SOAPMessageContextJAXRPC)msgContext).getEndpointMetaData();
- WSSecurityConfiguration securityConfiguration =
epMetaData.getServiceMetaData().getSecurityConfiguration();
- if (securityConfiguration == null)
- log.warn("Cannot obtain security configuration");
-
- return securityConfiguration;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandler.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandler.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandlerInbound.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandlerInbound.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandlerInbound.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,47 +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.extensions.security.jaxrpc;
-
-// $Id$
-
-import javax.xml.rpc.handler.MessageContext;
-
-
-/**
- * A JAXRPC handler that delegates to the WSSecurityDispatcher
- * where the request is an inbound message.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-Nov-2005
- */
-public class WSSecurityHandlerInbound extends WSSecurityHandler
-{
- public boolean handleRequest(MessageContext msgContext)
- {
- return handleInboundSecurity(msgContext);
- }
-
- public boolean handleResponse(MessageContext msgContext)
- {
- return handleOutboundSecurity(msgContext);
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandlerInbound.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandlerInbound.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandlerOutbound.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandlerOutbound.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandlerOutbound.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,46 +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.extensions.security.jaxrpc;
-
-// $Id$
-
-import javax.xml.rpc.handler.MessageContext;
-
-
-/**
- * A JAXRPC handler that delegates to the WSSecurityDispatcher
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-Nov-2005
- */
-public class WSSecurityHandlerOutbound extends WSSecurityHandler
-{
- public boolean handleRequest(MessageContext msgContext)
- {
- return handleOutboundSecurity(msgContext);
- }
-
- public boolean handleResponse(MessageContext msgContext)
- {
- return handleInboundSecurity(msgContext);
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandlerOutbound.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandlerOutbound.java)
Copied: trunk/src/main/java/org/jboss/ws/extensions/security/jaxws (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/jaxws)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/security/jaxws/WSSecurityHandler.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/jaxws/WSSecurityHandler.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/jaxws/WSSecurityHandler.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,90 +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.extensions.security.jaxws;
-
-// $Id$
-
-import javax.xml.soap.SOAPException;
-import javax.xml.ws.handler.MessageContext;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
-import org.jboss.ws.extensions.security.WSSecurityDispatcher;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
-
-/**
- * An abstract JAXWS handler that delegates to the WSSecurityDispatcher
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-Nov-2005
- */
-public abstract class WSSecurityHandler extends GenericSOAPHandler
-{
- // provide logging
- private static Logger log = Logger.getLogger(WSSecurityHandler.class);
-
- protected boolean handleInboundSecurity(MessageContext msgContext)
- {
- try
- {
- if (getSecurityConfiguration(msgContext) != null)
- {
- WSSecurityDispatcher.handleInbound((CommonMessageContext)msgContext);
- }
- }
- catch (SOAPException ex)
- {
- log.error("Cannot handle inbound ws-security", ex);
- return false;
- }
- return true;
- }
-
- protected boolean handleOutboundSecurity(MessageContext msgContext)
- {
- try
- {
- if (getSecurityConfiguration(msgContext) != null)
- {
- WSSecurityDispatcher.handleOutbound((CommonMessageContext)msgContext);
- }
- }
- catch (SOAPException ex)
- {
- log.error("Cannot handle outbound ws-security", ex);
- return false;
- }
- return true;
- }
-
- private WSSecurityConfiguration getSecurityConfiguration(MessageContext msgContext)
- {
- EndpointMetaData epMetaData =
((CommonMessageContext)msgContext).getEndpointMetaData();
- WSSecurityConfiguration securityConfiguration =
epMetaData.getServiceMetaData().getSecurityConfiguration();
- if (securityConfiguration == null)
- log.warn("Cannot obtain security configuration");
-
- return securityConfiguration;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/security/jaxws/WSSecurityHandler.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/jaxws/WSSecurityHandler.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/security/jaxws/WSSecurityHandlerInbound.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/jaxws/WSSecurityHandlerInbound.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/jaxws/WSSecurityHandlerInbound.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,46 +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.extensions.security.jaxws;
-
-import javax.xml.ws.handler.MessageContext;
-
-// $Id$
-
-/**
- * A JAXWS handler that delegates to the WSSecurityDispatcher
- * where the request is an inbound message.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-Nov-2005
- */
-public class WSSecurityHandlerInbound extends WSSecurityHandler
-{
- protected boolean handleInbound(MessageContext msgContext)
- {
- return handleInboundSecurity(msgContext);
- }
-
- protected boolean handleOutbound(MessageContext msgContext)
- {
- return handleOutboundSecurity(msgContext);
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/extensions/security/jaxws/WSSecurityHandlerInbound.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/jaxws/WSSecurityHandlerInbound.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/security/jaxws/WSSecurityHandlerOutbound.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/jaxws/WSSecurityHandlerOutbound.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/security/jaxws/WSSecurityHandlerOutbound.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -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.extensions.security.jaxws;
-
-import javax.xml.ws.handler.MessageContext;
-
-// $Id$
-
-/**
- * A JAXWS handler that delegates to the WSSecurityDispatcher
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-Nov-2005
- */
-public class WSSecurityHandlerOutbound extends WSSecurityHandler
-{
- protected boolean handleInbound(MessageContext msgContext)
- {
- return handleOutboundSecurity(msgContext);
- }
-
- protected boolean handleOutbound(MessageContext msgContext)
- {
- return handleInboundSecurity(msgContext);
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/extensions/security/jaxws/WSSecurityHandlerOutbound.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/security/jaxws/WSSecurityHandlerOutbound.java)
Copied: trunk/src/main/java/org/jboss/ws/extensions/xop (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/xop)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/xop/CreateAttachmentVisitor.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/xop/CreateAttachmentVisitor.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/xop/CreateAttachmentVisitor.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,89 +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.extensions.xop;
-
-import java.io.IOException;
-import java.io.Writer;
-import java.util.Iterator;
-
-import org.jboss.ws.core.soap.SAAJVisitor;
-import org.jboss.ws.core.soap.SOAPContentElement;
-import org.jboss.ws.core.soap.SOAPElementImpl;
-
-/**
- * @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: trunk/src/main/java/org/jboss/ws/extensions/xop/CreateAttachmentVisitor.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/xop/CreateAttachmentVisitor.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/xop/DisableMTOMHandler.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/xop/DisableMTOMHandler.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/xop/DisableMTOMHandler.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,59 +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.extensions.xop;
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.handler.GenericHandler;
-import javax.xml.rpc.handler.MessageContext;
-
-import org.jboss.ws.core.jaxrpc.StubExt;
-
-/**
- * @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: trunk/src/main/java/org/jboss/ws/extensions/xop/DisableMTOMHandler.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/xop/DisableMTOMHandler.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/xop/RestoreXOPElementVisitor.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/xop/RestoreXOPElementVisitor.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/xop/RestoreXOPElementVisitor.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,75 +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.extensions.xop;
-
-import java.util.Iterator;
-
-import org.jboss.ws.core.soap.SAAJVisitor;
-import org.jboss.ws.core.soap.SOAPContentElement;
-import org.jboss.ws.core.soap.SOAPElementImpl;
-
-/**
- * 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: trunk/src/main/java/org/jboss/ws/extensions/xop/RestoreXOPElementVisitor.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/xop/RestoreXOPElementVisitor.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/xop/XOPContext.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/xop/XOPContext.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/xop/XOPContext.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,429 +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.extensions.xop;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.util.Iterator;
-
-import javax.activation.DataHandler;
-import javax.xml.namespace.QName;
-import javax.xml.soap.AttachmentPart;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-
-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.core.jaxrpc.StubExt;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.core.soap.NameImpl;
-import org.jboss.ws.core.soap.SOAPElementImpl;
-import org.jboss.ws.core.soap.SOAPMessageImpl;
-import org.jboss.ws.core.soap.attachment.MimeConstants;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.core.utils.JavaUtils;
-import org.jboss.ws.core.utils.MimeUtils;
-import org.jboss.ws.extensions.xop.jaxrpc.XOPMarshallerImpl;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.xb.binding.SimpleTypeBindings;
-import org.jboss.xb.binding.sunday.xop.XOPMarshaller;
-import org.jboss.xb.binding.sunday.xop.XOPObject;
-
-/**
- * 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.core.soap.SOAPContentElement#handleMTOMTransitions()
- * @see org.jboss.ws.extensions.xop.jaxrpc.XOPUnmarshallerImpl
- * @see XOPMarshallerImpl
- *
- * @author Heiko Braun <heiko.braun(a)jboss.com>
- * @since May 10, 2006
- * @version $Id$
- */
-public class XOPContext
-{
- // provide logging
- 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 enabled.<br>
- *
- * With JAX-WS is depends on a endpoint property and defaults to FALSE,
- * opposed to JAX-RPC where it defaults to TRUE and is set through a message context
property.
- * (<code>org.jboss.ws.mtom.enabled</code>)<br>
- */
- public static boolean isMTOMEnabled()
- {
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- boolean isJAXWS = msgContext.getEndpointMetaData().getType() ==
EndpointMetaData.Type.JAXWS;
-
- if (isJAXWS)
- {
- return msgContext.getEndpointMetaData().isMtomEnabled();
- }
- else
- {
- 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.core.soap.SOAPConnectionImpl#callInternal(javax.xml.soap.SOAPMessage, Object,
boolean)
- * @see org.jboss.ws.core.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: trunk/src/main/java/org/jboss/ws/extensions/xop/XOPContext.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/xop/XOPContext.java)
Copied: trunk/src/main/java/org/jboss/ws/extensions/xop/jaxrpc (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/xop/jaxrpc)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/xop/jaxrpc/JBossXBContentAdapter.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/xop/jaxrpc/JBossXBContentAdapter.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/xop/jaxrpc/JBossXBContentAdapter.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,236 +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.extensions.xop.jaxrpc;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-import javax.activation.DataHandler;
-import javax.activation.DataSource;
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.soap.attachment.ContentHandlerRegistry;
-import org.jboss.ws.core.soap.attachment.SwapableMemoryDataSource;
-import org.jboss.ws.core.utils.IOUtils;
-import org.jboss.ws.core.utils.MimeUtils;
-import org.jboss.ws.extensions.xop.XOPContext;
-import org.jboss.xb.binding.sunday.marshalling.MarshallingContext;
-import org.jboss.xb.binding.sunday.marshalling.TermBeforeMarshallingCallback;
-import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
-import org.jboss.xb.binding.sunday.unmarshalling.TermBeforeSetParentCallback;
-import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding;
-import org.jboss.xb.binding.sunday.unmarshalling.UnmarshallingContext;
-
-/**
- * Adopts raw binary contents to java types.
- * This class works in conjunction with the <code>XOPUnmarshallerImpl</code>
- * and <code>XOPMarshallerImpl</code>.
- *
- * @see XOPUnmarshallerImpl
- * @see XOPMarshallerImpl
- *
- * @author Heiko Braun <heiko.braun(a)jboss.com>
- * @version $Id: JBossXBContentAdapter.java 1322 2006-10-27 13:27:04Z
heiko.braun(a)jboss.com $
- * @since Oct 19, 2006
- */
-public class JBossXBContentAdapter implements TermBeforeMarshallingCallback,
TermBeforeSetParentCallback {
-
- private static final Logger log = Logger.getLogger(JBossXBContentAdapter.class);
- private static final QName XMIME_BASE_64 = new QName(Constants.NS_XML_MIME,
"base64Binary");
- private static final QName XOP_INCLUDE = new QName(Constants.NS_XOP,
"Include");
-
- static
- {
- // Load JAF content handlers
- ContentHandlerRegistry.register();
- }
-
- /**
- * When XOP is disabled we need to convert java types to byte[]
- * before handing off to XB.
- */
- public Object beforeMarshalling(Object object, MarshallingContext marshallingContext)
{
-
- boolean mtomDisabled = !XOPContext.isMTOMEnabled();
- boolean convertableType = object!=null && !(object instanceof byte[]);
-
- if( mtomDisabled && convertableType )
- {
- String contentType = MimeUtils.resolveMimeType(object);
- log.debug("Adopt " + object.getClass() + " to byte[], contentType
" + contentType);
-
- DataHandler dh = new DataHandler(object, contentType);
- ByteArrayOutputStream bout = new ByteArrayOutputStream();
- try
- {
- IOUtils.copyStream(bout, dh.getInputStream());
- object = bout.toByteArray();
- }
- catch (IOException e)
- {
- throw new WSException("Failed to adopt XOP content type", e);
- }
- }
-
- return object;
- }
-
- /**
- * When XOP is disabled (inlined request) we receive a byte[] from XB
- * that needs to be converted in to java type
- */
- public Object beforeSetParent(Object object, UnmarshallingContext ctx) {
-
- if(null==object)
- return object;
-
- // may be null when it's actually an encoded request ?!
- Class targetClass = ctx.resolvePropertyType();
-
- if(null==targetClass) {
- throw new WSException("Failed to resolve target property type on "+
ctx.getParticle());
- }
-
- boolean isRegularMessage = !XOPContext.isXOPMessage();
- boolean isSimpleType = (object instanceof byte[]);
- boolean doTypesMatch = ( targetClass.equals(object.getClass()) );
-
- // Handle inlined requests.
- // In this case XB treats binaries as simple types that are unmarshalled to byte[]
- // Still type conversion will be necessary.
- if( isRegularMessage && isSimpleType && !doTypesMatch)
- {
- String contentType = MimeUtils.resolveMimeType(targetClass);
- log.debug("Adopt byte[] to " + targetClass +", contentType
"+ contentType);
-
- try
- {
- DataHandler dh = new DataHandler(
- wrapAsDataSource(object, contentType)
- );
-
- if(targetClass.equals(DataHandler.class))
- object = dh;
- else
- object = dh.getContent();
- }
- catch (IOException e)
- {
- throw new WSException("Failed to adopt XOP content type", e);
- }
- }
-
- // Handle XOP encoded requests.
- // XB will use the XOPUnmarshaller callback and receive a DataHandler instance.
- // In this case we are be able to instantiate the correct content object
- // from the data handler, with the exception of content-type
'application/octet-stream'.
- // These attachments will be returned as DataHandler instances.
- else if(XOPContext.isXOPMessage() && (object instanceof DataHandler)
&& !doTypesMatch)
- {
- try
- {
- String contentType = MimeUtils.resolveMimeType(targetClass);
- log.debug("Adopt DataHandler to " + targetClass +",
contentType "+ contentType);
-
- DataHandler dh = new DataHandler(
- wrapAsDataSource(object, contentType)
- );
- object = dh.getContent();
-
- // 'application/octet-stream' will return a byte[] instead fo the
stream
- if(object instanceof InputStream)
- {
- ByteArrayOutputStream bout = new ByteArrayOutputStream();
- dh.writeTo(bout);
- object = bout.toByteArray();
- }
- }
- catch (IOException e)
- {
- throw new WSException("Failed to adopt XOP content type", e);
- }
- }
-
- return object;
- }
-
- private DataSource wrapAsDataSource(Object object, String contentType) throws
IOException {
-
- DataSource ds;
-
- if(object instanceof byte[])
- {
- ds = new SwapableMemoryDataSource(new ByteArrayInputStream((byte[])object),
contentType);
- }
- else if(object instanceof DataHandler)
- {
- ds = new SwapableMemoryDataSource(((DataHandler)object).getInputStream(),
contentType);
- }
- else
- {
- throw new IllegalArgumentException("Failed to wrap as data source:
"+object.getClass());
- }
-
- return ds;
- }
-
- /**
- * A factory method that registers the XB (un)marshalling adapters with schema
binding.
- * These adapters convert java types into byte[] and reverse,
- * in order to match the jaxrpc-mapping declaration in case we receive or send an
inlined request.
- */
- public static void register(SchemaBinding schemaBinding)
- {
- JBossXBContentAdapter contentAdapter = new JBossXBContentAdapter();
-
- // base64 simple types
- TypeBinding base64Type =
schemaBinding.getType(org.jboss.xb.binding.Constants.QNAME_BASE64BINARY);
- base64Type.setBeforeMarshallingCallback( contentAdapter );
- base64Type.setBeforeSetParentCallback( contentAdapter );
-
- // xmime complex types
- TypeBinding xmimeBase64Type = schemaBinding.getType(XMIME_BASE_64);
- if(xmimeBase64Type!=null)
- {
- xmimeBase64Type.setBeforeMarshallingCallback( contentAdapter );
- xmimeBase64Type.setBeforeSetParentCallback( contentAdapter );
-
- // xop:Include
- /*ModelGroupBinding modelGroup =
(ModelGroupBinding)xmimeBase64Type.getParticle().getTerm();
- ParticleBinding particle =
(ParticleBinding)modelGroup.getParticles().iterator().next();
- ElementBinding xopInclude = (ElementBinding)particle.getTerm();
-
- if(! xopInclude.getQName().equals(XOP_INCLUDE))
- throw new WSException("Looks like the JBossXB XOP implementation has
changed, please open a JIRA issue");
-
- xopInclude.setBeforeMarshallingCallback(contentAdapter);
- xopInclude.setBeforeSetParentCallback(contentAdapter);
- */
- }
- }
-
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/xop/jaxrpc/JBossXBContentAdapter.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/xop/jaxrpc/JBossXBContentAdapter.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/xop/jaxrpc/XOPMarshallerImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/xop/jaxrpc/XOPMarshallerImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/xop/jaxrpc/XOPMarshallerImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,106 +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.extensions.xop.jaxrpc;
-
-import javax.activation.DataHandler;
-import javax.xml.namespace.QName;
-import javax.xml.soap.AttachmentPart;
-
-import org.jboss.logging.Logger;
-import org.jboss.util.NotImplementedException;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.core.soap.SOAPMessageImpl;
-import org.jboss.ws.core.soap.attachment.ContentHandlerRegistry;
-import org.jboss.ws.core.soap.attachment.MimeConstants;
-import org.jboss.ws.extensions.xop.XOPContext;
-import org.jboss.xb.binding.sunday.xop.XOPMarshaller;
-import org.jboss.xb.binding.sunday.xop.XOPObject;
-
-/**
- * The XOPUnmarshallerImpl allows callbacks from the binding layer towards the
- * soap processing components in order to optimize binary processing.
- *
- * @see XOPUnmarshallerImpl
- *
- * @author Heiko Braun <heiko.braun(a)jboss.com>
- * @since May 9, 2006
- * @version $Id$
- */
-public class XOPMarshallerImpl implements XOPMarshaller {
-
- private static final Logger log = Logger.getLogger(XOPMarshallerImpl.class);
-
- static
- {
- // Load JAF content handlers
- ContentHandlerRegistry.register();
- }
-
- public boolean isXOPPackage()
- {
- return XOPContext.isXOPMessage();
- }
-
- public String addMtomAttachment(XOPObject obj, String elementNamespace, String
elementName)
- {
-
- CommonMessageContext msgContext =
(CommonMessageContext)MessageContextAssociation.peekMessageContext();
- SOAPMessageImpl soapMessage = (SOAPMessageImpl)msgContext.getSOAPMessage();
-
- QName xmlName = new QName(elementNamespace, elementName);
- log.debug("serialize: [xmlName=" + xmlName + "]");
-
- String cid =
soapMessage.getCidGenerator().generateFromName(xmlName.getLocalPart());
-
- DataHandler dataHandler = XOPContext.createDataHandler(obj);
- AttachmentPart xopPart = soapMessage.createAttachmentPart(dataHandler);
- xopPart.addMimeHeader(MimeConstants.CONTENT_ID, '<'+cid+'>');
// RFC2392 requirement
- soapMessage.addAttachmentPart(xopPart);
-
- log.debug("Created attachment part " +cid+", with content-type
" +xopPart.getContentType());
-
- return "cid:" + cid;
-
- }
-
- public String addMtomAttachment(byte[] data, String elementNamespace, String
elementName)
- {
- /*
- TODO: this requires a java mail upgrade
- ByteArrayDataSource ds = new ByteArrayDataSource(data,
MimeConstants.TYPE_APPLICATION_OCTET_STREAM);
- return addMtomAttachment(
- new DataHandler(
- ds, MimeConstants.TYPE_APPLICATION_OCTET_STREAM),
- elementNamespace, elementName
- );*/
-
- throw new NotImplementedException("Not implemented yet");
- }
-
- public String addSwaRefAttachment(Object obj)
- {
- throw new NotImplementedException();
- }
-
-
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/xop/jaxrpc/XOPMarshallerImpl.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/xop/jaxrpc/XOPMarshallerImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/xop/jaxrpc/XOPScanner.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/xop/jaxrpc/XOPScanner.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/extensions/xop/jaxrpc/XOPScanner.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,153 +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.extensions.xop.jaxrpc;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.xerces.xs.XSComplexTypeDefinition;
-import org.apache.xerces.xs.XSElementDeclaration;
-import org.apache.xerces.xs.XSModelGroup;
-import org.apache.xerces.xs.XSObjectList;
-import org.apache.xerces.xs.XSParticle;
-import org.apache.xerces.xs.XSSimpleTypeDefinition;
-import org.apache.xerces.xs.XSTerm;
-import org.apache.xerces.xs.XSTypeDefinition;
-
-/**
- * Scans complex type definitions for nested XOP type declarations.
- * A XOP type declaration is identified as a complex type
- * that derives from xsd:base64Binary, i.e:
- *
- * <code> <pre>
- * <xs:complexType name="MyXOPElement" >
- * <xs:simpleContent>
- * <xs:extension base="xs:base64Binary" >
- * <xs:attribute ref="xmime:contentType" />
- * </xs:extension>
- * </xs:simpleContent>
- * </xs:complexType>
- * </pre></code>
- *
- * @author Heiko Braun <heiko.braun(a)jboss.com>
- * @since Jun 9, 2006
- * @version $Id$
- */
-public class XOPScanner {
-
- // avoid circular scans
- private List<String> scannedItems = new ArrayList<String>();
- private static final String BASE64_BINARY = "base64Binary";
-
- /**
- * Query a complex type for nested XOP type definitions.
- */
- public XSTypeDefinition findXOPTypeDef(XSTypeDefinition typeDef)
- {
- if(typeDef==null)
- return typeDef;
- XSTypeDefinition result = null;
- String name = typeDef.getName();
- String namespace = typeDef.getNamespace()!=null ?
typeDef.getNamespace():"";
-
- if(typeDef instanceof XSSimpleTypeDefinition &&
BASE64_BINARY.equals(name))
- {
- return typeDef;
- }
- else if(typeDef instanceof XSComplexTypeDefinition)
- {
- XSComplexTypeDefinition complexTypeDef = (XSComplexTypeDefinition)typeDef;
- if(name!=null)
- {
- String typeKey = namespace+":"+name;
-
- if(scannedItems.contains(typeKey))
- {
- return null;
- }
- else
- {
- scannedItems.add(typeKey);
- }
- }
-
- // An XOP parameter is detected if it is a complex type
- // that derives from xsd:base64Binary
- if (complexTypeDef.getSimpleType() != null)
- {
- String typeName = complexTypeDef.getSimpleType().getName();
- if (BASE64_BINARY.equals(typeName))
- return complexTypeDef;
- }
- else
- {
-
- XSModelGroup xm = null;
- if(complexTypeDef.getContentType() !=
XSComplexTypeDefinition.CONTENTTYPE_EMPTY)
- {
- XSParticle xp = complexTypeDef.getParticle();
- if (xp != null)
- {
- XSTerm xterm = xp.getTerm();
- if(xterm instanceof XSModelGroup)
- {
- xm = (XSModelGroup)xterm;
- //System.out.println("xm -> " + xm);
-
- XSObjectList xo = xm.getParticles();
-
- // interate over nested particles
- for(int i=0; i<xm.getParticles().getLength(); i++ )
- {
- XSTerm xsterm = ((XSParticle)xo.item(i)).getTerm();
-
- // Can be either XSModelGroup, XSWildcard, XSElementDeclaration
- // We only proceed with XSElementDeclaration
- if(xsterm instanceof XSElementDeclaration)
- {
- XSElementDeclaration xe = (XSElementDeclaration)xsterm;
- XSTypeDefinition nestedTypeDef = xe.getTypeDefinition();
-
- //System.out.println("Query nested -> " +
xe.getName());
- result = findXOPTypeDef(nestedTypeDef);
- }
- }
- }
- }
- }
-
- }
-
- //System.out.println("result -> " + result);
-
- }
-
- return result;
-
- }
-
- public void reset()
- {
- scannedItems.clear();
- }
-
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/extensions/xop/jaxrpc/XOPScanner.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/xop/jaxrpc/XOPScanner.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/xop/jaxrpc/XOPUnmarshallerImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/xop/jaxrpc/XOPUnmarshallerImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/xop/jaxrpc/XOPUnmarshallerImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,107 +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.extensions.xop.jaxrpc;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-
-import javax.activation.DataHandler;
-import javax.xml.namespace.QName;
-import javax.xml.soap.AttachmentPart;
-import javax.xml.soap.SOAPException;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.soap.attachment.ContentHandlerRegistry;
-import org.jboss.ws.extensions.xop.XOPContext;
-import org.jboss.xb.binding.sunday.xop.XOPObject;
-import org.jboss.xb.binding.sunday.xop.XOPUnmarshaller;
-
-/**
- * The XOPUnmarshallerImpl allows callbacks from the binding layer towards the
- * soap processing components in order to optimize binary processing.
- *
- * @see XOPMarshallerImpl
- *
- * @author Heiko Braun <heiko.braun(a)jboss.com>
- * @since May 9, 2006
- * @version $Id$
- */
-public class XOPUnmarshallerImpl implements XOPUnmarshaller {
-
- private static final Logger log = Logger.getLogger(XOPUnmarshallerImpl.class);
- private static final QName XOP_INCLUDE = new QName(Constants.NS_XOP,
"Include");
-
- static
- {
- // Load JAF content handlers
- ContentHandlerRegistry.register();
- }
-
- public boolean isXOPPackage()
- {
- return XOPContext.isXOPMessage();
- }
-
- public XOPObject getAttachmentAsDataHandler(String cid)
- {
- try
- {
- AttachmentPart part = XOPContext.getAttachmentByCID(cid);
- DataHandler dataHandler = part.getDataHandler();
- String contentType = dataHandler.getContentType();
-
- // Wrapping the DataHandler shields XB from the JAF dependency
- XOPObject xopObject = new XOPObject(dataHandler);
- xopObject.setContentType(contentType);
-
- return xopObject;
- }
- catch(SOAPException e)
- {
- throw new WSException("Failed to access attachment part", e);
- }
- }
-
- public byte[] getAttachmentAsByteArray(String cid)
- {
- try
- {
- AttachmentPart part = XOPContext.getAttachmentByCID(cid);
- DataHandler dh = part.getDataHandler();
- ByteArrayOutputStream bout = new ByteArrayOutputStream();
- dh.writeTo(bout);
-
- return bout.toByteArray();
- }
- catch (SOAPException ex)
- {
- throw new WSException(ex);
- }
- catch(IOException e)
- {
- throw new WSException(e);
- }
-
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/xop/jaxrpc/XOPUnmarshallerImpl.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/xop/jaxrpc/XOPUnmarshallerImpl.java)
Copied: trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentMarshallerImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentMarshallerImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentMarshallerImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,65 +0,0 @@
-package org.jboss.ws.extensions.xop.jaxws;
-
-import javax.activation.DataHandler;
-import javax.xml.bind.attachment.AttachmentMarshaller;
-import javax.xml.namespace.QName;
-import javax.xml.soap.AttachmentPart;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.core.soap.SOAPMessageImpl;
-import org.jboss.ws.core.soap.attachment.ContentHandlerRegistry;
-import org.jboss.ws.core.soap.attachment.MimeConstants;
-import org.jboss.ws.extensions.xop.XOPContext;
-
-public class AttachmentMarshallerImpl extends AttachmentMarshaller
-{
- // provide logging
- private static final Logger log = Logger.getLogger(AttachmentMarshallerImpl.class);
-
- static
- {
- // Load JAF content handlers
- ContentHandlerRegistry.register();
- }
-
- public AttachmentMarshallerImpl()
- {
- super();
- }
-
- public String addMtomAttachment(DataHandler dataHandler, String string, String
string1)
- {
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- SOAPMessageImpl soapMessage = (SOAPMessageImpl)msgContext.getSOAPMessage();
-
- QName xmlName = new QName(string, string1);
- log.debug("serialize: [xmlName=" + xmlName + "]");
-
- String cid =
soapMessage.getCidGenerator().generateFromName(xmlName.getLocalPart());
- AttachmentPart xopPart = soapMessage.createAttachmentPart(dataHandler);
- xopPart.addMimeHeader(MimeConstants.CONTENT_ID, '<' + cid +
'>'); // RFC2392 requirement
- soapMessage.addAttachmentPart(xopPart);
-
- log.debug("Created attachment part " + cid + ", with content-type
" + xopPart.getContentType());
-
- return "cid:" + cid;
- }
-
- public String addMtomAttachment(byte[] bytes, int i, int i1, String string, String
string1, String string2)
- {
- throw new WSException("Not yet implemented");
- }
-
- public String addSwaRefAttachment(DataHandler dataHandler)
- {
- throw new WSException("Not yet implemented");
- }
-
- public boolean isXOPPackage()
- {
- return XOPContext.isXOPMessage();
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentMarshallerImpl.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentMarshallerImpl.java)
Deleted:
trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentUnmarshallerImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentUnmarshallerImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentUnmarshallerImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,67 +0,0 @@
-package org.jboss.ws.extensions.xop.jaxws;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-
-import javax.activation.DataHandler;
-import javax.xml.bind.attachment.AttachmentUnmarshaller;
-import javax.xml.soap.AttachmentPart;
-import javax.xml.soap.SOAPException;
-
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.soap.attachment.ContentHandlerRegistry;
-import org.jboss.ws.extensions.xop.XOPContext;
-
-public class AttachmentUnmarshallerImpl extends AttachmentUnmarshaller
-{
-
- static
- {
- // Load JAF content handlers
- ContentHandlerRegistry.register();
- }
-
- public AttachmentUnmarshallerImpl()
- {
- super();
- }
-
- public boolean isXOPPackage()
- {
- return XOPContext.isXOPMessage();
- }
-
- public DataHandler getAttachmentAsDataHandler(String cid)
- {
- try
- {
- AttachmentPart part = XOPContext.getAttachmentByCID(cid);
- return part.getDataHandler();
- }
- catch (SOAPException e)
- {
- throw new WSException("Failed to access attachment part", e);
- }
- }
-
- public byte[] getAttachmentAsByteArray(String cid)
- {
- try
- {
- AttachmentPart part = XOPContext.getAttachmentByCID(cid);
- DataHandler dh = part.getDataHandler();
- ByteArrayOutputStream bout = new ByteArrayOutputStream();
- dh.writeTo(bout);
-
- return bout.toByteArray();
- }
- catch (SOAPException ex)
- {
- throw new WSException(ex);
- }
- catch (IOException e)
- {
- throw new WSException(e);
- }
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentUnmarshallerImpl.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentUnmarshallerImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws/ReflectiveXOPScanner.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws/ReflectiveXOPScanner.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws/ReflectiveXOPScanner.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,91 +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.extensions.xop.jaxws;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-import javax.xml.bind.annotation.XmlMimeType;
-
-/**
- * @author Heiko Braun <heiko.braun(a)jboss.com>
- * @version $Id$
- * @since 04.12.2006
- */
-public class ReflectiveXOPScanner {
-
- /**
- * Scan java types for MTOM declarations
- *
- * @param xmlRoot
- * @return the first matching XmlMimeType#value()
- */
- public String scan(Class xmlRoot)
- {
-
- for(Field field : xmlRoot.getDeclaredFields())
- {
- Class<?> type = field.getType();
- String mimeType = null;
-
- if(field.isAnnotationPresent(XmlMimeType.class))
- {
- XmlMimeType mimeTypeDecl = field.getAnnotation(XmlMimeType.class);
- mimeType = mimeTypeDecl.value();
- }
-
- if(null == mimeType) // try getter methods
- {
- mimeType = scanGetterAnnotation(xmlRoot, field);
- }
-
- if(null == mimeType) // recursive search
- {
- boolean isJDKClass = type.getPackage()!= null ?
type.getPackage().getName().startsWith("java") : true;
- if(!isJDKClass) scan(type);
- }
- else
- {
- return mimeType;
- }
-
- }
-
- return null;
- }
-
- private static String scanGetterAnnotation(Class owner, Field field)
- {
- String getterMethodName = "get"+field.getName();
- for(Method method : owner.getDeclaredMethods())
- {
- if(method.getName().equalsIgnoreCase(getterMethodName)
- && method.isAnnotationPresent(XmlMimeType.class))
- {
- XmlMimeType mimeTypeDecl = method.getAnnotation(XmlMimeType.class);
- return mimeTypeDecl.value();
- }
- }
-
- return null;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws/ReflectiveXOPScanner.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws/ReflectiveXOPScanner.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws/ReflectiveXOPScanner.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws/ReflectiveXOPScanner.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -0,0 +1,96 @@
+/*
+ * 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.extensions.xop.jaxws;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+
+import javax.xml.bind.annotation.XmlMimeType;
+
+import org.jboss.ws.core.utils.JavaUtils;
+
+/**
+ * @author Heiko Braun <heiko.braun(a)jboss.com>
+ * @version $Id$
+ * @since 04.12.2006
+ */
+public class ReflectiveXOPScanner
+{
+
+ /**
+ * Scan java types for MTOM declarations
+ *
+ * @param xmlRoot
+ * @return the first matching XmlMimeType#value()
+ */
+ public String scan(Class xmlRoot)
+ {
+ for (Field field : xmlRoot.getDeclaredFields())
+ {
+ Class<?> type = field.getType();
+ String mimeType = null;
+
+ // prevent endless recursion
+ if (type == xmlRoot)
+ continue;
+
+ if (field.isAnnotationPresent(XmlMimeType.class))
+ {
+ XmlMimeType mimeTypeDecl = field.getAnnotation(XmlMimeType.class);
+ mimeType = mimeTypeDecl.value();
+ }
+
+ if (null == mimeType) // try getter methods
+ {
+ mimeType = scanGetterAnnotation(xmlRoot, field);
+ }
+
+ if (null == mimeType) // recursive search
+ {
+ if (!JavaUtils.isPrimitive(type) && !type.isArray() &&
!type.getName().startsWith("java"))
+ scan(type);
+ }
+ else
+ {
+ return mimeType;
+ }
+
+ }
+
+ return null;
+ }
+
+ private static String scanGetterAnnotation(Class owner, Field field)
+ {
+ String getterMethodName = "get" + field.getName();
+ for (Method method : owner.getDeclaredMethods())
+ {
+ if (method.getName().equalsIgnoreCase(getterMethodName) &&
method.isAnnotationPresent(XmlMimeType.class))
+ {
+ XmlMimeType mimeTypeDecl = method.getAnnotation(XmlMimeType.class);
+ return mimeTypeDecl.value();
+ }
+ }
+
+ return null;
+ }
+}
Modified: trunk/src/main/java/org/jboss/ws/integration/SecurityAdaptorFactoryImpl.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/SecurityAdaptorFactoryImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/main/java/org/jboss/ws/integration/SecurityAdaptorFactoryImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -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.extensions.security.SecurityAdaptor;
+import org.jboss.ws.extensions.security.SecurityAdaptorFactory;
/**
* A Jboss specific SecurityAdaptorFactory
Modified: trunk/src/main/java/org/jboss/ws/integration/jboss50/AbstractDeployer.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/integration/jboss50/AbstractDeployer.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/main/java/org/jboss/ws/integration/jboss50/AbstractDeployer.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -28,11 +28,11 @@
import org.jboss.deployers.spi.deployer.DeploymentUnit;
import org.jboss.kernel.spi.registry.KernelRegistry;
import org.jboss.kernel.spi.registry.KernelRegistryEntry;
-import org.jboss.ws.deployment.AbstractServiceEndpointPublisher;
-import org.jboss.ws.deployment.ServiceEndpointDeployer;
-import org.jboss.ws.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.deployment.UnifiedDeploymentInfo.DeploymentType;
-import org.jboss.ws.server.KernelLocator;
+import org.jboss.ws.core.server.AbstractServiceEndpointPublisher;
+import org.jboss.ws.core.server.KernelLocator;
+import org.jboss.ws.core.server.ServiceEndpointDeployer;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
/**
* An abstract web service deployer
Modified: trunk/src/main/java/org/jboss/ws/integration/jboss50/AbstractEJBDeployer.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss50/AbstractEJBDeployer.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss50/AbstractEJBDeployer.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -27,8 +27,8 @@
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.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
/**
* An abstract deployer for EJB Endpoints
Modified: trunk/src/main/java/org/jboss/ws/integration/jboss50/AbstractJSEDeployer.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss50/AbstractJSEDeployer.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss50/AbstractJSEDeployer.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -43,10 +43,10 @@
import org.jboss.metadata.web.Servlet;
import org.jboss.virtual.VirtualFile;
import org.jboss.ws.WSException;
-import org.jboss.ws.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.server.ServerConfig;
-import org.jboss.ws.server.ServerConfigFactory;
-import org.jboss.ws.utils.IOUtils;
+import org.jboss.ws.core.server.ServerConfig;
+import org.jboss.ws.core.server.ServerConfigFactory;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.core.utils.IOUtils;
/**
* An abstract deployer for JSE Endpoints
Modified: trunk/src/main/java/org/jboss/ws/integration/jboss50/DeploymentInfoAdaptor.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss50/DeploymentInfoAdaptor.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss50/DeploymentInfoAdaptor.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -29,7 +29,7 @@
import org.jboss.ejb3.Ejb3Deployment;
import org.jboss.logging.Logger;
import org.jboss.metadata.WebMetaData;
-import org.jboss.ws.deployment.UnifiedDeploymentInfo;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
// $Id$
Modified: trunk/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerJSE.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerJSE.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerJSE.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -29,8 +29,8 @@
import org.jboss.deployers.spi.deployer.DeploymentUnit;
import org.jboss.metadata.WebMetaData;
import org.jboss.virtual.VirtualFile;
-import org.jboss.ws.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.deployment.UnifiedDeploymentInfo.DeploymentType;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCDeployment;
/**
Modified: trunk/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerEJB3.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerEJB3.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerEJB3.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -32,9 +32,9 @@
import org.jboss.ejb3.EJBContainer;
import org.jboss.ejb3.Ejb3Deployment;
import org.jboss.ejb3.stateless.StatelessContainer;
-import org.jboss.ws.deployment.JAXWSDeployment;
-import org.jboss.ws.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.deployment.UnifiedDeploymentInfo.DeploymentType;
+import org.jboss.ws.core.server.JAXWSDeployment;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
/**
* A deployer JAXWS EJB3 Endpoints
Modified: trunk/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerJSE.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerJSE.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerJSE.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -32,9 +32,9 @@
import org.jboss.deployers.spi.deployer.DeploymentUnit;
import org.jboss.metadata.WebMetaData;
import org.jboss.metadata.web.Servlet;
-import org.jboss.ws.deployment.JAXWSDeployment;
-import org.jboss.ws.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.deployment.UnifiedDeploymentInfo.DeploymentType;
+import org.jboss.ws.core.server.JAXWSDeployment;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
/**
* A deployer JAXWS JSE Endpoints
Modified: trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossContextServlet.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossContextServlet.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossContextServlet.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -24,8 +24,8 @@
// $Id$
import org.jboss.logging.Logger;
-import org.jboss.ws.common.CommonContextServlet;
-import org.jboss.ws.server.ServiceEndpointManagerFactory;
+import org.jboss.ws.core.CommonContextServlet;
+import org.jboss.ws.core.server.ServiceEndpointManagerFactory;
/**
* The servlet that that is associated with context /jbossws
Modified:
trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossServiceEndpointServlet.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossServiceEndpointServlet.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossServiceEndpointServlet.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -29,12 +29,12 @@
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.core.server.AbstractServiceEndpointServlet;
+import org.jboss.ws.core.server.ServiceEndpoint;
import org.jboss.ws.metadata.config.WSCommonConfig;
-import org.jboss.ws.server.ServiceEndpoint;
-import org.jboss.ws.server.AbstractServiceEndpointServlet;
+import org.jboss.ws.metadata.umdm.HandlerMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
/**
* A servlet that is installed for every web service endpoint.
Modified:
trunk/src/main/java/org/jboss/ws/integration/jboss50/PortComponentLinkServlet.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss50/PortComponentLinkServlet.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss50/PortComponentLinkServlet.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -34,9 +34,9 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-import org.jboss.ws.server.ServiceEndpoint;
-import org.jboss.ws.server.ServiceEndpointManager;
-import org.jboss.ws.server.ServiceEndpointManagerFactory;
+import org.jboss.ws.core.server.ServiceEndpoint;
+import org.jboss.ws.core.server.ServiceEndpointManager;
+import org.jboss.ws.core.server.ServiceEndpointManagerFactory;
/**
* A servlet that reports the serviceURL for a given service ID.
Modified: trunk/src/main/java/org/jboss/ws/integration/jboss50/ServerConfigImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/integration/jboss50/ServerConfigImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/main/java/org/jboss/ws/integration/jboss50/ServerConfigImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -30,8 +30,8 @@
import javax.management.ObjectName;
import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.ws.server.ServerConfig;
-import org.jboss.ws.utils.ObjectNameFactory;
+import org.jboss.ws.core.server.ServerConfig;
+import org.jboss.ws.core.utils.ObjectNameFactory;
/**
* JBoss specific implementation of a ServerConfig
Modified:
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointGeneratorEJB.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointGeneratorEJB.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointGeneratorEJB.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -34,14 +34,14 @@
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.server.ServerConfig;
-import org.jboss.ws.server.ServerConfigFactory;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
+import org.jboss.ws.core.server.ServerConfig;
+import org.jboss.ws.core.server.ServerConfigFactory;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
+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.w3c.dom.Element;
/**
Modified:
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointGeneratorEJB3.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointGeneratorEJB3.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointGeneratorEJB3.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -31,7 +31,7 @@
import org.jboss.ejb3.EJBContainer;
import org.jboss.ejb3.Ejb3Deployment;
import org.jboss.logging.Logger;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMUtils;
import org.w3c.dom.Element;
/**
Modified:
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointInvokerEJB3.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointInvokerEJB3.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointInvokerEJB3.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -32,12 +32,12 @@
import org.jboss.ejb3.stateless.StatelessContainer;
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-import org.jboss.ws.binding.EndpointInvocation;
-import org.jboss.ws.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.server.AbstractServiceEndpointInvoker;
-import org.jboss.ws.server.ServiceEndpointInfo;
-import org.jboss.ws.server.ServiceEndpointInvoker;
-import org.jboss.ws.utils.ObjectNameFactory;
+import org.jboss.ws.core.EndpointInvocation;
+import org.jboss.ws.core.server.AbstractServiceEndpointInvoker;
+import org.jboss.ws.core.server.ServiceEndpointInfo;
+import org.jboss.ws.core.server.ServiceEndpointInvoker;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.core.utils.ObjectNameFactory;
/**
* Handles invocations on EJB3 endpoints.
Modified:
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointLifecycleDeployer.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointLifecycleDeployer.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointLifecycleDeployer.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -31,10 +31,9 @@
import org.jboss.kernel.spi.registry.KernelRegistry;
import org.jboss.kernel.spi.registry.KernelRegistryEntry;
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.server.KernelLocator;
+import org.jboss.ws.core.server.KernelLocator;
+import org.jboss.ws.core.server.ServiceEndpointDeployer;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
/**
* A deployer that starts and stops web service deployments
Modified:
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointPublisher.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointPublisher.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointPublisher.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -34,8 +34,7 @@
import org.jboss.logging.Logger;
import org.jboss.virtual.VFS;
import org.jboss.virtual.VirtualFile;
-import org.jboss.ws.deployment.AbstractServiceEndpointPublisher;
-import org.jboss.ws.deployment.UnifiedDeploymentInfo;
+import org.jboss.ws.core.server.AbstractServiceEndpointPublisher;
/**
* Publish the HTTP service endpoint to Tomcat
Modified: trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefHandler.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefHandler.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefHandler.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -38,13 +38,13 @@
import org.jboss.naming.Util;
import org.jboss.webservice.metadata.serviceref.ServiceRefMetaData;
import org.jboss.ws.WSException;
-import org.jboss.ws.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.jaxrpc.ServiceReferenceable;
+import org.jboss.ws.core.jaxrpc.ServiceReferenceable;
import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCClientDeployment;
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.wsdl.WSDL11DefinitionFactory;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.tools.wsdl.WSDL11DefinitionFactory;
/**
* Binds a JAXRPC Service object in the client's ENC for every service-ref element in
the
Modified:
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefHandlerMBean.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefHandlerMBean.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefHandlerMBean.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -24,7 +24,7 @@
import javax.management.ObjectName;
import org.jboss.webservice.ServiceRefHandler;
-import org.jboss.ws.utils.ObjectNameFactory;
+import org.jboss.ws.core.utils.ObjectNameFactory;
/**
* MBean interface.
Modified:
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefMetaDataAdaptor.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefMetaDataAdaptor.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefMetaDataAdaptor.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -24,7 +24,6 @@
// $Id$
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.LinkedHashMap;
import javax.xml.namespace.QName;
@@ -33,10 +32,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: trunk/src/main/java/org/jboss/ws/integration/tomcat/DeploymentInfoAdaptor.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/tomcat/DeploymentInfoAdaptor.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/main/java/org/jboss/ws/integration/tomcat/DeploymentInfoAdaptor.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -36,10 +36,10 @@
import javax.servlet.ServletContext;
-import org.jboss.ws.utils.DOMUtils;
import org.jboss.ws.WSException;
-import org.jboss.ws.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.deployment.AbstractServiceEndpointPublisher;
+import org.jboss.ws.core.server.AbstractServiceEndpointPublisher;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.metadata.j2ee.UnifiedWebMetaData;
import org.jboss.ws.metadata.j2ee.UnifiedWebSecurityMetaData;
import
org.jboss.ws.metadata.j2ee.UnifiedWebSecurityMetaData.UnifiedWebResourceCollection;
Modified: trunk/src/main/java/org/jboss/ws/integration/tomcat/KernelBootstrap.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/integration/tomcat/KernelBootstrap.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/main/java/org/jboss/ws/integration/tomcat/KernelBootstrap.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -28,7 +28,7 @@
import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
import org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer;
import org.jboss.logging.Logger;
-import org.jboss.ws.server.KernelLocator;
+import org.jboss.ws.core.server.KernelLocator;
/**
* Bootstrap the microkernel in Tomcat
Modified: trunk/src/main/java/org/jboss/ws/integration/tomcat/ServerConfigImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/integration/tomcat/ServerConfigImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/main/java/org/jboss/ws/integration/tomcat/ServerConfigImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -26,7 +26,7 @@
import java.io.File;
import java.io.IOException;
-import org.jboss.ws.server.ServerConfig;
+import org.jboss.ws.core.server.ServerConfig;
/**
* Tomcat specific implementation of a ServerConfig
Modified: trunk/src/main/java/org/jboss/ws/integration/tomcat/TomcatContextServlet.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/tomcat/TomcatContextServlet.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/main/java/org/jboss/ws/integration/tomcat/TomcatContextServlet.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -24,22 +24,12 @@
// $Id$
import java.io.File;
-import java.io.IOException;
-import java.io.PrintWriter;
import java.net.URL;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
-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.WSException;
-import org.jboss.ws.common.CommonContextServlet;
-import org.jboss.ws.server.ServiceEndpointManager;
-import org.jboss.ws.server.ServiceEndpointManagerFactory;
+import org.jboss.ws.core.CommonContextServlet;
+import org.jboss.ws.core.server.ServiceEndpointManagerFactory;
/**
* The servlet that that is associated with context /jbossws
Modified:
trunk/src/main/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointPublisher.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointPublisher.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/main/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointPublisher.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -32,8 +32,8 @@
import org.jboss.logging.Logger;
import org.jboss.util.NotImplementedException;
-import org.jboss.ws.deployment.AbstractServiceEndpointPublisher;
-import org.jboss.ws.deployment.UnifiedDeploymentInfo;
+import org.jboss.ws.core.server.AbstractServiceEndpointPublisher;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
/**
* Publish the HTTP service endpoint to Tomcat
Modified:
trunk/src/main/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/main/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -38,12 +38,12 @@
import org.jboss.kernel.spi.registry.KernelRegistryEntry;
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-import org.jboss.ws.deployment.JAXWSDeployment;
-import org.jboss.ws.deployment.ServiceEndpointDeployer;
-import org.jboss.ws.deployment.UnifiedDeploymentInfo;
+import org.jboss.ws.core.server.AbstractServiceEndpointServlet;
+import org.jboss.ws.core.server.JAXWSDeployment;
+import org.jboss.ws.core.server.KernelLocator;
+import org.jboss.ws.core.server.ServiceEndpointDeployer;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCDeployment;
-import org.jboss.ws.server.AbstractServiceEndpointServlet;
-import org.jboss.ws.server.KernelLocator;
/**
* A servlet that is installed for every web service endpoint.
Copied: trunk/src/main/java/org/jboss/ws/metadata (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata)
Copied: trunk/src/main/java/org/jboss/ws/metadata/acessor (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/acessor)
Deleted: 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-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/acessor/JAXBAccessor.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,125 +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.acessor;
-
-import javax.xml.bind.JAXBException;
-import javax.xml.namespace.QName;
-
-import org.jboss.ws.WSException;
-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;
-import com.sun.xml.bind.api.RawAccessor;
-
-/**
- * A JAXB object accessor.
- *
- * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-@SuppressWarnings("unchecked")
-public class JAXBAccessor implements Accessor
-{
- private RawAccessor accessor;
-
- public static AccessorFactoryCreator FACTORY_CREATOR = new AccessorFactoryCreator()
- {
- public AccessorFactory create(ParameterMetaData parameter)
- {
- final Class clazz = parameter.getJavaType();
- final JAXBRIContext ctx;
-
- try
- {
- ctx = (JAXBRIContext) JAXBRIContext.newInstance(new Class[]{clazz});
- }
- catch (JAXBException e)
- {
- WSException ex = new WSException(e.getMessage());
- ex.setStackTrace(e.getStackTrace());
- throw ex;
- }
-
- return new AccessorFactory()
- {
- public Accessor create(WrappedParameter parameter)
- {
- RawAccessor<Object,Object> accessor;
- try
- {
- QName name = parameter.getName();
- accessor = ctx.getElementPropertyAccessor(clazz,
name.getNamespaceURI(), name.getLocalPart());
- }
- catch (Throwable t)
- {
- WSException ex = new WSException(t.getMessage());
- ex.setStackTrace(t.getStackTrace());
- throw ex;
- }
-
- if (accessor == null)
- throw new IllegalStateException("Could not obtain accessor for
parameter: " + parameter);
-
- return new JAXBAccessor(accessor);
- }
- };
- }
- };
-
- private JAXBAccessor(RawAccessor accessor)
- {
- this.accessor = accessor;
- }
-
- public Object get(Object bean)
- {
- try
- {
- return accessor.get(bean);
- }
- catch (AccessorException a)
- {
- WSException ex = new WSException(a.getMessage());
- ex.setStackTrace(a.getStackTrace());
- throw ex;
- }
- }
-
- public void set(Object bean, Object value)
- {
- try
- {
- accessor.set(bean, value);
- }
- catch (AccessorException a)
- {
- WSException ex = new WSException(a.getMessage());
- ex.setStackTrace(a.getStackTrace());
- throw ex;
- }
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/metadata/acessor/JAXBAccessor.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/acessor/JAXBAccessor.java)
Deleted: 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-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/acessor/ReflectiveMethodAccessor.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,105 +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.acessor;
-
-import java.beans.PropertyDescriptor;
-import java.lang.reflect.Method;
-
-import org.jboss.ws.WSException;
-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.
- *
- * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-@SuppressWarnings("unchecked")
-public class ReflectiveMethodAccessor implements Accessor
-{
- private Method getter;
- private Method setter;
-
- public static AccessorFactoryCreator FACTORY_CREATOR = new AccessorFactoryCreator()
- {
- public AccessorFactory create(ParameterMetaData parameter)
- {
- final Class clazz = parameter.getJavaType();
-
- return new AccessorFactory()
- {
- public Accessor create(WrappedParameter parameter)
- {
- try
- {
- PropertyDescriptor pd = new PropertyDescriptor(parameter.getVariable(),
clazz);
- return new ReflectiveMethodAccessor(pd.getReadMethod(),
pd.getWriteMethod());
- }
- catch (Throwable t)
- {
- WSException ex = new WSException(t.getMessage());
- ex.setStackTrace(t.getStackTrace());
- throw ex;
- }
- }
- };
- }
- };
-
- private ReflectiveMethodAccessor(Method getter, Method setter)
- {
- this.getter = getter;
- this.setter = setter;
- }
-
- public Object get(Object bean)
- {
- try
- {
- return getter.invoke(bean);
- }
- catch (Throwable e)
- {
- WSException ex = new WSException(e.getMessage());
- ex.setStackTrace(ex.getStackTrace());
- throw ex;
- }
- }
-
- public void set(Object bean, Object value)
- {
- try
- {
- setter.invoke(bean, value);
- }
- catch (Throwable e)
- {
- WSException ex = new WSException(e.getMessage());
- ex.setStackTrace(ex.getStackTrace());
- throw ex;
- }
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/metadata/acessor/ReflectiveMethodAccessor.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/acessor/ReflectiveMethodAccessor.java)
Copied: trunk/src/main/java/org/jboss/ws/metadata/builder (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder)
Deleted: 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-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,476 +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.builder;
-
-// $Id$
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.management.ObjectName;
-import javax.wsdl.Definition;
-import javax.wsdl.Import;
-import javax.wsdl.Port;
-import javax.wsdl.Service;
-import javax.wsdl.extensions.ExtensibilityElement;
-import javax.wsdl.extensions.UnknownExtensibilityElement;
-import javax.wsdl.extensions.soap.SOAPAddress;
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.jaxrpc.Use;
-import org.jboss.ws.core.jaxrpc.binding.CommonSOAPBinding;
-import org.jboss.ws.core.server.ServiceEndpointManager;
-import org.jboss.ws.core.server.ServiceEndpointManagerFactory;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.core.utils.ObjectNameFactory;
-import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedEjbPortComponentMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedMessageDrivenMetaData;
-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;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
-import org.jboss.ws.metadata.wsdl.WSDLInterface;
-import org.jboss.ws.metadata.wsdl.WSDLService;
-import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
-import org.jboss.ws.metadata.wsse.WSSecurityConfigurationFactory;
-import org.w3c.dom.Element;
-
-/** An abstract meta data builder.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 19-May-2005
- */
-public abstract class MetaDataBuilder
-{
- // provide logging
- private final static Logger log = Logger.getLogger(MetaDataBuilder.class);
-
- public static WSSecurityConfiguration getWsSecurityConfiguration(UnifiedDeploymentInfo
udi) throws IOException
- {
- WSSecurityConfiguration config = null;
-
- String resource = WSSecurityConfigurationFactory.SERVER_RESOURCE_NAME;
- if (udi.metaData instanceof UnifiedWebMetaData)
- {
- resource = "WEB-INF/" + resource;
- }
- else
- {
- resource = "META-INF/" + resource;
- }
-
- URL location = udi.classLoader.getResource(resource);
- if (location != null)
- {
- config = WSSecurityConfigurationFactory.newInstance().parse(location);
-
- // Get and set deployment path to the keystore file
- if (config.getKeyStoreFile() != null)
- {
- location = udi.classLoader.getResource(config.getKeyStoreFile());
- if (location != null)
- config.setKeyStoreURL(location);
- }
-
- if (config.getTrustStoreFile() != null)
- {
- location = udi.classLoader.getResource(config.getTrustStoreFile());
- if (location != null)
- config.setTrustStoreURL(location);
- }
- }
-
- return config;
- }
-
- /** Inititialize the endpoint binding */
- protected void initEndpointBinding(WSDLEndpoint wsdlEndpoint, ClientEndpointMetaData
epMetaData)
- {
- WSDLDefinitions wsdlDefinitions =
wsdlEndpoint.getWsdlService().getWsdlDefinitions();
- WSDLInterface wsdlInterface = wsdlEndpoint.getInterface();
- WSDLBinding wsdlBinding =
wsdlDefinitions.getBindingByInterfaceName(wsdlInterface.getQName());
- String bindingType = wsdlBinding.getType();
- if (Constants.NS_SOAP11.equals(bindingType))
- epMetaData.setBindingId(CommonSOAPBinding.SOAP11HTTP_BINDING);
- else if (Constants.NS_SOAP12.equals(bindingType))
- epMetaData.setBindingId(CommonSOAPBinding.SOAP12HTTP_BINDING);
- }
-
- /** Initialize the endpoint encoding style from the binding operations
- */
- protected void initEndpointEncodingStyle(EndpointMetaData epMetaData)
- {
- WSDLDefinitions wsdlDefinitions =
epMetaData.getServiceMetaData().getWsdlDefinitions();
- for (WSDLService wsdlService : wsdlDefinitions.getServices())
- {
- for (WSDLEndpoint wsdlEndpoint : wsdlService.getEndpoints())
- {
- if (epMetaData.getQName().equals(wsdlEndpoint.getQName()))
- {
- QName bindQName = wsdlEndpoint.getBinding();
- NCName ncName = new NCName(bindQName.getLocalPart());
- WSDLBinding wsdlBinding = wsdlDefinitions.getBinding(ncName);
- if (wsdlBinding == null)
- throw new WSException("Cannot obtain binding: " + ncName);
-
- for (WSDLBindingOperation wsdlBindingOperation :
wsdlBinding.getOperations())
- {
- String encStyle = wsdlBindingOperation.getEncodingStyle();
- epMetaData.setEncodingStyle(Use.valueOf(encStyle));
- }
- }
- }
- }
- }
-
-
- public static void initEndpointAddress(UnifiedDeploymentInfo udi,
ServerEndpointMetaData sepMetaData, String linkName)
- {
- String contextRoot = sepMetaData.getContextRoot();
- String urlPattern = sepMetaData.getURLPattern();
-
- if (udi.metaData instanceof UnifiedWebMetaData)
- {
- UnifiedWebMetaData webMetaData = (UnifiedWebMetaData)udi.metaData;
- String jbwebContextRoot = webMetaData.getContextRoot();
- if (jbwebContextRoot != null)
- contextRoot = jbwebContextRoot;
-
- Map<String, String> servletMappings = webMetaData.getServletMappings();
- urlPattern = (String)servletMappings.get(linkName);
- if (urlPattern == null)
- throw new WSException("Cannot obtain url pattern for servlet name:
" + linkName);
- }
-
- if (udi.metaData instanceof UnifiedApplicationMetaData)
- {
- UnifiedApplicationMetaData applMetaData =
(UnifiedApplicationMetaData)udi.metaData;
- UnifiedBeanMetaData beanMetaData =
(UnifiedBeanMetaData)applMetaData.getBeanByEjbName(linkName);
- if (beanMetaData == null)
- throw new WSException("Cannot obtain meta data for ejb link: " +
linkName);
-
- String wsContextRoot = applMetaData.getWebServiceContextRoot();
- if (wsContextRoot != null)
- contextRoot = wsContextRoot;
-
- UnifiedEjbPortComponentMetaData ejbpcMetaData =
beanMetaData.getPortComponent();
- if (ejbpcMetaData != null && ejbpcMetaData.getPortComponentURI() !=
null)
- {
- String pcUrlPattern = ejbpcMetaData.getPortComponentURI();
- if (pcUrlPattern != null)
- urlPattern = pcUrlPattern;
- }
- }
-
- // If not, derive the context root from the deployment
- if (contextRoot == null)
- {
- contextRoot = "/";
- if (udi.parent != null)
- {
- String shortName = udi.parent.shortName;
- shortName = shortName.substring(0, shortName.indexOf('.'));
- contextRoot += shortName + "-";
- }
- String shortName = udi.shortName;
- shortName = shortName.substring(0, shortName.indexOf('.'));
- contextRoot += shortName;
- }
-
- if (contextRoot.startsWith("/") == false)
- contextRoot = "/" + contextRoot;
- if (urlPattern == null)
- urlPattern = "/" + linkName;
- if (urlPattern.startsWith("/") == false)
- urlPattern = "/" + urlPattern;
-
- sepMetaData.setContextRoot(contextRoot);
- sepMetaData.setURLPattern(urlPattern);
-
- String servicePath = contextRoot + urlPattern;
- sepMetaData.setEndpointAddress(getServiceEndpointAddress(null, servicePath));
- }
-
- public static ObjectName getServiceEndpointID(UnifiedDeploymentInfo udi,
ServerEndpointMetaData sepMetaData)
- {
- String linkName = sepMetaData.getLinkName();
- String context = sepMetaData.getContextRoot();
- if (context.startsWith("/"))
- context = context.substring(1);
-
- StringBuilder idstr = new StringBuilder(ServerEndpointMetaData.SEPID_DOMAIN +
":");
- idstr.append(ServerEndpointMetaData.SEPID_PROPERTY_CONTEXT + "=" +
context);
- idstr.append("," + ServerEndpointMetaData.SEPID_PROPERTY_ENDPOINT +
"=" + linkName);
-
- // Add JMS destination JNDI name for MDB endpoints
- if (udi.metaData instanceof UnifiedApplicationMetaData)
- {
- String ejbName = sepMetaData.getLinkName();
- if (ejbName == null)
- throw new WSException("Cannot obtain ejb-link from port
component");
-
- UnifiedApplicationMetaData applMetaData =
(UnifiedApplicationMetaData)udi.metaData;
- UnifiedBeanMetaData beanMetaData =
(UnifiedBeanMetaData)applMetaData.getBeanByEjbName(ejbName);
- if (beanMetaData == null)
- throw new WSException("Cannot obtain ejb meta data for: " +
ejbName);
-
- if (beanMetaData instanceof UnifiedMessageDrivenMetaData)
- {
- UnifiedMessageDrivenMetaData mdMetaData =
(UnifiedMessageDrivenMetaData)beanMetaData;
- String jndiName = mdMetaData.getDestinationJndiName();
- idstr.append(",jms=" + jndiName);
- }
- }
-
- return ObjectNameFactory.create(idstr.toString());
- }
-
-
- /** Get the web service address for a given path
- */
- public static String getServiceEndpointAddress(String uriScheme, String servicePath)
- {
- if (servicePath == null || servicePath.length() == 0)
- throw new WSException("Service path cannot be null");
-
- if (servicePath.endsWith("/*"))
- servicePath = servicePath.substring(0, servicePath.length() - 2);
-
- if (uriScheme == null)
- uriScheme = "http";
-
- ServiceEndpointManagerFactory factory =
ServiceEndpointManagerFactory.getInstance();
- ServiceEndpointManager epManager = factory.getServiceEndpointManager();
- String host = epManager.getWebServiceHost();
- int port = epManager.getWebServicePort();
- if ("https".equals(uriScheme))
- port = epManager.getWebServiceSecurePort();
-
- String urlStr = uriScheme + "://" + host + ":" + port +
servicePath;
- try
- {
- return new URL(urlStr).toExternalForm();
- }
- catch (MalformedURLException e)
- {
- throw new WSException("Malformed URL: " + urlStr);
- }
- }
-
- /**
- * Read the transport guarantee from web.xml
- */
- protected void initTransportGuaranteeJSE(UnifiedDeploymentInfo udi,
ServerEndpointMetaData sepMetaData, String servletLink) throws IOException
- {
- String transportGuarantee = null;
- if (udi.metaData instanceof UnifiedWebMetaData)
- {
- UnifiedWebMetaData webMetaData = (UnifiedWebMetaData)udi.metaData;
- Map<String, String> servletMappings = webMetaData.getServletMappings();
- String urlPattern = servletMappings.get(servletLink);
-
- if (urlPattern == null)
- throw new WSException("Cannot find <url-pattern> for servlet-name:
" + servletLink);
-
- List<UnifiedWebSecurityMetaData> securityList =
webMetaData.getSecurityMetaData();
- for (UnifiedWebSecurityMetaData currentSecurity : securityList)
- {
- if (currentSecurity.getTransportGuarantee() != null &&
currentSecurity.getTransportGuarantee().length() > 0)
- {
- for (UnifiedWebResourceCollection currentCollection :
currentSecurity.getWebResources())
- {
- for (String currentUrlPattern : currentCollection.getUrlPatterns())
- {
- if (urlPattern.equals(currentUrlPattern))
- {
- transportGuarantee = currentSecurity.getTransportGuarantee();
- }
- }
- }
- }
- }
- }
- sepMetaData.setTransportGuarantee(transportGuarantee);
- }
-
- /** Replace the address locations for a given port component.
- */
- public static void replaceAddressLocation(ServerEndpointMetaData sepMetaData)
- {
- WSDLDefinitions wsdlDefinitions =
sepMetaData.getServiceMetaData().getWsdlDefinitions();
- QName portName = sepMetaData.getQName();
-
- boolean endpointFound = false;
- for (WSDLService wsdlService : wsdlDefinitions.getServices())
- {
- for (WSDLEndpoint wsdlEndpoint : wsdlService.getEndpoints())
- {
- QName wsdlPortName = wsdlEndpoint.getQName();
- if (wsdlPortName.equals(portName))
- {
- endpointFound = true;
-
- String orgAddress = wsdlEndpoint.getAddress();
- String uriScheme = getUriScheme(orgAddress);
-
- String transportGuarantee = sepMetaData.getTransportGuarantee();
- if ("CONFIDENTIAL".equals(transportGuarantee))
- uriScheme = "https";
-
- String servicePath = sepMetaData.getContextRoot() +
sepMetaData.getURLPattern();
- String serviceEndpointURL = getServiceEndpointAddress(uriScheme,
servicePath);
-
- ServiceEndpointManagerFactory factory =
ServiceEndpointManagerFactory.getInstance();
- ServiceEndpointManager epManager = factory.getServiceEndpointManager();
- boolean alwaysModify = epManager.isAlwaysModifySOAPAddress();
-
- if (alwaysModify || uriScheme == null ||
orgAddress.indexOf("REPLACE_WITH_ACTUAL_URL") >= 0)
- {
- log.debug("Replace service endpoint address '" +
orgAddress + "' with '" + serviceEndpointURL + "'");
- wsdlEndpoint.setAddress(serviceEndpointURL);
- sepMetaData.setEndpointAddress(serviceEndpointURL);
-
- // modify the wsdl-1.1 definition
- if (wsdlDefinitions.getWsdlOneOneDefinition() != null)
- replaceWSDL11SOAPAddress(wsdlDefinitions, portName,
serviceEndpointURL);
- }
- else
- {
- log.debug("Don't replace service endpoint address '"
+ orgAddress + "'");
- try
- {
- sepMetaData.setEndpointAddress(new
URL(orgAddress).toExternalForm());
- }
- catch (MalformedURLException e)
- {
- throw new WSException("Malformed URL: " + orgAddress);
- }
- }
- }
- }
- }
-
- if (endpointFound == false)
- throw new WSException("Cannot find port in wsdl: " + portName);
- }
-
- private static void replaceWSDL11SOAPAddress(WSDLDefinitions wsdlDefinitions, QName
portQName, String serviceEndpointURL)
- {
- Definition wsdlOneOneDefinition = wsdlDefinitions.getWsdlOneOneDefinition();
- String tnsURI = wsdlOneOneDefinition.getTargetNamespace();
-
- // search for matching portElement and replace the address URI
- Port wsdlOneOnePort = modifySOAPAddress(tnsURI, portQName, serviceEndpointURL,
wsdlOneOneDefinition.getServices());
-
- // recursivly process imports if none can be found
- if (wsdlOneOnePort == null &&
!wsdlOneOneDefinition.getImports().isEmpty())
- {
-
- Iterator imports = wsdlOneOneDefinition.getImports().values().iterator();
- while (imports.hasNext())
- {
- List l = (List)imports.next();
- Iterator importsByNS = l.iterator();
- while (importsByNS.hasNext())
- {
- Import anImport = (Import)importsByNS.next();
- wsdlOneOnePort = modifySOAPAddress(anImport.getNamespaceURI(), portQName,
serviceEndpointURL, anImport.getDefinition().getServices());
- }
- }
- }
-
- // if it still doesn't exist something is wrong
- if (wsdlOneOnePort == null)
- throw new IllegalArgumentException("Cannot find port with name '"
+ portQName + "' in wsdl document");
- }
-
- private static Port modifySOAPAddress(String tnsURI, QName portQName, String
serviceEndpointURL, Map services)
- {
- QName SOAP12_ADDRESS = new QName(Constants.NS_SOAP12, "address");
-
- Port wsdlOneOnePort = null;
- Iterator itServices = services.values().iterator();
- while (itServices.hasNext())
- {
- Service wsdlOneOneService = (Service)itServices.next();
- Map wsdlOneOnePorts = wsdlOneOneService.getPorts();
- Iterator itPorts = wsdlOneOnePorts.keySet().iterator();
- while (itPorts.hasNext())
- {
- String portLocalName = (String)itPorts.next();
- if (portQName.equals(new QName(tnsURI, portLocalName)))
- {
- wsdlOneOnePort = (Port)wsdlOneOnePorts.get(portLocalName);
- List extElements = wsdlOneOnePort.getExtensibilityElements();
- for (Object extElement : extElements)
- {
- QName elementType =
((ExtensibilityElement)extElement).getElementType();
- if (extElement instanceof SOAPAddress)
- {
- SOAPAddress address = (SOAPAddress)extElement;
- address.setLocationURI(serviceEndpointURL);
- }
- else if (SOAP12_ADDRESS.equals(elementType))
- {
- Element domElement =
((UnknownExtensibilityElement)extElement).getElement();
- domElement.setAttribute("location", serviceEndpointURL);
- }
- }
- }
- }
- }
-
- return wsdlOneOnePort;
- }
-
- private static String getUriScheme(String addrStr)
- {
- try
- {
- URI addrURI = new URI(addrStr);
- String scheme = addrURI.getScheme();
- return scheme;
- }
- catch (URISyntaxException e)
- {
- return null;
- }
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java)
Copied: trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc)
Deleted:
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientDeployment.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientDeployment.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientDeployment.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,42 +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.builder.jaxrpc;
-
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-
-
-// $Id$
-
-/**
- * The container independent deployment info.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class JAXRPCClientDeployment extends UnifiedDeploymentInfo
-{
-
- public JAXRPCClientDeployment(DeploymentType type)
- {
- super(type);
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientDeployment.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientDeployment.java)
Deleted:
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-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,258 +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.builder.jaxrpc;
-
-//$Id$
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.jboss.ws.WSException;
-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;
-import org.jboss.ws.metadata.wsdl.WSDLService;
-import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
-import org.jboss.ws.metadata.wsse.WSSecurityConfigurationFactory;
-
-/**
- * A client side meta data builder.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 19-May-2005
- */
-public class JAXRPCClientMetaDataBuilder extends JAXRPCMetaDataBuilder
-{
- // provide logging
- private final Logger log = Logger.getLogger(JAXRPCClientMetaDataBuilder.class);
-
- /** Build from WSDL and jaxrpc-mapping.xml
- */
- public ServiceMetaData buildMetaData(QName serviceQName, URL wsdlURL, URL mappingURL,
URL securityURL,
- UnifiedServiceRefMetaData serviceRefMetaData, ClassLoader loader)
- {
- try
- {
- JavaWsdlMapping javaWsdlMapping = null;
- if (mappingURL != null)
- {
- JavaWsdlMappingFactory mappingFactory =
JavaWsdlMappingFactory.newInstance();
- javaWsdlMapping = mappingFactory.parse(mappingURL);
- }
-
- WSSecurityConfiguration securityConfig = null;
- if (securityURL != null)
- {
- securityConfig =
WSSecurityConfigurationFactory.newInstance().parse(securityURL);
- }
-
- return buildMetaData(serviceQName, wsdlURL, javaWsdlMapping, securityConfig,
serviceRefMetaData, loader);
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WSException("Cannot build meta data: " + ex.getMessage(),
ex);
- }
- }
-
- /** Build from WSDL and jaxrpc-mapping.xml
- */
- public ServiceMetaData buildMetaData(QName serviceQName, URL wsdlURL, JavaWsdlMapping
javaWsdlMapping, WSSecurityConfiguration securityConfig,
- UnifiedServiceRefMetaData serviceRefMetaData, ClassLoader loader)
- {
- log.debug("START buildMetaData: [service=" + serviceQName +
"]");
- try
- {
- UnifiedMetaData wsMetaData = new UnifiedMetaData();
- wsMetaData.setClassLoader(loader);
-
- ServiceMetaData serviceMetaData = new ServiceMetaData(wsMetaData,
serviceQName);
- wsMetaData.addService(serviceMetaData);
-
- serviceMetaData.setWsdlFile(wsdlURL.toExternalForm());
- WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
-
- URL mappingURL = null;
- if (javaWsdlMapping != null)
- {
- mappingURL = new URL(Constants.NS_JBOSSWS_URI +
"/dummy-mapping-url");
- wsMetaData.addMappingDefinition(mappingURL.toExternalForm(),
javaWsdlMapping);
- serviceMetaData.setJaxrpcMappingFile(mappingURL.toExternalForm());
- }
-
- if (securityConfig != null)
- {
- serviceMetaData.setSecurityConfiguration(securityConfig);
- setupSecurity(securityConfig, loader);
- }
-
- buildMetaDataInternal(serviceMetaData, wsdlDefinitions, javaWsdlMapping,
serviceRefMetaData);
-
- // eagerly initialize
- wsMetaData.eagerInitialize();
-
- log.debug("END buildMetaData: " + wsMetaData);
- return serviceMetaData;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WSException("Cannot build meta data: " + ex.getMessage(),
ex);
- }
- }
-
- private void buildMetaDataInternal(ServiceMetaData serviceMetaData, WSDLDefinitions
wsdlDefinitions, JavaWsdlMapping javaWsdlMapping,
- UnifiedServiceRefMetaData serviceRefMetaData) throws IOException
- {
- QName serviceQName = serviceMetaData.getServiceName();
-
- // Get the WSDL service
- WSDLService wsdlService = null;
- if (serviceQName == null)
- {
- if (wsdlDefinitions.getServices().length != 1)
- throw new IllegalArgumentException("Expected a single service
element");
-
- wsdlService = wsdlDefinitions.getServices()[0];
- serviceMetaData.setServiceName(wsdlService.getQName());
- }
- else
- {
- wsdlService = wsdlDefinitions.getService(new
NCName(serviceQName.getLocalPart()));
- }
- if (wsdlService == null)
- throw new IllegalArgumentException("Cannot obtain wsdl service: " +
serviceQName);
-
- // Build type mapping meta data
- setupTypesMetaData(serviceMetaData);
-
- // Build endpoint meta data
- for (WSDLEndpoint wsdlEndpoint : wsdlService.getEndpoints())
- {
- QName portName = wsdlEndpoint.getQName();
- QName interfaceQName = wsdlEndpoint.getInterface().getQName();
- ClientEndpointMetaData epMetaData = new ClientEndpointMetaData(serviceMetaData,
portName, interfaceQName, Type.JAXRPC);
- epMetaData.setEndpointAddress(wsdlEndpoint.getAddress());
- serviceMetaData.addEndpoint(epMetaData);
-
- // config-name, config-file
- if (serviceRefMetaData != null)
- {
- String configName = serviceRefMetaData.getConfigName();
- if (configName != null)
- epMetaData.setConfigName(configName);
-
- String configFile = serviceRefMetaData.getConfigFile();
- if (configFile != null)
- epMetaData.setConfigFile(configFile);
- }
-
- // Init the endpoint binding
- initEndpointBinding(wsdlEndpoint, epMetaData);
-
- // Init the service encoding style
- initEndpointEncodingStyle(epMetaData);
-
- ServiceEndpointInterfaceMapping seiMapping = null;
- if (javaWsdlMapping != null)
- {
- QName portType = wsdlEndpoint.getInterface().getQName();
- seiMapping =
javaWsdlMapping.getServiceEndpointInterfaceMappingByPortType(portType);
- if (seiMapping != null)
- {
-
epMetaData.setServiceEndpointInterfaceName(seiMapping.getServiceEndpointInterface());
- }
- else
- {
- log.warn("Cannot obtain the SEI mapping for: " + portType);
- }
- }
-
- processEndpointMetaDataExtensions(epMetaData, wsdlDefinitions);
- setupOperationsFromWSDL(epMetaData, wsdlEndpoint, seiMapping);
- setupHandlers(serviceRefMetaData, portName, epMetaData);
- }
- }
-
- private void setupHandlers(UnifiedServiceRefMetaData serviceRefMetaData, QName
portName, EndpointMetaData epMetaData)
- {
- // Add pre handlers
- WSClientConfigJAXRPC jaxrpcConfig =
(WSClientConfigJAXRPC)epMetaData.getEndpointConfig();
- epMetaData.addHandlers(jaxrpcConfig.getHandlers(epMetaData, HandlerType.PRE));
-
- // Setup the endpoint handlers
- if (serviceRefMetaData != null)
- {
- for (UnifiedHandlerMetaData uhmd : serviceRefMetaData.getHandlers())
- {
- Set<String> portNames = uhmd.getPortNames();
- if (portNames.size() == 0 || portNames.contains(portName.getLocalPart()))
- {
- epMetaData.addHandler(uhmd.getHandlerMetaDataJAXRPC(epMetaData,
HandlerType.ENDPOINT));
- }
- }
- }
-
- // Add post handlers
- epMetaData.addHandlers(jaxrpcConfig.getHandlers(epMetaData, HandlerType.POST));
- }
-
- private void setupSecurity(WSSecurityConfiguration securityConfig, ClassLoader
loader)
- {
- if (securityConfig.getKeyStoreFile() != null)
- {
- URL location = loader.getResource(securityConfig.getKeyStoreFile());
- if (location != null)
- securityConfig.setKeyStoreURL(location);
- }
-
- if (securityConfig.getTrustStoreFile() != null)
- {
- URL location = loader.getResource(securityConfig.getTrustStoreFile());
- if (location != null)
- securityConfig.setTrustStoreURL(location);
- }
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCDeployment.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCDeployment.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCDeployment.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,75 +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.builder.jaxrpc;
-
-import java.io.InputStream;
-import java.net.URL;
-
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.metadata.webservices.WebservicesFactory;
-import org.jboss.ws.metadata.webservices.WebservicesMetaData;
-import org.jboss.xb.binding.ObjectModelFactory;
-import org.jboss.xb.binding.Unmarshaller;
-import org.jboss.xb.binding.UnmarshallerFactory;
-
-// $Id$
-
-/**
- * The container independent deployment info.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class JAXRPCDeployment extends UnifiedDeploymentInfo
-{
- private WebservicesMetaData jsr109MetaData;
-
- public JAXRPCDeployment(DeploymentType type, URL webservicesURL)
- {
- super(type);
-
- try
- {
- // Unmarshall webservices.xml
- InputStream is = webservicesURL.openStream();
- try
- {
- Unmarshaller unmarshaller =
UnmarshallerFactory.newInstance().newUnmarshaller();
- ObjectModelFactory factory = new WebservicesFactory(webservicesURL);
- jsr109MetaData = (WebservicesMetaData)unmarshaller.unmarshal(is, factory,
null);
- }
- finally
- {
- is.close();
- }
- }
- catch (Exception ex)
- {
- throw new RuntimeException(ex);
- }
- }
-
- public WebservicesMetaData getWebservicesMetaData()
- {
- return jsr109MetaData;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCDeployment.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCDeployment.java)
Deleted:
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-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,968 +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.builder.jaxrpc;
-
-//$Id$
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.jws.soap.SOAPBinding.ParameterStyle;
-import javax.xml.namespace.QName;
-import javax.xml.rpc.ParameterMode;
-import javax.xml.rpc.encoding.TypeMappingRegistry;
-import javax.xml.ws.addressing.AddressingProperties;
-
-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.core.jaxrpc.LiteralTypeMapping;
-import org.jboss.ws.core.jaxrpc.Style;
-import org.jboss.ws.core.jaxrpc.TypeMappingImpl;
-import org.jboss.ws.core.jaxrpc.TypeMappingRegistryImpl;
-import org.jboss.ws.core.jaxrpc.UnqualifiedFaultException;
-import org.jboss.ws.core.jaxrpc.Use;
-import org.jboss.ws.core.utils.JavaUtils;
-import org.jboss.ws.extensions.addressing.AddressingPropertiesImpl;
-import org.jboss.ws.extensions.addressing.metadata.AddressingOpMetaExt;
-import org.jboss.ws.extensions.eventing.EventingConstants;
-import org.jboss.ws.extensions.eventing.deployment.EventingEndpoint;
-import org.jboss.ws.extensions.eventing.metadata.EventingEpMetaExt;
-import org.jboss.ws.extensions.xop.jaxrpc.XOPScanner;
-import org.jboss.ws.metadata.builder.MetaDataBuilder;
-import org.jboss.ws.metadata.jaxrpcmapping.ExceptionMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaXmlTypeMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.MethodParamPartsMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.ServiceEndpointInterfaceMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.ServiceEndpointMethodMapping;
-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;
-import org.jboss.ws.metadata.wsdl.WSDLBindingOperationInput;
-import org.jboss.ws.metadata.wsdl.WSDLBindingOperationOutput;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
-import org.jboss.ws.metadata.wsdl.WSDLInterface;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceFault;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperation;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationInput;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutfault;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutput;
-import org.jboss.ws.metadata.wsdl.WSDLMIMEPart;
-import org.jboss.ws.metadata.wsdl.WSDLProperty;
-import org.jboss.ws.metadata.wsdl.WSDLRPCPart;
-import org.jboss.ws.metadata.wsdl.WSDLRPCSignatureItem;
-import org.jboss.ws.metadata.wsdl.WSDLSOAPHeader;
-import org.jboss.ws.metadata.wsdl.WSDLTypes;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
-import org.jboss.ws.metadata.wsdl.WSDLRPCSignatureItem.Direction;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
-
-/**
- * A meta data builder that is based on webservices.xml.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @authoer <a href="mailto:jason.greene@jboss.org">Jason T.
Greene</a>
- * @since 19-Oct-2005
- */
-public abstract class JAXRPCMetaDataBuilder extends MetaDataBuilder
-{
- // provide logging
- final Logger log = Logger.getLogger(JAXRPCMetaDataBuilder.class);
-
- protected QName lookupSchemaType(WSDLInterfaceOperation operation, QName element)
- {
- WSDLDefinitions wsdlDefinitions =
operation.getWsdlInterface().getWsdlDefinitions();
- WSDLTypes wsdlTypes = wsdlDefinitions.getWsdlTypes();
- return wsdlTypes.getXMLType(element);
- }
-
- protected void setupTypesMetaData(ServiceMetaData serviceMetaData)
- {
- WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
- JavaWsdlMapping javaWsdlMapping = serviceMetaData.getJavaWsdlMapping();
- TypesMetaData typesMetaData = serviceMetaData.getTypesMetaData();
-
- // Copy the schema locations to the types meta data
- if (wsdlDefinitions != null)
- {
- WSDLTypes wsdlTypes = wsdlDefinitions.getWsdlTypes();
- typesMetaData.setSchemaModel(WSDLUtils.getSchemaModel(wsdlTypes));
- }
-
- // Copy the type mappings to the types meta data
- if (javaWsdlMapping != null)
- {
- for (JavaXmlTypeMapping xmlTypeMapping :
javaWsdlMapping.getJavaXmlTypeMappings())
- {
- String javaTypeName = xmlTypeMapping.getJavaType();
- String qnameScope = xmlTypeMapping.getQnameScope();
-
- QName xmlType = xmlTypeMapping.getRootTypeQName();
- QName anonymousXMLType = xmlTypeMapping.getAnonymousTypeQName();
- if (xmlType == null && anonymousXMLType != null)
- xmlType = anonymousXMLType;
-
- String nsURI = xmlType.getNamespaceURI();
- if (Constants.NS_SCHEMA_XSD.equals(nsURI) == false &&
Constants.URI_SOAP11_ENC.equals(nsURI) == false)
- {
- TypeMappingMetaData tmMetaData = new TypeMappingMetaData(typesMetaData,
xmlType, javaTypeName);
- tmMetaData.setQNameScope(qnameScope);
- typesMetaData.addTypeMapping(tmMetaData);
- }
- }
-
- for (ExceptionMapping exceptionMapping :
javaWsdlMapping.getExceptionMappings())
- {
- QName xmlType = exceptionMapping.getWsdlMessage();
- String javaTypeName = exceptionMapping.getExceptionType();
- TypeMappingMetaData tmMetaData = new TypeMappingMetaData(typesMetaData,
xmlType, javaTypeName);
- typesMetaData.addTypeMapping(tmMetaData);
- }
- }
- }
-
- protected void setupOperationsFromWSDL(EndpointMetaData epMetaData, WSDLEndpoint
wsdlEndpoint, ServiceEndpointInterfaceMapping seiMapping)
- {
- WSDLDefinitions wsdlDefinitions =
wsdlEndpoint.getInterface().getWsdlDefinitions();
-
- // For every WSDL interface operation build the OperationMetaData
- WSDLInterface wsdlInterface = wsdlEndpoint.getInterface();
- for (WSDLInterfaceOperation wsdlOperation : wsdlInterface.getOperations())
- {
- String opName = wsdlOperation.getName().toString();
- QName opQName = wsdlOperation.getQName();
-
- // Set java method name
- String javaName = opName.substring(0, 1).toLowerCase() + opName.substring(1);
- ServiceEndpointMethodMapping seiMethodMapping = null;
- if (seiMapping != null)
- {
-
epMetaData.setServiceEndpointInterfaceName(seiMapping.getServiceEndpointInterface());
-
- seiMethodMapping =
seiMapping.getServiceEndpointMethodMappingByWsdlOperation(opName);
- if (seiMethodMapping == null)
- throw new WSException("Cannot obtain method mapping for: " +
opName);
-
- javaName = seiMethodMapping.getJavaMethodName();
- }
-
- OperationMetaData opMetaData = new OperationMetaData(epMetaData, opQName,
javaName);
- epMetaData.addOperation(opMetaData);
-
- // Set the operation style
- String style = wsdlOperation.getStyle();
- epMetaData.setStyle((Constants.URI_STYLE_IRI.equals(style) ? Style.DOCUMENT :
Style.RPC));
-
- // Set the operation MEP
- if (Constants.WSDL20_PATTERN_IN_ONLY.equals(wsdlOperation.getPattern()))
- opMetaData.setOneWay(true);
-
- // Set the operation SOAPAction
- WSDLBinding wsdlBinding =
wsdlDefinitions.getBindingByInterfaceName(wsdlInterface.getQName());
- WSDLBindingOperation wsdlBindingOperation =
wsdlBinding.getOperationByRef(opQName);
- if (wsdlBindingOperation != null)
- opMetaData.setSOAPAction(wsdlBindingOperation.getSOAPAction());
-
- // Get the type mapping for the encoding style
- String encStyle = epMetaData.getEncodingStyle().toURI();
- TypeMappingRegistry tmRegistry = new TypeMappingRegistryImpl();
- TypeMappingImpl typeMapping =
(TypeMappingImpl)tmRegistry.getTypeMapping(encStyle);
-
- // Build the parameter meta data
- if (opMetaData.getStyle() == Style.RPC)
- {
- buildParameterMetaDataRpc(opMetaData, wsdlOperation, seiMethodMapping,
typeMapping);
- }
- else
- {
- buildParameterMetaDataDoc(opMetaData, wsdlOperation, seiMethodMapping,
typeMapping);
- }
-
- // Build operation faults
- buildFaultMetaData(opMetaData, wsdlOperation);
-
- // process further operation extensions
- processOpMetaExtensions(opMetaData, wsdlOperation);
- }
- }
-
- private ParameterMetaData buildInputParameter(OperationMetaData opMetaData,
WSDLInterfaceOperation wsdlOperation, ServiceEndpointMethodMapping seiMethodMapping,
TypeMappingImpl typeMapping, String partName, QName xmlName, QName xmlType, int pos)
- {
- WSDLRPCSignatureItem item = wsdlOperation.getRpcSignatureitem(partName);
- if (item != null)
- pos = item.getPosition();
-
- String javaTypeName = typeMapping.getJavaTypeName(xmlType);
- if (seiMethodMapping != null)
- {
- MethodParamPartsMapping paramMapping =
seiMethodMapping.getMethodParamPartsMappingByPartName(partName);
- if (paramMapping == null)
- throw new WSException("Cannot obtain method parameter mapping for
message part '" + partName + "' in wsdl operation: "
- + seiMethodMapping.getWsdlOperation());
-
- javaTypeName = paramMapping.getParamType();
- pos = paramMapping.getParamPosition();
- }
-
- JavaWsdlMapping javaWsdlMapping =
opMetaData.getEndpointMetaData().getServiceMetaData().getJavaWsdlMapping();
- if (javaTypeName == null && javaWsdlMapping != null)
- {
- String packageName =
javaWsdlMapping.getPackageNameForNamespaceURI(xmlType.getNamespaceURI());
- if (packageName != null)
- {
- javaTypeName = packageName + "." + xmlType.getLocalPart();
- log.warn("Guess java type from package mapping: [xmlType=" +
xmlType + ",javaType=" + javaTypeName + "]");
- }
- }
-
- if (javaTypeName == null)
- throw new WSException("Cannot obtain java type mapping for: " +
xmlType);
-
- ParameterMetaData inMetaData = new ParameterMetaData(opMetaData, xmlName, xmlType,
javaTypeName);
- inMetaData.setPartName(partName);
- inMetaData.setIndex(pos);
- opMetaData.addParameter(inMetaData);
-
- TypesMetaData typesMetaData =
opMetaData.getEndpointMetaData().getServiceMetaData().getTypesMetaData();
- // In arrays of user types, wscompile does not generate a mapping in
jaxrpc-mapping.xml
- if (typesMetaData.getTypeMappingByXMLType(xmlType) == null)
- {
- String nsURI = xmlType.getNamespaceURI();
- if (Constants.NS_SCHEMA_XSD.equals(nsURI) == false &&
Constants.URI_SOAP11_ENC.equals(nsURI) == false)
- {
- TypeMappingMetaData tmMetaData = new TypeMappingMetaData(typesMetaData,
xmlType, javaTypeName);
- typesMetaData.addTypeMapping(tmMetaData);
- }
- }
-
- return inMetaData;
- }
-
- private ParameterMetaData buildOutputParameter(OperationMetaData opMetaData,
WSDLInterfaceOperation wsdlOperation, ServiceEndpointMethodMapping seiMethodMapping, int
pos, String partName, QName xmlName, QName xmlType, TypeMappingImpl typeMapping)
- {
- // Default is first listed output
- boolean hasReturnMapping = opMetaData.getReturnParameter() == null;
-
- WSDLRPCSignatureItem item = wsdlOperation.getRpcSignatureitem(partName);
- if (item != null)
- {
- hasReturnMapping = item.getDirection() == Direction.RETURN;
- pos = item.getPosition();
- }
-
- String javaTypeName = typeMapping.getJavaTypeName(xmlType);
- if (seiMethodMapping != null)
- {
- MethodParamPartsMapping paramMapping =
seiMethodMapping.getMethodParamPartsMappingByPartName(partName);
- if (paramMapping != null)
- {
- javaTypeName = paramMapping.getParamType();
- pos = paramMapping.getParamPosition();
- hasReturnMapping = false;
- }
- else
- {
- WsdlReturnValueMapping returnMapping =
seiMethodMapping.getWsdlReturnValueMapping();
- String mappingPart = returnMapping.getWsdlMessagePartName();
- if (returnMapping != null && mappingPart != null &&
partName.equals(mappingPart));
- {
- javaTypeName = returnMapping.getMethodReturnValue();
- hasReturnMapping = true;
- }
- }
- }
-
- JavaWsdlMapping javaWsdlMapping =
opMetaData.getEndpointMetaData().getServiceMetaData().getJavaWsdlMapping();
- if (javaTypeName == null && javaWsdlMapping != null)
- {
- String packageName =
javaWsdlMapping.getPackageNameForNamespaceURI(xmlType.getNamespaceURI());
- if (packageName != null)
- {
- javaTypeName = packageName + "." + xmlType.getLocalPart();
- log.warn("Guess java type from package mapping: [xmlType=" +
xmlType + ",javaType=" + javaTypeName + "]");
- }
- }
-
- if (javaTypeName == null)
- throw new WSException("Cannot obtain java type mapping for: " +
xmlType);
-
- ParameterMetaData outMetaData = new ParameterMetaData(opMetaData, xmlName, xmlType,
javaTypeName);
- outMetaData.setPartName(partName);
-
- if (hasReturnMapping)
- {
- opMetaData.setReturnParameter(outMetaData);
- }
- else
- {
- outMetaData.setIndex(pos);
- outMetaData.setMode(ParameterMode.OUT);
- opMetaData.addParameter(outMetaData);
- }
-
- TypesMetaData typesMetaData =
opMetaData.getEndpointMetaData().getServiceMetaData().getTypesMetaData();
- // In arrays of user types, wscompile does not generate a mapping in
jaxrpc-mapping.xml
- if (typesMetaData.getTypeMappingByXMLType(xmlType) == null)
- {
- String nsURI = xmlType.getNamespaceURI();
- if (Constants.NS_SCHEMA_XSD.equals(nsURI) == false &&
Constants.URI_SOAP11_ENC.equals(nsURI) == false)
- {
- TypeMappingMetaData tmMetaData = new TypeMappingMetaData(typesMetaData,
xmlType, javaTypeName);
- typesMetaData.addTypeMapping(tmMetaData);
- }
- }
-
- return outMetaData;
- }
-
- private int processBindingParameters(OperationMetaData opMetaData,
WSDLInterfaceOperation wsdlOperation, ServiceEndpointMethodMapping seiMethodMapping,
TypeMappingImpl typeMapping, WSDLBindingOperation bindingOperation, int wsdlPosition)
- {
- WSDLBindingOperationInput bindingInput = bindingOperation.getInputs()[0];
- for (WSDLSOAPHeader header : bindingInput.getSoapHeaders())
- {
- QName xmlName = header.getElement();
- QName xmlType = lookupSchemaType(wsdlOperation, xmlName);
- String partName = header.getPartName();
-
- ParameterMetaData pmd = buildInputParameter(opMetaData, wsdlOperation,
seiMethodMapping, typeMapping, partName, xmlName, xmlType, wsdlPosition++);
- pmd.setInHeader(true);
- }
-
- for (WSDLMIMEPart mimePart : bindingInput.getMimeParts())
- {
- String partName = mimePart.getPartName();
- QName xmlName = new QName(partName);
- QName xmlType = mimePart.getXmlType();
-
- ParameterMetaData pmd = buildInputParameter(opMetaData, wsdlOperation,
seiMethodMapping, typeMapping, partName, xmlName, xmlType, wsdlPosition++);
- pmd.setSwA(true);
- pmd.setMimeTypes(mimePart.getMimeTypes());
- }
-
- return wsdlPosition;
- }
-
- private int processBindingOutputParameters(OperationMetaData opMetaData,
WSDLInterfaceOperation wsdlOperation, ServiceEndpointMethodMapping seiMethodMapping,
TypeMappingImpl typeMapping, WSDLBindingOperation bindingOperation, int wsdlPosition)
- {
- WSDLBindingOperationOutput bindingOutput = bindingOperation.getOutputs()[0];
- for (WSDLSOAPHeader header : bindingOutput.getSoapHeaders())
- {
- String partName = header.getPartName();
- QName xmlName = header.getElement();
-
- ParameterMetaData outMetaData = opMetaData.getParameter(xmlName);
- if (outMetaData != null)
- {
- outMetaData.setMode(ParameterMode.INOUT);
- }
- else
- {
- QName xmlType = lookupSchemaType(wsdlOperation, xmlName);
-
- ParameterMetaData pmd = buildOutputParameter(opMetaData, wsdlOperation,
seiMethodMapping, wsdlPosition, partName, xmlName, xmlType, typeMapping);
- pmd.setInHeader(true);
-
- if (opMetaData.getReturnParameter() != pmd)
- wsdlPosition++;
- }
- }
-
- for (WSDLMIMEPart mimePart : bindingOutput.getMimeParts())
- {
- String partName = mimePart.getPartName();
- QName xmlName = new QName(partName);
-
- ParameterMetaData outMetaData = opMetaData.getParameter(xmlName);
- if (outMetaData != null)
- {
- outMetaData.setMode(ParameterMode.INOUT);
- }
- else
- {
- QName xmlType = mimePart.getXmlType();
-
- ParameterMetaData pmd = buildOutputParameter(opMetaData, wsdlOperation,
seiMethodMapping, wsdlPosition, partName, xmlName, xmlType, typeMapping);
- pmd.setSwA(true);
- pmd.setMimeTypes(mimePart.getMimeTypes());
-
- if (opMetaData.getReturnParameter() != pmd)
- wsdlPosition++;
- }
- }
-
- return wsdlPosition;
- }
-
- /* SOAP-ENC:Array
- *
- * FIXME: This hack should be removed as soon as we can reliably get the
- * soapenc:arrayType from wsdl + schema.
- */
- private void setupSOAPArrayParameter(ParameterMetaData paramMetaData)
- {
- Use use = paramMetaData.getOperationMetaData().getUse();
- String xmlTypeLocalPart = paramMetaData.getXmlType().getLocalPart();
- if (use == Use.ENCODED && xmlTypeLocalPart.indexOf("ArrayOf")
>= 0)
- {
- paramMetaData.setSOAPArrayParam(true);
- try
- {
- String javaTypeName = paramMetaData.getJavaTypeName();
- // This approach determins the array component type from the javaTypeName.
- // It will not work for user defined types, nor will the array dimension be
- // initialized properly. Ideally the array parameter meta data should be
initialized
- // from the XSModel or wherever it is defined in WSDL.
- Class javaType = JavaUtils.loadJavaType(javaTypeName);
- Class compJavaType = javaType.getComponentType();
-
- if (xmlTypeLocalPart.indexOf("ArrayOfArrayOf") >= 0)
- compJavaType = compJavaType.getComponentType();
-
- QName compXMLType = new LiteralTypeMapping().getXMLType(compJavaType);
- paramMetaData.setSOAPArrayCompType(compXMLType);
- }
- catch (ClassNotFoundException e)
- {
- // ignore that user defined types cannot be loaded yet
- }
- }
- }
-
- private void setupXOPAttachmentParameter(WSDLInterfaceOperation operation,
ParameterMetaData paramMetaData)
- {
- QName xmlType = paramMetaData.getXmlType();
-
- // An XOP parameter is detected if it is a complex type that derives from
xsd:base64Binary
- WSDLTypes wsdlTypes =
operation.getWsdlInterface().getWsdlDefinitions().getWsdlTypes();
- JBossXSModel schemaModel = WSDLUtils.getSchemaModel(wsdlTypes);
- String localPart = xmlType.getLocalPart() != null ? xmlType.getLocalPart() :
"";
- String ns = xmlType.getNamespaceURI() != null ? xmlType.getNamespaceURI() :
"";
- XSTypeDefinition xsType = schemaModel.getTypeDefinition(localPart, ns);
- XOPScanner scanner = new XOPScanner();
- if(scanner.findXOPTypeDef(xsType)!=null |
(localPart.equals("base64Binary")&&ns.equals(Constants.NS_SCHEMA_XSD)))
- {
- // FIXME: read the xmime:contentType from the element declaration
- // See SchemaUtils#findXOPTypeDef(XSTypeDefinition typeDef) for details
-
- /*
- FIXME: the classloader is not set yet
- paramMetaData.setXopContentType(
- MimeUtils.resolveMimeType(paramMetaData.getJavaType())
- );
- */
-
- paramMetaData.setXOP(true);
-
- }
- }
-
- /*
- * Perhaps the JAX-RPC mapping model should be hash based. For now we optimize just
this case.
- */
- private Map<String, String> createVariableMappingMap(VariableMapping[]
mappings)
- {
- HashMap<String, String> map = new HashMap<String, String>();
- if (mappings != null)
- for (VariableMapping mapping : mappings)
- map.put(mapping.getXmlElementName(), mapping.getJavaVariableName());
-
- return map;
- }
-
- private void buildParameterMetaDataRpc(OperationMetaData opMetaData,
WSDLInterfaceOperation wsdlOperation, ServiceEndpointMethodMapping seiMethodMapping,
- TypeMappingImpl typeMapping)
- {
- log.trace("buildParameterMetaDataRpc: " + opMetaData.getQName());
-
- WSDLBindingOperation bindingOperation = wsdlOperation.getBindingOperation();
- if (bindingOperation == null)
- throw new WSException("Could not locate binding operation for:" +
opMetaData.getQName());
-
- // RPC has one input
- WSDLInterfaceOperationInput input = wsdlOperation.getInputs()[0];
- int wsdlPosition = 0;
- for (WSDLRPCPart part : input.getChildParts())
- {
- QName xmlType = part.getType();
- String partName = part.getName();
- QName xmlName = new QName(partName);
-
- ParameterMetaData pmd = buildInputParameter(opMetaData, wsdlOperation,
seiMethodMapping, typeMapping, partName, xmlName, xmlType, wsdlPosition++);
-
- setupXOPAttachmentParameter(wsdlOperation, pmd);
- setupSOAPArrayParameter(pmd);
- }
-
- wsdlPosition = processBindingParameters(opMetaData, wsdlOperation,
seiMethodMapping, typeMapping, bindingOperation, wsdlPosition);
-
- WSDLInterfaceOperationOutput[] outputs = wsdlOperation.getOutputs();
- if (outputs.length > 0)
- {
- WSDLInterfaceOperationOutput output = outputs[0];
- for (WSDLRPCPart part : output.getChildParts())
- {
- String partName = part.getName();
-
- ParameterMetaData outMetaData = opMetaData.getParameter(new
QName(partName));
- if (outMetaData != null)
- {
- outMetaData.setMode(ParameterMode.INOUT);
- }
- else
- {
- QName xmlName = new QName(partName);
- QName xmlType = part.getType();
-
- ParameterMetaData pmd = buildOutputParameter(opMetaData, wsdlOperation,
seiMethodMapping, wsdlPosition, partName, xmlName, xmlType, typeMapping);
- if (opMetaData.getReturnParameter() != pmd)
- wsdlPosition++;
-
- setupXOPAttachmentParameter(wsdlOperation, pmd);
- setupSOAPArrayParameter(pmd);
- }
- }
-
- processBindingOutputParameters(opMetaData, wsdlOperation, seiMethodMapping,
typeMapping, bindingOperation, wsdlPosition);
- }
- else if (wsdlOperation.getPattern() != Constants.WSDL20_PATTERN_IN_ONLY)
- {
- throw new WSException("RPC style was missing an output, and was not an
IN-ONLY MEP.");
- }
- }
-
- private int processDocElement(OperationMetaData operation, WSDLInterfaceOperation
wsdlOperation, ServiceEndpointMethodMapping seiMethodMapping, TypeMappingImpl typeMapping,
List<WrappedParameter> wrappedParameters, List<WrappedParameter>
wrappedResponseParameters)
- {
- WSDLInterfaceOperationInput input = wsdlOperation.getInputs()[0];
- int wsdlPosition;
-
- QName xmlName = input.getElement();
- QName xmlType = input.getXMLType();
- String javaTypeName = typeMapping.getJavaTypeName(xmlType);
-
- TypesMetaData typesMetaData =
operation.getEndpointMetaData().getServiceMetaData().getTypesMetaData();
- TypeMappingMetaData typeMetaData = typesMetaData.getTypeMappingByXMLType(xmlType);
- if (typeMetaData != null)
- javaTypeName = typeMetaData.getJavaTypeName();
-
- if (javaTypeName == null)
- throw new WSException("Cannot obtain java type mapping for: " +
xmlType);
-
- // Check if we need to wrap the parameters
- boolean isWrapped = isWrapped(seiMethodMapping, javaTypeName);
- operation.getEndpointMetaData().setParameterStyle(isWrapped ?
ParameterStyle.WRAPPED : ParameterStyle.BARE);
-
- ParameterMetaData inMetaData = new ParameterMetaData(operation, xmlName, xmlType,
javaTypeName);
- operation.addParameter(inMetaData);
-
-
- // Set the variable names
- if (inMetaData.getOperationMetaData().isDocumentWrapped())
- {
- if (seiMethodMapping == null)
- throw new IllegalArgumentException("Cannot wrap parameters without SEI
method mapping");
-
- ServiceEndpointInterfaceMapping seiMapping =
seiMethodMapping.getServiceEndpointInterfaceMapping();
- JavaXmlTypeMapping javaXmlTypeMapping =
seiMapping.getJavaWsdlMapping().getTypeMappingForQName(xmlType);
- if (javaXmlTypeMapping == null)
- throw new WSException("Cannot obtain java/xml type mapping for: " +
xmlType);
-
-
- Map<String, String> variableMap =
createVariableMappingMap(javaXmlTypeMapping.getVariableMappings());
- for (MethodParamPartsMapping partMapping :
seiMethodMapping.getMethodParamPartsMappings())
- {
- WsdlMessageMapping wsdlMessageMapping = partMapping.getWsdlMessageMapping();
- if (wsdlMessageMapping == null)
- throw new IllegalArgumentException("wsdl-message-message mapping
required for document/literal wrapped");
-
- String elementName = wsdlMessageMapping.getWsdlMessagePartName();
- String variable =
variableMap.get(wsdlMessageMapping.getWsdlMessagePartName());
- if (variable == null)
- throw new IllegalArgumentException("Could not determine variable name
for element: " + elementName);
-
- WrappedParameter wrapped = new WrappedParameter(new QName(elementName),
partMapping.getParamType(), variable,
- partMapping.getParamPosition());
-
-
- String parameterMode = wsdlMessageMapping.getParameterMode();
- if (parameterMode == null || parameterMode.length() < 2)
- throw new IllegalArgumentException("Invalid parameter mode for
element: " + elementName);
-
- if (! "OUT".equals(parameterMode))
- wrappedParameters.add(wrapped);
- if (! "IN".equals(parameterMode))
- wrappedResponseParameters.add(wrapped);
- }
- inMetaData.setWrappedParameters(wrappedParameters);
- wsdlPosition = wrappedParameters.size();
- }
- else
- {
- if (seiMethodMapping != null)
- {
- MethodParamPartsMapping part =
seiMethodMapping.getMethodParamPartsMappingByPartName(input.getPartName());
- if (part != null)
- {
- inMetaData.setJavaTypeName(part.getParamType());
- inMetaData.setIndex(part.getParamPosition());
- }
- }
-
- setupXOPAttachmentParameter(wsdlOperation, inMetaData);
- wsdlPosition = 1;
- }
-
- return wsdlPosition;
- }
-
- private boolean isWrapped(ServiceEndpointMethodMapping seiMethodMapping, String
javaTypeName)
- {
- boolean isWrapParameters = (seiMethodMapping != null ?
seiMethodMapping.isWrappedElement() : false);
- log.trace("isWrapParameters based on wrapped-element: " +
isWrapParameters);
- if (isWrapParameters == false && seiMethodMapping != null)
- {
-
- MethodParamPartsMapping[] partsMappings =
seiMethodMapping.getMethodParamPartsMappings();
- if (partsMappings.length > 0)
- {
- boolean matchingPartFound = false;
- for (MethodParamPartsMapping partsMapping : partsMappings)
- {
- String paramTypeName = partsMapping.getParamType();
- if (paramTypeName.equals(javaTypeName))
- {
- matchingPartFound = true;
- break;
- }
- else
- {
- // Check assignability,
- // JavaUtils.isAssignableFrom("org.w3c.dom.Element",
- // "javax.xml.soap.SOAPElement")
- try
- {
- Class paramType = JavaUtils.loadJavaType(paramTypeName);
- Class javaType = JavaUtils.loadJavaType(javaTypeName);
-
- // If it is assignable the explict mapping takes presedence
- // and we don't wrap
- if (JavaUtils.isAssignableFrom(javaType, paramType))
- {
- // javaTypeName = paramTypeName;
- matchingPartFound = true;
- break;
- }
- }
- catch (ClassNotFoundException e)
- {
- // Ignore. For simple types this should work, others should
- // be lexically equal
- // if it is not wrapped.
- }
- }
- }
- // Do we really want to continue to handle invalid mappings?
- isWrapParameters = (matchingPartFound == false);
- log.trace("isWrapParameters based on matching parts: " +
isWrapParameters);
- }
- }
- return isWrapParameters;
- }
-
- private int processOutputDocElement(OperationMetaData opMetaData,
WSDLInterfaceOperation wsdlOperation,
- ServiceEndpointMethodMapping seiMethodMapping, TypeMappingImpl typeMapping,
List<WrappedParameter> wrappedResponseParameters,
- int wsdlPosition)
- {
- WSDLInterfaceOperationOutput opOutput = wsdlOperation.getOutputs()[0];
- QName xmlName = opOutput.getElement();
- QName xmlType = opOutput.getXMLType();
-
- String javaTypeName = typeMapping.getJavaTypeName(xmlType);
-
- TypesMetaData typesMetaData =
opMetaData.getEndpointMetaData().getServiceMetaData().getTypesMetaData();
- if (typesMetaData.getTypeMappingByXMLType(xmlType) != null)
- javaTypeName =
typesMetaData.getTypeMappingByXMLType(xmlType).getJavaTypeName();
-
- if (javaTypeName == null)
- throw new WSException("Cannot obtain java/xml type mapping for: " +
xmlType);
-
- ParameterMetaData outMetaData = new ParameterMetaData(opMetaData, xmlName, xmlType,
javaTypeName);
-
- boolean hasReturnMapping = true;
- if (opMetaData.isDocumentWrapped())
- {
- if (seiMethodMapping == null)
- throw new IllegalArgumentException("Cannot wrap parameters without SEI
method mapping");
-
- WsdlReturnValueMapping returnValueMapping =
seiMethodMapping.getWsdlReturnValueMapping();
- if (returnValueMapping != null)
- {
- ServiceEndpointInterfaceMapping seiMapping =
seiMethodMapping.getServiceEndpointInterfaceMapping();
- JavaWsdlMapping javaWsdlMapping = seiMapping.getJavaWsdlMapping();
- JavaXmlTypeMapping javaXmlTypeMapping =
javaWsdlMapping.getTypeMappingForQName(xmlType);
- if (javaXmlTypeMapping == null)
- throw new WSException("Cannot obtain java/xml type mapping for:
" + xmlType);
-
- Map<String, String> map =
createVariableMappingMap(javaXmlTypeMapping.getVariableMappings());
- String elementName = returnValueMapping.getWsdlMessagePartName();
- String variable = map.get(elementName);
- if (variable == null)
- throw new IllegalArgumentException("Could not determine variable name
for element: " + elementName);
-
- String wrappedType = returnValueMapping.getMethodReturnValue();
- QName element = new QName(elementName);
- WrappedParameter wrappedParameter = new WrappedParameter(element,
wrappedType, variable, WrappedParameter.RETURN);
- wrappedResponseParameters.add(0, wrappedParameter);
- }
-
- outMetaData.setWrappedParameters(wrappedResponseParameters);
- }
- else
- {
- if (seiMethodMapping != null)
- {
- MethodParamPartsMapping part =
seiMethodMapping.getMethodParamPartsMappingByPartName(opOutput.getPartName());
- String mode = null;
- if (part != null)
- {
- WsdlMessageMapping wsdlMessageMapping = part.getWsdlMessageMapping();
- mode = wsdlMessageMapping.getParameterMode();
- }
- if ("INOUT".equals(mode))
- {
- ParameterMetaData inMetaData = opMetaData.getParameter(xmlName);
- if (inMetaData != null)
- {
- inMetaData.setMode(ParameterMode.INOUT);
- return wsdlPosition;
- }
-
- throw new WSException("Could not update IN parameter to be INOUT, as
indicated in the mapping: " + opOutput.getPartName());
- }
- // It's potentialy possible that an input parameter could exist with the
same part name
- else if ("OUT".equals(mode))
- {
- hasReturnMapping = false;
- javaTypeName = part.getParamType();
- outMetaData.setIndex(part.getParamPosition());
- outMetaData.setJavaTypeName(javaTypeName);
- }
- else
- {
- WsdlReturnValueMapping returnValueMapping =
seiMethodMapping.getWsdlReturnValueMapping();
- if (returnValueMapping != null)
- {
- javaTypeName = returnValueMapping.getMethodReturnValue();
- outMetaData.setJavaTypeName(javaTypeName);
- }
- }
- }
-
- setupXOPAttachmentParameter(wsdlOperation, outMetaData);
- }
-
- if (hasReturnMapping)
- {
- opMetaData.setReturnParameter(outMetaData);
- }
- else
- {
- opMetaData.addParameter(outMetaData);
- outMetaData.setMode(ParameterMode.OUT);
- wsdlPosition++;
- }
-
- return wsdlPosition;
- }
-
- private void buildParameterMetaDataDoc(OperationMetaData opMetaData,
WSDLInterfaceOperation wsdlOperation, ServiceEndpointMethodMapping seiMethodMapping,
- TypeMappingImpl typeMapping)
- {
- log.trace("buildParameterMetaDataDoc: " + opMetaData.getQName());
-
- WSDLBindingOperation bindingOperation = wsdlOperation.getBindingOperation();
- if (bindingOperation == null)
- throw new WSException("Could not locate binding operation for:" +
bindingOperation);
-
- List<WrappedParameter> wrappedParameters = new
ArrayList<WrappedParameter>();
- List<WrappedParameter> wrappedResponseParameters = new
ArrayList<WrappedParameter>();
-
- int wsdlPosition = 0;
- // WS-I BP 1.0 allows document/literal bare to have zero message parts
- if (wsdlOperation.getInputs().length > 0)
- {
- wsdlPosition = processDocElement(opMetaData, wsdlOperation, seiMethodMapping,
typeMapping, wrappedParameters, wrappedResponseParameters);
- wsdlPosition = processBindingParameters(opMetaData, wsdlOperation,
seiMethodMapping, typeMapping, bindingOperation, wsdlPosition);
- }
- else
- {
- // Set the default to bare in case there isn't an input object, revisit
this
- opMetaData.getEndpointMetaData().setParameterStyle(ParameterStyle.BARE);
- }
-
- if (wsdlOperation.getOutputs().length > 0)
- {
- wsdlPosition = processOutputDocElement(opMetaData, wsdlOperation,
seiMethodMapping, typeMapping, wrappedResponseParameters, wsdlPosition);
- wsdlPosition = processBindingOutputParameters(opMetaData, wsdlOperation,
seiMethodMapping, typeMapping, bindingOperation, wsdlPosition);
- }
- }
-
- /**
- * Build default action according to the pattern described in
- *
http://www.w3.org/Submission/2004/SUBM-ws-addressing-20040810/
- * Section 3.3.2 'Default Action Pattern'<br>
- * [target namespace]/[port type name]/[input|output name]
- *
- * @param wsdlOperation
- * @return action value
- */
- private String buildWsaActionValue(WSDLInterfaceOperation wsdlOperation)
- {
- WSDLProperty wsaAction =
wsdlOperation.getProperty(Constants.WSDL_ATTRIBUTE_WSA_ACTION.toString());
- String actionValue = null;
-
- if (null == wsaAction)
- {
-
- String tns = wsdlOperation.getQName().getNamespaceURI();
- String portTypeName = wsdlOperation.getQName().getLocalPart();
- WSDLProperty messageName =
wsdlOperation.getProperty("http://www.jboss.org/jbossws/messagename/...;
-
- actionValue = new String(tns + "/" + portTypeName + "/" +
messageName.getValue());
- }
- else
- {
- actionValue = wsaAction.getValue();
- }
-
- return actionValue;
- }
-
- protected void buildFaultMetaData(OperationMetaData opMetaData, WSDLInterfaceOperation
wsdlOperation)
- {
- TypesMetaData typesMetaData =
opMetaData.getEndpointMetaData().getServiceMetaData().getTypesMetaData();
-
- WSDLInterface wsdlInterface = wsdlOperation.getWsdlInterface();
- for (WSDLInterfaceOperationOutfault outFault : wsdlOperation.getOutfaults())
- {
- QName ref = outFault.getRef();
-
- WSDLInterfaceFault wsdlFault = wsdlInterface.getFault(new
NCName(ref.getLocalPart()));
- QName xmlName = wsdlFault.getElement();
- QName xmlType = wsdlFault.getXmlType();
- String javaTypeName = null;
-
- if (xmlType == null)
- {
- log.warn("Cannot obtain fault type for element: " + xmlName);
- xmlType = xmlName;
- }
-
- TypeMappingMetaData tmMetaData =
typesMetaData.getTypeMappingByXMLType(xmlType);
- if (tmMetaData != null)
- javaTypeName = tmMetaData.getJavaTypeName();
-
- if (javaTypeName == null)
- {
- log.warn("Cannot obtain java type mapping for: " + xmlType);
- javaTypeName = new UnqualifiedFaultException(xmlType).getClass().getName();
- }
-
- FaultMetaData faultMetaData = new FaultMetaData(opMetaData, xmlName, xmlType,
javaTypeName);
- opMetaData.addFault(faultMetaData);
- }
- }
-
- protected void processEndpointMetaDataExtensions(EndpointMetaData epMetaData,
WSDLDefinitions wsdlDefinitions)
- {
- for (WSDLInterface wsdlInterface : wsdlDefinitions.getInterfaces())
- {
- WSDLProperty eventSourceProp =
wsdlInterface.getProperty(Constants.WSDL_PROPERTY_EVENTSOURCE);
- if (eventSourceProp != null && epMetaData instanceof
ServerEndpointMetaData)
- {
- ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData;
- String eventSourceNS = wsdlInterface.getQName().getNamespaceURI() +
"/" + wsdlInterface.getQName().getLocalPart();
- Object notificationSchema = null; // todo: resolve schema from operation
message
-
- EventingEpMetaExt ext = new
EventingEpMetaExt(EventingConstants.NS_EVENTING);
- ext.setEventSourceNS(eventSourceNS);
- ext.setNotificationSchema(notificationSchema);
-
- sepMetaData.addExtension(ext);
- sepMetaData.setManagedEndpointBean(EventingEndpoint.class.getName());
- }
- }
- }
-
- /** Process operation meta data extensions. */
- protected void processOpMetaExtensions(OperationMetaData opMetaData,
WSDLInterfaceOperation wsdlOperation)
- {
-
- String tns = wsdlOperation.getQName().getNamespaceURI();
- String portTypeName = wsdlOperation.getQName().getLocalPart();
-
- AddressingProperties ADDR = new AddressingPropertiesImpl();
- AddressingOpMetaExt addrExt = new AddressingOpMetaExt(ADDR.getNamespaceURI());
-
- // inbound action
- WSDLProperty wsaInAction =
wsdlOperation.getProperty(Constants.WSDL_PROPERTY_ACTION_IN);
- if (wsaInAction != null)
- {
- addrExt.setInboundAction(wsaInAction.getValue());
- }
- else
- {
- WSDLProperty messageName =
wsdlOperation.getProperty(Constants.WSDL_PROPERTY_MESSAGE_NAME_IN);
- addrExt.setInboundAction(tns + "/" + portTypeName + "/" +
messageName);
- }
-
- // outbound action
- WSDLProperty wsaOutAction =
wsdlOperation.getProperty(Constants.WSDL_PROPERTY_ACTION_OUT);
- if (wsaOutAction != null)
- {
- addrExt.setOutboundAction(wsaOutAction.getValue());
- }
- else
- {
- WSDLProperty messageName =
wsdlOperation.getProperty(Constants.WSDL_PROPERTY_MESSAGE_NAME_OUT);
- addrExt.setOutboundAction(tns + "/" + portTypeName + "/" +
messageName);
- }
-
- opMetaData.addExtension(addrExt);
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java)
Deleted:
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-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,263 +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.
- */
-// $Id$
-package org.jboss.ws.metadata.builder.jaxrpc;
-
-import java.util.Set;
-
-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.jaxrpc.WSEndpointConfigJAXRPC;
-import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedEjbPortComponentMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedWebMetaData;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.ServiceEndpointInterfaceMapping;
-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.webservices.PortComponentMetaData;
-import org.jboss.ws.metadata.webservices.WebserviceDescriptionMetaData;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
-import org.jboss.ws.metadata.wsdl.WSDLService;
-import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
-
-/**
- * A server side meta data builder that is based on webservices.xml.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 19-May-2005
- */
-public class JAXRPCServerMetaDataBuilder extends JAXRPCMetaDataBuilder
-{
- // provide logging
- final Logger log = Logger.getLogger(JAXRPCServerMetaDataBuilder.class);
-
- /**
- * Build from webservices.xml
- */
- public UnifiedMetaData buildMetaData(JAXRPCDeployment udi)
- {
- log.debug("START buildMetaData: [name=" + udi.getCanonicalName() +
"]");
- try
- {
- // For every webservice-description build the ServiceMetaData
- UnifiedMetaData wsMetaData = new UnifiedMetaData();
- wsMetaData.setDeploymentName(udi.getCanonicalName());
- wsMetaData.setClassLoader(udi.classLoader);
-
- WebserviceDescriptionMetaData[] wsDescriptionArr =
udi.getWebservicesMetaData().getWebserviceDescriptions();
- for (WebserviceDescriptionMetaData wsdMetaData : wsDescriptionArr)
- {
- ServiceMetaData serviceMetaData = new ServiceMetaData(wsMetaData, null);
-
serviceMetaData.setWebserviceDescriptionName(wsdMetaData.getWebserviceDescriptionName());
- wsMetaData.addService(serviceMetaData);
-
- // Unmarshall the WSDL
- serviceMetaData.setWsdlFile(wsdMetaData.getWsdlFile());
- WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
-
- // Unmarshall the jaxrpc-mapping.xml
- serviceMetaData.setJaxrpcMappingFile(wsdMetaData.getJaxrpcMappingFile());
- JavaWsdlMapping javaWsdlMapping = serviceMetaData.getJavaWsdlMapping();
- if (javaWsdlMapping == null)
- throw new WSException("jaxrpc-mapping-file not configured from
webservices.xml");
-
- // Build type mapping meta data
- setupTypesMetaData(serviceMetaData);
-
- // Assign the WS-Security configuration,
- WSSecurityConfiguration securityConfiguration =
getWsSecurityConfiguration(udi);
- serviceMetaData.setSecurityConfiguration(securityConfiguration);
-
- // For every port-component build the EndpointMetaData
- PortComponentMetaData[] pcMetaDataArr = wsdMetaData.getPortComponents();
- for (PortComponentMetaData pcMetaData : pcMetaDataArr)
- {
- QName portName = pcMetaData.getWsdlPort();
-
- // JBWS-722
- // <wsdl-port> in webservices.xml should be qualified
- if (portName.getNamespaceURI().length() == 0)
- {
- String nsURI = wsdlDefinitions.getTargetNamespace();
- portName = new QName(nsURI, portName.getLocalPart());
- log.warn("Adding wsdl targetNamespace to: " + portName);
- pcMetaData.setWsdlPort(portName);
- }
-
- WSDLEndpoint wsdlEndpoint = getWsdlEndpoint(wsdlDefinitions, portName);
- if (wsdlEndpoint == null)
- throw new WSException("Cannot find port in wsdl: " +
portName);
-
- // set service name
- serviceMetaData.setServiceName(wsdlEndpoint.getWsdlService().getQName());
- QName interfaceQName = wsdlEndpoint.getInterface().getQName();
-
- ServerEndpointMetaData sepMetaData = new
ServerEndpointMetaData(serviceMetaData, portName, interfaceQName, Type.JAXRPC);
- sepMetaData.setPortComponentName(pcMetaData.getPortComponentName());
- String linkName = pcMetaData.getEjbLink() != null ?
pcMetaData.getEjbLink() : pcMetaData.getServletLink();
- sepMetaData.setLinkName(linkName);
- serviceMetaData.addEndpoint(sepMetaData);
-
- initEndpointEncodingStyle(sepMetaData);
-
- initEndpointAddress(udi, sepMetaData, linkName);
-
- if (udi.metaData instanceof UnifiedApplicationMetaData)
- {
- UnifiedApplicationMetaData apMetaData =
(UnifiedApplicationMetaData)udi.metaData;
- wsMetaData.setSecurityDomain(apMetaData.getSecurityDomain());
-
- // Copy the wsdl publish location from jboss.xml
- String wsdName = serviceMetaData.getWebserviceDescriptionName();
- String wsdlPublishLocation =
apMetaData.getWsdlPublishLocationByName(wsdName);
- serviceMetaData.setWsdlPublishLocation(wsdlPublishLocation);
-
- // Copy <port-component> meta data
- UnifiedBeanMetaData beanMetaData =
(UnifiedBeanMetaData)apMetaData.getBeanByEjbName(linkName);
- if (beanMetaData == null)
- throw new WSException("Cannot obtain UnifiedBeanMetaData for:
" + linkName);
-
- String configName = apMetaData.getConfigName();
- if (configName != null)
- sepMetaData.setConfigName(configName);
-
- String configFile = apMetaData.getConfigFile();
- if (configFile != null)
- sepMetaData.setConfigFile(configFile);
-
- UnifiedEjbPortComponentMetaData bpcMetaData =
beanMetaData.getPortComponent();
- if (bpcMetaData != null)
- {
- if (bpcMetaData.getAuthMethod() != null)
- {
- String authMethod = bpcMetaData.getAuthMethod();
- sepMetaData.setAuthMethod(authMethod);
- }
- if (bpcMetaData.getTransportGuarantee() != null)
- {
- String transportGuarantee = bpcMetaData.getTransportGuarantee();
- sepMetaData.setTransportGuarantee(transportGuarantee);
- }
-
- sepMetaData.setURLPattern(bpcMetaData.getURLPattern());
- }
- }
- else if (udi.metaData instanceof UnifiedWebMetaData)
- {
- UnifiedWebMetaData webMetaData = (UnifiedWebMetaData)udi.metaData;
- wsMetaData.setSecurityDomain(webMetaData.getSecurityDomain());
-
- String targetBean = webMetaData.getServletClassNames().get(linkName);
- sepMetaData.setServiceEndpointImplName(targetBean);
-
- // Copy the wsdl publish location from jboss-web.xml
- String wsdName = serviceMetaData.getWebserviceDescriptionName();
- String wsdlPublishLocation =
webMetaData.getWsdlPublishLocationByName(wsdName);
- serviceMetaData.setWsdlPublishLocation(wsdlPublishLocation);
-
- String configName = webMetaData.getConfigName();
- if (configName != null)
- sepMetaData.setConfigName(configName);
-
- String configFile = webMetaData.getConfigFile();
- if (configFile != null)
- sepMetaData.setConfigFile(configFile);
-
- initTransportGuaranteeJSE(udi, sepMetaData, linkName);
- }
-
- // init service endpoint id
- ObjectName sepID = getServiceEndpointID(udi, sepMetaData);
- sepMetaData.setServiceEndpointID(sepID);
-
- replaceAddressLocation(sepMetaData);
-
- String seiName = pcMetaData.getServiceEndpointInterface();
- sepMetaData.setServiceEndpointInterfaceName(seiName);
-
- ServiceEndpointInterfaceMapping seiMapping =
javaWsdlMapping.getServiceEndpointInterfaceMapping(seiName);
- if (seiMapping == null)
- log.warn("Cannot obtain SEI mapping for: " + seiName);
-
- // process endpoint meta extension
- processEndpointMetaDataExtensions(sepMetaData, wsdlDefinitions);
-
- // Setup the endpoint operations
- setupOperationsFromWSDL(sepMetaData, wsdlEndpoint, seiMapping);
-
- // Add pre handlers
- WSEndpointConfigJAXRPC jaxrpcConfig =
(WSEndpointConfigJAXRPC)sepMetaData.getEndpointConfig();
- sepMetaData.addHandlers(jaxrpcConfig.getHandlers(sepMetaData,
HandlerType.PRE));
-
- // Setup the endpoint handlers
- for (UnifiedHandlerMetaData uhmd : pcMetaData.getHandlers())
- {
- Set<String> portNames = uhmd.getPortNames();
- if (portNames.size() == 0 ||
portNames.contains(portName.getLocalPart()))
- {
- sepMetaData.addHandler(uhmd.getHandlerMetaDataJAXRPC(sepMetaData,
HandlerType.ENDPOINT));
- }
- }
-
- // Add post handlers
- sepMetaData.addHandlers(jaxrpcConfig.getHandlers(sepMetaData,
HandlerType.POST));
- }
- }
-
- log.debug("END buildMetaData: " + wsMetaData);
- return wsMetaData;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WSException("Cannot build meta data: " + ex.getMessage(),
ex);
- }
- }
-
- private WSDLEndpoint getWsdlEndpoint(WSDLDefinitions wsdlDefinitions, QName portName)
- {
- WSDLEndpoint wsdlEndpoint = null;
- for (WSDLService wsdlService : wsdlDefinitions.getServices())
- {
- WSDLEndpoint auxEndpoint = wsdlService.getEndpoint(portName);
- if (auxEndpoint != null)
- {
- wsdlEndpoint = auxEndpoint;
- break;
- }
- }
- return wsdlEndpoint;
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java)
Copied: trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws)
Deleted:
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-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientEndpointMetaDataBuilder.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,89 +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.
-*/
-// $Id$
-package org.jboss.ws.metadata.builder.jaxws;
-
-import javax.jws.HandlerChain;
-import javax.jws.soap.SOAPBinding;
-import javax.xml.ws.BindingType;
-
-import org.jboss.logging.Logger;
-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
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 9-Aug-2006
- */
-public class JAXWSClientEndpointMetaDataBuilder extends JAXWSWebServiceMetaDataBuilder
-{
- // provide logging
- private final Logger log =
Logger.getLogger(JAXWSClientEndpointMetaDataBuilder.class);
-
- public void rebuildEndpointMetaData(EndpointMetaData epMetaData, Class<?>
wsClass)
- {
- log.debug("START: rebuildMetaData");
-
- // Clear the java types, etc.
- resetMetaDataBuilder(epMetaData.getClassLoader());
-
- // Nuke parameterStyle
- epMetaData.setParameterStyle(null);
-
- // Process an optional @BindingType annotation
- if (wsClass.isAnnotationPresent(BindingType.class))
- processBindingType(epMetaData, wsClass);
-
- // Process @SOAPBinding
- if (wsClass.isAnnotationPresent(SOAPBinding.class))
- processSOAPBinding(epMetaData, wsClass);
-
- // Clear handlers
- epMetaData.clearHandlers();
-
- // Add pre handlers
- WSClientConfigJAXWS jaxwsConfig =
(WSClientConfigJAXWS)epMetaData.getEndpointConfig();
- epMetaData.addHandlers(jaxwsConfig.getHandlers(epMetaData, HandlerType.PRE));
-
- // Process an optional @HandlerChain annotation
- if (wsClass.isAnnotationPresent(HandlerChain.class))
- processHandlerChain(epMetaData, wsClass);
-
- // Add post handlers
- epMetaData.addHandlers(jaxwsConfig.getHandlers(epMetaData, HandlerType.POST));
-
- // Process @WebMethod
- processWebMethods(epMetaData, wsClass);
-
- // Initialize types
- createJAXBContext(epMetaData);
- populateXmlTypes(epMetaData);
-
- // Eager initialization
- epMetaData.eagerInitialize();
-
- log.debug("END: rebuildMetaData\n" + epMetaData.getServiceMetaData());
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientEndpointMetaDataBuilder.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientEndpointMetaDataBuilder.java)
Deleted:
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-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,173 +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.builder.jaxws;
-
-//$Id$
-
-import java.io.IOException;
-import java.net.URL;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.jaxrpc.Style;
-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;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
-import org.jboss.ws.metadata.wsdl.WSDLInterface;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperation;
-import org.jboss.ws.metadata.wsdl.WSDLService;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
-
-/**
- * A client side meta data builder.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 19-May-2005
- */
-public class JAXWSClientMetaDataBuilder extends JAXWSMetaDataBuilder
-{
- // provide logging
- private final Logger log = Logger.getLogger(JAXWSClientMetaDataBuilder.class);
-
- /** Build from WSDL and jaxrpc-mapping.xml
- */
- public ServiceMetaData buildMetaData(QName serviceName, URL wsdlURL, ClassLoader
loader)
- {
- if (wsdlURL == null)
- throw new IllegalArgumentException("Invalid wsdlURL: " + wsdlURL);
-
- log.debug("START buildMetaData: [service=" + serviceName +
"]");
- try
- {
- UnifiedMetaData wsMetaData = new UnifiedMetaData();
-
- ServiceMetaData serviceMetaData = new ServiceMetaData(wsMetaData, serviceName);
- wsMetaData.addService(serviceMetaData);
-
- serviceMetaData.setWsdlFile(wsdlURL.toExternalForm());
- WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
-
- buildMetaDataInternal(serviceMetaData, wsdlDefinitions);
-
- // Read the WSDL and initialize the schema model
- // This should only be needed for debuging purposes of the UMDM
- JBossXSModel schemaModel =
WSDLUtils.getSchemaModel(wsdlDefinitions.getWsdlTypes());
- serviceMetaData.getTypesMetaData().setSchemaModel(schemaModel);
-
- log.debug("END buildMetaData: " + wsMetaData);
- return serviceMetaData;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WSException("Cannot build meta data: " + ex.getMessage(),
ex);
- }
- }
-
- private void buildMetaDataInternal(ServiceMetaData serviceMetaData, WSDLDefinitions
wsdlDefinitions) throws IOException
- {
- QName serviceName = serviceMetaData.getServiceName();
-
- // Get the WSDL service
- WSDLService wsdlService = null;
- if (serviceName == null)
- {
- if (wsdlDefinitions.getServices().length != 1)
- throw new IllegalArgumentException("Expected a single service
element");
-
- wsdlService = wsdlDefinitions.getServices()[0];
- serviceMetaData.setServiceName(wsdlService.getQName());
- }
- else
- {
- wsdlService = wsdlDefinitions.getService(new
NCName(serviceName.getLocalPart()));
- }
- if (wsdlService == null)
- throw new IllegalArgumentException("Cannot obtain wsdl service: " +
serviceName);
-
- // Build endpoint meta data
- for (WSDLEndpoint wsdlEndpoint : wsdlService.getEndpoints())
- {
- QName portName = wsdlEndpoint.getQName();
- QName interfaceQName = wsdlEndpoint.getInterface().getQName();
- ClientEndpointMetaData epMetaData = new ClientEndpointMetaData(serviceMetaData,
portName, interfaceQName, Type.JAXWS);
- epMetaData.setEndpointAddress(wsdlEndpoint.getAddress());
- serviceMetaData.addEndpoint(epMetaData);
-
- // Init the endpoint binding
- initEndpointBinding(wsdlEndpoint, epMetaData);
-
- // Init the service encoding style
- initEndpointEncodingStyle(epMetaData);
-
- setupOperationsFromWSDL(epMetaData, wsdlEndpoint);
- }
- }
-
- protected void setupOperationsFromWSDL(EndpointMetaData epMetaData, WSDLEndpoint
wsdlEndpoint)
- {
- WSDLDefinitions wsdlDefinitions =
wsdlEndpoint.getInterface().getWsdlDefinitions();
-
- // For every WSDL interface operation build the OperationMetaData
- WSDLInterface wsdlInterface = wsdlEndpoint.getInterface();
- for (WSDLInterfaceOperation wsdlOperation : wsdlInterface.getOperations())
- {
- String opName = wsdlOperation.getName().toString();
- QName opQName = wsdlOperation.getQName();
-
- // Set java method name
- String javaName = opName.substring(0, 1).toLowerCase() + opName.substring(1);
-
- OperationMetaData opMetaData = new OperationMetaData(epMetaData, opQName,
javaName);
- epMetaData.addOperation(opMetaData);
-
- // Set the operation style
- String style = wsdlOperation.getStyle();
- epMetaData.setStyle((Constants.URI_STYLE_IRI.equals(style) ? Style.DOCUMENT :
Style.RPC));
-
- // Set the operation MEP
- if (Constants.WSDL20_PATTERN_IN_ONLY.equals(wsdlOperation.getPattern()))
- opMetaData.setOneWay(true);
-
- // Set the operation SOAPAction
- WSDLBinding wsdlBinding =
wsdlDefinitions.getBindingByInterfaceName(wsdlInterface.getQName());
- WSDLBindingOperation wsdlBindingOperation =
wsdlBinding.getOperationByRef(opQName);
- if (wsdlBindingOperation != null)
- opMetaData.setSOAPAction(wsdlBindingOperation.getSOAPAction());
- }
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java)
Deleted:
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-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,152 +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.builder.jaxws;
-
-import javax.xml.ws.BindingType;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.annotation.PortComponent;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
-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.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public abstract class JAXWSEndpointMetaDataBuilder extends JAXWSMetaDataBuilder
-{
- // provide logging
- private final Logger log = Logger.getLogger(JAXWSEndpointMetaDataBuilder.class);
-
- public abstract ServerEndpointMetaData buildEndpoint(UnifiedMetaData wsMetaData,
UnifiedDeploymentInfo udi, Class<?> sepClass, String linkName);
-
- protected void processBindingType(EndpointMetaData epMetaData, Class<?>
wsClass)
- {
- BindingType anBindingType = (BindingType)wsClass.getAnnotation(BindingType.class);
- String uri = anBindingType.value();
- if (uri.length() > 0)
- {
- // TODO: switch to JAX-WS 2.1
- // This allows us to use constants here and reuse the orig. URI straigt away
-
if(uri.equals("http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true&q...
- {
- log.debug("MTOM enabled endpoint found");
- epMetaData.setMtomEnabled(true);
- epMetaData.setBindingId(uri.substring(0, uri.indexOf("?")));
- }
- else
- {
- epMetaData.setBindingId(uri);
- }
- }
- }
-
- protected void processPortComponent(UnifiedDeploymentInfo udi, Class<?> wsClass,
String linkName, ServerEndpointMetaData sepMetaData)
- {
- PortComponent anPortComponent =
(PortComponent)wsClass.getAnnotation(PortComponent.class);
- if (anPortComponent != null)
- {
- // setup config name
- if (anPortComponent.configName().length() > 0)
- {
- String configName = anPortComponent.configName();
- sepMetaData.setConfigName(configName);
- }
-
- // setup config file
- if (anPortComponent.configFile().length() > 0)
- {
- String configFile = anPortComponent.configFile();
- sepMetaData.setConfigFile(configFile);
- }
-
- boolean isJSEEndpoint = udi.type == DeploymentType.JAXWS_JSE;
-
- // context-root
- if (anPortComponent.contextRoot().length() > 0)
- {
- if (isJSEEndpoint)
- log.warn("(a)PortComponent.contextRoot is only valid on EJB
endpoints");
-
- if (isJSEEndpoint == false)
- {
- String contextRoot = anPortComponent.contextRoot();
- if (contextRoot.startsWith("/") == false)
- contextRoot = "/" + contextRoot;
-
- sepMetaData.setContextRoot(contextRoot);
- }
- }
-
- // url-pattern
- if (anPortComponent.urlPattern().length() > 0)
- {
- if (isJSEEndpoint)
- log.warn("(a)PortComponent.urlPattern is only valid on EJB
endpoints");
-
- if (isJSEEndpoint == false)
- {
- String urlPattern = anPortComponent.urlPattern();
- sepMetaData.setURLPattern(urlPattern);
- }
- }
-
- // auth-method
- if (anPortComponent.authMethod().length() > 0)
- {
- if (isJSEEndpoint)
- log.warn("(a)PortComponent.authMethod is only valid on EJB
endpoints");
-
- if (isJSEEndpoint == false)
- {
- String authMethod = anPortComponent.authMethod();
- sepMetaData.setAuthMethod(authMethod);
- }
- }
-
- // transport-guarantee
- if (anPortComponent.transportGuarantee().length() > 0)
- {
- if (isJSEEndpoint)
- log.warn("(a)PortComponent.transportGuarantee is only valid on EJB
endpoints");
-
- if (isJSEEndpoint == false)
- {
- String transportGuarantee = anPortComponent.transportGuarantee();
- sepMetaData.setTransportGuarantee(transportGuarantee);
- }
- }
-
- // virtual hosts
- String[] virtualHosts = anPortComponent.virtualHosts();
- if (virtualHosts != null & virtualHosts.length > 0)
- {
- sepMetaData.setVirtualHosts(virtualHosts);
- }
- }
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java)
Deleted:
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,34 +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.builder.jaxws;
-
-import org.jboss.ws.metadata.builder.MetaDataBuilder;
-
-/**
- * Abstract class that represents a JAX-WS metadata builder.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class JAXWSMetaDataBuilder extends MetaDataBuilder
-{
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java)
Deleted:
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-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB21.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,85 +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.
-*/
-// $Id$
-package org.jboss.ws.metadata.builder.jaxws;
-
-import java.util.Iterator;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-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
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @since 19-May-2005
- */
-public class JAXWSMetaDataBuilderEJB21 extends JAXWSServerMetaDataBuilder
-{
- // provide logging
- private final Logger log = Logger.getLogger(JAXWSMetaDataBuilderEJB21.class);
-
- /** Build from annotations
- */
- public UnifiedMetaData buildMetaData(UnifiedDeploymentInfo udi)
- {
- log.debug("START buildMetaData: [name=" + udi.getCanonicalName() +
"]");
- try
- {
- UnifiedMetaData wsMetaData = new UnifiedMetaData();
- wsMetaData.setDeploymentName(udi.getCanonicalName());
- wsMetaData.setClassLoader(udi.classLoader);
-
- if (udi.classLoader == null)
- throw new WSException("Deployment class loader not initialized");
-
- // For every bean
- UnifiedApplicationMetaData appMetaData =
(UnifiedApplicationMetaData)udi.metaData;
- Iterator it = appMetaData.getEnterpriseBeans();
- while (it.hasNext())
- {
- UnifiedBeanMetaData beanMetaData = (UnifiedBeanMetaData)it.next();
-
- String ejbName = beanMetaData.getEjbName();
- String ejbClassName = beanMetaData.getEjbClass();
- Class beanClass = udi.classLoader.loadClass(ejbClassName);
- setupEndpoint(wsMetaData, udi, beanClass, ejbName);
- }
-
- log.debug("END buildMetaData: " + wsMetaData);
- return wsMetaData;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WSException("Cannot build meta data: " + ex.getMessage(),
ex);
- }
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB21.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB21.java)
Deleted:
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-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,104 +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.
- */
-// $Id$
-package org.jboss.ws.metadata.builder.jaxws;
-
-import java.util.Iterator;
-
-import javax.jws.WebService;
-
-import org.jboss.annotation.security.SecurityDomain;
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-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
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @since 19-May-2005
- */
-public class JAXWSMetaDataBuilderEJB3 extends JAXWSServerMetaDataBuilder
-{
- // provide logging
- private final Logger log = Logger.getLogger(JAXWSMetaDataBuilderEJB3.class);
-
- protected Class annotatedClass;
-
- /** Build from webservices.xml
- */
- public UnifiedMetaData buildMetaData(UnifiedDeploymentInfo udi)
- {
- log.debug("START buildMetaData: [name=" + udi.getCanonicalName() +
"]");
- try
- {
- UnifiedMetaData wsMetaData = new UnifiedMetaData();
- wsMetaData.setDeploymentName(udi.getCanonicalName());
- wsMetaData.setClassLoader(udi.classLoader);
-
- if (udi.classLoader == null)
- throw new WSException("Deployment class loader not initialized");
-
- // The container objects below provide access to all of the ejb metadata
- UnifiedApplicationMetaData appMetaData =
(UnifiedApplicationMetaData)udi.metaData;
- Iterator<UnifiedBeanMetaData> it = appMetaData.getEnterpriseBeans();
- while (it.hasNext())
- {
- UnifiedBeanMetaData beanMetaData = it.next();
- String ejbClassName = beanMetaData.getEjbClass();
- Class<?> beanClass = udi.classLoader.loadClass(ejbClassName);
- if (beanClass.isAnnotationPresent(WebService.class))
- {
- String ejbLink = beanMetaData.getEjbName();
- setupEndpoint(wsMetaData, udi, beanClass, ejbLink);
-
- // setup the security domain
- if (beanClass.isAnnotationPresent(SecurityDomain.class))
- {
- SecurityDomain anSecurityDomain =
(SecurityDomain)beanClass.getAnnotation(SecurityDomain.class);
- String lastDomain = wsMetaData.getSecurityDomain();
- String securityDomain = anSecurityDomain.value();
- if (lastDomain != null && lastDomain.equals(securityDomain) ==
false)
- throw new IllegalStateException("Multiple security domains not
supported: " + securityDomain);
-
- wsMetaData.setSecurityDomain(securityDomain);
- }
- }
- }
-
- log.debug("END buildMetaData: " + wsMetaData);
- return wsMetaData;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WSException("Cannot build meta data: " + ex.getMessage(),
ex);
- }
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java)
Deleted:
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-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,88 +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.
- */
-// $Id$
-package org.jboss.ws.metadata.builder.jaxws;
-
-import java.util.Map;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-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
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @since 23-Jul-2005
- */
-public class JAXWSMetaDataBuilderJSE extends JAXWSServerMetaDataBuilder
-{
- // provide logging
- private final Logger log = Logger.getLogger(JAXWSMetaDataBuilderJSE.class);
-
- /** Build from annotations
- */
- public UnifiedMetaData buildMetaData(UnifiedDeploymentInfo udi)
- {
- log.debug("START buildMetaData: [name=" + udi.getCanonicalName() +
"]");
- try
- {
- UnifiedMetaData wsMetaData = new UnifiedMetaData();
- wsMetaData.setDeploymentName(udi.getCanonicalName());
- wsMetaData.setClassLoader(udi.classLoader);
-
- if (udi.classLoader == null)
- throw new WSException("Deployment class loader not initialized");
-
- // For every bean
- UnifiedWebMetaData webMetaData = (UnifiedWebMetaData)udi.metaData;
- Map<String, String> servletClassMap = webMetaData.getServletClassNames();
- for (String servletName : servletClassMap.keySet())
- {
- String servletClassName = servletClassMap.get(servletName);
- try
- {
- Class beanClass = udi.classLoader.loadClass(servletClassName);
- setupEndpoint(wsMetaData, udi, beanClass, servletName);
- }
- catch (ClassNotFoundException ex)
- {
- log.warn("Cannot load service endpoint class: " +
servletClassName);
- }
- }
-
- log.debug("END buildMetaData: " + wsMetaData);
- return wsMetaData;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WSException("Cannot build meta data: " + ex.getMessage(),
ex);
- }
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java)
Deleted:
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-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,169 +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.
- */
-// $Id$
-package org.jboss.ws.metadata.builder.jaxws;
-
-import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding.ParameterStyle;
-import javax.management.ObjectName;
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.transform.Source;
-import javax.xml.ws.Provider;
-import javax.xml.ws.ServiceMode;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.WebServiceProvider;
-import javax.xml.ws.Service.Mode;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.jboss.ws.core.jaxrpc.Style;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.core.utils.JavaUtils;
-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;
-
-/**
- * A server side meta data builder that is based on JSR-181 annotations
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @since 23-Jul-2005
- */
-public class JAXWSProviderMetaDataBuilder extends JAXWSEndpointMetaDataBuilder
-{
- // provide logging
- private final Logger log = Logger.getLogger(JAXWSProviderMetaDataBuilder.class);
-
- /** Build from annotations
- */
-
- @Override
- public ServerEndpointMetaData buildEndpoint(UnifiedMetaData wsMetaData,
UnifiedDeploymentInfo udi, Class<?> sepClass, String linkName)
- {
- // 5.3 Conformance (Provider implementation): A Provider based service endpoint
implementation MUST
- // implement a typed Provider interface.
- if (JavaUtils.isAssignableFrom(Provider.class, sepClass) == false)
- throw new WebServiceException("Endpoint implementation does not implement
javax.xml.ws.Provider: " + sepClass.getName());
-
- // 5.4 Conformance (WebServiceProvider annotation): A Provider based service
endpoint implementation
- // MUST carry a WebServiceProvider annotation
- WebServiceProvider anWebServiceProvider =
(WebServiceProvider)sepClass.getAnnotation(WebServiceProvider.class);
- if (anWebServiceProvider == null)
- throw new WebServiceException("Cannot obtain @WebServiceProvider annotation
from: " + sepClass.getName());
-
- // 7.3 Conformance (WebServiceProvider and WebService): A class annotated with the
WebServiceProvider
- // annotation MUST NOT carry a WebService annotation
- if (sepClass.isAnnotationPresent(WebService.class))
- throw new WebServiceException("Provider cannot carry @WebService
annotation: " + sepClass.getName());
-
- WSDLUtils wsdlUtils = WSDLUtils.getInstance();
-
- String name = wsdlUtils.getJustClassName(sepClass);
-
- String serviceName = anWebServiceProvider.serviceName();
- if (serviceName.length() == 0)
- serviceName = name + "Service";
-
- String targetNS = anWebServiceProvider.targetNamespace();
- if (targetNS.length() == 0)
- targetNS = wsdlUtils.getTypeNamespace(sepClass);
-
- String portName = anWebServiceProvider.portName();
- if (portName.length() == 0)
- portName = name + "Port";
-
- ServiceMetaData serviceMetaData = new ServiceMetaData(wsMetaData, new
QName(targetNS, serviceName));
- wsMetaData.addService(serviceMetaData);
-
- // Setup the ServerEndpointMetaData
- QName portQName = new QName(targetNS, portName);
- QName portTypeQName = new QName(targetNS, name);
- ServerEndpointMetaData sepMetaData = new ServerEndpointMetaData(serviceMetaData,
portQName, portTypeQName, Type.JAXWS);
- sepMetaData.setLinkName(linkName);
-
- sepMetaData.setStyle(Style.DOCUMENT);
- sepMetaData.setParameterStyle(ParameterStyle.BARE);
-
- sepMetaData.setServiceEndpointImplName(sepClass.getName());
- sepMetaData.setServiceEndpointInterfaceName(sepClass.getName());
-
- ServiceMode anServiceMode = sepClass.getAnnotation(ServiceMode.class);
- if (anServiceMode != null)
- sepMetaData.setServiceMode(anServiceMode.value());
- else sepMetaData.setServiceMode(Mode.PAYLOAD);
-
- serviceMetaData.addEndpoint(sepMetaData);
-
- // Process invoke method
- processInvokeMethod(sepMetaData);
-
- // Process WSDL
- String wsdlLocation = anWebServiceProvider.wsdlLocation();
- if (wsdlLocation != null)
- serviceMetaData.setWsdlFile(wsdlLocation);
-
- // Set the endpoint address
- processPortComponent(udi, sepClass, linkName, sepMetaData);
-
- // Init the endpoint address
- MetaDataBuilder.initEndpointAddress(udi, sepMetaData, linkName);
-
- // A provider may not have a WSDL file
- if (sepMetaData.getServiceMetaData().getWsdlFile() != null)
- MetaDataBuilder.replaceAddressLocation(sepMetaData);
-
- // init service endpoint id
- ObjectName sepID = MetaDataBuilder.getServiceEndpointID(udi, sepMetaData);
- sepMetaData.setServiceEndpointID(sepID);
-
- return sepMetaData;
- }
-
- private void processInvokeMethod(ServerEndpointMetaData epMetaData)
- {
- String javaName = "invoke";
- String targetNS = epMetaData.getQName().getNamespaceURI();
- OperationMetaData opMetaData = new OperationMetaData(epMetaData, new
QName(targetNS, javaName), javaName);
- epMetaData.addOperation(opMetaData);
-
- Mode serviceMode = epMetaData.getServiceMode();
- Class paramType = (serviceMode == Mode.MESSAGE ? SOAPMessage.class :
Source.class);
-
- // Setup invoke param
- QName xmlName = new QName("invokeParam");
- QName xmlType = Constants.TYPE_LITERAL_ANYTYPE;
- ParameterMetaData pmd = new ParameterMetaData(opMetaData, xmlName, xmlType,
paramType.getName());
- opMetaData.addParameter(pmd);
-
- // Setup invoke return
- xmlName = new QName("invokeReturn");
- ParameterMetaData retMetaData = new ParameterMetaData(opMetaData, xmlName, xmlType,
paramType.getName());
- opMetaData.setReturnParameter(retMetaData);
- }
-}
\ No newline at end of file
Copied:
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java)
Deleted:
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-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,59 +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.builder.jaxws;
-
-// $Id$
-
-import javax.jws.WebService;
-import javax.xml.ws.WebServiceProvider;
-
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-
-/** An abstract annotation meta data builder.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 27-Jun-2006
- */
-public abstract class JAXWSServerMetaDataBuilder extends JAXWSMetaDataBuilder
-{
- public abstract UnifiedMetaData buildMetaData(UnifiedDeploymentInfo udi);
-
- protected JAXWSEndpointMetaDataBuilder getEndpointBuilder(Class<?> bean)
- {
- if (bean.isAnnotationPresent(WebServiceProvider.class))
- return new JAXWSProviderMetaDataBuilder();
-
- if (bean.isAnnotationPresent(WebService.class))
- return new JAXWSWebServiceMetaDataBuilder();
-
- return null;
- }
-
- protected void setupEndpoint(UnifiedMetaData umd, UnifiedDeploymentInfo udi,
Class<?> beanClass, String beanName)
- throws SecurityException, ClassNotFoundException, NoSuchMethodException
- {
- JAXWSEndpointMetaDataBuilder builder = getEndpointBuilder(beanClass);
- if (builder != null)
- builder.buildEndpoint(umd, udi, beanClass, beanName);
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java)
Deleted:
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-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,1047 +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.builder.jaxws;
-
-// $Id$
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Writer;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.rmi.RemoteException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-
-import javax.jws.HandlerChain;
-import javax.jws.Oneway;
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebResult;
-import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding;
-import javax.jws.soap.SOAPMessageHandlers;
-import javax.jws.soap.SOAPBinding.ParameterStyle;
-import javax.management.ObjectName;
-import javax.xml.bind.JAXBException;
-import javax.xml.namespace.QName;
-import javax.xml.rpc.ParameterMode;
-import javax.xml.ws.BindingType;
-import javax.xml.ws.RequestWrapper;
-import javax.xml.ws.ResponseWrapper;
-import javax.xml.ws.WebFault;
-import javax.xml.ws.addressing.AddressingProperties;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.jaxrpc.Style;
-import org.jboss.ws.core.jaxrpc.Use;
-import org.jboss.ws.core.jaxws.DynamicWrapperGenerator;
-import org.jboss.ws.core.jaxws.WrapperGenerator;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.core.utils.HolderUtils;
-import org.jboss.ws.core.utils.IOUtils;
-import org.jboss.ws.core.utils.JBossWSEntityResolver;
-import org.jboss.ws.core.utils.JavaUtils;
-import org.jboss.ws.extensions.addressing.AddressingPropertiesImpl;
-import org.jboss.ws.extensions.addressing.metadata.AddressingOpMetaExt;
-import org.jboss.ws.metadata.acessor.JAXBAccessor;
-import org.jboss.ws.metadata.builder.MetaDataBuilder;
-import org.jboss.ws.metadata.config.jaxws.WSEndpointConfigJAXWS;
-import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
-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.xmlschema.JBossXSModel;
-import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
-import org.jboss.ws.tools.jaxws.JAXBWSDLGenerator;
-import org.jboss.ws.tools.jaxws.WSDLGenerator;
-import org.jboss.ws.tools.wsdl.WSDLWriter;
-import org.jboss.ws.tools.wsdl.WSDLWriterResolver;
-import org.jboss.xb.binding.ObjectModelFactory;
-import org.jboss.xb.binding.Unmarshaller;
-import org.jboss.xb.binding.UnmarshallerFactory;
-
-import com.sun.xml.bind.api.JAXBRIContext;
-import com.sun.xml.bind.api.TypeReference;
-
-/** An abstract annotation meta data builder.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @since 15-Oct-2005
- */
-@SuppressWarnings("deprecation")
-public class JAXWSWebServiceMetaDataBuilder extends JAXWSEndpointMetaDataBuilder
-{
- private static class EndpointResult
- {
- private Class<?> klass;
- private ServerEndpointMetaData semd;
- private ServiceMetaData smd;
- private String wsdlLocation;
- }
-
- // provide logging
- private static final Logger log =
Logger.getLogger(JAXWSWebServiceMetaDataBuilder.class);
- private List<Class> javaTypes = new ArrayList<Class>();
- private JAXBRIContext jaxbCtx;
- private List<TypeReference> typeRefs = new ArrayList<TypeReference>();
-
- private WrapperGenerator wrapperGenerator;
-
- public JAXWSWebServiceMetaDataBuilder()
- {
- }
-
- private void addFault(OperationMetaData omd, Class<?> exception)
- {
- if (omd.isOneWay())
- throw new IllegalStateException("JSR-181 4.3.1 - 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.");
-
- WebFault annotation = exception.getAnnotation(WebFault.class);
-
- String name;
- String namespace;
- String faultBeanName = null;
-
- // Only the element name is effected by @WebFault, the type uses the same
convention
- QName xmlType = new QName(omd.getQName().getNamespaceURI(),
exception.getSimpleName());
-
- /*
- * If @WebFault is present, and the exception contains getFaultInfo, the
- * return value should be used. Otherwise we need to generate the bean.
- */
- boolean generate = true;
- if (annotation != null)
- {
- name = annotation.name();
- namespace = annotation.targetNamespace();
- if (namespace.length() == 0)
- namespace = omd.getQName().getNamespaceURI();
-
- Class<?> faultBean = getFaultInfo(exception);
- if (faultBean != null)
- {
- generate = false;
- faultBeanName = faultBean.getName();
- }
- }
- else
- {
- name = xmlType.getLocalPart();
- namespace = xmlType.getNamespaceURI();
- }
-
- if (faultBeanName == null)
- faultBeanName =
JavaUtils.getPackageName(omd.getEndpointMetaData().getServiceEndpointInterface()) +
".jaxws." + exception.getSimpleName() + "Bean";
-
- QName xmlName = new QName(namespace, name);
-
- FaultMetaData fmd = new FaultMetaData(omd, xmlName, xmlType, exception.getName());
- fmd.setFaultBeanName(faultBeanName);
-
- if (generate)
- wrapperGenerator.generate(fmd);
-
- javaTypes.add(fmd.getFaultBean());
- typeRefs.add(new TypeReference(fmd.getXmlName(), fmd.getFaultBean()));
-
- omd.addFault(fmd);
- }
-
- private String convertToVariable(String localName)
- {
- return JAXBRIContext.mangleNameToVariableName(localName);
- }
-
- private String[] convertTypeArguments(Class rawType, Type type)
- {
- if (!Collection.class.isAssignableFrom(rawType) &&
!Map.class.isAssignableFrom(rawType))
- return null;
-
- if (!(type instanceof ParameterizedType))
- return null;
-
- ParameterizedType paramType = (ParameterizedType)type;
- Type[] arguments = paramType.getActualTypeArguments();
- String[] ret = new String[arguments.length];
- for (int i = 0; i < arguments.length; i++)
- ret[i] = JavaUtils.erasure(arguments[i]).getName();
-
- return ret;
- }
-
- private ParameterMetaData createRequestWrapper(OperationMetaData operation, Method
method)
- {
- String requestWrapperType = null;
- QName xmlName = operation.getQName();
- QName xmlType = xmlName;
- if (method.isAnnotationPresent(RequestWrapper.class))
- {
- RequestWrapper anReqWrapper = method.getAnnotation(RequestWrapper.class);
-
- String localName = anReqWrapper.localName().length() > 0 ?
anReqWrapper.localName() : xmlName.getLocalPart();
- String targetNamespace = anReqWrapper.targetNamespace().length() > 0 ?
anReqWrapper.targetNamespace() : xmlName.getNamespaceURI();
- xmlName = new QName(targetNamespace, localName);
-
- if (anReqWrapper.className().length() > 0)
- requestWrapperType = anReqWrapper.className();
- }
-
- // Conformance 3.18, the default value must be the same as the method name
- if (requestWrapperType == null)
- {
- String packageName = JavaUtils.getPackageName(method.getDeclaringClass()) +
".jaxws";
- requestWrapperType = packageName + "." +
JavaUtils.capitalize(method.getName());
- }
-
- // JAX-WS p.37 pg.1, the annotation only affects the element name, not the type
name
- ParameterMetaData wrapperParameter = new ParameterMetaData(operation, xmlName,
xmlType, requestWrapperType);
- wrapperParameter.setAccessorFactoryCreator(JAXBAccessor.FACTORY_CREATOR);
- operation.addParameter(wrapperParameter);
-
- return wrapperParameter;
- }
-
- private ParameterMetaData createResponseWrapper(OperationMetaData operation, Method
method)
- {
- QName operationQName = operation.getQName();
- QName xmlName = new QName(operationQName.getNamespaceURI(),
operationQName.getLocalPart() + "Response");
- QName xmlType = xmlName;
-
- String responseWrapperType = null;
- if (method.isAnnotationPresent(ResponseWrapper.class))
- {
- ResponseWrapper anResWrapper = method.getAnnotation(ResponseWrapper.class);
-
- String localName = anResWrapper.localName().length() > 0 ?
anResWrapper.localName() : xmlName.getLocalPart();
- String targetNamespace = anResWrapper.targetNamespace().length() > 0 ?
anResWrapper.targetNamespace() : xmlName.getNamespaceURI();
- xmlName = new QName(targetNamespace, localName);
-
- if (anResWrapper.className().length() > 0)
- responseWrapperType = anResWrapper.className();
- }
-
- if (responseWrapperType == null)
- {
- String packageName = JavaUtils.getPackageName(method.getDeclaringClass()) +
".jaxws";
- responseWrapperType = packageName + "." +
JavaUtils.capitalize(method.getName()) + "Response";
- }
-
- ParameterMetaData retMetaData = new ParameterMetaData(operation, xmlName, xmlType,
responseWrapperType);
- retMetaData.setAccessorFactoryCreator(JAXBAccessor.FACTORY_CREATOR);
- operation.setReturnParameter(retMetaData);
-
- return retMetaData;
- }
-
- private Class<?> getFaultInfo(Class<?> exception)
- {
- try
- {
- Method method = exception.getMethod("getFaultInfo");
- Class<?> returnType = method.getReturnType();
- if (returnType == void.class)
- return null;
-
- return returnType;
- }
- catch (SecurityException e)
- {
- throw new WSException("Unexpected security exception: " +
e.getMessage(), e);
- }
- catch (NoSuchMethodException e)
- {
- return null;
- }
- }
-
- private ParameterMode getParameterMode(WebParam anWebParam, Class javaType)
- {
- if (anWebParam != null)
- {
- if (anWebParam.mode() == WebParam.Mode.INOUT)
- return ParameterMode.INOUT;
- if (anWebParam.mode() == WebParam.Mode.OUT)
- return ParameterMode.OUT;
- }
-
- return HolderUtils.isHolderType(javaType) ? ParameterMode.INOUT :
ParameterMode.IN;
- }
-
- private WebParam getWebParamAnnotation(Method method, int pos)
- {
- for (Annotation annotation : method.getParameterAnnotations()[pos])
- if (annotation instanceof WebParam)
- return (WebParam)annotation;
-
- return null;
- }
-
- private QName getWebParamName(OperationMetaData opMetaData, int index, Class javaType,
WebParam webParam)
- {
- String namespace = null;
- String name = null;
- boolean header = false;
-
- if (webParam != null)
- {
- if (webParam.targetNamespace().length() > 0)
- namespace = webParam.targetNamespace();
-
- if (webParam.name().length() > 0)
- name = webParam.name();
-
- header = webParam.header();
- }
-
- // Bare and headers must be qualified
- if (namespace == null && (opMetaData.isDocumentBare() || header))
- namespace = opMetaData.getQName().getNamespaceURI();
-
- // RPC body parts must have no namespace
- else if (opMetaData.isRPCLiteral() && !header)
- namespace = null;
-
- // Bare uses the operation name as the default, everything else is generated
- if (name == null)
- name = opMetaData.isDocumentBare() && !header ?
opMetaData.getQName().getLocalPart() : "arg" + index;
-
- return (namespace != null) ? new QName(namespace, name) : new QName(name);
- }
-
- private QName getWebResultName(OperationMetaData opMetaData, Class javaType, WebResult
anWebResult)
- {
- String name = null;
- String namespace = null;
- boolean header = false;
-
- if (anWebResult != null)
- {
- if (anWebResult.targetNamespace().length() > 0)
- namespace = anWebResult.targetNamespace();
-
- if (anWebResult.name().length() > 0)
- name = anWebResult.name();
-
- header = anWebResult.header();
- }
-
- // Bare and headers must be qualified
- if (namespace == null && (opMetaData.isDocumentBare() || header))
- namespace = opMetaData.getQName().getNamespaceURI();
-
- // RPC body parts must have no namespace
- else if (opMetaData.isRPCLiteral() && !header)
- namespace = null;
-
- // Bare uses the operation name as the default, everything else is generated
- if (name == null)
- name = opMetaData.isDocumentBare() && !header ?
opMetaData.getResponseName().getLocalPart() : "return";
-
- return (namespace != null) ? new QName(namespace, name) : new QName(name);
- }
-
- private void populateXmlType(FaultMetaData faultMetaData)
- {
- EndpointMetaData epMetaData =
faultMetaData.getOperationMetaData().getEndpointMetaData();
- TypesMetaData types = epMetaData.getServiceMetaData().getTypesMetaData();
-
- QName xmlType = faultMetaData.getXmlType();
- String faultBeanName = faultMetaData.getFaultBeanName();
-
- types.addTypeMapping(new TypeMappingMetaData(types, xmlType, faultBeanName));
- }
-
- private void populateXmlType(ParameterMetaData paramMetaData)
- {
- EndpointMetaData epMetaData =
paramMetaData.getOperationMetaData().getEndpointMetaData();
- TypesMetaData types = epMetaData.getServiceMetaData().getTypesMetaData();
-
- QName xmlName = paramMetaData.getXmlName();
- QName xmlType = paramMetaData.getXmlType();
- Class javaType = paramMetaData.getJavaType();
- String javaName = paramMetaData.getJavaTypeName();
-
- if (xmlType == null)
- {
- try
- {
- xmlType = jaxbCtx.getTypeName(new TypeReference(xmlName, javaType));
- }
- catch (IllegalArgumentException e)
- {
- throw new IllegalStateException("Cannot obtain xml type for:
[xmlName=" + xmlName + ",javaName=" + javaName + "]");
- }
-
- /* Anonymous type.
- *
- * Currently the design of our stack is based on the
- * notion of their always being a unique type. In order to lookup the
- * appropriate (de)serializer you must have a type. So we use a fake
- * name. This is an illegal NCName, so it shouldn't collide.
- */
- if (xmlType == null)
- xmlType = new QName(xmlName.getNamespaceURI(), ">" +
xmlName.getLocalPart());
-
- paramMetaData.setXmlType(xmlType);
- }
-
- types.addTypeMapping(new TypeMappingMetaData(types, xmlType, javaName));
- }
-
- /**
- * Process operation meta data extensions.
- */
- private void processMetaExtensions(EndpointMetaData epMetaData, OperationMetaData
opMetaData)
- {
- // Until there is a addressing annotion we fallback to implicit action asosciation
- // TODO: figure out a way to assign message name instead of IN and OUT
- String tns = epMetaData.getQName().getNamespaceURI();
- String portTypeName = epMetaData.getQName().getLocalPart();
-
- AddressingProperties ADDR = new AddressingPropertiesImpl();
- AddressingOpMetaExt addrExt = new AddressingOpMetaExt(ADDR.getNamespaceURI());
- addrExt.setInboundAction(tns + "/" + portTypeName + "/IN");
-
- if (!opMetaData.isOneWay())
- addrExt.setOutboundAction(tns + "/" + portTypeName +
"/OUT");
-
- opMetaData.addExtension(addrExt);
- }
-
- private void processWebMethod(EndpointMetaData epMetaData, Method method)
- {
- String javaName = method.getName();
-
- // skip asnyc methods, they dont need meta data representation
- if (method.getName().endsWith(Constants.ASYNC_METHOD_SUFFIX))
- return;
-
- // reflection defaults
- String soapAction = "";
- String operationName = method.getName();
-
- // annotation values that override defaults
- if (method.isAnnotationPresent(WebMethod.class))
- {
- WebMethod anWebMethod = method.getAnnotation(WebMethod.class);
- soapAction = anWebMethod.action();
- if (anWebMethod.operationName().length() > 0)
- {
- operationName = anWebMethod.operationName();
- }
- }
-
- String targetNS = epMetaData.getInterfaceQName().getNamespaceURI();
- OperationMetaData opMetaData = new OperationMetaData(epMetaData, new
QName(targetNS, operationName), javaName);
- opMetaData.setOneWay(method.isAnnotationPresent(Oneway.class));
- opMetaData.setSOAPAction(soapAction);
- epMetaData.addOperation(opMetaData);
-
- // Build parameter meta data
- Class[] parameterTypes = method.getParameterTypes();
- Type[] genericTypes = method.getGenericParameterTypes();
- Annotation[][] parameterAnnotations = method.getParameterAnnotations();
- ParameterMetaData wrapperParameter = null, wrapperOutputParameter = null;
- List<WrappedParameter> wrappedParameters = null, wrappedOutputParameters =
null;
-
- // Force paramter style to wrapped
- if (method.isAnnotationPresent(RequestWrapper.class) ||
method.isAnnotationPresent(ResponseWrapper.class))
- {
- epMetaData.setParameterStyle(ParameterStyle.WRAPPED);
- }
-
- if (opMetaData.isDocumentWrapped())
- {
- wrapperParameter = createRequestWrapper(opMetaData, method);
- wrappedParameters = new
ArrayList<WrappedParameter>(parameterTypes.length);
- wrapperParameter.setWrappedParameters(wrappedParameters);
-
- if (!opMetaData.isOneWay())
- {
- wrapperOutputParameter = createResponseWrapper(opMetaData, method);
- wrappedOutputParameters = new
ArrayList<WrappedParameter>(parameterTypes.length + 1);
- wrapperOutputParameter.setWrappedParameters(wrappedOutputParameters);
- }
- }
-
- for (int i = 0; i < parameterTypes.length; i++)
- {
- Class javaType = parameterTypes[i];
- Type genericType = genericTypes[i];
- String javaTypeName = javaType.getName();
- WebParam anWebParam = getWebParamAnnotation(method, i);
- boolean isHeader = anWebParam != null && anWebParam.header();
- boolean isWrapped = opMetaData.isDocumentWrapped() && !isHeader;
- ParameterMode mode = getParameterMode(anWebParam, javaType);
-
- // Assert one-way
- if (opMetaData.isOneWay() && mode != ParameterMode.IN)
- throw new IllegalArgumentException("A one-way operation can not have
output parameters [" + "method = " + method.getName() + ", parameter =
" + i + "]");
-
- if (HolderUtils.isHolderType(javaType))
- {
- genericType = HolderUtils.getGenericValueType(genericType);
- javaType = JavaUtils.erasure(genericType);
- javaTypeName = javaType.getName();
- }
-
- if (isWrapped)
- {
- QName wrappedElementName = getWebParamName(opMetaData, i, javaType,
anWebParam);
- String variable = convertToVariable(wrappedElementName.getLocalPart());
-
- WrappedParameter wrappedParameter = new WrappedParameter(wrappedElementName,
javaTypeName, variable, i);
- wrappedParameter.setTypeArguments(convertTypeArguments(javaType,
genericType));
-
- if (mode != ParameterMode.OUT)
- wrappedParameters.add(wrappedParameter);
- if (mode != ParameterMode.IN)
- {
- wrappedOutputParameters.add(wrappedParameter);
- wrappedParameter.setHolder(true);
- }
- }
- else
- {
- QName xmlName = getWebParamName(opMetaData, i, javaType, anWebParam);
-
- ParameterMetaData paramMetaData = new ParameterMetaData(opMetaData, xmlName,
javaTypeName);
- paramMetaData.setInHeader(isHeader);
- paramMetaData.setIndex(i);
- paramMetaData.setMode(mode);
-
- opMetaData.addParameter(paramMetaData);
- javaTypes.add(javaType);
- typeRefs.add(new TypeReference(xmlName, genericType,
parameterAnnotations[i]));
- }
- }
-
- // Build result meta data
- Class returnType = method.getReturnType();
- Type genericReturnType = method.getGenericReturnType();
- String returnTypeName = returnType.getName();
- if ((returnType == void.class) == false)
- {
- if (opMetaData.isOneWay())
- throw new IllegalArgumentException("[JSR-181 2.5.1] The method
'" + method.getName() + "' can not have a return value if it is marked
OneWay");
-
- WebResult anWebResult = method.getAnnotation(WebResult.class);
- boolean isHeader = anWebResult != null && anWebResult.header();
- boolean isWrapped = opMetaData.isDocumentWrapped() && !isHeader;
- QName xmlName = getWebResultName(opMetaData, returnType, anWebResult);
-
- if (isWrapped)
- {
- WrappedParameter wrapped = new WrappedParameter(xmlName, returnTypeName,
convertToVariable(xmlName.getLocalPart()), -1);
- wrapped.setTypeArguments(convertTypeArguments(returnType,
genericReturnType));
-
- // insert at the beginning just for prettiness
- wrappedOutputParameters.add(0, wrapped);
- }
- else
- {
- ParameterMetaData retMetaData = new ParameterMetaData(opMetaData, xmlName,
returnTypeName);
- retMetaData.setInHeader(isHeader);
- opMetaData.setReturnParameter(retMetaData);
-
- javaTypes.add(returnType);
- typeRefs.add(new TypeReference(xmlName, genericReturnType,
method.getAnnotations()));
- }
- }
-
- // Generate wrapper beans
- if (opMetaData.isDocumentWrapped())
- {
- wrapperGenerator.generate(wrapperParameter);
- Class wrapperClass = wrapperParameter.getJavaType();
- javaTypes.add(wrapperClass);
- // In case there is no @XmlRootElement
- typeRefs.add(new TypeReference(wrapperParameter.getXmlName(), wrapperClass));
- if (!opMetaData.isOneWay())
- {
- wrapperGenerator.generate(wrapperOutputParameter);
- wrapperClass = wrapperOutputParameter.getJavaType();
- javaTypes.add(wrapperClass);
- // In case there is no @XmlRootElement
- typeRefs.add(new TypeReference(wrapperOutputParameter.getXmlName(),
wrapperClass));
- }
- }
-
- // Add faults
- for (Class exClass : method.getExceptionTypes())
- if (!RemoteException.class.isAssignableFrom(exClass))
- addFault(opMetaData, exClass);
-
- // process op meta data extension
- processMetaExtensions(epMetaData, opMetaData);
- }
-
- private EndpointResult processWebService(UnifiedMetaData wsMetaData, Class<?>
sepClass, ClassLoader loader) throws ClassNotFoundException
- {
- WebService anWebService = sepClass.getAnnotation(WebService.class);
- if (anWebService == null)
- throw new WSException("Cannot obtain @WebService annotation from: " +
sepClass.getName());
-
- Class<?> seiClass = null;
- String seiName = null;
- WSDLUtils wsdlUtils = WSDLUtils.getInstance();
-
- String name = anWebService.name();
- if (name.length() == 0)
- name = WSDLUtils.getJustClassName(sepClass);
-
- String serviceName = anWebService.serviceName();
- if (serviceName.length() == 0)
- serviceName = name + "Service";
-
- String serviceNS = anWebService.targetNamespace();
- if (serviceNS.length() == 0)
- serviceNS = wsdlUtils.getTypeNamespace(sepClass);
-
- String portName = anWebService.portName();
- if (portName.length() == 0)
- portName = name + "Port";
-
- String wsdlLocation = anWebService.wsdlLocation();
- String interfaceNS = serviceNS;
-
- if (anWebService.endpointInterface().length() > 0)
- {
- seiName = anWebService.endpointInterface();
- seiClass = loader.loadClass(seiName);
- anWebService = seiClass.getAnnotation(WebService.class);
-
- if (anWebService == null)
- throw new WSException("Interface does not have a @WebService annotation:
" + seiName);
- else
- {
- if(anWebService.portName().length()>0
- || anWebService.serviceName().length()>0
- || anWebService.endpointInterface().length()>0
- )
- {
- throw new WSException("The service endpoint interface MUST NOT
include the JSR-181 annotation" +
- "elements portName, serviceName and endpointInterface of the
annotation @WebService.");
- }
- }
-
- name = anWebService.name();
- if (name.length() == 0)
- name = WSDLUtils.getJustClassName(seiClass);
-
- interfaceNS = anWebService.targetNamespace();
- if (interfaceNS.length() == 0)
- interfaceNS = wsdlUtils.getTypeNamespace(seiClass);
-
- // The spec states that WSDL location should be allowed on an SEI, although it
- // makes far more sense on the implementation bean, so we ALWAYS override the
SEI
- // when wsdlLocation is defined on the bean
-
- if (wsdlLocation.length() == 0)
- wsdlLocation = anWebService.wsdlLocation();
- }
-
- // Setup the ServerEndpointMetaData
- QName portQName = new QName(serviceNS, portName);
- QName portTypeQName = new QName(interfaceNS, name);
-
- EndpointResult result = new EndpointResult();
- result.smd = new ServiceMetaData(wsMetaData, new QName(serviceNS, serviceName));
- result.semd = new ServerEndpointMetaData(result.smd, portQName, portTypeQName,
EndpointMetaData.Type.JAXWS);
- result.klass = (seiClass != null ? seiClass : sepClass);
- result.wsdlLocation = wsdlLocation;
-
- result.smd.addEndpoint(result.semd);
- wsMetaData.addService(result.smd);
-
- return result;
- }
-
- protected void createJAXBContext(EndpointMetaData epMetaData)
- {
- try
- {
- String targetNS = epMetaData.getInterfaceQName().getNamespaceURI();
- log.debug("JAXBContext [types=" + javaTypes + ",tns=" +
targetNS + "]");
- jaxbCtx = JAXBRIContext.newInstance(javaTypes.toArray(new Class[0]), typeRefs,
targetNS, false);
- }
- catch (JAXBException ex)
- {
- throw new IllegalStateException("Cannot build JAXB context", ex);
- }
- }
-
- protected void populateXmlTypes(EndpointMetaData epMetaData)
- {
- for (OperationMetaData operation : epMetaData.getOperations())
- {
- // parameters
- for (ParameterMetaData paramMetaData : operation.getParameters())
- {
- populateXmlType(paramMetaData);
- }
-
- // return value
- ParameterMetaData returnParameter = operation.getReturnParameter();
- if (returnParameter != null)
- populateXmlType(returnParameter);
-
- // faults
- for (FaultMetaData faultMetaData : operation.getFaults())
- {
- populateXmlType(faultMetaData);
- }
- }
- }
-
- /**
- * Process an optional @HandlerChain annotation
- *
- * Location of the handler chain file. The location supports 2 formats.
- *
- * 1. An absolute java.net.URL in externalForm.
- * (ex:
http://myhandlers.foo.com/handlerfile1.xml)
- *
- * 2. A relative path from the source file or class file.
- * (ex: bar/handlerfile1.xml)
- */
- protected void processHandlerChain(EndpointMetaData epMetaData, Class<?>
wsClass)
- {
- if (wsClass.isAnnotationPresent(SOAPMessageHandlers.class))
- throw new WSException("Cannot combine @HandlerChain with
@SOAPMessageHandlers");
-
- HandlerChain anHandlerChain =
(HandlerChain)wsClass.getAnnotation(HandlerChain.class);
-
- URL fileURL = null;
- String filename = anHandlerChain.file();
-
- // Try the filename as URL
- try
- {
- fileURL = new URL(filename);
- }
- catch (MalformedURLException ex)
- {
- // ignore
- }
-
- // Try the filename as File
- if (fileURL == null)
- {
- try
- {
- File file = new File(filename);
- if (file.exists())
- fileURL = file.toURL();
- }
- catch (MalformedURLException e)
- {
- // ignore
- }
- }
-
- // Try the filename as Resource
- if (fileURL == null)
- {
- fileURL = epMetaData.getClassLoader().getResource(filename);
- }
-
- // Try the filename relative to class
- if (fileURL == null)
- {
- String packagePath = wsClass.getPackage().getName().replace('.',
'/');
- fileURL = epMetaData.getClassLoader().getResource(packagePath + "/" +
filename);
- }
-
- if (fileURL == null)
- throw new WSException("Cannot resolve handler file '" + filename +
"' on " + wsClass.getName());
-
- try
- {
- HandlerChainsMetaData handlerChainsMetaData = null;
- InputStream is = fileURL.openStream();
- try
- {
- Unmarshaller unmarshaller =
UnmarshallerFactory.newInstance().newUnmarshaller();
- unmarshaller.setValidation(true);
- unmarshaller.setSchemaValidation(true);
- unmarshaller.setEntityResolver(new JBossWSEntityResolver());
- ObjectModelFactory factory = new HandlerChainFactory();
- handlerChainsMetaData = (HandlerChainsMetaData)unmarshaller.unmarshal(is,
factory, null);
- }
- finally
- {
- is.close();
- }
-
- // Setup the endpoint handlers
- for (HandlerChainMetaData handlerChainMetaData :
handlerChainsMetaData.getHandlerChains())
- {
- for (UnifiedHandlerMetaData uhmd : handlerChainMetaData.getHandlers())
- {
- epMetaData.addHandler(uhmd.getHandlerMetaDataJAXWS(epMetaData,
HandlerType.ENDPOINT));
- }
- }
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WSException("Cannot process handler chain: " + filename,
ex);
- }
- }
-
- protected void processOrGenerateWSDL(Class wsClass, ServiceMetaData serviceMetaData,
String wsdlLocation, EndpointMetaData epMetaData)
- {
- if (wsdlLocation.length() > 0)
- {
- serviceMetaData.setWsdlFile(wsdlLocation);
- }
- else
- {
- try
- {
- String serviceName = serviceMetaData.getServiceName().getLocalPart();
-
- WSDLGenerator generator = new JAXBWSDLGenerator(jaxbCtx);
- WSDLDefinitions wsdlDefinitions = generator.generate(serviceMetaData);
-
- // Ensure that types are only in the interface qname
-
wsdlDefinitions.getWsdlTypes().setNamespace(epMetaData.getInterfaceQName().getNamespaceURI());
-
- final File tmpdir = IOUtils.createTempDirectory();
- File wsdlTmpFile = File.createTempFile(serviceName, ".wsdl",
tmpdir);
- wsdlTmpFile.deleteOnExit();
-
- Writer writer = IOUtils.getCharsetFileWriter(wsdlTmpFile,
Constants.DEFAULT_XML_CHARSET);
- new WSDLWriter(wsdlDefinitions).write(writer, Constants.DEFAULT_XML_CHARSET,
new WSDLWriterResolver()
- {
- public WSDLWriterResolver resolve(String suggestedFile) throws
IOException
- {
- File newTmpFile = File.createTempFile(suggestedFile, ".wsdl",
tmpdir);
- newTmpFile.deleteOnExit();
- actualFile = newTmpFile.getName();
- charset = Constants.DEFAULT_XML_CHARSET;
- writer = IOUtils.getCharsetFileWriter(newTmpFile,
Constants.DEFAULT_XML_CHARSET);
- return this;
- }
- });
- writer.close();
-
- serviceMetaData.setWsdlFile(wsdlTmpFile.toURL().toExternalForm());
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (IOException e)
- {
- throw new WSException("Cannot write generated wsdl", e);
- }
- }
- }
-
- protected void processSOAPBinding(EndpointMetaData epMetaData, Class<?>
wsClass)
- {
- SOAPBinding anSoapBinding = (SOAPBinding)wsClass.getAnnotation(SOAPBinding.class);
-
- SOAPBinding.Style attrStyle = anSoapBinding.style();
- Style style = (attrStyle == SOAPBinding.Style.RPC ? Style.RPC : Style.DOCUMENT);
- epMetaData.setStyle(style);
-
- SOAPBinding.Use attrUse = anSoapBinding.use();
- if (attrUse == SOAPBinding.Use.ENCODED)
- throw new WSException("SOAP encoding is not supported for JSR-181
deployments");
-
- epMetaData.setEncodingStyle(Use.LITERAL);
-
- ParameterStyle paramStyle = anSoapBinding.parameterStyle();
- epMetaData.setParameterStyle(paramStyle);
- }
-
- // If the implementation bean does not implement a service endpoint interface and
- // there are no @WebMethod annotations in the implementation bean (excluding
- // @WebMethod annotations used to exclude inherited @WebMethods), all public
- // methods other than those inherited from java.lang.Object will be exposed as Web
- // Service operations, subject to the inheritance rules specified in Common
- // Annotations for the Java Platform [12], section 2.1.
- protected void processWebMethods(EndpointMetaData epMetaData, Class wsClass)
- {
- epMetaData.clearOperations();
-
- // Process @WebMethod annotations
- int webMethodCount = 0;
- for (Method method : wsClass.getMethods())
- {
- WebMethod annotation = method.getAnnotation(WebMethod.class);
- boolean exclude = annotation != null && annotation.exclude();
- if (!exclude && (annotation != null || wsClass.isInterface()))
- {
- processWebMethod(epMetaData, method);
- webMethodCount++;
- }
- }
-
- // @WebService should expose all inherited methods if @WebMethod is never
specified
- if (webMethodCount == 0 && !wsClass.isInterface())
- {
- for (Method method : wsClass.getMethods())
- {
- WebMethod annotation = method.getAnnotation(WebMethod.class);
- boolean exclude = annotation != null && annotation.exclude();
- if (!exclude && method.getDeclaringClass() != Object.class)
- {
- processWebMethod(epMetaData, method);
- webMethodCount++;
- }
- }
- }
-
- if (webMethodCount == 0)
- throw new WSException("No exposable methods found");
- }
-
- protected void resetMetaDataBuilder(ClassLoader loader)
- {
- wrapperGenerator = new DynamicWrapperGenerator(loader);
- javaTypes.clear();
- typeRefs.clear();
- jaxbCtx = null;
- }
-
- public ServerEndpointMetaData buildEndpoint(UnifiedMetaData wsMetaData,
UnifiedDeploymentInfo udi, Class<?> sepClass, String linkName)
- {
- try
- {
- EndpointResult result = processWebService(wsMetaData, sepClass,
udi.classLoader);
-
- // Clear the java types, etc.
- resetMetaDataBuilder(udi.classLoader);
-
- ServerEndpointMetaData sepMetaData = result.semd;
- ServiceMetaData serviceMetaData = result.smd;
- Class<?> wsClass = result.klass;
- sepMetaData.setLinkName(linkName);
-
- // Assign the WS-Security configuration,
- WSSecurityConfiguration securityConfiguration =
MetaDataBuilder.getWsSecurityConfiguration(udi);
- serviceMetaData.setSecurityConfiguration(securityConfiguration);
-
- sepMetaData.setServiceEndpointImplName(sepClass.getName());
- sepMetaData.setServiceEndpointInterfaceName(wsClass.getName());
-
- // Process an optional @SOAPBinding annotation
- if (wsClass.isAnnotationPresent(SOAPBinding.class))
- processSOAPBinding(sepMetaData, wsClass);
-
- // Process an optional @BindingType annotation
- if (wsClass.isAnnotationPresent(BindingType.class))
- processBindingType(sepMetaData, wsClass);
-
- // Init the transport guarantee
- initTransportGuaranteeJSE(udi, sepMetaData, linkName);
-
- // Process web methods
- processWebMethods(sepMetaData, wsClass);
-
- // Initialize types
- createJAXBContext(sepMetaData);
- populateXmlTypes(sepMetaData);
-
- // Process or generate WSDL
- processOrGenerateWSDL(wsClass, serviceMetaData, result.wsdlLocation,
sepMetaData);
-
- // Read the generated WSDL and initialize the schema model
- // FIXME - This should be removed
- WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
- JBossXSModel schemaModel =
WSDLUtils.getSchemaModel(wsdlDefinitions.getWsdlTypes());
- serviceMetaData.getTypesMetaData().setSchemaModel(schemaModel);
-
- // Set the endpoint address
- processPortComponent(udi, wsClass, linkName, sepMetaData);
-
- // Init the endpoint address
- MetaDataBuilder.initEndpointAddress(udi, sepMetaData, linkName);
-
- // replace the SOAP address
- MetaDataBuilder.replaceAddressLocation(sepMetaData);
-
- // Process an optional @SOAPMessageHandlers annotation
- if (sepClass.isAnnotationPresent(SOAPMessageHandlers.class) ||
wsClass.isAnnotationPresent(SOAPMessageHandlers.class))
- log.warn("@SOAPMessageHandlers is deprecated as of JAX-WS 2.0 with no
replacement.");
-
- // Add pre handlers
- WSEndpointConfigJAXWS jaxrpcConfig =
(WSEndpointConfigJAXWS)sepMetaData.getEndpointConfig();
- sepMetaData.addHandlers(jaxrpcConfig.getHandlers(sepMetaData,
HandlerType.PRE));
-
- // Process an optional @HandlerChain annotation
- if (sepClass.isAnnotationPresent(HandlerChain.class))
- processHandlerChain(sepMetaData, sepClass);
- else if (wsClass.isAnnotationPresent(HandlerChain.class))
- processHandlerChain(sepMetaData, wsClass);
-
- // Add post handlers
- sepMetaData.addHandlers(jaxrpcConfig.getHandlers(sepMetaData,
HandlerType.POST));
-
- // init service endpoint id
- ObjectName sepID = MetaDataBuilder.getServiceEndpointID(udi, sepMetaData);
- sepMetaData.setServiceEndpointID(sepID);
-
- return sepMetaData;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WSException("Cannot build meta data: " + ex.getMessage(),
ex);
- }
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
(from rev 1598,
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-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -0,0 +1,1036 @@
+/*
+ * 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.builder.jaxws;
+
+// $Id$
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Writer;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.rmi.RemoteException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+import javax.jws.HandlerChain;
+import javax.jws.Oneway;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPMessageHandlers;
+import javax.jws.soap.SOAPBinding.ParameterStyle;
+import javax.management.ObjectName;
+import javax.xml.bind.JAXBException;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.ParameterMode;
+import javax.xml.ws.BindingType;
+import javax.xml.ws.RequestWrapper;
+import javax.xml.ws.ResponseWrapper;
+import javax.xml.ws.WebFault;
+import javax.xml.ws.addressing.AddressingProperties;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.Constants;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.jaxrpc.Use;
+import org.jboss.ws.core.jaxws.DynamicWrapperGenerator;
+import org.jboss.ws.core.jaxws.WrapperGenerator;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.core.utils.HolderUtils;
+import org.jboss.ws.core.utils.IOUtils;
+import org.jboss.ws.core.utils.JBossWSEntityResolver;
+import org.jboss.ws.core.utils.JavaUtils;
+import org.jboss.ws.extensions.addressing.AddressingPropertiesImpl;
+import org.jboss.ws.extensions.addressing.metadata.AddressingOpMetaExt;
+import org.jboss.ws.metadata.acessor.JAXBAccessor;
+import org.jboss.ws.metadata.builder.MetaDataBuilder;
+import org.jboss.ws.metadata.config.jaxws.WSEndpointConfigJAXWS;
+import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
+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.xmlschema.JBossXSModel;
+import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
+import org.jboss.ws.tools.jaxws.JAXBWSDLGenerator;
+import org.jboss.ws.tools.jaxws.WSDLGenerator;
+import org.jboss.ws.tools.wsdl.WSDLWriter;
+import org.jboss.ws.tools.wsdl.WSDLWriterResolver;
+import org.jboss.xb.binding.ObjectModelFactory;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+
+import com.sun.xml.bind.api.JAXBRIContext;
+import com.sun.xml.bind.api.TypeReference;
+
+/** An abstract annotation meta data builder.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @since 15-Oct-2005
+ */
+@SuppressWarnings("deprecation")
+public class JAXWSWebServiceMetaDataBuilder extends JAXWSEndpointMetaDataBuilder
+{
+ private static class EndpointResult
+ {
+ private Class<?> klass;
+ private ServerEndpointMetaData semd;
+ private ServiceMetaData smd;
+ private String wsdlLocation;
+ }
+
+ // provide logging
+ private static final Logger log =
Logger.getLogger(JAXWSWebServiceMetaDataBuilder.class);
+ private List<Class> javaTypes = new ArrayList<Class>();
+ private JAXBRIContext jaxbCtx;
+ private List<TypeReference> typeRefs = new ArrayList<TypeReference>();
+
+ private WrapperGenerator wrapperGenerator;
+
+ public JAXWSWebServiceMetaDataBuilder()
+ {
+ }
+
+ private void addFault(OperationMetaData omd, Class<?> exception)
+ {
+ if (omd.isOneWay())
+ throw new IllegalStateException("JSR-181 4.3.1 - 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.");
+
+ WebFault annotation = exception.getAnnotation(WebFault.class);
+
+ String name;
+ String namespace;
+ String faultBeanName = null;
+
+ // Only the element name is effected by @WebFault, the type uses the same
convention
+ QName xmlType = new QName(omd.getQName().getNamespaceURI(),
exception.getSimpleName());
+
+ /*
+ * If @WebFault is present, and the exception contains getFaultInfo, the
+ * return value should be used. Otherwise we need to generate the bean.
+ */
+ boolean generate = true;
+ if (annotation != null)
+ {
+ name = annotation.name();
+ namespace = annotation.targetNamespace();
+ if (namespace.length() == 0)
+ namespace = omd.getQName().getNamespaceURI();
+
+ Class<?> faultBean = getFaultInfo(exception);
+ if (faultBean != null)
+ {
+ generate = false;
+ faultBeanName = faultBean.getName();
+ }
+ }
+ else
+ {
+ name = xmlType.getLocalPart();
+ namespace = xmlType.getNamespaceURI();
+ }
+
+ if (faultBeanName == null)
+ faultBeanName =
JavaUtils.getPackageName(omd.getEndpointMetaData().getServiceEndpointInterface()) +
".jaxws." + exception.getSimpleName() + "Bean";
+
+ QName xmlName = new QName(namespace, name);
+
+ FaultMetaData fmd = new FaultMetaData(omd, xmlName, xmlType, exception.getName());
+ fmd.setFaultBeanName(faultBeanName);
+
+ if (generate)
+ wrapperGenerator.generate(fmd);
+
+ javaTypes.add(fmd.getFaultBean());
+ typeRefs.add(new TypeReference(fmd.getXmlName(), fmd.getFaultBean()));
+
+ omd.addFault(fmd);
+ }
+
+ private String convertToVariable(String localName)
+ {
+ return JAXBRIContext.mangleNameToVariableName(localName);
+ }
+
+ private String[] convertTypeArguments(Class rawType, Type type)
+ {
+ if (!Collection.class.isAssignableFrom(rawType) &&
!Map.class.isAssignableFrom(rawType))
+ return null;
+
+ if (!(type instanceof ParameterizedType))
+ return null;
+
+ ParameterizedType paramType = (ParameterizedType)type;
+ Type[] arguments = paramType.getActualTypeArguments();
+ String[] ret = new String[arguments.length];
+ for (int i = 0; i < arguments.length; i++)
+ ret[i] = JavaUtils.erasure(arguments[i]).getName();
+
+ return ret;
+ }
+
+ private ParameterMetaData createRequestWrapper(OperationMetaData operation, Method
method)
+ {
+ String requestWrapperType = null;
+ QName xmlName = operation.getQName();
+ QName xmlType = xmlName;
+ if (method.isAnnotationPresent(RequestWrapper.class))
+ {
+ RequestWrapper anReqWrapper = method.getAnnotation(RequestWrapper.class);
+
+ String localName = anReqWrapper.localName().length() > 0 ?
anReqWrapper.localName() : xmlName.getLocalPart();
+ String targetNamespace = anReqWrapper.targetNamespace().length() > 0 ?
anReqWrapper.targetNamespace() : xmlName.getNamespaceURI();
+ xmlName = new QName(targetNamespace, localName);
+
+ if (anReqWrapper.className().length() > 0)
+ requestWrapperType = anReqWrapper.className();
+ }
+
+ // Conformance 3.18, the default value must be the same as the method name
+ if (requestWrapperType == null)
+ {
+ String packageName = JavaUtils.getPackageName(method.getDeclaringClass()) +
".jaxws";
+ requestWrapperType = packageName + "." +
JavaUtils.capitalize(method.getName());
+ }
+
+ // JAX-WS p.37 pg.1, the annotation only affects the element name, not the type
name
+ ParameterMetaData wrapperParameter = new ParameterMetaData(operation, xmlName,
xmlType, requestWrapperType);
+ wrapperParameter.setAccessorFactoryCreator(JAXBAccessor.FACTORY_CREATOR);
+ operation.addParameter(wrapperParameter);
+
+ return wrapperParameter;
+ }
+
+ private ParameterMetaData createResponseWrapper(OperationMetaData operation, Method
method)
+ {
+ QName operationQName = operation.getQName();
+ QName xmlName = new QName(operationQName.getNamespaceURI(),
operationQName.getLocalPart() + "Response");
+ QName xmlType = xmlName;
+
+ String responseWrapperType = null;
+ if (method.isAnnotationPresent(ResponseWrapper.class))
+ {
+ ResponseWrapper anResWrapper = method.getAnnotation(ResponseWrapper.class);
+
+ String localName = anResWrapper.localName().length() > 0 ?
anResWrapper.localName() : xmlName.getLocalPart();
+ String targetNamespace = anResWrapper.targetNamespace().length() > 0 ?
anResWrapper.targetNamespace() : xmlName.getNamespaceURI();
+ xmlName = new QName(targetNamespace, localName);
+
+ if (anResWrapper.className().length() > 0)
+ responseWrapperType = anResWrapper.className();
+ }
+
+ if (responseWrapperType == null)
+ {
+ String packageName = JavaUtils.getPackageName(method.getDeclaringClass()) +
".jaxws";
+ responseWrapperType = packageName + "." +
JavaUtils.capitalize(method.getName()) + "Response";
+ }
+
+ ParameterMetaData retMetaData = new ParameterMetaData(operation, xmlName, xmlType,
responseWrapperType);
+ retMetaData.setAccessorFactoryCreator(JAXBAccessor.FACTORY_CREATOR);
+ operation.setReturnParameter(retMetaData);
+
+ return retMetaData;
+ }
+
+ private Class<?> getFaultInfo(Class<?> exception)
+ {
+ try
+ {
+ Method method = exception.getMethod("getFaultInfo");
+ Class<?> returnType = method.getReturnType();
+ if (returnType == void.class)
+ return null;
+
+ return returnType;
+ }
+ catch (SecurityException e)
+ {
+ throw new WSException("Unexpected security exception: " +
e.getMessage(), e);
+ }
+ catch (NoSuchMethodException e)
+ {
+ return null;
+ }
+ }
+
+ private ParameterMode getParameterMode(WebParam anWebParam, Class javaType)
+ {
+ if (anWebParam != null)
+ {
+ if (anWebParam.mode() == WebParam.Mode.INOUT)
+ return ParameterMode.INOUT;
+ if (anWebParam.mode() == WebParam.Mode.OUT)
+ return ParameterMode.OUT;
+ }
+
+ return HolderUtils.isHolderType(javaType) ? ParameterMode.INOUT :
ParameterMode.IN;
+ }
+
+ private WebParam getWebParamAnnotation(Method method, int pos)
+ {
+ for (Annotation annotation : method.getParameterAnnotations()[pos])
+ if (annotation instanceof WebParam)
+ return (WebParam)annotation;
+
+ return null;
+ }
+
+ private QName getWebParamName(OperationMetaData opMetaData, int index, Class javaType,
WebParam webParam)
+ {
+ String namespace = null;
+ String name = null;
+ boolean header = false;
+
+ if (webParam != null)
+ {
+ if (webParam.targetNamespace().length() > 0)
+ namespace = webParam.targetNamespace();
+
+ if (webParam.name().length() > 0)
+ name = webParam.name();
+
+ header = webParam.header();
+ }
+
+ // Bare and headers must be qualified
+ if (namespace == null && (opMetaData.isDocumentBare() || header))
+ namespace = opMetaData.getQName().getNamespaceURI();
+
+ // RPC body parts must have no namespace
+ else if (opMetaData.isRPCLiteral() && !header)
+ namespace = null;
+
+ // Bare uses the operation name as the default, everything else is generated
+ if (name == null)
+ name = opMetaData.isDocumentBare() && !header ?
opMetaData.getQName().getLocalPart() : "arg" + index;
+
+ return (namespace != null) ? new QName(namespace, name) : new QName(name);
+ }
+
+ private QName getWebResultName(OperationMetaData opMetaData, Class javaType, WebResult
anWebResult)
+ {
+ String name = null;
+ String namespace = null;
+ boolean header = false;
+
+ if (anWebResult != null)
+ {
+ if (anWebResult.targetNamespace().length() > 0)
+ namespace = anWebResult.targetNamespace();
+
+ if (anWebResult.name().length() > 0)
+ name = anWebResult.name();
+
+ header = anWebResult.header();
+ }
+
+ // Bare and headers must be qualified
+ if (namespace == null && (opMetaData.isDocumentBare() || header))
+ namespace = opMetaData.getQName().getNamespaceURI();
+
+ // RPC body parts must have no namespace
+ else if (opMetaData.isRPCLiteral() && !header)
+ namespace = null;
+
+ // Bare uses the operation name as the default, everything else is generated
+ if (name == null)
+ name = opMetaData.isDocumentBare() && !header ?
opMetaData.getResponseName().getLocalPart() : "return";
+
+ return (namespace != null) ? new QName(namespace, name) : new QName(name);
+ }
+
+ private void populateXmlType(FaultMetaData faultMetaData)
+ {
+ EndpointMetaData epMetaData =
faultMetaData.getOperationMetaData().getEndpointMetaData();
+ TypesMetaData types = epMetaData.getServiceMetaData().getTypesMetaData();
+
+ QName xmlType = faultMetaData.getXmlType();
+ String faultBeanName = faultMetaData.getFaultBeanName();
+
+ types.addTypeMapping(new TypeMappingMetaData(types, xmlType, faultBeanName));
+ }
+
+ private void populateXmlType(ParameterMetaData paramMetaData)
+ {
+ EndpointMetaData epMetaData =
paramMetaData.getOperationMetaData().getEndpointMetaData();
+ TypesMetaData types = epMetaData.getServiceMetaData().getTypesMetaData();
+
+ QName xmlName = paramMetaData.getXmlName();
+ QName xmlType = paramMetaData.getXmlType();
+ Class javaType = paramMetaData.getJavaType();
+ String javaName = paramMetaData.getJavaTypeName();
+
+ if (xmlType == null)
+ {
+ try
+ {
+ xmlType = jaxbCtx.getTypeName(new TypeReference(xmlName, javaType));
+ }
+ catch (IllegalArgumentException e)
+ {
+ throw new IllegalStateException("Cannot obtain xml type for:
[xmlName=" + xmlName + ",javaName=" + javaName + "]");
+ }
+
+ /* Anonymous type.
+ *
+ * Currently the design of our stack is based on the
+ * notion of their always being a unique type. In order to lookup the
+ * appropriate (de)serializer you must have a type. So we use a fake
+ * name. This is an illegal NCName, so it shouldn't collide.
+ */
+ if (xmlType == null)
+ xmlType = new QName(xmlName.getNamespaceURI(), ">" +
xmlName.getLocalPart());
+
+ paramMetaData.setXmlType(xmlType);
+ }
+
+ types.addTypeMapping(new TypeMappingMetaData(types, xmlType, javaName));
+ }
+
+ /**
+ * Process operation meta data extensions.
+ */
+ private void processMetaExtensions(EndpointMetaData epMetaData, OperationMetaData
opMetaData)
+ {
+ // Until there is a addressing annotion we fallback to implicit action asosciation
+ // TODO: figure out a way to assign message name instead of IN and OUT
+ String tns = epMetaData.getQName().getNamespaceURI();
+ String portTypeName = epMetaData.getQName().getLocalPart();
+
+ AddressingProperties ADDR = new AddressingPropertiesImpl();
+ AddressingOpMetaExt addrExt = new AddressingOpMetaExt(ADDR.getNamespaceURI());
+ addrExt.setInboundAction(tns + "/" + portTypeName + "/IN");
+
+ if (!opMetaData.isOneWay())
+ addrExt.setOutboundAction(tns + "/" + portTypeName +
"/OUT");
+
+ opMetaData.addExtension(addrExt);
+ }
+
+ private void processWebMethod(EndpointMetaData epMetaData, Method method)
+ {
+ String javaName = method.getName();
+
+ // skip asnyc methods, they dont need meta data representation
+ if (method.getName().endsWith(Constants.ASYNC_METHOD_SUFFIX))
+ return;
+
+ // reflection defaults
+ String soapAction = "";
+ String operationName = method.getName();
+
+ // annotation values that override defaults
+ if (method.isAnnotationPresent(WebMethod.class))
+ {
+ WebMethod anWebMethod = method.getAnnotation(WebMethod.class);
+ soapAction = anWebMethod.action();
+ if (anWebMethod.operationName().length() > 0)
+ {
+ operationName = anWebMethod.operationName();
+ }
+ }
+
+ String targetNS = epMetaData.getInterfaceQName().getNamespaceURI();
+ OperationMetaData opMetaData = new OperationMetaData(epMetaData, new
QName(targetNS, operationName), javaName);
+ opMetaData.setOneWay(method.isAnnotationPresent(Oneway.class));
+ opMetaData.setSOAPAction(soapAction);
+ epMetaData.addOperation(opMetaData);
+
+ // Build parameter meta data
+ Class[] parameterTypes = method.getParameterTypes();
+ Type[] genericTypes = method.getGenericParameterTypes();
+ Annotation[][] parameterAnnotations = method.getParameterAnnotations();
+ ParameterMetaData wrapperParameter = null, wrapperOutputParameter = null;
+ List<WrappedParameter> wrappedParameters = null, wrappedOutputParameters =
null;
+
+ // Force paramter style to wrapped
+ if (method.isAnnotationPresent(RequestWrapper.class) ||
method.isAnnotationPresent(ResponseWrapper.class))
+ {
+ epMetaData.setParameterStyle(ParameterStyle.WRAPPED);
+ }
+
+ if (opMetaData.isDocumentWrapped())
+ {
+ wrapperParameter = createRequestWrapper(opMetaData, method);
+ wrappedParameters = new
ArrayList<WrappedParameter>(parameterTypes.length);
+ wrapperParameter.setWrappedParameters(wrappedParameters);
+
+ if (!opMetaData.isOneWay())
+ {
+ wrapperOutputParameter = createResponseWrapper(opMetaData, method);
+ wrappedOutputParameters = new
ArrayList<WrappedParameter>(parameterTypes.length + 1);
+ wrapperOutputParameter.setWrappedParameters(wrappedOutputParameters);
+ }
+ }
+
+ for (int i = 0; i < parameterTypes.length; i++)
+ {
+ Class javaType = parameterTypes[i];
+ Type genericType = genericTypes[i];
+ String javaTypeName = javaType.getName();
+ WebParam anWebParam = getWebParamAnnotation(method, i);
+ boolean isHeader = anWebParam != null && anWebParam.header();
+ boolean isWrapped = opMetaData.isDocumentWrapped() && !isHeader;
+ ParameterMode mode = getParameterMode(anWebParam, javaType);
+
+ // Assert one-way
+ if (opMetaData.isOneWay() && mode != ParameterMode.IN)
+ throw new IllegalArgumentException("A one-way operation can not have
output parameters [" + "method = " + method.getName() + ", parameter =
" + i + "]");
+
+ if (HolderUtils.isHolderType(javaType))
+ {
+ genericType = HolderUtils.getGenericValueType(genericType);
+ javaType = JavaUtils.erasure(genericType);
+ javaTypeName = javaType.getName();
+ }
+
+ if (isWrapped)
+ {
+ QName wrappedElementName = getWebParamName(opMetaData, i, javaType,
anWebParam);
+ String variable = convertToVariable(wrappedElementName.getLocalPart());
+
+ WrappedParameter wrappedParameter = new WrappedParameter(wrappedElementName,
javaTypeName, variable, i);
+ wrappedParameter.setTypeArguments(convertTypeArguments(javaType,
genericType));
+
+ if (mode != ParameterMode.OUT)
+ wrappedParameters.add(wrappedParameter);
+ if (mode != ParameterMode.IN)
+ {
+ wrappedOutputParameters.add(wrappedParameter);
+ wrappedParameter.setHolder(true);
+ }
+ }
+ else
+ {
+ QName xmlName = getWebParamName(opMetaData, i, javaType, anWebParam);
+
+ ParameterMetaData paramMetaData = new ParameterMetaData(opMetaData, xmlName,
javaTypeName);
+ paramMetaData.setInHeader(isHeader);
+ paramMetaData.setIndex(i);
+ paramMetaData.setMode(mode);
+
+ opMetaData.addParameter(paramMetaData);
+ javaTypes.add(javaType);
+ typeRefs.add(new TypeReference(xmlName, genericType,
parameterAnnotations[i]));
+ }
+ }
+
+ // Build result meta data
+ Class returnType = method.getReturnType();
+ Type genericReturnType = method.getGenericReturnType();
+ String returnTypeName = returnType.getName();
+ if ((returnType == void.class) == false)
+ {
+ if (opMetaData.isOneWay())
+ throw new IllegalArgumentException("[JSR-181 2.5.1] The method
'" + method.getName() + "' can not have a return value if it is marked
OneWay");
+
+ WebResult anWebResult = method.getAnnotation(WebResult.class);
+ boolean isHeader = anWebResult != null && anWebResult.header();
+ boolean isWrapped = opMetaData.isDocumentWrapped() && !isHeader;
+ QName xmlName = getWebResultName(opMetaData, returnType, anWebResult);
+
+ if (isWrapped)
+ {
+ WrappedParameter wrapped = new WrappedParameter(xmlName, returnTypeName,
convertToVariable(xmlName.getLocalPart()), -1);
+ wrapped.setTypeArguments(convertTypeArguments(returnType,
genericReturnType));
+
+ // insert at the beginning just for prettiness
+ wrappedOutputParameters.add(0, wrapped);
+ }
+ else
+ {
+ ParameterMetaData retMetaData = new ParameterMetaData(opMetaData, xmlName,
returnTypeName);
+ retMetaData.setInHeader(isHeader);
+ opMetaData.setReturnParameter(retMetaData);
+
+ javaTypes.add(returnType);
+ typeRefs.add(new TypeReference(xmlName, genericReturnType,
method.getAnnotations()));
+ }
+ }
+
+ // Generate wrapper beans
+ if (opMetaData.isDocumentWrapped())
+ {
+ wrapperGenerator.generate(wrapperParameter);
+ Class wrapperClass = wrapperParameter.getJavaType();
+ javaTypes.add(wrapperClass);
+ // In case there is no @XmlRootElement
+ typeRefs.add(new TypeReference(wrapperParameter.getXmlName(), wrapperClass));
+ if (!opMetaData.isOneWay())
+ {
+ wrapperGenerator.generate(wrapperOutputParameter);
+ wrapperClass = wrapperOutputParameter.getJavaType();
+ javaTypes.add(wrapperClass);
+ // In case there is no @XmlRootElement
+ typeRefs.add(new TypeReference(wrapperOutputParameter.getXmlName(),
wrapperClass));
+ }
+ }
+
+ // Add faults
+ for (Class exClass : method.getExceptionTypes())
+ if (!RemoteException.class.isAssignableFrom(exClass))
+ addFault(opMetaData, exClass);
+
+ // process op meta data extension
+ processMetaExtensions(epMetaData, opMetaData);
+ }
+
+ private EndpointResult processWebService(UnifiedMetaData wsMetaData, Class<?>
sepClass, ClassLoader loader) throws ClassNotFoundException
+ {
+ WebService anWebService = sepClass.getAnnotation(WebService.class);
+ if (anWebService == null)
+ throw new WSException("Cannot obtain @WebService annotation from: " +
sepClass.getName());
+
+ Class<?> seiClass = null;
+ String seiName = null;
+ WSDLUtils wsdlUtils = WSDLUtils.getInstance();
+
+ String name = anWebService.name();
+ if (name.length() == 0)
+ name = WSDLUtils.getJustClassName(sepClass);
+
+ String serviceName = anWebService.serviceName();
+ if (serviceName.length() == 0)
+ serviceName = name + "Service";
+
+ String serviceNS = anWebService.targetNamespace();
+ if (serviceNS.length() == 0)
+ serviceNS = wsdlUtils.getTypeNamespace(sepClass);
+
+ String portName = anWebService.portName();
+ if (portName.length() == 0)
+ portName = name + "Port";
+
+ String wsdlLocation = anWebService.wsdlLocation();
+ String interfaceNS = serviceNS;
+
+ if (anWebService.endpointInterface().length() > 0)
+ {
+ seiName = anWebService.endpointInterface();
+ seiClass = loader.loadClass(seiName);
+ anWebService = seiClass.getAnnotation(WebService.class);
+
+ if (anWebService == null)
+ throw new WSException("Interface does not have a @WebService annotation:
" + seiName);
+
+ name = anWebService.name();
+ if (name.length() == 0)
+ name = WSDLUtils.getJustClassName(seiClass);
+
+ interfaceNS = anWebService.targetNamespace();
+ if (interfaceNS.length() == 0)
+ interfaceNS = wsdlUtils.getTypeNamespace(seiClass);
+
+ // The spec states that WSDL location should be allowed on an SEI, although it
+ // makes far more sense on the implementation bean, so we ALWAYS override the
SEI
+ // when wsdlLocation is defined on the bean
+
+ if (wsdlLocation.length() == 0)
+ wsdlLocation = anWebService.wsdlLocation();
+ }
+
+ // Setup the ServerEndpointMetaData
+ QName portQName = new QName(serviceNS, portName);
+ QName portTypeQName = new QName(interfaceNS, name);
+
+ EndpointResult result = new EndpointResult();
+ result.smd = new ServiceMetaData(wsMetaData, new QName(serviceNS, serviceName));
+ result.semd = new ServerEndpointMetaData(result.smd, portQName, portTypeQName,
EndpointMetaData.Type.JAXWS);
+ result.klass = (seiClass != null ? seiClass : sepClass);
+ result.wsdlLocation = wsdlLocation;
+
+ result.smd.addEndpoint(result.semd);
+ wsMetaData.addService(result.smd);
+
+ return result;
+ }
+
+ protected void createJAXBContext(EndpointMetaData epMetaData)
+ {
+ try
+ {
+ String targetNS = epMetaData.getInterfaceQName().getNamespaceURI();
+ log.debug("JAXBContext [types=" + javaTypes + ",tns=" +
targetNS + "]");
+ jaxbCtx = JAXBRIContext.newInstance(javaTypes.toArray(new Class[0]), typeRefs,
targetNS, false);
+ }
+ catch (JAXBException ex)
+ {
+ throw new IllegalStateException("Cannot build JAXB context", ex);
+ }
+ }
+
+ protected void populateXmlTypes(EndpointMetaData epMetaData)
+ {
+ for (OperationMetaData operation : epMetaData.getOperations())
+ {
+ // parameters
+ for (ParameterMetaData paramMetaData : operation.getParameters())
+ {
+ populateXmlType(paramMetaData);
+ }
+
+ // return value
+ ParameterMetaData returnParameter = operation.getReturnParameter();
+ if (returnParameter != null)
+ populateXmlType(returnParameter);
+
+ // faults
+ for (FaultMetaData faultMetaData : operation.getFaults())
+ {
+ populateXmlType(faultMetaData);
+ }
+ }
+ }
+
+ /**
+ * Process an optional @HandlerChain annotation
+ *
+ * Location of the handler chain file. The location supports 2 formats.
+ *
+ * 1. An absolute java.net.URL in externalForm.
+ * (ex:
http://myhandlers.foo.com/handlerfile1.xml)
+ *
+ * 2. A relative path from the source file or class file.
+ * (ex: bar/handlerfile1.xml)
+ */
+ protected void processHandlerChain(EndpointMetaData epMetaData, Class<?>
wsClass)
+ {
+ if (wsClass.isAnnotationPresent(SOAPMessageHandlers.class))
+ throw new WSException("Cannot combine @HandlerChain with
@SOAPMessageHandlers");
+
+ HandlerChain anHandlerChain =
(HandlerChain)wsClass.getAnnotation(HandlerChain.class);
+
+ URL fileURL = null;
+ String filename = anHandlerChain.file();
+
+ // Try the filename as URL
+ try
+ {
+ fileURL = new URL(filename);
+ }
+ catch (MalformedURLException ex)
+ {
+ // ignore
+ }
+
+ // Try the filename as File
+ if (fileURL == null)
+ {
+ try
+ {
+ File file = new File(filename);
+ if (file.exists())
+ fileURL = file.toURL();
+ }
+ catch (MalformedURLException e)
+ {
+ // ignore
+ }
+ }
+
+ // Try the filename as Resource
+ if (fileURL == null)
+ {
+ fileURL = epMetaData.getClassLoader().getResource(filename);
+ }
+
+ // Try the filename relative to class
+ if (fileURL == null)
+ {
+ String packagePath = wsClass.getPackage().getName().replace('.',
'/');
+ fileURL = epMetaData.getClassLoader().getResource(packagePath + "/" +
filename);
+ }
+
+ if (fileURL == null)
+ throw new WSException("Cannot resolve handler file '" + filename +
"' on " + wsClass.getName());
+
+ try
+ {
+ HandlerChainsMetaData handlerChainsMetaData = null;
+ InputStream is = fileURL.openStream();
+ try
+ {
+ Unmarshaller unmarshaller =
UnmarshallerFactory.newInstance().newUnmarshaller();
+ unmarshaller.setValidation(true);
+ unmarshaller.setSchemaValidation(true);
+ unmarshaller.setEntityResolver(new JBossWSEntityResolver());
+ ObjectModelFactory factory = new HandlerChainFactory();
+ handlerChainsMetaData = (HandlerChainsMetaData)unmarshaller.unmarshal(is,
factory, null);
+ }
+ finally
+ {
+ is.close();
+ }
+
+ // Setup the endpoint handlers
+ for (HandlerChainMetaData handlerChainMetaData :
handlerChainsMetaData.getHandlerChains())
+ {
+ for (UnifiedHandlerMetaData uhmd : handlerChainMetaData.getHandlers())
+ {
+ epMetaData.addHandler(uhmd.getHandlerMetaDataJAXWS(epMetaData,
HandlerType.ENDPOINT));
+ }
+ }
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new WSException("Cannot process handler chain: " + filename,
ex);
+ }
+ }
+
+ protected void processOrGenerateWSDL(Class wsClass, ServiceMetaData serviceMetaData,
String wsdlLocation, EndpointMetaData epMetaData)
+ {
+ if (wsdlLocation.length() > 0)
+ {
+ serviceMetaData.setWsdlFile(wsdlLocation);
+ }
+ else
+ {
+ try
+ {
+ String serviceName = serviceMetaData.getServiceName().getLocalPart();
+
+ WSDLGenerator generator = new JAXBWSDLGenerator(jaxbCtx);
+ WSDLDefinitions wsdlDefinitions = generator.generate(serviceMetaData);
+
+ // Ensure that types are only in the interface qname
+
wsdlDefinitions.getWsdlTypes().setNamespace(epMetaData.getInterfaceQName().getNamespaceURI());
+
+ final File tmpdir = IOUtils.createTempDirectory();
+ File wsdlTmpFile = File.createTempFile(serviceName, ".wsdl",
tmpdir);
+ wsdlTmpFile.deleteOnExit();
+
+ Writer writer = IOUtils.getCharsetFileWriter(wsdlTmpFile,
Constants.DEFAULT_XML_CHARSET);
+ new WSDLWriter(wsdlDefinitions).write(writer, Constants.DEFAULT_XML_CHARSET,
new WSDLWriterResolver()
+ {
+ public WSDLWriterResolver resolve(String suggestedFile) throws
IOException
+ {
+ File newTmpFile = File.createTempFile(suggestedFile, ".wsdl",
tmpdir);
+ newTmpFile.deleteOnExit();
+ actualFile = newTmpFile.getName();
+ charset = Constants.DEFAULT_XML_CHARSET;
+ writer = IOUtils.getCharsetFileWriter(newTmpFile,
Constants.DEFAULT_XML_CHARSET);
+ return this;
+ }
+ });
+ writer.close();
+
+ serviceMetaData.setWsdlFile(wsdlTmpFile.toURL().toExternalForm());
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (IOException e)
+ {
+ throw new WSException("Cannot write generated wsdl", e);
+ }
+ }
+ }
+
+ protected void processSOAPBinding(EndpointMetaData epMetaData, Class<?>
wsClass)
+ {
+ SOAPBinding anSoapBinding = (SOAPBinding)wsClass.getAnnotation(SOAPBinding.class);
+
+ SOAPBinding.Style attrStyle = anSoapBinding.style();
+ Style style = (attrStyle == SOAPBinding.Style.RPC ? Style.RPC : Style.DOCUMENT);
+ epMetaData.setStyle(style);
+
+ SOAPBinding.Use attrUse = anSoapBinding.use();
+ if (attrUse == SOAPBinding.Use.ENCODED)
+ throw new WSException("SOAP encoding is not supported for JSR-181
deployments");
+
+ epMetaData.setEncodingStyle(Use.LITERAL);
+
+ ParameterStyle paramStyle = anSoapBinding.parameterStyle();
+ epMetaData.setParameterStyle(paramStyle);
+ }
+
+ // If the implementation bean does not implement a service endpoint interface and
+ // there are no @WebMethod annotations in the implementation bean (excluding
+ // @WebMethod annotations used to exclude inherited @WebMethods), all public
+ // methods other than those inherited from java.lang.Object will be exposed as Web
+ // Service operations, subject to the inheritance rules specified in Common
+ // Annotations for the Java Platform [12], section 2.1.
+ protected void processWebMethods(EndpointMetaData epMetaData, Class wsClass)
+ {
+ epMetaData.clearOperations();
+
+ // Process @WebMethod annotations
+ int webMethodCount = 0;
+ for (Method method : wsClass.getMethods())
+ {
+ WebMethod annotation = method.getAnnotation(WebMethod.class);
+ boolean exclude = annotation != null && annotation.exclude();
+ if (!exclude && (annotation != null || wsClass.isInterface()))
+ {
+ processWebMethod(epMetaData, method);
+ webMethodCount++;
+ }
+ }
+
+ // @WebService should expose all inherited methods if @WebMethod is never
specified
+ if (webMethodCount == 0 && !wsClass.isInterface())
+ {
+ for (Method method : wsClass.getMethods())
+ {
+ WebMethod annotation = method.getAnnotation(WebMethod.class);
+ boolean exclude = annotation != null && annotation.exclude();
+ if (!exclude && method.getDeclaringClass() != Object.class)
+ {
+ processWebMethod(epMetaData, method);
+ webMethodCount++;
+ }
+ }
+ }
+
+ if (webMethodCount == 0)
+ throw new WSException("No exposable methods found");
+ }
+
+ protected void resetMetaDataBuilder(ClassLoader loader)
+ {
+ wrapperGenerator = new DynamicWrapperGenerator(loader);
+ javaTypes.clear();
+ typeRefs.clear();
+ jaxbCtx = null;
+ }
+
+ public ServerEndpointMetaData buildEndpoint(UnifiedMetaData wsMetaData,
UnifiedDeploymentInfo udi, Class<?> sepClass, String linkName)
+ {
+ try
+ {
+ EndpointResult result = processWebService(wsMetaData, sepClass,
udi.classLoader);
+
+ // Clear the java types, etc.
+ resetMetaDataBuilder(udi.classLoader);
+
+ ServerEndpointMetaData sepMetaData = result.semd;
+ ServiceMetaData serviceMetaData = result.smd;
+ Class<?> wsClass = result.klass;
+ sepMetaData.setLinkName(linkName);
+
+ // Assign the WS-Security configuration,
+ WSSecurityConfiguration securityConfiguration =
MetaDataBuilder.getWsSecurityConfiguration(udi);
+ serviceMetaData.setSecurityConfiguration(securityConfiguration);
+
+ sepMetaData.setServiceEndpointImplName(sepClass.getName());
+ sepMetaData.setServiceEndpointInterfaceName(wsClass.getName());
+
+ // Process an optional @SOAPBinding annotation
+ if (wsClass.isAnnotationPresent(SOAPBinding.class))
+ processSOAPBinding(sepMetaData, wsClass);
+
+ // Process an optional @BindingType annotation
+ if (wsClass.isAnnotationPresent(BindingType.class))
+ processBindingType(sepMetaData, wsClass);
+
+ // Init the transport guarantee
+ initTransportGuaranteeJSE(udi, sepMetaData, linkName);
+
+ // Process web methods
+ processWebMethods(sepMetaData, wsClass);
+
+ // Initialize types
+ createJAXBContext(sepMetaData);
+ populateXmlTypes(sepMetaData);
+
+ // Process or generate WSDL
+ processOrGenerateWSDL(wsClass, serviceMetaData, result.wsdlLocation,
sepMetaData);
+
+ // Read the generated WSDL and initialize the schema model
+ // FIXME - This should be removed
+ WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
+ JBossXSModel schemaModel =
WSDLUtils.getSchemaModel(wsdlDefinitions.getWsdlTypes());
+ serviceMetaData.getTypesMetaData().setSchemaModel(schemaModel);
+
+ // Set the endpoint address
+ processPortComponent(udi, wsClass, linkName, sepMetaData);
+
+ // Init the endpoint address
+ MetaDataBuilder.initEndpointAddress(udi, sepMetaData, linkName);
+
+ // replace the SOAP address
+ MetaDataBuilder.replaceAddressLocation(sepMetaData);
+
+ // Process an optional @SOAPMessageHandlers annotation
+ if (sepClass.isAnnotationPresent(SOAPMessageHandlers.class) ||
wsClass.isAnnotationPresent(SOAPMessageHandlers.class))
+ log.warn("@SOAPMessageHandlers is deprecated as of JAX-WS 2.0 with no
replacement.");
+
+ // Add pre handlers
+ WSEndpointConfigJAXWS jaxrpcConfig =
(WSEndpointConfigJAXWS)sepMetaData.getEndpointConfig();
+ sepMetaData.addHandlers(jaxrpcConfig.getHandlers(sepMetaData,
HandlerType.PRE));
+
+ // Process an optional @HandlerChain annotation
+ if (sepClass.isAnnotationPresent(HandlerChain.class))
+ processHandlerChain(sepMetaData, sepClass);
+ else if (wsClass.isAnnotationPresent(HandlerChain.class))
+ processHandlerChain(sepMetaData, wsClass);
+
+ // Add post handlers
+ sepMetaData.addHandlers(jaxrpcConfig.getHandlers(sepMetaData,
HandlerType.POST));
+
+ // init service endpoint id
+ ObjectName sepID = MetaDataBuilder.getServiceEndpointID(udi, sepMetaData);
+ sepMetaData.setServiceEndpointID(sepID);
+
+ return sepMetaData;
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new WSException("Cannot build meta data: " + ex.getMessage(),
ex);
+ }
+ }
+}
Copied: trunk/src/main/java/org/jboss/ws/metadata/config (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config)
Deleted: 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-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/config/WSCommonConfig.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,53 +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.config;
-
-//$Id$
-
-import java.util.List;
-
-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
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public abstract class WSCommonConfig
-{
- private String configName;
-
- public String getConfigName()
- {
- return configName;
- }
-
- public void setConfigName(String configName)
- {
- this.configName = configName;
- }
-
- public abstract List<HandlerMetaData> getHandlers(EndpointMetaData epMetaData,
HandlerType type);
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/config/WSCommonConfig.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/WSCommonConfig.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/config/WSConfigFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/WSConfigFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/config/WSConfigFactory.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,129 +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.config;
-
-//$Id$
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.core.utils.JBossWSEntityResolver;
-import org.jboss.ws.metadata.config.jaxrpc.WSConfigFactoryJAXRPC;
-import org.jboss.ws.metadata.config.jaxws.WSConfigFactoryJAXWS;
-import org.jboss.xb.binding.JBossXBException;
-import org.jboss.xb.binding.Unmarshaller;
-import org.jboss.xb.binding.UnmarshallerFactory;
-import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
-import org.jboss.xb.binding.sunday.unmarshalling.XsdBinder;
-import org.w3c.dom.Element;
-
-/**
- * A factory for the JBossWS endpoint/client configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSConfigFactory
-{
- // provide logging
- private final Logger log = Logger.getLogger(WSConfigFactory.class);
-
- private static String URN_JAXRPC_CONFIG = "urn:jboss:jaxrpc-config:2.0";
- private static String URN_JAXWS_CONFIG = "urn:jboss:jaxws-config:2.0";
-
- // Hide constructor
- private WSConfigFactory()
- {
- }
-
- /** Create a new instance of the factory
- */
- public static WSConfigFactory newInstance()
- {
- return new WSConfigFactory();
- }
-
- public Object parseWithSchemaBinding(URL configURL) throws IOException,
JBossXBException
- {
- log.debug("parse: " + configURL);
-
- String configSchema = "schema/jaxrpc-config_2_0.xsd";
- URL xsdURL =
Thread.currentThread().getContextClassLoader().getResource(configSchema);
- if (xsdURL == null)
- throw new WSException("Cannot find: " + configSchema);
-
- InputStream xsd = xsdURL.openStream();
- SchemaBinding schemaBinding = XsdBinder.bind(xsd, "UTF-8");
-
- Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
- unmarshaller.setValidation(true);
- unmarshaller.setSchemaValidation(true);
- unmarshaller.setEntityResolver(new JBossWSEntityResolver());
- Object wsConfig = unmarshaller.unmarshal(configURL.openStream(), schemaBinding);
- return wsConfig;
- }
-
- // Below is ObjectModelFactory stuff, which should be removed when
parseWithSchemaBinding works.
-
- public Object parseWithObjectModelFactory(URL configURL) throws IOException,
JBossXBException
- {
- log.debug("parse: " + configURL);
-
- Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
- unmarshaller.setValidation(true);
- unmarshaller.setSchemaValidation(true);
-
- Object wsConfig;
- String nsURI = getNamespaceURI(configURL);
- if (URN_JAXRPC_CONFIG.equals(nsURI))
- {
- wsConfig = unmarshaller.unmarshal(configURL.openStream(), new
WSConfigFactoryJAXRPC(), null);
- }
- else if (URN_JAXWS_CONFIG.equals(nsURI))
- {
- wsConfig = unmarshaller.unmarshal(configURL.openStream(), new
WSConfigFactoryJAXWS(), null);
- }
- else
- {
- throw new WSException("Invalid config namespace: " + nsURI);
- }
-
- return wsConfig;
- }
-
- private String getNamespaceURI(URL configURL)
- {
- try
- {
- Element root = DOMUtils.parse(configURL.openStream());
- return root.getNamespaceURI();
- }
- catch (IOException ex)
- {
- throw new WSException(ex);
- }
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/config/WSConfigFactory.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/WSConfigFactory.java)
Copied: trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc)
Deleted:
trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSClientConfigJAXRPC.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSClientConfigJAXRPC.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSClientConfigJAXRPC.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,35 +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.config.jaxrpc;
-
-
-// $Id$
-
-/**
- * A JBossWS client configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSClientConfigJAXRPC extends WSCommonConfigJAXRPC
-{
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSClientConfigJAXRPC.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSClientConfigJAXRPC.java)
Deleted:
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-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSCommonConfigJAXRPC.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,91 +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.config.jaxrpc;
-
-import java.util.ArrayList;
-import java.util.List;
-
-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$
-
-/**
- * A JBossWS client configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public abstract class WSCommonConfigJAXRPC extends WSCommonConfig
-{
- private HandlerChainMetaData preHandlerChain;
- private HandlerChainMetaData postHandlerChain;
-
- public HandlerChainMetaData getPostHandlerChain()
- {
- return postHandlerChain;
- }
-
- public void setPostHandlerChain(HandlerChainMetaData postHandlerChain)
- {
- this.postHandlerChain = postHandlerChain;
- }
-
- public HandlerChainMetaData getPreHandlerChain()
- {
- return preHandlerChain;
- }
-
- public void setPreHandlerChain(HandlerChainMetaData preHandlerChain)
- {
- this.preHandlerChain = preHandlerChain;
- }
-
- @Override
- public List<HandlerMetaData> getHandlers(EndpointMetaData epMetaData,
HandlerType type)
- {
- List<HandlerMetaData> handlers = new ArrayList<HandlerMetaData>();
-
- HandlerChainMetaData handlerChain;
- if (type == HandlerType.PRE)
- handlerChain = getPreHandlerChain();
- else if (type == HandlerType.POST)
- handlerChain = getPostHandlerChain();
- else
- throw new IllegalArgumentException("Invalid handler type: " + type);
-
- if (handlerChain != null)
- {
- for (UnifiedHandlerMetaData uhmd : handlerChain.getHandlers())
- {
- handlers.add(uhmd.getHandlerMetaDataJAXRPC(epMetaData, type));
- }
- }
-
- return handlers;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSCommonConfigJAXRPC.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSCommonConfigJAXRPC.java)
Deleted:
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-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,161 +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.config.jaxrpc;
-
-//$Id$
-
-import java.util.List;
-
-import org.jboss.logging.Logger;
-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.xb.binding.ObjectModelFactory;
-import org.jboss.xb.binding.UnmarshallingContext;
-import org.xml.sax.Attributes;
-
-/**
- * A factory for the JBossWS endpoint/client configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSConfigFactoryJAXRPC implements ObjectModelFactory
-{
- // provide logging
- private final Logger log = Logger.getLogger(WSConfigFactoryJAXRPC.class);
-
- public Object newRoot(Object root, UnmarshallingContext ctx, String namespaceURI,
String localName, Attributes attrs)
- {
- return new WSConfigRootJAXRPC();
- }
-
- public Object completeRoot(Object root, UnmarshallingContext ctx, String namespaceURI,
String localName)
- {
- return root;
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(WSConfigRootJAXRPC wsConfig, UnmarshallingContext navigator,
String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("WSConfig newChild: " + localName);
- if ("endpoint-config".equals(localName))
- {
- WSEndpointConfigJAXRPC wsEndpointConfig = new WSEndpointConfigJAXRPC();
- wsConfig.getEndpointConfig().add(wsEndpointConfig);
- return wsEndpointConfig;
- }
- if ("client-config".equals(localName))
- {
- WSClientConfigJAXRPC wsClientConfig = new WSClientConfigJAXRPC();
- wsConfig.getClientConfig().add(wsClientConfig);
- return wsClientConfig;
- }
- return null;
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(WSCommonConfigJAXRPC wsCommonConfig, UnmarshallingContext
navigator, String namespaceURI, String localName, String value)
- {
- if (log.isTraceEnabled())
- log.trace("WSCommonConfig setValue: nuri=" + namespaceURI + "
localName=" + localName + " value=" + value);
-
- if (localName.equals("config-name"))
- wsCommonConfig.setConfigName(value);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(WSCommonConfigJAXRPC wsCommonConfig, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("WSCommonConfig newChild: " + localName);
-
- if ("pre-handler-chain".equals(localName))
- {
- HandlerChainMetaData preHandlerChain = new HandlerChainMetaData(null);
- wsCommonConfig.setPreHandlerChain(preHandlerChain);
- return preHandlerChain;
- }
- if ("post-handler-chain".equals(localName))
- {
- HandlerChainMetaData postHandlerChain = new HandlerChainMetaData(null);
- wsCommonConfig.setPostHandlerChain(postHandlerChain);
- return postHandlerChain;
- }
- return null;
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(HandlerChainMetaData handlerChainMetaData, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("WSHandlerChainConfig newChild: " + localName);
- if ("handler".equals(localName))
- {
- UnifiedHandlerMetaData handler = new
UnifiedHandlerMetaData(handlerChainMetaData);
- List<UnifiedHandlerMetaData> handlers =
handlerChainMetaData.getHandlers();
- handlers.add(handler);
- return handler;
- }
- return null;
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(UnifiedHandlerMetaData handler, UnmarshallingContext navigator,
String namespaceURI, String localName, String value)
- {
- if (log.isTraceEnabled())
- log.trace("UnifiedHandlerMetaData setValue: nuri=" + namespaceURI +
" localName=" + localName + " value=" + value);
-
- if (localName.equals("handler-name"))
- handler.setHandlerName(value);
- else if (localName.equals("handler-class"))
- handler.setHandlerClass(value);
- else if (localName.equals("soap-header"))
- handler.addSoapHeader(navigator.resolveQName(value));
- else if (localName.equals("soap-role"))
- handler.addSoapRole(value);
- else if (localName.equals("port-name"))
- handler.addPortName(value);
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(HandlerInitParam param, UnmarshallingContext navigator, String
namespaceURI, String localName, String value)
- {
- if (log.isTraceEnabled())
- log.trace("UnifiedInitParamMetaData setValue: nuri=" + namespaceURI +
" localName=" + localName + " value=" + value);
-
- if (localName.equals("param-name"))
- param.setParamName(value);
- else if (localName.equals("param-value"))
- param.setParamValue(value);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigRootJAXRPC.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigRootJAXRPC.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigRootJAXRPC.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,94 +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.config.jaxrpc;
-
-import java.util.ArrayList;
-import java.util.List;
-
-
-/**
- * A JBossWS configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSConfigRootJAXRPC
-{
- private List<WSClientConfigJAXRPC> clientConfigList = new
ArrayList<WSClientConfigJAXRPC>();
- private List<WSEndpointConfigJAXRPC> endpointConfigList = new
ArrayList<WSEndpointConfigJAXRPC>();
-
- public List<WSClientConfigJAXRPC> getClientConfig()
- {
- return clientConfigList;
- }
-
- public void setClientConfig(List<WSClientConfigJAXRPC> clientConfig)
- {
- this.clientConfigList = clientConfig;
- }
-
- public List<WSEndpointConfigJAXRPC> getEndpointConfig()
- {
- return endpointConfigList;
- }
-
- public void setEndpointConfig(List<WSEndpointConfigJAXRPC> endpointConfig)
- {
- this.endpointConfigList = endpointConfig;
- }
-
- public WSClientConfigJAXRPC getClientConfigByName(String configName)
- {
- WSClientConfigJAXRPC config = null;
- for(WSClientConfigJAXRPC aux : clientConfigList)
- {
- if (aux.getConfigName().equals(configName))
- {
- config = aux;
- break;
- }
- }
-
- if (config == null && clientConfigList.size() == 1)
- config = clientConfigList.get(0);
-
- return config;
- }
-
- public WSEndpointConfigJAXRPC getEndpointConfigByName(String configName)
- {
- WSEndpointConfigJAXRPC config = null;
- for(WSEndpointConfigJAXRPC aux : endpointConfigList)
- {
- if (aux.getConfigName().equals(configName))
- {
- config = aux;
- break;
- }
- }
-
- if (config == null && endpointConfigList.size() == 1)
- config = endpointConfigList.get(0);
-
- return config;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigRootJAXRPC.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigRootJAXRPC.java)
Deleted:
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-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSEndpointConfigJAXRPC.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,36 +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.config.jaxrpc;
-
-
-
-// $Id$
-
-/**
- * A JBossWS endpoint configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSEndpointConfigJAXRPC extends WSCommonConfigJAXRPC
-{
-}
Copied:
trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSEndpointConfigJAXRPC.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSEndpointConfigJAXRPC.java)
Copied: trunk/src/main/java/org/jboss/ws/metadata/config/jaxws (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSClientConfigJAXWS.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSClientConfigJAXWS.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSClientConfigJAXWS.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,35 +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.config.jaxws;
-
-
-// $Id$
-
-/**
- * A JBossWS client configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSClientConfigJAXWS extends WSCommonConfigJAXWS
-{
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSClientConfigJAXWS.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSClientConfigJAXWS.java)
Deleted: 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-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSCommonConfigJAXWS.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,91 +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.config.jaxws;
-
-import java.util.ArrayList;
-import java.util.List;
-
-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$
-
-/**
- * A JBossWS client configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public abstract class WSCommonConfigJAXWS extends WSCommonConfig
-{
- private WSHandlerChainsConfigJAXWS preHandlerChains;
- private WSHandlerChainsConfigJAXWS postHandlerChains;
-
- public WSHandlerChainsConfigJAXWS getPostHandlerChains()
- {
- return postHandlerChains;
- }
-
- public void setPostHandlerChains(WSHandlerChainsConfigJAXWS postHandlerChain)
- {
- this.postHandlerChains = postHandlerChain;
- }
-
- public WSHandlerChainsConfigJAXWS getPreHandlerChains()
- {
- return preHandlerChains;
- }
-
- public void setPreHandlerChains(WSHandlerChainsConfigJAXWS preHandlerChains)
- {
- this.preHandlerChains = preHandlerChains;
- }
-
- public List<HandlerMetaData> getHandlers(EndpointMetaData epMetaData,
HandlerType type)
- {
- List<HandlerMetaData> handlers = new ArrayList<HandlerMetaData>();
-
- WSHandlerChainsConfigJAXWS handlerChains;
- if (type == HandlerType.PRE)
- handlerChains = getPreHandlerChains();
- else if (type == HandlerType.POST)
- handlerChains = getPostHandlerChains();
- else throw new IllegalArgumentException("Invalid handler type: " +
type);
-
- if (handlerChains != null)
- {
- for (HandlerChainMetaData handlerChainMetaData :
handlerChains.getHandlerChains())
- {
- for (UnifiedHandlerMetaData uhmd : handlerChainMetaData.getHandlers())
- {
- handlers.add(uhmd.getHandlerMetaDataJAXWS(epMetaData, type));
- }
- }
- }
-
- return handlers;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSCommonConfigJAXWS.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSCommonConfigJAXWS.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSConfigFactoryJAXWS.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSConfigFactoryJAXWS.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSConfigFactoryJAXWS.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,123 +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.config.jaxws;
-
-//$Id$
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.metadata.jsr181.HandlerChainFactory;
-import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
-import org.jboss.xb.binding.UnmarshallingContext;
-import org.xml.sax.Attributes;
-
-/**
- * A factory for the JBossWS endpoint/client configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSConfigFactoryJAXWS extends HandlerChainFactory
-{
- // provide logging
- private final Logger log = Logger.getLogger(WSConfigFactoryJAXWS.class);
-
- public Object newRoot(Object root, UnmarshallingContext ctx, String namespaceURI,
String localName, Attributes attrs)
- {
- return new WSConfigRootJAXWS();
- }
-
- public Object completeRoot(Object root, UnmarshallingContext ctx, String namespaceURI,
String localName)
- {
- return root;
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(WSConfigRootJAXWS wsConfig, UnmarshallingContext navigator,
String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("WSConfig newChild: " + localName);
- if ("endpoint-config".equals(localName))
- {
- WSEndpointConfigJAXWS wsEndpointConfig = new WSEndpointConfigJAXWS();
- wsConfig.getEndpointConfig().add(wsEndpointConfig);
- return wsEndpointConfig;
- }
- if ("client-config".equals(localName))
- {
- WSClientConfigJAXWS wsClientConfig = new WSClientConfigJAXWS();
- wsConfig.getClientConfig().add(wsClientConfig);
- return wsClientConfig;
- }
- return null;
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(WSCommonConfigJAXWS wsCommonConfig, UnmarshallingContext
navigator, String namespaceURI, String localName, String value)
- {
- if (log.isTraceEnabled())
- log.trace("WSCommonConfig setValue: nuri=" + namespaceURI + "
localName=" + localName + " value=" + value);
-
- if (localName.equals("config-name"))
- wsCommonConfig.setConfigName(value);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(WSCommonConfigJAXWS wsCommonConfig, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("WSCommonConfig newChild: " + localName);
-
- if ("pre-handler-chains".equals(localName))
- {
- WSHandlerChainsConfigJAXWS preHandlerChains = new WSHandlerChainsConfigJAXWS();
- wsCommonConfig.setPreHandlerChains(preHandlerChains);
- return preHandlerChains;
- }
- if ("post-handler-chains".equals(localName))
- {
- WSHandlerChainsConfigJAXWS postHandlerChains = new
WSHandlerChainsConfigJAXWS();
- wsCommonConfig.setPostHandlerChains(postHandlerChains);
- return postHandlerChains;
- }
- return null;
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(WSHandlerChainsConfigJAXWS wsHandlerChains,
UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("WSHandlerChainsConfig newChild: " + localName);
-
- if ("handler-chain".equals(localName))
- {
- HandlerChainMetaData handlerChain = new HandlerChainMetaData(null);
- wsHandlerChains.getHandlerChains().add(handlerChain);
- return handlerChain;
- }
- return null;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSConfigFactoryJAXWS.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSConfigFactoryJAXWS.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSConfigRootJAXWS.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSConfigRootJAXWS.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSConfigRootJAXWS.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,94 +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.config.jaxws;
-
-import java.util.ArrayList;
-import java.util.List;
-
-
-/**
- * A JBossWS configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSConfigRootJAXWS
-{
- private List<WSClientConfigJAXWS> clientConfigList = new
ArrayList<WSClientConfigJAXWS>();
- private List<WSEndpointConfigJAXWS> endpointConfigList = new
ArrayList<WSEndpointConfigJAXWS>();
-
- public List<WSClientConfigJAXWS> getClientConfig()
- {
- return clientConfigList;
- }
-
- public void setClientConfig(List<WSClientConfigJAXWS> clientConfig)
- {
- this.clientConfigList = clientConfig;
- }
-
- public List<WSEndpointConfigJAXWS> getEndpointConfig()
- {
- return endpointConfigList;
- }
-
- public void setEndpointConfig(List<WSEndpointConfigJAXWS> endpointConfig)
- {
- this.endpointConfigList = endpointConfig;
- }
-
- public WSClientConfigJAXWS getClientConfigByName(String configName)
- {
- WSClientConfigJAXWS config = null;
- for(WSClientConfigJAXWS aux : clientConfigList)
- {
- if (aux.getConfigName().equals(configName))
- {
- config = aux;
- break;
- }
- }
-
- if (config == null && clientConfigList.size() == 1)
- config = clientConfigList.get(0);
-
- return config;
- }
-
- public WSEndpointConfigJAXWS getEndpointConfigByName(String configName)
- {
- WSEndpointConfigJAXWS config = null;
- for(WSEndpointConfigJAXWS aux : endpointConfigList)
- {
- if (aux.getConfigName().equals(configName))
- {
- config = aux;
- break;
- }
- }
-
- if (config == null && endpointConfigList.size() == 1)
- config = endpointConfigList.get(0);
-
- return config;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSConfigRootJAXWS.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSConfigRootJAXWS.java)
Deleted:
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-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSEndpointConfigJAXWS.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,35 +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.config.jaxws;
-
-
-// $Id$
-
-/**
- * A JBossWS endpoint configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSEndpointConfigJAXWS extends WSCommonConfigJAXWS
-{
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSEndpointConfigJAXWS.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSEndpointConfigJAXWS.java)
Deleted:
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-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSHandlerChainsConfigJAXWS.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,48 +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.config.jaxws;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
-
-
-/**
- * A JBossWS handler chains configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSHandlerChainsConfigJAXWS
-{
- private List<HandlerChainMetaData> chains = new
ArrayList<HandlerChainMetaData>();
-
- public WSHandlerChainsConfigJAXWS()
- {
- }
-
- public List<HandlerChainMetaData> getHandlerChains()
- {
- return chains;
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSHandlerChainsConfigJAXWS.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSHandlerChainsConfigJAXWS.java)
Copied: trunk/src/main/java/org/jboss/ws/metadata/j2ee (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedApplicationMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedApplicationMetaData.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedApplicationMetaData.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,131 +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.j2ee;
-
-//$Id$
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * The container independent top level meta data from the jboss.xml and ejb-jar.xml
descriptor.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class UnifiedApplicationMetaData
-{
- /** ArrayList<BeanMetaData> for the ejbs */
- private List<UnifiedBeanMetaData> beans = new
ArrayList<UnifiedBeanMetaData>();
- /** The optional JBossWS config-name */
- private String configName;
- /** The optional JBossWS config-file */
- private String configFile;
- /** The web context root to use for web services */
- private String webServiceContextRoot;
- /** The security-domain value assigned to the application */
- private String securityDomain;
- /** A HashMap<String, String> for webservice description publish locations */
- private PublishLocationAdapter publishLocationAdapter;
-
- public UnifiedBeanMetaData getBeanByEjbName(String ejbName)
- {
- for (UnifiedBeanMetaData beanMetaData : beans)
- {
- if (beanMetaData.getEjbName().equals(ejbName))
- {
- return beanMetaData;
- }
- }
- return null;
- }
-
- public Iterator<UnifiedBeanMetaData> getEnterpriseBeans()
- {
- return beans.iterator();
- }
-
- public void setEnterpriseBeans(List<UnifiedBeanMetaData> beans)
- {
- this.beans = beans;
- }
-
- public String getConfigName()
- {
- return configName;
- }
-
- public void setConfigName(String configName)
- {
- this.configName = configName;
- }
-
- public String getConfigFile()
- {
- return configFile;
- }
-
- public void setConfigFile(String configFile)
- {
- this.configFile = configFile;
- }
-
- public String getWebServiceContextRoot()
- {
- return webServiceContextRoot;
- }
-
- public void setWebServiceContextRoot(String contextRoot)
- {
- this.webServiceContextRoot = contextRoot;
- }
-
- public String getSecurityDomain()
- {
- return securityDomain;
- }
-
- public void setSecurityDomain(String securityDomain)
- {
- this.securityDomain = securityDomain;
- }
-
- public void setPublishLocationAdapter(PublishLocationAdapter publishLocationAdapter)
- {
- this.publishLocationAdapter = publishLocationAdapter;
- }
-
- public String getWsdlPublishLocationByName(String name)
- {
- String publishLocation = null;
- if (publishLocationAdapter != null)
- publishLocation = publishLocationAdapter.getWsdlPublishLocationByName(name);
- return publishLocation;
-
- }
-
- public interface PublishLocationAdapter
- {
- String getWsdlPublishLocationByName(String name);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedApplicationMetaData.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedApplicationMetaData.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedBeanMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedBeanMetaData.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedBeanMetaData.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -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.j2ee;
-
-//$Id$
-
-/**
- * The container independent common meta data class for the entity, message-driven and
session beans.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class UnifiedBeanMetaData
-{
- /** The ejb-name element specifies an enterprise bean's name. */
- private String ejbName;
- /** The ejb-class element contains the fully-qualified name of the enterprise
bean's class. */
- private String ejbClass;
- /** The home element contains the fully-qualified name of the enterprise
- bean's home interface. */
- private String homeClass;
- /** The local-home element contains the fully-qualified name of the
- enterprise bean's local home interface. */
- private String localHomeClass;
- /** The service-endpoint element contains the fully-qualified name of the beans
service endpoint interface (SEI) */
- protected String seiName;
- /** The JNDI name under with the home interface should be bound */
- private String jndiName;
- /** The JNDI name under with the local home interface should be bound */
- private String localJndiName;
- /** The jboss port-component binding for a ejb webservice */
- protected UnifiedEjbPortComponentMetaData portComponent;
-
- public String getEjbName()
- {
- return ejbName;
- }
-
- public void setEjbName(String ejbName)
- {
- this.ejbName = ejbName;
- }
-
- public String getEjbClass()
- {
- return ejbClass;
- }
-
- public void setEjbClass(String ejbClass)
- {
- this.ejbClass = ejbClass;
- }
-
- public UnifiedEjbPortComponentMetaData getPortComponent()
- {
- return portComponent;
- }
-
- public void setPortComponent(UnifiedEjbPortComponentMetaData portComponent)
- {
- this.portComponent = portComponent;
- }
-
- public String getServiceEndpoint()
- {
- return seiName;
- }
-
- public void setServiceEndpoint(String seiName)
- {
- this.seiName = seiName;
- }
-
- public String getContainerObjectNameJndiName()
- {
- return getHome() != null ? getJndiName() : getLocalJndiName();
- }
-
- public String getHome()
- {
- return homeClass;
- }
-
- public void setHome(String homeClass)
- {
- this.homeClass = homeClass;
- }
-
- public String getJndiName()
- {
- return jndiName;
- }
-
- public void setJndiName(String jndiName)
- {
- this.jndiName = jndiName;
- }
-
- public String getLocalHome()
- {
- return localHomeClass;
- }
-
- public void setLocalHome(String localHomeClass)
- {
- this.localHomeClass = localHomeClass;
- }
-
- public String getLocalJndiName()
- {
- return localJndiName;
- }
-
- public void setLocalJndiName(String localJndiName)
- {
- this.localJndiName = localJndiName;
- }
-
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedBeanMetaData.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedBeanMetaData.java)
Deleted:
trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedEjbPortComponentMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedEjbPortComponentMetaData.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedEjbPortComponentMetaData.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,90 +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.j2ee;
-
-
-//$Id$
-
-
-/**
- * The container independent metadata for session/port-component element from jboss.xml
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class UnifiedEjbPortComponentMetaData
-{
- private String portComponentName;
- private String portComponentURI;
- private String authMethod;
- private String transportGuarantee;
-
- public String getPortComponentName()
- {
- return portComponentName;
- }
-
- public void setPortComponentName(String portComponentName)
- {
- this.portComponentName = portComponentName;
- }
-
- public String getPortComponentURI()
- {
- return portComponentURI;
- }
-
- public void setPortComponentURI(String portComponentURI)
- {
- this.portComponentURI = portComponentURI;
- }
-
- public String getURLPattern()
- {
- String pattern = "/*";
- if (portComponentURI != null)
- {
- return portComponentURI;
- }
- return pattern;
- }
-
- public String getAuthMethod()
- {
- return authMethod;
- }
-
- public void setAuthMethod(String authMethod)
- {
- this.authMethod = authMethod;
- }
-
- public String getTransportGuarantee()
- {
- return transportGuarantee;
- }
-
- public void setTransportGuarantee(String transportGuarantee)
- {
- this.transportGuarantee = transportGuarantee;
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedEjbPortComponentMetaData.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedEjbPortComponentMetaData.java)
Deleted: 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-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedHandlerMetaData.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -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.j2ee;
-
-//$Id$
-
-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.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
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class UnifiedHandlerMetaData implements Serializable
-{
- private static final long serialVersionUID = -3019416564080333900L;
-
- private HandlerChainMetaData chainConfig;
-
- // The required <handler-name> element
- private String handlerName;
- // The required <handler-class> element
- private String handlerClass;
- // The optional <init-param> elements
- private ArrayList<HandlerInitParam> initParams = new
ArrayList<HandlerInitParam>();
- // The optional <soap-header> elements
- private Set<QName> soapHeaders = new HashSet<QName>();
- // 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 UnifiedHandlerMetaData(HandlerChainMetaData handlerChainMetaData)
- {
- this.chainConfig = handlerChainMetaData;
- }
-
- public void setHandlerName(String value)
- {
- this.handlerName = value;
- }
-
- public String getHandlerName()
- {
- return handlerName;
- }
-
- public void setHandlerClass(String handlerClass)
- {
- this.handlerClass = handlerClass;
- }
-
- public String getHandlerClass()
- {
- return handlerClass;
- }
-
- public void addInitParam(HandlerInitParam param)
- {
- initParams.add(param);
- }
-
- public List<HandlerInitParam> getInitParams()
- {
- return initParams;
- }
-
- public void addSoapRole(String value)
- {
- soapRoles.add(value);
- }
-
- public Set<String> getSoapRoles()
- {
- return soapRoles;
- }
-
- public void addSoapHeader(QName qName)
- {
- soapHeaders.add(qName);
- }
-
- public Set<QName> getSoapHeaders()
- {
- return soapHeaders;
- }
-
- public String getProtocolBindings()
- {
- return (chainConfig != null ? chainConfig.getProtocolBindings() : null);
- }
-
- public QName getServiceNamePattern()
- {
- return (chainConfig != null ? chainConfig.getServiceNamePattern() : null);
- }
-
- public QName getPortNamePattern()
- {
- return (chainConfig != null ? chainConfig.getPortNamePattern() : null);
- }
-
- public void addPortName(String portName)
- {
- portNames.add(portName);
- }
-
- public Set<String> getPortNames()
- {
- return portNames;
- }
-
- public HandlerMetaDataJAXRPC getHandlerMetaDataJAXRPC (EndpointMetaData epMetaData,
HandlerType type)
- {
- HandlerMetaDataJAXRPC hmd = new HandlerMetaDataJAXRPC(epMetaData, type);
- hmd.setHandlerName(getHandlerName());
- hmd.setHandlerClassName(getHandlerClass());
- hmd.seiInitParams(getInitParams());
- hmd.setSoapHeaders(getSoapHeaders());
- hmd.setSoapRoles(getSoapRoles());
- hmd.setPortNames(getPortNames());
- return hmd;
- }
-
- public HandlerMetaDataJAXWS getHandlerMetaDataJAXWS (EndpointMetaData epMetaData,
HandlerType type)
- {
- HandlerMetaDataJAXWS hmd = new HandlerMetaDataJAXWS(epMetaData, type);
- hmd.setHandlerName(getHandlerName());
- hmd.setHandlerClassName(getHandlerClass());
- hmd.seiInitParams(getInitParams());
- hmd.setProtocolBindings(getProtocolBindings());
- hmd.setServiceNamePattern(getServiceNamePattern());
- hmd.setPortNamePattern(getPortNamePattern());
- return hmd;
- }
-
- public String toString()
- {
- StringBuffer buffer = new StringBuffer("\nUnifiedHandlerMetaData:");
- buffer.append("\n name=" + getHandlerName());
- buffer.append("\n class=" + getHandlerClass());
- buffer.append("\n params=" + getInitParams());
- buffer.append("\n headers=" + getSoapHeaders());
- buffer.append("\n roles=" + getSoapRoles());
- buffer.append("\n protocols=" + getProtocolBindings());
- buffer.append("\n services=" + getServiceNamePattern());
- buffer.append("\n ports=" + (getPortNamePattern() != null ?
getPortNamePattern() : portNames));
- return buffer.toString();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedHandlerMetaData.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedHandlerMetaData.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedMessageDrivenMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedMessageDrivenMetaData.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedMessageDrivenMetaData.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,47 +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.j2ee;
-
-
-// $Id$
-
-
-/**
- * The container independent metadata of a message driven bean.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class UnifiedMessageDrivenMetaData extends UnifiedBeanMetaData
-{
- private String destinationJndiName;
-
- public String getDestinationJndiName()
- {
- return destinationJndiName;
- }
-
- public void setDestinationJndiName(String destinationJndiName)
- {
- this.destinationJndiName = destinationJndiName;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedMessageDrivenMetaData.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedMessageDrivenMetaData.java)
Deleted:
trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedPortComponentRefMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedPortComponentRefMetaData.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedPortComponentRefMetaData.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,77 +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.j2ee;
-
-import java.io.Serializable;
-import java.util.Properties;
-
-//$Id$
-
-/**
- * The container independent metdata data from handler init params
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class UnifiedPortComponentRefMetaData implements Serializable
-{
- private static final long serialVersionUID = -7030007637678646740L;
-
- // The required <service-endpoint-interface> element
- private String serviceEndpointInterface;
- // The optional <port-component-link> element
- private String portComponentLink;
-
- /** Arbitrary proxy properties given by <call-property> */
- private Properties callProperties;
-
- public String getPortComponentLink()
- {
- return portComponentLink;
- }
-
- public void setPortComponentLink(String portComponentLink)
- {
- this.portComponentLink = portComponentLink;
- }
-
- public String getServiceEndpointInterface()
- {
- return serviceEndpointInterface;
- }
-
- public void setServiceEndpointInterface(String serviceEndpointInterface)
- {
- this.serviceEndpointInterface = serviceEndpointInterface;
- }
-
- public Properties getCallProperties()
- {
- return callProperties;
- }
-
- public void setCallProperties(Properties callProperties)
- {
- this.callProperties = callProperties;
- }
-
-}
Copied:
trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedPortComponentRefMetaData.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedPortComponentRefMetaData.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedServiceRefMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedServiceRefMetaData.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedServiceRefMetaData.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,258 +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.j2ee;
-
-//$Id$
-
-import java.io.Serializable;
-import java.net.URL;
-import java.net.URLClassLoader;
-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;
-
-
-/**
- * The container independent metdata data from service-ref element in web.xml,
ejb-jar.xml, and
- * application-client.xml.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class UnifiedServiceRefMetaData implements Serializable
-{
- private static final long serialVersionUID = 122554634182144069L;
-
- // The required <service-ref-name> element
- private String serviceRefName;
- // The required <service-interface> element
- private String serviceInterface;
- // The optional <wsdl-file> element
- private String wsdlFile;
- // The optional <jaxrpc-mapping-file> element
- private String jaxrpcMappingFile;
- // The optional <service-qname> element
- private QName serviceQName;
- // The LinkedHashMap<String, UnifiedPortComponentRefMetaData> for
<port-component-ref> elements
- private Map<String, UnifiedPortComponentRefMetaData> portComponentRefs = new
LinkedHashMap<String, UnifiedPortComponentRefMetaData>();
- // The optional <handler> elements
- private List<UnifiedHandlerMetaData> handlers = new
ArrayList<UnifiedHandlerMetaData>();
-
- // The optional JBossWS config-name
- private String configName;
- // The optional JBossWS config-file
- private String configFile;
- /** The URL of the actual WSDL to use, <wsdl-override> */
- private URL wsdlOverride;
- /** Arbitrary proxy properties given by <call-property> */
- private Properties callProperties;
-
- // The wsdl definition, if we have one
- private Object wsdlDefinition;
- // The java/wsdl mapping, if we have one
- private Object javaWsdlMapping;
-
- //The ClassLoader to load additional resources
- private transient URLClassLoader resourceCL;
-
- /** Set the resource classloader that can load the wsdl file
- * On the client side this is set expicitly after unmarshalling.
- */
- public void setResourceCL(URLClassLoader resourceCL)
- {
- if (resourceCL == null)
- throw new IllegalArgumentException("ResourceClassLoader cannot be
null");
-
- this.resourceCL = resourceCL;
- }
-
- public URLClassLoader getResourceCL()
- {
- if (resourceCL == null)
- resourceCL = new URLClassLoader(new URL[] {},
Thread.currentThread().getContextClassLoader());
-
- return resourceCL;
- }
-
- public String getJaxrpcMappingFile()
- {
- return jaxrpcMappingFile;
- }
-
- public void setJaxrpcMappingFile(String jaxrpcMappingFile)
- {
- this.jaxrpcMappingFile = jaxrpcMappingFile;
- }
-
- public URL getJavaWsdlMappingURL()
- {
- URL mappingURL = null;
- if (jaxrpcMappingFile != null)
- {
- mappingURL = getResourceCL().findResource(jaxrpcMappingFile);
- if (mappingURL == null)
- throw new IllegalStateException("Cannot find resource: " +
jaxrpcMappingFile);
- }
- return mappingURL;
- }
-
- public Object getJavaWsdlMapping()
- {
- return javaWsdlMapping;
- }
-
- public void setJavaWsdlMapping(Object javaWsdlMapping)
- {
- this.javaWsdlMapping = javaWsdlMapping;
- }
-
- public UnifiedPortComponentRefMetaData[] getPortComponentRefs()
- {
- UnifiedPortComponentRefMetaData[] array = new
UnifiedPortComponentRefMetaData[portComponentRefs.size()];
- portComponentRefs.values().toArray(array);
- return array;
- }
-
- public void setPortComponentRefs(LinkedHashMap<String,
UnifiedPortComponentRefMetaData> portComponentRefs)
- {
- this.portComponentRefs = portComponentRefs;
- }
-
- public UnifiedHandlerMetaData[] getHandlers()
- {
- UnifiedHandlerMetaData[] array = new UnifiedHandlerMetaData[handlers.size()];
- handlers.toArray(array);
- return array;
- }
-
- public void setHandlers(ArrayList<UnifiedHandlerMetaData> handlers)
- {
- this.handlers = handlers;
- }
-
- public String getServiceInterface()
- {
- return serviceInterface;
- }
-
- public void setServiceInterface(String serviceInterface)
- {
- this.serviceInterface = serviceInterface;
- }
-
- public QName getServiceQName()
- {
- return serviceQName;
- }
-
- public void setServiceQName(QName serviceQName)
- {
- this.serviceQName = serviceQName;
- }
-
- public String getServiceRefName()
- {
- return serviceRefName;
- }
-
- public void setServiceRefName(String serviceRefName)
- {
- this.serviceRefName = serviceRefName;
- }
-
- public String getWsdlFile()
- {
- return wsdlFile;
- }
-
- public void setWsdlFile(String wsdlFile)
- {
- this.wsdlFile = wsdlFile;
- }
-
- public String getConfigFile()
- {
- return configFile;
- }
-
- public void setConfigFile(String configFile)
- {
- this.configFile = configFile;
- }
-
- public String getConfigName()
- {
- return configName;
- }
-
- public void setConfigName(String configName)
- {
- this.configName = configName;
- }
-
- public URL getWsdlOverride()
- {
- return wsdlOverride;
- }
-
-
- public void setWsdlOverride(URL wsdlOverride)
- {
- this.wsdlOverride = wsdlOverride;
- }
-
- public URL getWsdlURL()
- {
- URL wsdlURL = wsdlOverride;
- if (wsdlURL == null && wsdlFile != null)
- {
- wsdlURL = getResourceCL().findResource(wsdlFile);
- if (wsdlURL == null)
- throw new IllegalStateException("Cannot find resource: " +
wsdlFile);
- }
- return wsdlURL;
- }
-
- public Properties getCallProperties()
- {
- return callProperties;
- }
-
- public void setCallProperties(Properties callProperties)
- {
- this.callProperties = callProperties;
- }
-
- public Object getWsdlDefinition()
- {
- return wsdlDefinition;
- }
-
- public void setWsdlDefinition(Object wsdlDefinition)
- {
- this.wsdlDefinition = wsdlDefinition;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedServiceRefMetaData.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedServiceRefMetaData.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedSessionMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedSessionMetaData.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedSessionMetaData.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,37 +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.j2ee;
-
-
-// $Id$
-
-
-/**
- * The container independent metadata of a message driven bean.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class UnifiedSessionMetaData extends UnifiedBeanMetaData
-{
-
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedSessionMetaData.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedSessionMetaData.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedWebMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedWebMetaData.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedWebMetaData.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,143 +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.j2ee;
-
-//$Id$
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * The container independent representation of the web.xml and jboss-web.xml deployment
descriptors
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class UnifiedWebMetaData
-{
- /** The war context root as specified at the jboss-web.xml descriptor level. */
- private String contextRoot;
- /** The servlet-mapping <servlet-name, url-pattern> */
- private Map<String, String> servletMappings = new HashMap<String,
String>();
- /** The servlet <servlet-name, servlet-class> */
- private Map<String, String> servletClassNames = new HashMap<String,
String>();
- /** The optional JBossWS config-name */
- private String configName;
- /** The optional JBossWS config-file */
- private String configFile;
- /** The security-domain value assigned to the application */
- private String securityDomain;
- /** A HashMap<String, String> for webservice description publish locations */
- private PublishLocationAdapter publishLocationAdapter;
- /** web.xml security-constraints */
- private List<UnifiedWebSecurityMetaData> securityMetaData;
-
- public String getContextRoot()
- {
- return contextRoot;
- }
-
- public void setContextRoot(String contextRoot)
- {
- this.contextRoot = contextRoot;
- }
-
- public Map<String, String> getServletMappings()
- {
- return servletMappings;
- }
-
- public void setServletMappings(Map<String, String> servletMappings)
- {
- this.servletMappings = servletMappings;
- }
-
- public Map<String, String> getServletClassNames()
- {
- return servletClassNames;
- }
-
- public void setServletClassNames(Map<String, String> servletClassNames)
- {
- this.servletClassNames = servletClassNames;
- }
-
- public String getConfigName()
- {
- return configName;
- }
-
- public void setConfigName(String configName)
- {
- this.configName = configName;
- }
-
- public String getConfigFile()
- {
- return configFile;
- }
-
- public void setConfigFile(String configFile)
- {
- this.configFile = configFile;
- }
-
- public String getSecurityDomain()
- {
- return securityDomain;
- }
-
- public void setSecurityDomain(String securityDomain)
- {
- this.securityDomain = securityDomain;
- }
-
- public List<UnifiedWebSecurityMetaData> getSecurityMetaData()
- {
- return securityMetaData;
- }
-
- public void setSecurityMetaData(List<UnifiedWebSecurityMetaData>
securityMetaData)
- {
- this.securityMetaData = securityMetaData;
- }
-
- public void setPublishLocationAdapter(PublishLocationAdapter publishLocationAdapter)
- {
- this.publishLocationAdapter = publishLocationAdapter;
- }
-
- public String getWsdlPublishLocationByName(String name)
- {
- String publishLocation = null;
- if (publishLocationAdapter != null)
- publishLocation = publishLocationAdapter.getWsdlPublishLocationByName(name);
- return publishLocation;
-
- }
-
- public interface PublishLocationAdapter
- {
- String getWsdlPublishLocationByName(String name);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedWebMetaData.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedWebMetaData.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedWebSecurityMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedWebSecurityMetaData.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedWebSecurityMetaData.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,95 +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.j2ee;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-
-/**
- *
- * @author darran.lofthouse(a)jboss.com
- * @since Oct 22, 2006
- */
-public class UnifiedWebSecurityMetaData
-{
-
- /** The optional security-constraint/user-data-constraint/transport-guarantee */
- private String transportGuarantee;
-
- /**
- * The HashMap for the security-constraint/web-resource-collection
- * elements.
- */
- private HashMap<String, UnifiedWebResourceCollection> webResources = new
HashMap<String, UnifiedWebResourceCollection>();
-
- public UnifiedWebResourceCollection addWebResource(final String name)
- {
- UnifiedWebResourceCollection wrc = new UnifiedWebResourceCollection(name);
- webResources.put(name, wrc);
-
- return wrc;
- }
-
- public Collection<UnifiedWebResourceCollection> getWebResources()
- {
- return webResources.values();
- }
-
- public String getTransportGuarantee()
- {
- return transportGuarantee;
- }
-
- public void setTransportGuarantee(String transportGuarantee)
- {
- this.transportGuarantee = transportGuarantee;
- }
-
- public static class UnifiedWebResourceCollection
- {
- private String name;
- /** The required url-pattern element(s) */
- private HashSet<String> urlPatterns = new HashSet<String>();
-
- public UnifiedWebResourceCollection(final String name)
- {
- this.name = name;
- }
-
- public String getName()
- {
- return name;
- }
-
- public void addPattern(String pattern)
- {
- urlPatterns.add(pattern);
- }
-
- public HashSet<String> getUrlPatterns()
- {
- return urlPatterns;
- }
- }
-
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedWebSecurityMetaData.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedWebSecurityMetaData.java)
Copied: trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ExceptionMapping.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ExceptionMapping.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ExceptionMapping.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,113 +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.jaxrpcmapping;
-
-// $Id$
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-
-/**
- * XML mapping of the java-wsdl-mapping/exception-mapping element.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 14-May-2004
- */
-public class ExceptionMapping implements Serializable
-{
- private static final long serialVersionUID = 2964098233936811614L;
-
- // The parent <java-wsdl-mapping> element
- private JavaWsdlMapping javaWsdlMapping;
-
- // The required <exception-type> element
- private String exceptionType;
- // The required <wsdl-message> element
- private QName wsdlMessage;
- // The optional <constructor-parameter-order> element
- private ArrayList constructorParameterOrder = new ArrayList();
-
- public ExceptionMapping(JavaWsdlMapping javaWsdlMapping)
- {
- this.javaWsdlMapping = javaWsdlMapping;
- }
-
- public JavaWsdlMapping getJavaWsdlMapping()
- {
- return javaWsdlMapping;
- }
-
- public String getExceptionType()
- {
- return exceptionType;
- }
-
- public void setExceptionType(String exceptionType)
- {
- this.exceptionType = exceptionType;
- }
-
- public QName getWsdlMessage()
- {
- return wsdlMessage;
- }
-
- public void setWsdlMessage(QName wsdlMessage)
- {
- this.wsdlMessage = wsdlMessage;
- }
-
- public String[] getConstructorParameterOrder()
- {
- String[] arr = new String[constructorParameterOrder.size()];
- constructorParameterOrder.toArray(arr);
- return arr;
- }
-
- public void addConstructorParameter(String elementName)
- {
- constructorParameterOrder.add(elementName);
- }
-
- public String serialize()
- {
- StringBuffer sb = new StringBuffer();
- sb.append("<exception-mapping>");
-
sb.append("<exception-type>").append(exceptionType).append("</exception-type>");
- sb.append("<wsdl-message
xmlns:exMsgNS='").append(wsdlMessage.getNamespaceURI()).append("'>");
-
sb.append("exMsgNS").append(":").append(wsdlMessage.getLocalPart());
- sb.append("</wsdl-message>");
-
- if (constructorParameterOrder.size() > 0)
- {
- sb.append("<constructor-parameter-order>");
- for (Iterator i = constructorParameterOrder.iterator(); i.hasNext();)
-
sb.append("<element-name>").append(i.next()).append("</element-name>");
- sb.append("</constructor-parameter-order>");
- }
- sb.append("</exception-mapping>");
- return sb.toString();
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ExceptionMapping.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ExceptionMapping.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaWsdlMapping.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaWsdlMapping.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaWsdlMapping.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,317 +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.jaxrpcmapping;
-
-// $Id$
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-
-/**
- * XML mapping of the java-wsdl-mapping root element in jaxrpc-mapping.xml
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 14-May-2004
- */
-public class JavaWsdlMapping implements Serializable
-{
- private static final long serialVersionUID = -142671631068024054L;
-
- // provide logging
- private static Logger log = Logger.getLogger(JavaWsdlMapping.class);
-
- // One or more <package-mapping> elements
- private List packageMappings = new ArrayList();
- // Zero or more <java-xml-type-mapping> elements
- private List javaXmlTypeMappings = new ArrayList();
- // Zero or more <exception-mapping> elements
- private List exceptionMappings = new ArrayList();
- // Zero or more <service-interface-mapping> elements
- private List serviceInterfaceMappings = new ArrayList();
- // Zero or more <service-endpoint-interface-mapping> elements
- private List serviceEndpointInterfaceMappings = new ArrayList();
-
- public PackageMapping[] getPackageMappings()
- {
- PackageMapping[] arr = new PackageMapping[packageMappings.size()];
- packageMappings.toArray(arr);
- return arr;
- }
-
- public JavaXmlTypeMapping[] getJavaXmlTypeMappings()
- {
- JavaXmlTypeMapping[] arr = new JavaXmlTypeMapping[javaXmlTypeMappings.size()];
- javaXmlTypeMappings.toArray(arr);
- return arr;
- }
-
- public ExceptionMapping[] getExceptionMappings()
- {
- ExceptionMapping[] arr = new ExceptionMapping[exceptionMappings.size()];
- exceptionMappings.toArray(arr);
- return arr;
- }
-
- public ServiceInterfaceMapping[] getServiceInterfaceMappings()
- {
- ServiceInterfaceMapping[] arr = new
ServiceInterfaceMapping[serviceInterfaceMappings.size()];
- serviceInterfaceMappings.toArray(arr);
- return arr;
- }
-
- public ServiceEndpointInterfaceMapping[] getServiceEndpointInterfaceMappings()
- {
- ServiceEndpointInterfaceMapping[] arr = new
ServiceEndpointInterfaceMapping[serviceEndpointInterfaceMappings.size()];
- serviceEndpointInterfaceMappings.toArray(arr);
- return arr;
- }
-
- // convenience methods
********************************************************************
-
- /** Get the package string for a given URI
- */
- public String getPackageNameForNamespaceURI(String nsURI)
- {
- String packageStr = null;
- for (int i = 0; packageStr == null && i < packageMappings.size(); i++)
- {
- PackageMapping mapping = (PackageMapping)packageMappings.get(i);
- if (mapping.getNamespaceURI().equals(nsURI))
- packageStr = mapping.getPackageType();
- }
- return packageStr;
- }
-
- /** Get the type mapping fo a given root-type-qname
- */
- public JavaXmlTypeMapping getTypeMappingForQName(QName xmlType)
- {
- JavaXmlTypeMapping typeMapping = null;
-
- if (xmlType != null)
- {
- // Check the <root-type-qname>
- Iterator it = javaXmlTypeMappings.iterator();
- while (typeMapping == null && it.hasNext())
- {
- JavaXmlTypeMapping mapping = (JavaXmlTypeMapping)it.next();
- if (xmlType.equals(mapping.getRootTypeQName()))
- typeMapping = mapping;
- }
-
- // Check the <anonymous-type-qname>
- it = javaXmlTypeMappings.iterator();
- while (typeMapping == null && it.hasNext())
- {
- JavaXmlTypeMapping mapping = (JavaXmlTypeMapping)it.next();
- QName anonymousQName = mapping.getAnonymousTypeQName();
- if (anonymousQName != null)
- {
- if (xmlType.getNamespaceURI().equals(anonymousQName.getNamespaceURI()))
- {
- String localPart = xmlType.getLocalPart();
- if (anonymousQName.getLocalPart().equals(localPart))
- typeMapping = mapping;
- if (anonymousQName.getLocalPart().equals(">" +
localPart))
- typeMapping = mapping;
- }
- }
- }
-
- if (typeMapping == null)
- log.warn("Cannot find jaxrpc-mapping for type: " + xmlType);
- }
-
- return typeMapping;
- }
-
- /** Get the exception mapping fo a given wsdl message
- */
- public ExceptionMapping getExceptionMappingForMessageQName(QName wsdlMessage)
- {
- ExceptionMapping exMapping = null;
-
- if (wsdlMessage != null)
- {
- Iterator it = exceptionMappings.iterator();
- while (it.hasNext())
- {
- ExceptionMapping mapping = (ExceptionMapping)it.next();
- if (wsdlMessage.equals(mapping.getWsdlMessage()))
- exMapping = mapping;
- }
- }
-
- return exMapping;
- }
-
- /** Get the exception mapping fo a given exception type
- */
- public ExceptionMapping getExceptionMappingForExceptionType(String javaType)
- {
- ExceptionMapping exMapping = null;
-
- if (javaType != null)
- {
- Iterator it = exceptionMappings.iterator();
- while (it.hasNext())
- {
- ExceptionMapping mapping = (ExceptionMapping)it.next();
- if (javaType.equals(mapping.getExceptionType()))
- exMapping = mapping;
- }
- }
-
- return exMapping;
- }
-
- /** Get the port type qname for a given service endpoint infterface
- */
- public QName getPortTypeQNameForServiceEndpointInterface(String seiName)
- {
- QName portTypeQName = null;
-
- ServiceEndpointInterfaceMapping[] seiMappings =
getServiceEndpointInterfaceMappings();
- for (int i = 0; i < seiMappings.length; i++)
- {
- ServiceEndpointInterfaceMapping aux = seiMappings[i];
- if (aux.getServiceEndpointInterface().equals(seiName))
- portTypeQName = aux.getWsdlPortType();
- }
-
- return portTypeQName;
- }
-
- /** Get the service endpoint infterfacemapping for a given port type qname
- */
- public ServiceEndpointInterfaceMapping
getServiceEndpointInterfaceMappingByPortType(QName portType)
- {
- ServiceEndpointInterfaceMapping seiMapping = null;
-
- ServiceEndpointInterfaceMapping[] seiMappings =
getServiceEndpointInterfaceMappings();
- for (int i = 0; seiMapping == null && i < seiMappings.length; i++)
- {
- ServiceEndpointInterfaceMapping aux = seiMappings[i];
- if (aux.getWsdlPortType().equals(portType))
- seiMapping = aux;
- }
-
- return seiMapping;
- }
-
- /** Get the service endpoint infterface mapping for a service endpoint infterface
- */
- public ServiceEndpointInterfaceMapping getServiceEndpointInterfaceMapping(String
seiName)
- {
- ServiceEndpointInterfaceMapping seiMapping = null;
-
- ServiceEndpointInterfaceMapping[] seiMappings =
getServiceEndpointInterfaceMappings();
- for (int i = 0; seiMapping == null && i < seiMappings.length; i++)
- {
- ServiceEndpointInterfaceMapping aux = seiMappings[i];
- if (aux.getServiceEndpointInterface().equals(seiName))
- seiMapping = aux;
- }
-
- return seiMapping;
- }
-
- /**
- * Serialize the model as a String (Should return the mapping file)
- *
- * @return
- */
- public String serialize()
- {
- StringBuffer sb = new StringBuffer();
- //Append Standard Namespace Header
- sb.append("<java-wsdl-mapping version='1.1'
").append("xmlns='http://java.sun.com/xml/ns/j2ee' ");
-
sb.append("xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance&...
");
-
sb.append("xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee ");
-
sb.append("http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_...;
-
- Iterator piter = packageMappings.iterator();
- while (piter != null && piter.hasNext())
- sb.append(((PackageMapping)piter.next()).serialize());
-
- Iterator jxiter = javaXmlTypeMappings.iterator();
- while (jxiter.hasNext())
- sb.append(((JavaXmlTypeMapping)jxiter.next()).serialize());
-
- for (Iterator i = exceptionMappings.iterator(); i.hasNext();)
- sb.append(((ExceptionMapping)i.next()).serialize());
-
- // A <service-interface-mapping> is followed by 1 or many
<service-endpoint-interface-mapping> elements
- int lenSIM = serviceInterfaceMappings.size();
- for (int i = 0; i < lenSIM; i++)
- {
- ServiceInterfaceMapping sim =
(ServiceInterfaceMapping)serviceInterfaceMappings.get(i);
- sb.append(sim.serialize());
- ServiceEndpointInterfaceMapping seim =
(ServiceEndpointInterfaceMapping)serviceEndpointInterfaceMappings.get(i);
- sb.append(seim.serialize());
- }
-
- int lenSEI = serviceEndpointInterfaceMappings.size();
- for (int i = lenSIM; i < lenSEI; i++)
- {
- ServiceEndpointInterfaceMapping seim =
(ServiceEndpointInterfaceMapping)serviceEndpointInterfaceMappings.get(i);
- sb.append(seim.serialize());
- }
-
- sb.append("</java-wsdl-mapping>");
-
- return sb.toString();
- }
-
- // factory methods
********************************************************************
-
- public void addPackageMapping(PackageMapping packageMapping)
- {
- packageMappings.add(packageMapping);
- }
-
- public void addJavaXmlTypeMappings(JavaXmlTypeMapping typeMapping)
- {
- javaXmlTypeMappings.add(typeMapping);
- }
-
- public void addExceptionMappings(ExceptionMapping exceptionMapping)
- {
- exceptionMappings.add(exceptionMapping);
- }
-
- public void addServiceInterfaceMappings(ServiceInterfaceMapping
serviceInterfaceMapping)
- {
- serviceInterfaceMappings.add(serviceInterfaceMapping);
- }
-
- public void addServiceEndpointInterfaceMappings(ServiceEndpointInterfaceMapping
serviceEndpointInterfaceMapping)
- {
- serviceEndpointInterfaceMappings.add(serviceEndpointInterfaceMapping);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaWsdlMapping.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaWsdlMapping.java)
Deleted:
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaWsdlMappingFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaWsdlMappingFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaWsdlMappingFactory.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,578 +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.jaxrpcmapping;
-
-// $Id$
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.xb.binding.JBossXBException;
-import org.jboss.xb.binding.ObjectModelFactory;
-import org.jboss.xb.binding.Unmarshaller;
-import org.jboss.xb.binding.UnmarshallerFactory;
-import org.jboss.xb.binding.UnmarshallingContext;
-import org.xml.sax.Attributes;
-
-/**
- * A JBossXB factory for {@link org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping}
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 14-May-2004
- */
-public class JavaWsdlMappingFactory implements ObjectModelFactory
-{
- // provide logging
- private static Logger log = Logger.getLogger(JavaWsdlMappingFactory.class);
-
- // Hide constructor
- private JavaWsdlMappingFactory()
- {
- }
-
- /**
- * Create a new instance of a jaxrpc-mapping factory
- */
- public static JavaWsdlMappingFactory newInstance()
- {
- return new JavaWsdlMappingFactory();
- }
-
- /**
- * Factory method for JavaWsdlMapping
- */
- public JavaWsdlMapping parse(URL jaxrpcMappingFile) throws IOException
- {
- if (jaxrpcMappingFile == null)
- {
- throw new IllegalArgumentException("URL cannot be null");
- }
-
- // setup the XML binding Unmarshaller
- Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
- InputStream is = jaxrpcMappingFile.openStream();
- try
- {
- JavaWsdlMapping javaWsdlMapping = (JavaWsdlMapping)unmarshaller.unmarshal(is,
this, null);
- return javaWsdlMapping;
- }
- catch (JBossXBException e)
- {
- IOException ioex = new IOException("Cannot parse: " +
jaxrpcMappingFile);
- Throwable cause = e.getCause();
- if (cause != null)
- ioex.initCause(cause);
- throw ioex;
- }
- finally
- {
- is.close();
- }
- }
-
- /**
- * This method is called on the factory by the object model builder when the parsing
starts.
- */
- public Object newRoot(Object root, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
- {
- return new JavaWsdlMapping();
- }
-
- public Object completeRoot(Object root, UnmarshallingContext ctx, String uri, String
name)
- {
- return root;
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(JavaWsdlMapping javaWsdlMapping, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("package-mapping".equals(localName))
- {
- return new PackageMapping(javaWsdlMapping);
- }
- if ("java-xml-type-mapping".equals(localName))
- {
- return new JavaXmlTypeMapping(javaWsdlMapping);
- }
- if ("exception-mapping".equals(localName))
- {
- return new ExceptionMapping(javaWsdlMapping);
- }
- if ("service-interface-mapping".equals(localName))
- {
- return new ServiceInterfaceMapping(javaWsdlMapping);
- }
- if ("service-endpoint-interface-mapping".equals(localName))
- {
- return new ServiceEndpointInterfaceMapping(javaWsdlMapping);
- }
- return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(JavaWsdlMapping javaWsdlMapping, PackageMapping packageMapping,
UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + javaWsdlMapping + ",child=" +
packageMapping + "]");
- javaWsdlMapping.addPackageMapping(packageMapping);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(JavaWsdlMapping javaWsdlMapping, JavaXmlTypeMapping typeMapping,
UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + javaWsdlMapping + ",child=" +
typeMapping + "]");
- javaWsdlMapping.addJavaXmlTypeMappings(typeMapping);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(JavaWsdlMapping javaWsdlMapping, ExceptionMapping
exceptionMapping, UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + javaWsdlMapping + ",child=" +
exceptionMapping + "]");
- javaWsdlMapping.addExceptionMappings(exceptionMapping);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(JavaWsdlMapping javaWsdlMapping, ServiceInterfaceMapping
siMapping, UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + javaWsdlMapping + ",child=" +
siMapping + "]");
- javaWsdlMapping.addServiceInterfaceMappings(siMapping);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(JavaWsdlMapping javaWsdlMapping, ServiceEndpointInterfaceMapping
seiMapping, UnmarshallingContext navigator, String namespaceURI,
- String localName)
- {
- log.trace("addChild: [obj=" + javaWsdlMapping + ",child=" +
seiMapping + "]");
- javaWsdlMapping.addServiceEndpointInterfaceMappings(seiMapping);
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(PackageMapping packageMapping, UnmarshallingContext navigator,
String namespaceURI, String localName, String value)
- {
- log.trace("setValue: [obj=" + packageMapping + ",localName=" +
localName + ",value=" + value + "]");
- if ("package-type".equals(localName))
- {
- packageMapping.setPackageType(value);
- }
- else if ("namespaceURI".equals(localName))
- {
- packageMapping.setNamespaceURI(value);
- }
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(JavaXmlTypeMapping typeMapping, UnmarshallingContext navigator,
String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("variable-mapping".equals(localName))
- {
- return new VariableMapping(typeMapping);
- }
- return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(JavaXmlTypeMapping typeMapping, VariableMapping variableMapping,
UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + typeMapping + ",child=" +
variableMapping + "]");
- typeMapping.addVariableMapping(variableMapping);
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(JavaXmlTypeMapping typeMapping, UnmarshallingContext navigator,
String namespaceURI, String localName, String value)
- {
- log.trace("setValue: [obj=" + typeMapping + ",localName=" +
localName + ",value=" + value + "]");
- if ("java-type".equals(localName))
- {
- typeMapping.setJavaType(value);
- }
- else if ("root-type-qname".equals(localName))
- {
- QName qname = navigator.resolveQName(value);
- typeMapping.setRootTypeQName(qname);
- }
- else if ("anonymous-type-qname".equals(localName))
- {
- QName qname = null;
- try
- {
- // <anonymous-type-qname
xmlns:typeNS="http://org.jboss.ws/anonymous/types">typeNS:>root</anonymous-type-qname>
- qname = navigator.resolveQName(value);
- }
- catch (Exception e)
- {
- // ignore unresolved qname
- }
-
- if (qname == null)
- {
- //
<
anonymous-type-qname>http://example.com/stockquote/schemas:>Get...
- int index = value.lastIndexOf(':');
- if (index > 0)
- {
- String nsURI = value.substring(0, index);
- String localPart = value.substring(index + 1);
- qname = new QName(nsURI, localPart);
- }
- }
-
- if (qname == null)
- throw new IllegalArgumentException("Invalid anonymous qname: " +
value);
-
- typeMapping.setAnonymousTypeQName(qname);
- }
- else if ("qname-scope".equals(localName))
- {
- typeMapping.setQNameScope(value);
- }
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(ExceptionMapping exceptionMapping, UnmarshallingContext
navigator, String namespaceURI, String localName, String value)
- {
- log.trace("setValue: [obj=" + exceptionMapping + ",localName="
+ localName + ",value=" + value + "]");
- if ("exception-type".equals(localName))
- {
- exceptionMapping.setExceptionType(value);
- }
- else if ("wsdl-message".equals(localName))
- {
- exceptionMapping.setWsdlMessage(navigator.resolveQName(value));
- }
- else if ("constructor-parameter-order".equals(localName))
- {
- exceptionMapping.addConstructorParameter(value);
- }
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(ServiceInterfaceMapping siMapping, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("port-mapping".equals(localName))
- {
- return new PortMapping(siMapping);
- }
- return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(ServiceInterfaceMapping siMapping, PortMapping portMapping,
UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + siMapping + ",child=" +
portMapping + "]");
- siMapping.addPortMapping(portMapping);
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(ServiceInterfaceMapping siMapping, UnmarshallingContext
navigator, String namespaceURI, String localName, String value)
- {
- log.trace("setValue: [obj=" + siMapping + ",localName=" +
localName + ",value=" + value + "]");
- if ("service-interface".equals(localName))
- {
- siMapping.setServiceInterface(value);
- }
- else if ("wsdl-service-name".equals(localName))
- {
- siMapping.setWsdlServiceName(navigator.resolveQName(value));
- }
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(ServiceEndpointInterfaceMapping seiMapping,
UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("service-endpoint-method-mapping".equals(localName))
- {
- return new ServiceEndpointMethodMapping(seiMapping);
- }
- return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(ServiceEndpointInterfaceMapping seiMapping,
ServiceEndpointMethodMapping seiMethodMapping, UnmarshallingContext navigator, String
namespaceURI,
- String localName)
- {
- log.trace("addChild: [obj=" + seiMapping + ",child=" +
seiMapping + "]");
- seiMapping.addServiceEndpointMethodMapping(seiMethodMapping);
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(ServiceEndpointInterfaceMapping seiMapping, UnmarshallingContext
navigator, String namespaceURI, String localName, String value)
- {
- log.trace("setValue: [obj=" + seiMapping + ",localName=" +
localName + ",value=" + value + "]");
- if ("service-endpoint-interface".equals(localName))
- {
- seiMapping.setServiceEndpointInterface(value);
- }
- else if ("wsdl-port-type".equals(localName))
- {
- seiMapping.setWsdlPortType(navigator.resolveQName(value));
- }
- else if ("wsdl-binding".equals(localName))
- {
- seiMapping.setWsdlBinding(navigator.resolveQName(value));
- }
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(VariableMapping variableMapping, UnmarshallingContext navigator,
String namespaceURI, String localName, String value)
- {
- log.trace("setValue: [obj=" + variableMapping + ",localName=" +
localName + ",value=" + value + "]");
- if ("java-variable-name".equals(localName))
- {
- variableMapping.setJavaVariableName(value);
- }
- else if ("data-member".equals(localName))
- {
- variableMapping.setDataMember(true);
- }
- else if ("xml-attribute-name".equals(localName))
- {
- variableMapping.setXmlAttributeName(value);
- }
- else if ("xml-element-name".equals(localName))
- {
- variableMapping.setXmlElementName(value);
- }
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(VariableMapping variableMapping, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("data-member".equals(localName))
- {
- variableMapping.setDataMember(true);
- }
- else if ("xml-wildcard".equals(localName))
- {
- variableMapping.setXmlWildcard(true);
- }
- return null;
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(PortMapping portMapping, UnmarshallingContext navigator, String
namespaceURI, String localName, String value)
- {
- log.trace("setValue: [obj=" + portMapping + ",localName=" +
localName + ",value=" + value + "]");
- if ("port-name".equals(localName))
- {
- portMapping.setPortName(value);
- }
- else if ("java-port-name".equals(localName))
- {
- portMapping.setJavaPortName(value);
- }
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(ServiceEndpointMethodMapping methodMapping,
UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("method-param-parts-mapping".equals(localName))
- {
- return new MethodParamPartsMapping(methodMapping);
- }
- if ("wsdl-return-value-mapping".equals(localName))
- {
- return new WsdlReturnValueMapping(methodMapping);
- }
- if ("wrapped-element".equals(localName))
- {
- methodMapping.setWrappedElement(true);
- }
- return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(ServiceEndpointMethodMapping methodMapping,
MethodParamPartsMapping partsMapping, UnmarshallingContext navigator, String
namespaceURI,
- String localName)
- {
- log.trace("addChild: [obj=" + methodMapping + ",child=" +
partsMapping + "]");
- methodMapping.addMethodParamPartsMapping(partsMapping);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(ServiceEndpointMethodMapping methodMapping,
WsdlReturnValueMapping returnValueMapping, UnmarshallingContext navigator, String
namespaceURI,
- String localName)
- {
- log.trace("addChild: [obj=" + methodMapping + ",child=" +
returnValueMapping + "]");
- methodMapping.setWsdlReturnValueMapping(returnValueMapping);
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(ServiceEndpointMethodMapping methodMapping, UnmarshallingContext
navigator, String namespaceURI, String localName, String value)
- {
- log.trace("setValue: [obj=" + methodMapping + ",localName=" +
localName + ",value=" + value + "]");
- if ("java-method-name".equals(localName))
- {
- methodMapping.setJavaMethodName(value);
- }
- else if ("wsdl-operation".equals(localName))
- {
- methodMapping.setWsdlOperation(value);
- }
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(MethodParamPartsMapping partsMapping, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("wsdl-message-mapping".equals(localName))
- {
- return new WsdlMessageMapping(partsMapping);
- }
- return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(MethodParamPartsMapping partsMapping, WsdlMessageMapping
msgMapping, UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + partsMapping + ",child=" +
msgMapping + "]");
- partsMapping.setWsdlMessageMapping(msgMapping);
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(MethodParamPartsMapping partsMapping, UnmarshallingContext
navigator, String namespaceURI, String localName, String value)
- {
- log.trace("setValue: [obj=" + partsMapping + ",localName=" +
localName + ",value=" + value + "]");
- if ("param-position".equals(localName))
- {
- partsMapping.setParamPosition(new Integer(value).intValue());
- }
- else if ("param-type".equals(localName))
- {
- partsMapping.setParamType(value);
- }
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(WsdlReturnValueMapping retValueMapping, UnmarshallingContext
navigator, String namespaceURI, String localName, String value)
- {
- log.trace("setValue: [obj=" + retValueMapping + ",localName=" +
localName + ",value=" + value + "]");
- if ("method-return-value".equals(localName))
- {
- retValueMapping.setMethodReturnValue(value);
- }
- else if ("wsdl-message".equals(localName))
- {
- retValueMapping.setWsdlMessage(navigator.resolveQName(value));
- }
- else if ("wsdl-message-part-name".equals(localName))
- {
- retValueMapping.setWsdlMessagePartName(value);
- }
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(WsdlMessageMapping msgMapping, UnmarshallingContext navigator,
String namespaceURI, String localName, String value)
- {
- log.trace("setValue: [obj=" + msgMapping + ",localName=" +
localName + ",value=" + value + "]");
- if ("wsdl-message".equals(localName))
- {
- msgMapping.setWsdlMessage(navigator.resolveQName(value));
- }
- else if ("wsdl-message-part-name".equals(localName))
- {
- msgMapping.setWsdlMessagePartName(value);
- }
- else if ("parameter-mode".equals(localName))
- {
- msgMapping.setParameterMode(value);
- }
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(WsdlMessageMapping msgMapping, UnmarshallingContext navigator,
String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("soap-header".equals(localName))
- {
- msgMapping.setSoapHeader(true);
- }
- return null;
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaWsdlMappingFactory.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaWsdlMappingFactory.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaXmlTypeMapping.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaXmlTypeMapping.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaXmlTypeMapping.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,158 +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.jaxrpcmapping;
-
-// $Id$
-
-import java.io.Serializable;
-import java.util.ArrayList;
-
-import javax.xml.namespace.QName;
-
-/**
- * XML mapping of the java-wsdl-mapping/java-xml-type-mapping element.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 14-May-2004
- */
-public class JavaXmlTypeMapping implements Serializable
-{
- private static final long serialVersionUID = -7671078579082015103L;
-
- // The parent <java-wsdl-mapping> element
- private JavaWsdlMapping javaWsdlMapping;
-
- /** The required <java-type> element
- * The java-type element is the fully qualified class name of a Java class.
- */
- private String javaType;
- // The choice <root-type-qname> element
- private QName rootTypeQName;
- // The choice <anonymous-type-qname> element
- private QName anonymousTypeQName;
-
- /** The required <qname-scope> element
- * The qname-scope elements scopes the reference of a QName to the WSDL element type
it applies to.
- * The value of qname-scope may be simpleType, complexType, or element
- */
- private String qnameScope;
-
- // Zero or more <variable-mapping> elements
- private ArrayList variableMappings = new ArrayList();
-
- public JavaXmlTypeMapping(JavaWsdlMapping javaWsdlMapping)
- {
- this.javaWsdlMapping = javaWsdlMapping;
- }
-
- public JavaWsdlMapping getJavaWsdlMapping()
- {
- return javaWsdlMapping;
- }
-
- public String getJavaType()
- {
- return javaType;
- }
-
- public void setJavaType(String javaType)
- {
- this.javaType = javaType;
- }
-
- public String getQnameScope()
- {
- return qnameScope;
- }
-
- public void setQNameScope(String qnameScope)
- {
- this.qnameScope = qnameScope;
- }
-
- public QName getRootTypeQName()
- {
- return rootTypeQName;
- }
-
- public void setRootTypeQName(QName rootTypeQName)
- {
- this.rootTypeQName = rootTypeQName;
- }
-
- public QName getAnonymousTypeQName()
- {
- return anonymousTypeQName;
- }
-
- public void setAnonymousTypeQName(QName anonymousTypeQName)
- {
- this.anonymousTypeQName = anonymousTypeQName;
- }
-
- public VariableMapping[] getVariableMappings()
- {
- VariableMapping[] arr = new VariableMapping[variableMappings.size()];
- variableMappings.toArray(arr);
- return arr;
- }
-
- public void addVariableMapping(VariableMapping variableMapping)
- {
- variableMappings.add(variableMapping);
- }
-
- public String toString()
- {
- return "[qname=" + rootTypeQName + ",javaType=" + javaType +
",scope=" + qnameScope + "]";
- }
-
- public String serialize()
- {
- StringBuffer sb = new StringBuffer();
- sb.append("<java-xml-type-mapping>");
-
sb.append("<java-type>").append(javaType).append("</java-type>");
-
- if (rootTypeQName != null)
- {
- sb.append("<root-type-qname
xmlns:typeNS='").append(rootTypeQName.getNamespaceURI()).append("'>");
-
sb.append(rootTypeQName.getPrefix()).append(":").append(rootTypeQName.getLocalPart());
- sb.append("</root-type-qname>");
- }
-
- if (anonymousTypeQName != null)
- {
- sb.append("<anonymous-type-qname
xmlns:typeNS='").append(anonymousTypeQName.getNamespaceURI()).append("'>");
-
sb.append(anonymousTypeQName.getPrefix()).append(":").append(anonymousTypeQName.getLocalPart());
- sb.append("</anonymous-type-qname>");
- }
-
-
sb.append("<qname-scope>").append(qnameScope).append("</qname-scope>");
-
- int len = variableMappings.size();
- for(int i = 0 ; i < len ; i ++)
- sb.append(((VariableMapping)variableMappings.get(i)).serialize());
-
- sb.append("</java-xml-type-mapping>");
- return sb.toString();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaXmlTypeMapping.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaXmlTypeMapping.java)
Deleted:
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/MethodParamPartsMapping.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/MethodParamPartsMapping.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/MethodParamPartsMapping.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,100 +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.jaxrpcmapping;
-
-import java.io.Serializable;
-
-// $Id$
-
-/**
- * XML mapping of the
java-wsdl-mapping/service-endpoint-interface-mapping/service-endpoint-method-mapping/method-param-parts-mapping
element.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 14-May-2004
- */
-public class MethodParamPartsMapping implements Serializable
-{
- private static final long serialVersionUID = -1351920471783503813L;
-
- // The parent <service-endpoint-method-mapping> element
- private ServiceEndpointMethodMapping serviceEndpointMethodMapping;
-
- // The required <param-position> element
- private int paramPosition;
- // The required <param-type> element
- private String paramType;
- // The required <wsdl-message-mapping> element
- private WsdlMessageMapping wsdlMessageMapping;
-
- public MethodParamPartsMapping(ServiceEndpointMethodMapping
serviceEndpointMethodMapping)
- {
- this.serviceEndpointMethodMapping = serviceEndpointMethodMapping;
- }
-
- public ServiceEndpointMethodMapping getServiceEndpointMethodMapping()
- {
- return serviceEndpointMethodMapping;
- }
-
- public int getParamPosition()
- {
- return paramPosition;
- }
-
- public void setParamPosition(int paramPosition)
- {
- this.paramPosition = paramPosition;
- }
-
- public String getParamType()
- {
- return paramType;
- }
-
- public void setParamType(String paramType)
- {
- this.paramType = paramType;
- }
-
- public WsdlMessageMapping getWsdlMessageMapping()
- {
- return wsdlMessageMapping;
- }
-
- public void setWsdlMessageMapping(WsdlMessageMapping wsdlMessageMapping)
- {
- this.wsdlMessageMapping = wsdlMessageMapping;
- }
-
- public String serialize()
- {
- StringBuffer sb = new StringBuffer();
-
sb.append("<method-param-parts-mapping><param-position>").append(paramPosition).append("</param-position>");
-
sb.append("<param-type>").append(paramType).append("</param-type>");
- if(wsdlMessageMapping == null)
- throw new IllegalStateException("wsdlMessageMapping is null");
- sb.append(wsdlMessageMapping.serialize());
-
- sb.append("</method-param-parts-mapping>");
- return sb.toString();
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/MethodParamPartsMapping.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/MethodParamPartsMapping.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/PackageMapping.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/PackageMapping.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/PackageMapping.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,88 +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.jaxrpcmapping;
-
-import java.io.Serializable;
-
-// $Id$
-
-/**
- * XML mapping of the java-wsdl-mapping/package-mapping element.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 14-May-2004
- */
-public class PackageMapping implements Serializable
-{
- private static final long serialVersionUID = 8105452343429986503L;
-
- // The parent <java-wsdl-mapping> element
- private JavaWsdlMapping javaWsdlMapping;
-
- // The required <package-type> element
- private String packageType;
- // The required <namespaceURI> element
- private String namespaceURI;
-
- public PackageMapping(JavaWsdlMapping javaWsdlMapping)
- {
- this.javaWsdlMapping = javaWsdlMapping;
- }
-
- public JavaWsdlMapping getJavaWsdlMapping()
- {
- return javaWsdlMapping;
- }
-
- public String getNamespaceURI()
- {
- return namespaceURI;
- }
-
- public void setNamespaceURI(String namespaceURI)
- {
- this.namespaceURI = namespaceURI;
- }
-
- public String getPackageType()
- {
- return packageType;
- }
-
- public void setPackageType(String packageType)
- {
- this.packageType = packageType;
- }
-
- public String toString()
- {
- return "[namespaceURI=" + namespaceURI + ",packageType=" +
packageType + "]";
- }
-
- public String serialize()
- {
- StringBuffer sb = new StringBuffer();
-
sb.append("<package-mapping>").append("<package-type>").append(packageType).append("</package-type>");
-
sb.append("<namespaceURI>").append(namespaceURI).append("</namespaceURI>").append("</package-mapping>");
- return sb.toString();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/PackageMapping.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/PackageMapping.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/PortMapping.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/PortMapping.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/PortMapping.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,84 +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.jaxrpcmapping;
-
-import java.io.Serializable;
-
-// $Id$
-
-/**
- * XML mapping of the java-wsdl-mapping/service-interface-mapping/port-mapping element.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 14-May-2004
- */
-public class PortMapping implements Serializable
-{
- private static final long serialVersionUID = 8229257516720800393L;
-
- // The parent <service-interface-mapping> element
- private ServiceInterfaceMapping serviceInterfaceMapping;
-
- // The required <port-name> element
- private String portName;
- // The required <java-port-name> element
- private String javaPortName;
-
- public PortMapping(ServiceInterfaceMapping serviceInterfaceMapping)
- {
- this.serviceInterfaceMapping = serviceInterfaceMapping;
- }
-
- public ServiceInterfaceMapping getServiceInterfaceMapping()
- {
- return serviceInterfaceMapping;
- }
-
- public String getJavaPortName()
- {
- return javaPortName;
- }
-
- public void setJavaPortName(String javaPortName)
- {
- this.javaPortName = javaPortName;
- }
-
- public String getPortName()
- {
- return portName;
- }
-
- public void setPortName(String portName)
- {
- this.portName = portName;
- }
-
- public String serialize()
- {
- StringBuffer sb = new StringBuffer();
-
sb.append("<port-mapping><port-name>").append(portName).append("</port-name><java-port-name>");
-
sb.append(javaPortName).append("</java-port-name></port-mapping>");
- return sb.toString();
- }
-}
-
Copied: trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/PortMapping.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/PortMapping.java)
Deleted:
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ServiceEndpointInterfaceMapping.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ServiceEndpointInterfaceMapping.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ServiceEndpointInterfaceMapping.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,140 +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.jaxrpcmapping;
-
-// $Id$
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-/**
- * XML mapping of the java-wsdl-mapping/service-endpoint-interface-mapping element.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 14-May-2004
- */
-public class ServiceEndpointInterfaceMapping implements Serializable
-{
- private static final long serialVersionUID = 3336973427288868587L;
-
- // The parent <java-wsdl-mapping> element
- private JavaWsdlMapping javaWsdlMapping;
-
- // The required <service-endpoint-interface> element
- private String serviceEndpointInterface;
- // The required <wsdl-port-type> element
- private QName wsdlPortType;
- // The required <wsdl-binding> element
- private QName wsdlBinding;
- // Zero or more <service-endpoint-method-mapping> elements
- private List serviceEndpointMethodMappings = new ArrayList();
-
- public ServiceEndpointInterfaceMapping(JavaWsdlMapping javaWsdlMapping)
- {
- this.javaWsdlMapping = javaWsdlMapping;
- }
-
- public JavaWsdlMapping getJavaWsdlMapping()
- {
- return javaWsdlMapping;
- }
-
- public String getServiceEndpointInterface()
- {
- return serviceEndpointInterface;
- }
-
- public void setServiceEndpointInterface(String serviceEndpointInterface)
- {
- this.serviceEndpointInterface = serviceEndpointInterface;
- }
-
- public QName getWsdlPortType()
- {
- return wsdlPortType;
- }
-
- public void setWsdlPortType(QName wsdlPortType)
- {
- this.wsdlPortType = wsdlPortType;
- }
-
- public QName getWsdlBinding()
- {
- return wsdlBinding;
- }
-
- public void setWsdlBinding(QName wsdlBinding)
- {
- this.wsdlBinding = wsdlBinding;
- }
-
- public ServiceEndpointMethodMapping[] getServiceEndpointMethodMappings()
- {
- ServiceEndpointMethodMapping[] arr = new
ServiceEndpointMethodMapping[serviceEndpointMethodMappings.size()];
- serviceEndpointMethodMappings.toArray(arr);
- return arr;
- }
-
- public void addServiceEndpointMethodMapping(ServiceEndpointMethodMapping
serviceEndpointMethodMapping)
- {
- serviceEndpointMethodMappings.add(serviceEndpointMethodMapping);
- }
-
- public ServiceEndpointMethodMapping
getServiceEndpointMethodMappingByWsdlOperation(String wsdlOperation)
- {
- ServiceEndpointMethodMapping semMapping = null;
-
- Iterator it = serviceEndpointMethodMappings.iterator();
- while (it.hasNext())
- {
- ServiceEndpointMethodMapping aux = (ServiceEndpointMethodMapping)it.next();
- if (aux.getWsdlOperation().equals(wsdlOperation))
- semMapping = aux;
- }
- return semMapping;
- }
-
- public String serialize()
- {
- StringBuffer sb = new StringBuffer();
-
sb.append("<service-endpoint-interface-mapping><service-endpoint-interface>");
-
sb.append(this.serviceEndpointInterface).append("</service-endpoint-interface>");
- sb.append("<wsdl-port-type
xmlns:").append(wsdlPortType.getPrefix()).append("='");
-
sb.append(wsdlPortType.getNamespaceURI()).append("'>").append(wsdlPortType.getPrefix());
-
sb.append(":").append(wsdlPortType.getLocalPart()).append("</wsdl-port-type>");
-
- sb.append("<wsdl-binding
xmlns:").append(wsdlBinding.getPrefix()).append("='");
-
sb.append(wsdlBinding.getNamespaceURI()).append("'>").append(wsdlBinding.getPrefix());
-
sb.append(":").append(wsdlBinding.getLocalPart()).append("</wsdl-binding>");
-
- Iterator iter = serviceEndpointMethodMappings.iterator();
- while(iter != null && iter.hasNext())
- sb.append(((ServiceEndpointMethodMapping)iter.next()).serialize());
- sb.append("</service-endpoint-interface-mapping>");
- return sb.toString();
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ServiceEndpointInterfaceMapping.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ServiceEndpointInterfaceMapping.java)
Deleted:
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ServiceEndpointMethodMapping.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ServiceEndpointMethodMapping.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ServiceEndpointMethodMapping.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,156 +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.jaxrpcmapping;
-
-// $Id$
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * XML mapping of the
java-wsdl-mapping/service-endpoint-interface-mapping/service-endpoint-method-mapping
element.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 14-May-2004
- */
-public class ServiceEndpointMethodMapping implements Serializable
-{
- private static final long serialVersionUID = 7857267872017006227L;
-
- // The parent <service-endpoint-interface-mapping> element
- private ServiceEndpointInterfaceMapping serviceEndpointInterfaceMapping;
-
- // The required <java-method-name> element
- private String javaMethodName;
- // The required <wsdl-operation> element
- private String wsdlOperation;
- // The optional <wrapped-element> element
- private boolean wrappedElement;
- // Zero or more <method-param-parts-mapping> elements
- private List methodParamPartsMappings = new ArrayList();
- // The optional <wsdl-return-value-mapping> element
- private WsdlReturnValueMapping wsdlReturnValueMapping;
-
- public ServiceEndpointMethodMapping(ServiceEndpointInterfaceMapping
serviceEndpointInterfaceMapping)
- {
- this.serviceEndpointInterfaceMapping = serviceEndpointInterfaceMapping;
- }
-
- public ServiceEndpointInterfaceMapping getServiceEndpointInterfaceMapping()
- {
- return serviceEndpointInterfaceMapping;
- }
-
- public String getJavaMethodName()
- {
- return javaMethodName;
- }
-
- public void setJavaMethodName(String javaMethodName)
- {
- this.javaMethodName = javaMethodName;
- }
-
- public MethodParamPartsMapping[] getMethodParamPartsMappings()
- {
- MethodParamPartsMapping[] arr = new
MethodParamPartsMapping[methodParamPartsMappings.size()];
- methodParamPartsMappings.toArray(arr);
- return arr;
- }
-
- public MethodParamPartsMapping getMethodParamPartsMappingByPartName(String partName)
- {
- MethodParamPartsMapping paramMapping = null;
- for (int i = 0; paramMapping == null && i <
methodParamPartsMappings.size(); i++)
- {
- MethodParamPartsMapping aux =
(MethodParamPartsMapping)methodParamPartsMappings.get(i);
- if (aux.getWsdlMessageMapping().getWsdlMessagePartName().equals(partName))
- paramMapping = aux;
- }
- return paramMapping;
- }
-
- public MethodParamPartsMapping getMethodParamPartsMappingByPosition(int pos)
- {
- MethodParamPartsMapping paramMapping = null;
- for (int i = 0; paramMapping == null && i <
methodParamPartsMappings.size(); i++)
- {
- MethodParamPartsMapping aux =
(MethodParamPartsMapping)methodParamPartsMappings.get(i);
- if (aux.getParamPosition() == pos)
- paramMapping = aux;
- }
- return paramMapping;
- }
-
- public void addMethodParamPartsMapping(MethodParamPartsMapping
methodParamPartsMapping)
- {
- methodParamPartsMappings.add(methodParamPartsMapping);
- }
-
- public boolean isWrappedElement()
- {
- return wrappedElement;
- }
-
- public void setWrappedElement(boolean wrappedElement)
- {
- this.wrappedElement = wrappedElement;
- }
-
- public String getWsdlOperation()
- {
- return wsdlOperation;
- }
-
- public void setWsdlOperation(String wsdlOperation)
- {
- this.wsdlOperation = wsdlOperation;
- }
-
- public WsdlReturnValueMapping getWsdlReturnValueMapping()
- {
- return wsdlReturnValueMapping;
- }
-
- public void setWsdlReturnValueMapping(WsdlReturnValueMapping wsdlReturnValueMapping)
- {
- this.wsdlReturnValueMapping = wsdlReturnValueMapping;
- }
-
- public String serialize()
- {
- StringBuffer sb = new StringBuffer();
-
sb.append("<service-endpoint-method-mapping><java-method-name>").append(javaMethodName).append("</java-method-name>");
-
sb.append("<wsdl-operation>").append(wsdlOperation).append("</wsdl-operation>");
- if (wrappedElement)
- sb.append("<wrapped-element/>");
- Iterator iter = methodParamPartsMappings.iterator();
- while (iter != null && iter.hasNext())
- sb.append(((MethodParamPartsMapping)iter.next()).serialize());
- if (wsdlReturnValueMapping != null)
- sb.append(wsdlReturnValueMapping.serialize());
- sb.append("</service-endpoint-method-mapping>");
- return sb.toString();
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ServiceEndpointMethodMapping.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ServiceEndpointMethodMapping.java)
Deleted:
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ServiceInterfaceMapping.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ServiceInterfaceMapping.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ServiceInterfaceMapping.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,111 +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.jaxrpcmapping;
-
-// $Id$
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-/**
- * XML mapping of the java-wsdl-mapping/service-interface-mapping element.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 14-May-2004
- */
-public class ServiceInterfaceMapping implements Serializable
-{
- private static final long serialVersionUID = -447051823681281236L;
-
- // The parent <java-wsdl-mapping> element
- private JavaWsdlMapping javaWsdlMapping;
-
- // The required <service-interface> element
- private String serviceInterface;
- // The required <wsdl-service-name> element
- private QName wsdlServiceName;
- // Zero or more <port-mapping> elements
- private List portMappings = new ArrayList();
-
- public ServiceInterfaceMapping(JavaWsdlMapping javaWsdlMapping)
- {
- this.javaWsdlMapping = javaWsdlMapping;
- }
-
- public JavaWsdlMapping getJavaWsdlMapping()
- {
- return javaWsdlMapping;
- }
-
- public String getServiceInterface()
- {
- return serviceInterface;
- }
-
- public void setServiceInterface(String serviceInterface)
- {
- this.serviceInterface = serviceInterface;
- }
-
- public QName getWsdlServiceName()
- {
- return wsdlServiceName;
- }
-
- public void setWsdlServiceName(QName wsdlServiceName)
- {
- this.wsdlServiceName = wsdlServiceName;
- }
-
- public PortMapping[] getPortMappings()
- {
- PortMapping[] arr = new PortMapping[portMappings.size()];
- portMappings.toArray(arr);
- return arr;
- }
-
- public void addPortMapping(PortMapping portMapping)
- {
- portMappings.add(portMapping);
- }
-
- public String serialize()
- {
- StringBuffer sb = new StringBuffer();
- sb.append("<service-interface-mapping>");
-
sb.append("<service-interface>").append(serviceInterface).append("</service-interface>");
- sb.append("<wsdl-service-name
xmlns:").append(wsdlServiceName.getPrefix()).append("='");
- sb.append(wsdlServiceName.getNamespaceURI()).append("'>");
-
sb.append(wsdlServiceName.getPrefix()).append(":").append(wsdlServiceName.getLocalPart());
- sb.append("</wsdl-service-name>");
-
- Iterator iter = portMappings.iterator();
- while(iter != null && iter.hasNext())
- sb.append(((PortMapping)iter.next()).serialize());
- sb.append("</service-interface-mapping>");
- return sb.toString();
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ServiceInterfaceMapping.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ServiceInterfaceMapping.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/VariableMapping.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/VariableMapping.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/VariableMapping.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,134 +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.jaxrpcmapping;
-
-import java.io.Serializable;
-
-// $Id$
-
-/**
- * XML mapping of the java-wsdl-mapping/java-xml-type-mapping/varaible-mapping element.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 14-May-2004
- */
-public class VariableMapping implements Serializable
-{
- private static final long serialVersionUID = 4168728468137337167L;
-
- // The parent <java-wsdl-mapping> element
- private JavaXmlTypeMapping typeMapping;
-
- // The required <java-variable-name> element
- private String javaVariableName;
- // The optional <data-member> element
- private boolean dataMember;
- // The choice [<xml-attribute-name> | <xml-element-name> |
<xml-wildcard>]
- private String xmlAttributeName;
- private String xmlElementName;
- private boolean xmlWildcard;
-
- public VariableMapping(JavaXmlTypeMapping typeMapping)
- {
- this.typeMapping = typeMapping;
- }
-
- public JavaXmlTypeMapping getTypeMapping()
- {
- return typeMapping;
- }
-
- public boolean isDataMember()
- {
- return dataMember;
- }
-
- public void setDataMember(boolean dataMember)
- {
- this.dataMember = dataMember;
- }
-
- public String getJavaVariableName()
- {
- return javaVariableName;
- }
-
- public void setJavaVariableName(String javaVariableName)
- {
- this.javaVariableName = javaVariableName;
- }
-
- public String getXmlAttributeName()
- {
- return xmlAttributeName;
- }
-
- public void setXmlAttributeName(String xmlAttributeName)
- {
- this.xmlAttributeName = xmlAttributeName;
- }
-
- public String getXmlElementName()
- {
- return xmlElementName;
- }
-
- public void setXmlElementName(String xmlElementName)
- {
- this.xmlElementName = xmlElementName;
- }
-
- public boolean getXmlWildcard()
- {
- return xmlWildcard;
- }
-
- public void setXmlWildcard(boolean xmlWildcard)
- {
- this.xmlWildcard = xmlWildcard;
- }
-
- public String serialize()
- {
- StringBuffer sb = new StringBuffer();
- sb.append("<variable-mapping>");
-
sb.append("<java-variable-name>").append(javaVariableName).append("</java-variable-name>");
- if(dataMember)
- {
- sb.append("<data-member/>");
- }
- if (xmlElementName != null)
- {
-
sb.append("<xml-element-name>").append(xmlElementName).append("</xml-element-name>");
- }
- else if (xmlAttributeName != null)
- {
-
sb.append("<xml-attribute-name>").append(xmlAttributeName).append("</xml-attribute-name>");
- }
- else if (xmlWildcard)
- {
- sb.append("<xml-wildcard/>");
- }
- sb.append("</variable-mapping>");
- return sb.toString();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/VariableMapping.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/VariableMapping.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/WsdlMessageMapping.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/WsdlMessageMapping.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/WsdlMessageMapping.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,116 +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.jaxrpcmapping;
-
-import java.io.Serializable;
-
-import javax.xml.namespace.QName;
-
-// $Id$
-
-/**
- * Created by IntelliJ IDEA.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 14-May-2004
- */
-public class WsdlMessageMapping implements Serializable
-{
- private static final long serialVersionUID = -3212852147033081838L;
-
- // The parent <method-param-parts-mapping> element
- private MethodParamPartsMapping methodParamPartsMapping;
- // The required <wsdl-message> element
- private QName wsdlMessage;
- // The required <wsdl-message-part-name> element
- private String wsdlMessagePartName;
- // The required <parameter-mode> element
- private String parameterMode;
- // The optional <soap-header> element
- private boolean soapHeader;
-
- public WsdlMessageMapping(MethodParamPartsMapping methodParamPartsMapping)
- {
- this.methodParamPartsMapping = methodParamPartsMapping;
- }
-
- public MethodParamPartsMapping getMethodParamPartsMapping()
- {
- return methodParamPartsMapping;
- }
-
- public String getParameterMode()
- {
- return parameterMode;
- }
-
- public void setParameterMode(String parameterMode)
- {
- if ("IN".equals(parameterMode) == false &&
"OUT".equals(parameterMode) == false &&
"INOUT".equals(parameterMode) == false)
- throw new IllegalArgumentException("Invalid parameter mode: " +
parameterMode);
- this.parameterMode = parameterMode;
- }
-
- public boolean isSoapHeader()
- {
- return soapHeader;
- }
-
- public void setSoapHeader(boolean soapHeader)
- {
- this.soapHeader = soapHeader;
- }
-
- public QName getWsdlMessage()
- {
- return wsdlMessage;
- }
-
- public void setWsdlMessage(QName wsdlMessage)
- {
- this.wsdlMessage = wsdlMessage;
- }
-
- public String getWsdlMessagePartName()
- {
- return wsdlMessagePartName;
- }
-
- public void setWsdlMessagePartName(String wsdlMessagePartName)
- {
- this.wsdlMessagePartName = wsdlMessagePartName;
- }
-
- public String serialize()
- {
- StringBuffer sb = new StringBuffer();
- sb.append(" <wsdl-message-mapping> <wsdl-message xmlns:");
-
sb.append(wsdlMessage.getPrefix()).append("='").append(wsdlMessage.getNamespaceURI()).append("'>");
-
sb.append(wsdlMessage.getPrefix()).append(":").append(wsdlMessage.getLocalPart()).append("</wsdl-message>");
-
sb.append("<wsdl-message-part-name>").append(wsdlMessagePartName).append("</wsdl-message-part-name>");
-
sb.append("<parameter-mode>").append(parameterMode).append("</parameter-mode>");
- if (soapHeader)
- sb.append("<soap-header/>");
- sb.append("</wsdl-message-mapping>");
- return sb.toString();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/WsdlMessageMapping.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/WsdlMessageMapping.java)
Deleted:
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/WsdlReturnValueMapping.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/WsdlReturnValueMapping.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/WsdlReturnValueMapping.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,101 +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.jaxrpcmapping;
-
-// $Id$
-
-import java.io.Serializable;
-
-import javax.xml.namespace.QName;
-
-/**
- * XML mapping of the
java-wsdl-mapping/service-endpoint-interface-mapping/service-endpoint-method-mapping/wsdl-return-value-mapping
element.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 14-May-2004
- */
-public class WsdlReturnValueMapping implements Serializable
-{
- private static final long serialVersionUID = -6910106650463959774L;
-
- // The parent <service-endpoint-method-mapping> element
- private ServiceEndpointMethodMapping serviceEndpointMethodMapping;
-
- // The required <method-return-value> element
- private String methodReturnValue;
- // The required <wsdl-message> element
- private QName wsdlMessage;
- // The optional <wsdl-message> element
- private String wsdlMessagePartName;
-
- public WsdlReturnValueMapping(ServiceEndpointMethodMapping
serviceEndpointMethodMapping)
- {
- this.serviceEndpointMethodMapping = serviceEndpointMethodMapping;
- }
-
- public ServiceEndpointMethodMapping getServiceEndpointMethodMapping()
- {
- return serviceEndpointMethodMapping;
- }
-
- public String getMethodReturnValue()
- {
- return methodReturnValue;
- }
-
- public void setMethodReturnValue(String methodReturnValue)
- {
- this.methodReturnValue = methodReturnValue;
- }
-
- public QName getWsdlMessage()
- {
- return wsdlMessage;
- }
-
- public void setWsdlMessage(QName wsdlMessage)
- {
- this.wsdlMessage = wsdlMessage;
- }
-
- public String getWsdlMessagePartName()
- {
- return wsdlMessagePartName;
- }
-
- public void setWsdlMessagePartName(String wsdlMessagePartName)
- {
- this.wsdlMessagePartName = wsdlMessagePartName;
- }
-
- public String serialize()
- {
- StringBuffer sb = new StringBuffer();
-
sb.append("<wsdl-return-value-mapping><method-return-value>").append(methodReturnValue).append("</method-return-value>");
- sb.append("<wsdl-message
xmlns:").append(wsdlMessage.getPrefix()).append("='").append(wsdlMessage.getNamespaceURI());
-
sb.append("'>").append(wsdlMessage.getPrefix()).append(":").append(wsdlMessage.getLocalPart()).append("</wsdl-message>");
-
sb.append("<wsdl-message-part-name>").append(wsdlMessagePartName).append("</wsdl-message-part-name>");
- sb.append("</wsdl-return-value-mapping>");
-
- return sb.toString();
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/WsdlReturnValueMapping.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/WsdlReturnValueMapping.java)
Copied: trunk/src/main/java/org/jboss/ws/metadata/jsr181 (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr181)
Deleted: 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-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/jsr181/HandlerChainFactory.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,164 +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.jsr181;
-
-// $Id$
-
-import org.jboss.logging.Logger;
-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;
-
-/**
- * A JBossXB factory for jsr181 the HandlerChain annotation
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 15-Oct-2005
- */
-public class HandlerChainFactory implements ObjectModelFactory
-{
- // provide logging
- private static final Logger log = Logger.getLogger(HandlerChainFactory.class);
-
- public HandlerChainFactory()
- {
- }
-
- /**
- * This method is called on the factory by the object model builder when the parsing
starts.
- *
- * @return the root of the object model.
- */
- public Object newRoot(Object root, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
- {
- HandlerChainsMetaData handlerConfigMetaData = new
HandlerChainsMetaData(HandlerType.ENDPOINT);
- return handlerConfigMetaData;
- }
-
- public Object completeRoot(Object root, UnmarshallingContext ctx, String uri, String
name)
- {
- return root;
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(HandlerChainsMetaData handlerConfig, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
- {
- if ("handler-chain".equals(localName))
- return new HandlerChainMetaData(handlerConfig);
- else
- return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(HandlerChainsMetaData handlerConfig, HandlerChainMetaData
handlerChain, UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- handlerConfig.addHandlerChain(handlerChain);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(HandlerChainMetaData chainConfig, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
- {
- if ("handler".equals(localName))
- return new UnifiedHandlerMetaData(chainConfig);
- else
- return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(HandlerChainMetaData handlerConfig, UnifiedHandlerMetaData
handler, UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- handlerConfig.addHandler(handler);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(UnifiedHandlerMetaData handler, UnmarshallingContext navigator,
String namespaceURI, String localName, Attributes attrs)
- {
- if ("init-param".equals(localName))
- return new HandlerInitParam();
- else return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(UnifiedHandlerMetaData handler, HandlerInitParam param,
UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- handler.addInitParam(param);
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(HandlerChainMetaData handlerChain, UnmarshallingContext
navigator, String namespaceURI, String localName, String value)
- {
- if (log.isTraceEnabled())
- log.trace("HandlerChainMetaData setValue: nuri=" + namespaceURI +
" localName=" + localName + " value=" + value);
-
- if (localName.equals("protocol-bindings"))
- handlerChain.setProtocolBindings(value);
- else if (localName.equals("service-name-pattern"))
- handlerChain.setServiceNamePattern(navigator.resolveQName(value));
- else if (localName.equals("port-name-pattern"))
- handlerChain.setPortNamePattern(navigator.resolveQName(value));
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(UnifiedHandlerMetaData handler, UnmarshallingContext navigator,
String namespaceURI, String localName, String value)
- {
- if (log.isTraceEnabled())
- log.trace("UnifiedHandlerMetaData setValue: nuri=" + namespaceURI +
" localName=" + localName + " value=" + value);
-
- if (localName.equals("handler-name"))
- handler.setHandlerName(value);
- else if (localName.equals("handler-class"))
- handler.setHandlerClass(value);
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(HandlerInitParam param, UnmarshallingContext navigator, String
namespaceURI, String localName, String value)
- {
- if (log.isTraceEnabled())
- log.trace("UnifiedInitParamMetaData setValue: nuri=" + namespaceURI +
" localName=" + localName + " value=" + value);
-
- if (localName.equals("param-name"))
- param.setParamName(value);
- else if (localName.equals("param-value"))
- param.setParamValue(value);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/jsr181/HandlerChainFactory.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr181/HandlerChainFactory.java)
Deleted: 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-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/jsr181/HandlerChainMetaData.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,103 +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.jsr181;
-
-// $Id$
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
-
-/**
- * XML Binding element for handler-config/handler-chain elements
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 15-Oct-2005
- */
-public class HandlerChainMetaData
-{
- // provide logging
- private static final Logger log = Logger.getLogger(HandlerChainMetaData.class);
-
- // The parent element
- private HandlerChainsMetaData handlerChainsMetaData;
-
- private String protocolBindings;
- private QName serviceNamePattern;
- private QName portNamePattern;
- private ArrayList<UnifiedHandlerMetaData> handlers = new
ArrayList<UnifiedHandlerMetaData>();
-
- public HandlerChainMetaData(HandlerChainsMetaData handlerConfig)
- {
- this.handlerChainsMetaData = handlerConfig;
- }
-
- public HandlerChainsMetaData getHandlerChainsMetaData()
- {
- return handlerChainsMetaData;
- }
-
- public void addHandler(UnifiedHandlerMetaData handlerMetaData)
- {
- handlers.add(handlerMetaData);
- }
-
- public List<UnifiedHandlerMetaData> getHandlers()
- {
- return handlers;
- }
-
- 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;
- }
-
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/jsr181/HandlerChainMetaData.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr181/HandlerChainMetaData.java)
Deleted: 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-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/jsr181/HandlerChainsMetaData.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,66 +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.
-*/
-// $Id$
-package org.jboss.ws.metadata.jsr181;
-
-//$Id$
-
-import java.util.ArrayList;
-
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-
-/**
- * XML Binding root element for JSR-181 HandlerChain
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 15-Oct-2005
- */
-public class HandlerChainsMetaData
-{
- // The required handler type
- private HandlerType handlerType;
- // The required <handler-chain> elements
- private ArrayList<HandlerChainMetaData> handlerChains = new
ArrayList<HandlerChainMetaData>();
-
- public HandlerChainsMetaData(HandlerType handlerType)
- {
- this.handlerType = handlerType;
- }
-
- public HandlerType getHandlerType()
- {
- return handlerType;
- }
-
-
- public void addHandlerChain(HandlerChainMetaData handlerChain)
- {
- handlerChains.add(handlerChain);
- }
-
- public HandlerChainMetaData[] getHandlerChains()
- {
- HandlerChainMetaData[] array = new HandlerChainMetaData[handlerChains.size()];
- handlerChains.toArray(array);
- return array;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/jsr181/HandlerChainsMetaData.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr181/HandlerChainsMetaData.java)
Copied: trunk/src/main/java/org/jboss/ws/metadata/umdm (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,170 +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.umdm;
-
-// $Id$
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-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.WSConfigRootJAXRPC;
-import org.jboss.ws.metadata.config.jaxws.WSConfigRootJAXWS;
-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: trunk/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,590 +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.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.jaxrpc.Style;
-import org.jboss.ws.core.jaxrpc.TypeMappingImpl;
-import org.jboss.ws.core.jaxrpc.Use;
-import org.jboss.ws.core.jaxrpc.binding.JBossXBDeserializerFactory;
-import org.jboss.ws.core.jaxrpc.binding.JBossXBSerializerFactory;
-import org.jboss.ws.core.jaxrpc.binding.SOAPArrayDeserializerFactory;
-import org.jboss.ws.core.jaxrpc.binding.SOAPArraySerializerFactory;
-import org.jboss.ws.core.jaxws.JAXBDeserializerFactory;
-import org.jboss.ws.core.jaxws.JAXBSerializerFactory;
-import org.jboss.ws.core.utils.JavaUtils;
-import org.jboss.ws.metadata.config.WSCommonConfig;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-
-/**
- * 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>();
-
- // JAX-WS default is false
- private boolean mtomEnabled = false;
-
- 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 = Constants.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 (!Constants.SOAP11HTTP_BINDING.equals(bindingId) &&
!Constants.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 boolean isMtomEnabled() {
- return mtomEnabled;
- }
-
- public void setMtomEnabled(boolean mtomEnabled) {
- this.mtomEnabled = mtomEnabled;
- }
-
- 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: trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/umdm/ExtensibleMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/ExtensibleMetaData.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/ExtensibleMetaData.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,29 +0,0 @@
-package org.jboss.ws.metadata.umdm;
-
-import java.util.HashMap;
-import java.util.Map;
-
-
-/**
- * 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: trunk/src/main/java/org/jboss/ws/metadata/umdm/ExtensibleMetaData.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/ExtensibleMetaData.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/umdm/FaultMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/FaultMetaData.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/FaultMetaData.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -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.umdm;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.jaxws.DynamicWrapperGenerator;
-import org.jboss.ws.core.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: trunk/src/main/java/org/jboss/ws/metadata/umdm/FaultMetaData.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/FaultMetaData.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaData.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaData.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -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.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.extensions.security.jaxrpc.WSSecurityHandlerInbound.class.getName());
-
securityHandlers.add(org.jboss.ws.extensions.security.jaxrpc.WSSecurityHandlerOutbound.class.getName());
-
securityHandlers.add(org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerInbound.class.getName());
-
securityHandlers.add(org.jboss.ws.extensions.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: trunk/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaData.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaData.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXRPC.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXRPC.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXRPC.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,82 +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.umdm;
-
-//$Id:HandlerMetaDataJAXRPC.java 915 2006-09-08 08:40:45Z thomas.diesler(a)jboss.com $
-
-import java.util.HashSet;
-import java.util.Set;
-
-
-/**
- * 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: trunk/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXRPC.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXRPC.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXWS.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXWS.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXWS.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,94 +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.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: trunk/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXWS.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXWS.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/umdm/MetaDataExtension.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/MetaDataExtension.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/MetaDataExtension.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -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.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: trunk/src/main/java/org/jboss/ws/metadata/umdm/MetaDataExtension.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/MetaDataExtension.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/umdm/OperationMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/OperationMetaData.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/OperationMetaData.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -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.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.core.jaxrpc.Style;
-import org.jboss.ws.core.jaxrpc.Use;
-import org.jboss.ws.core.utils.JavaUtils;
-import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
-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: trunk/src/main/java/org/jboss/ws/metadata/umdm/OperationMetaData.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/OperationMetaData.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/umdm/ParameterMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/ParameterMetaData.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/ParameterMetaData.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,476 +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.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.core.jaxrpc.ParameterWrapping;
-import org.jboss.ws.core.jaxws.DynamicWrapperGenerator;
-import org.jboss.ws.core.utils.HolderUtils;
-import org.jboss.ws.core.utils.JavaUtils;
-import org.jboss.ws.extensions.xop.jaxws.ReflectiveXOPScanner;
-import org.jboss.ws.metadata.acessor.ReflectiveMethodAccessor;
-import org.jboss.ws.metadata.umdm.WrappedParameter.AccessorFactory;
-
-/**
- * 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;
- }
- }
-
- 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);
-
- // check if the JavaType is an mtom parameter
- // TODO: this should only apply to JAX-WS and needs to happen outside UMD
- ReflectiveXOPScanner scanner = new ReflectiveXOPScanner();
- String mimeType = scanner.scan(javaType);
- if(mimeType!=null)
- {
- log.debug("MTOM parameter found: " + xmlName);
- setXOP(true);
- }
- }
-
-
- 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: trunk/src/main/java/org/jboss/ws/metadata/umdm/ParameterMetaData.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/ParameterMetaData.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -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.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.core.server.ServiceEndpoint;
-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;
-
-/**
- * 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: trunk/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -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.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.core.jaxrpc.TypeMappingImpl;
-import org.jboss.ws.core.jaxrpc.TypeMappingRegistryImpl;
-import org.jboss.ws.core.jaxrpc.Use;
-import org.jboss.ws.core.jaxrpc.binding.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.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.ws.tools.wsdl.WSDLDefinitionsFactory;
-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: trunk/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/umdm/TypeMappingMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/TypeMappingMetaData.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/TypeMappingMetaData.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,110 +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.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: trunk/src/main/java/org/jboss/ws/metadata/umdm/TypeMappingMetaData.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/TypeMappingMetaData.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/umdm/TypesMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/TypesMetaData.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/TypesMetaData.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -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.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.core.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: trunk/src/main/java/org/jboss/ws/metadata/umdm/TypesMetaData.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/TypesMetaData.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/umdm/UnifiedMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/UnifiedMetaData.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/UnifiedMetaData.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -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.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.core.server.ServiceEndpointManager;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-
-/**
- * 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: trunk/src/main/java/org/jboss/ws/metadata/umdm/UnifiedMetaData.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/UnifiedMetaData.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/umdm/WrappedParameter.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/WrappedParameter.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/WrappedParameter.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -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.umdm;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.ws.core.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
Copied: trunk/src/main/java/org/jboss/ws/metadata/umdm/WrappedParameter.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/WrappedParameter.java)
Copied: trunk/src/main/java/org/jboss/ws/metadata/webservices (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/webservices)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/webservices/PortComponentMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/webservices/PortComponentMetaData.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/webservices/PortComponentMetaData.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,194 +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.
- */
-// $Id$
-package org.jboss.ws.metadata.webservices;
-
-// $Id$
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
-
-/**
- * XML Binding and ws4ee meta-data element for
- * <code>webservices/webservice-description/port-component</code>
- * <p/>
- * A port component is the equivalent of an ordinary Axis service (and
- * as such it constitutes the building blocks for jaxrpc services).
- * <p/>
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 15-April-2004
- */
-public class PortComponentMetaData
-{
- /**
- * The index of the webservice-description in webservices.xml
- */
- public static final String PARAMETER_WEBSERVICE_ID = "webserviceID";
-
- // provide logging
- private static final Logger log = Logger.getLogger(PortComponentMetaData.class);
-
- // The parent <webservice-description> element
- private WebserviceDescriptionMetaData webserviceDescription;
-
- /** The required <port-component-name> element
- * This name bears no relationship to the WSDL port name.
- * This name must be unique amongst all port component names in a module.
- */
- private String portComponentName;
- // The required <wsdl-port> element
- private QName wsdlPort;
- // The required <service-endpoint-interface> element
- private String serviceEndpointInterface;
- // The required <ejb-link> or <servlet-link> in the
<service-impl-bean> element
- private String ejbLink;
- private String servletLink;
- // The optional <handler> elements
- private List<UnifiedHandlerMetaData> handlers = new
ArrayList<UnifiedHandlerMetaData>();
-
- // The HTTP context root
- private String contextRoot;
-
- /** Construct a new PortComponentMetaData for a given WebserviceDescriptionMetaData
- */
- public PortComponentMetaData(WebserviceDescriptionMetaData webserviceDescription)
- {
- this.webserviceDescription = webserviceDescription;
- }
-
- public WebserviceDescriptionMetaData getWebserviceDescription()
- {
- return webserviceDescription;
- }
-
- public String getPortComponentName()
- {
- return portComponentName;
- }
-
- public void setPortComponentName(String portComponentName)
- {
- this.portComponentName = portComponentName;
- }
-
- public QName getWsdlPort()
- {
- return wsdlPort;
- }
-
- public void setWsdlPort(QName wsdlPort)
- {
- if (wsdlPort.getNamespaceURI().length() == 0)
- log.warn("<wsdl-port> element in webservices.xml not namespace
qualified: " + wsdlPort);
-
- this.wsdlPort = wsdlPort;
- }
-
- public String getEjbLink()
- {
- return ejbLink;
- }
-
- public void setEjbLink(String ejbLink)
- {
- this.ejbLink = ejbLink;
- }
-
- public String getServletLink()
- {
- return servletLink;
- }
-
- public void setServletLink(String servletLink)
- {
- this.servletLink = servletLink;
- }
-
- public String getServiceEndpointInterface()
- {
- return serviceEndpointInterface;
- }
-
- public void setServiceEndpointInterface(String serviceEndpointInterface)
- {
- this.serviceEndpointInterface = serviceEndpointInterface;
- }
-
- public void addHandler(UnifiedHandlerMetaData handler)
- {
- handlers.add(handler);
- }
-
- public UnifiedHandlerMetaData[] getHandlers()
- {
- UnifiedHandlerMetaData[] array = new UnifiedHandlerMetaData[handlers.size()];
- handlers.toArray(array);
- return array;
- }
-
- public String getContextRoot()
- {
- return contextRoot;
- }
-
- public void setContextRoot(String contextRoot)
- {
- this.contextRoot = contextRoot;
- }
-
- /**
- * Serialize as a String
- *
- * @return
- */
- public String serialize()
- {
- StringBuilder builder = new StringBuilder("<port-component>
<port-component-name>");
- builder.append(portComponentName +
"</port-component-name><wsdl-port>impl:");
- builder.append(wsdlPort.getLocalPart() +
"</wsdl-port><service-endpoint-interface>");
- builder.append(serviceEndpointInterface);
- builder.append("</service-endpoint-interface>");
- builder.append("<service-impl-bean>");
- if (ejbLink != null)
- {
- builder.append("<ejb-link>");
- builder.append(ejbLink);
- builder.append("</ejb-link>");
-
- }
- else
- {
- builder.append("<servlet-link>");
- builder.append(servletLink);
- builder.append("</servlet-link>");
- }
- builder.append("</service-impl-bean>");
- builder.append("</port-component>");
- return builder.toString();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/webservices/PortComponentMetaData.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/webservices/PortComponentMetaData.java)
Deleted:
trunk/src/main/java/org/jboss/ws/metadata/webservices/WebserviceDescriptionMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/webservices/WebserviceDescriptionMetaData.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/webservices/WebserviceDescriptionMetaData.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -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.webservices;
-
-// $Id$
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-
-/**
- * XML Binding element for <code>webservices/webservice-description</code>
- *
- * @author Thomas.Diesler(a)jboss.org
- * @version $Revision$
- * @since 15-April-2004
- */
-public class WebserviceDescriptionMetaData
-{
- // provide logging
- private static final Logger log =
Logger.getLogger(WebserviceDescriptionMetaData.class);
-
- // The parent <webservices> element
- private WebservicesMetaData webservices;
-
- // The required <webservice-description-name> element
- private String webserviceDescriptionName;
- // The required <wsdl-file> element
- private String wsdlFile;
- // The required <jaxrpc-mapping-file> element
- private String jaxrpcMappingFile;
- // The required <port-component> elements
- private ArrayList<PortComponentMetaData> portComponents = new
ArrayList<PortComponentMetaData>();
-
- public WebserviceDescriptionMetaData(WebservicesMetaData webservices)
- {
- this.webservices = webservices;
- }
-
- public WebservicesMetaData getWebservices()
- {
- return webservices;
- }
-
- public void addPortComponent(PortComponentMetaData portComponent)
- {
- portComponents.add(portComponent);
- }
-
- public PortComponentMetaData[] getPortComponents()
- {
- PortComponentMetaData[] array = new PortComponentMetaData[portComponents.size()];
- portComponents.toArray(array);
- return array;
- }
-
- /**
- * Get the QNames of the port components to be declared
- * in the namespaces
- *
- * @return
- */
- public Collection getPortComponentQNames()
- {
- //TODO:Check if there is just one QName that drives all portcomponents
- //or each port component can have a distinct QName (namespace/prefix)
- //Maintain uniqueness of the QName
- Map map = new HashMap();
- Iterator iter = portComponents.iterator();
- while (iter != null && iter.hasNext())
- {
- PortComponentMetaData pcm = (PortComponentMetaData)iter.next();
- QName qname = pcm.getWsdlPort();
- map.put(qname.getPrefix(), qname);
- }
- return map.values();
- }
-
- /**
- * Lookup a PortComponentMetaData by wsdl-port local part
- *
- * @param name - the wsdl-port local part
- * @return PortComponentMetaData if found, null otherwise
- */
- public PortComponentMetaData getPortComponentByWsdlPort(String name)
- {
- ArrayList pcNames = new ArrayList();
- Iterator it = portComponents.iterator();
- while (it.hasNext())
- {
- PortComponentMetaData pc = (PortComponentMetaData)it.next();
- String wsdlPortName = pc.getWsdlPort().getLocalPart();
- if (wsdlPortName.equals(name))
- {
- return pc;
- }
- pcNames.add(wsdlPortName);
- }
-
- log.error("Cannot get port component name '" + name + "', we
have: " + pcNames);
- return null;
- }
-
- public String getWebserviceDescriptionName()
- {
- return webserviceDescriptionName;
- }
-
- public void setWebserviceDescriptionName(String webserviceDescriptionName)
- {
- this.webserviceDescriptionName = webserviceDescriptionName;
- }
-
- public String getWsdlFile()
- {
- return wsdlFile;
- }
-
- public void setWsdlFile(String wsdlFile)
- {
- this.wsdlFile = wsdlFile;
- }
-
- public String getJaxrpcMappingFile()
- {
- return jaxrpcMappingFile;
- }
-
- public void setJaxrpcMappingFile(String jaxrpcMappingFile)
- {
- this.jaxrpcMappingFile = jaxrpcMappingFile;
- }
-
- /**
- * Serialize as a String
- *
- * @return
- */
- public String serialize()
- {
- StringBuilder buffer = new StringBuilder("<webservice-description>
<webservice-description-name>");
- buffer.append(this.webserviceDescriptionName);
- buffer.append("</webservice-description-name>");
- buffer.append("<wsdl-file>" + wsdlFile +
"</wsdl-file>");
- buffer.append("<jaxrpc-mapping-file>" + jaxrpcMappingFile +
"</jaxrpc-mapping-file>");
- for (PortComponentMetaData pm : portComponents)
- buffer.append(pm.serialize());
- buffer.append("</webservice-description>");
- return buffer.toString();
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/metadata/webservices/WebserviceDescriptionMetaData.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/webservices/WebserviceDescriptionMetaData.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/webservices/WebservicesFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/webservices/WebservicesFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/webservices/WebservicesFactory.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,213 +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.webservices;
-
-// $Id$
-
-import java.net.URL;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerInitParam;
-import org.jboss.xb.binding.ObjectModelFactory;
-import org.jboss.xb.binding.UnmarshallingContext;
-import org.xml.sax.Attributes;
-
-/**
- * A JBossXB factory for {@link WebservicesMetaData}
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 16-Apr-2004
- */
-public class WebservicesFactory implements ObjectModelFactory
-{
- // provide logging
- private static final Logger log = Logger.getLogger(WebservicesFactory.class);
-
- // The URL to the webservices.xml descriptor
- private URL descriptorURL;
-
- public WebservicesFactory(URL descriptorURL)
- {
- this.descriptorURL = descriptorURL;
- }
-
- /**
- * This method is called on the factory by the object model builder when the parsing
starts.
- *
- * @return the root of the object model.
- */
- public Object newRoot(Object root, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
- {
- WebservicesMetaData webservicesMetaData = new WebservicesMetaData(descriptorURL);
- return webservicesMetaData;
- }
-
- public Object completeRoot(Object root, UnmarshallingContext ctx, String uri, String
name)
- {
- return root;
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(WebservicesMetaData webservices, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
- {
- if ("webservice-description".equals(localName))
- return new WebserviceDescriptionMetaData(webservices);
- else return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(WebservicesMetaData webservices, WebserviceDescriptionMetaData
webserviceDescription, UnmarshallingContext navigator, String namespaceURI,
- String localName)
- {
- webservices.addWebserviceDescription(webserviceDescription);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(WebserviceDescriptionMetaData webserviceDescription,
UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- if ("port-component".equals(localName))
- return new PortComponentMetaData(webserviceDescription);
- else return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(WebserviceDescriptionMetaData webserviceDescription,
PortComponentMetaData portComponent, UnmarshallingContext navigator, String namespaceURI,
- String localName)
- {
- webserviceDescription.addPortComponent(portComponent);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(PortComponentMetaData portComponent, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
- {
- if ("handler".equals(localName))
- return new UnifiedHandlerMetaData(null);
- else return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(PortComponentMetaData portComponent, UnifiedHandlerMetaData
handler, UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- portComponent.addHandler(handler);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(UnifiedHandlerMetaData handler, UnmarshallingContext navigator,
String namespaceURI, String localName, Attributes attrs)
- {
- if ("init-param".equals(localName))
- return new HandlerInitParam();
- else return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(UnifiedHandlerMetaData handler, HandlerInitParam param,
UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- handler.addInitParam(param);
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(WebserviceDescriptionMetaData webserviceDescription,
UnmarshallingContext navigator, String namespaceURI, String localName, String value)
- {
- if (log.isTraceEnabled())
- log.trace("WebserviceDescriptionMetaData setValue: nuri=" +
namespaceURI + " localName=" + localName + " value=" + value);
-
- if (localName.equals("webservice-description-name"))
- webserviceDescription.setWebserviceDescriptionName(value);
- else if (localName.equals("wsdl-file"))
- webserviceDescription.setWsdlFile(value);
- else if (localName.equals("jaxrpc-mapping-file"))
- webserviceDescription.setJaxrpcMappingFile(value);
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(PortComponentMetaData portComponent, UnmarshallingContext
navigator, String namespaceURI, String localName, String value)
- {
- if (log.isTraceEnabled())
- log.trace("PortComponentMetaData setValue: nuri=" + namespaceURI +
" localName=" + localName + " value=" + value);
-
- if (localName.equals("port-component-name"))
- portComponent.setPortComponentName(value);
- else if (localName.equals("wsdl-port"))
- portComponent.setWsdlPort(navigator.resolveQName(value));
- else if (localName.equals("service-endpoint-interface"))
- portComponent.setServiceEndpointInterface(value);
- else if (localName.equals("ejb-link"))
- portComponent.setEjbLink(value);
- else if (localName.equals("servlet-link"))
- portComponent.setServletLink(value);
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(UnifiedHandlerMetaData handler, UnmarshallingContext navigator,
String namespaceURI, String localName, String value)
- {
- if (log.isTraceEnabled())
- log.trace("UnifiedHandlerMetaData setValue: nuri=" + namespaceURI +
" localName=" + localName + " value=" + value);
-
- if (localName.equals("handler-name"))
- handler.setHandlerName(value);
- else if (localName.equals("handler-class"))
- handler.setHandlerClass(value);
- else if (localName.equals("soap-header"))
- handler.addSoapHeader(navigator.resolveQName(value));
- else if (localName.equals("soap-role"))
- handler.addSoapRole(value);
- else if (localName.equals("port-name"))
- handler.addPortName(value);
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(HandlerInitParam param, UnmarshallingContext navigator, String
namespaceURI, String localName, String value)
- {
- if (log.isTraceEnabled())
- log.trace("UnifiedInitParamMetaData setValue: nuri=" + namespaceURI +
" localName=" + localName + " value=" + value);
-
- if (localName.equals("param-name"))
- param.setParamName(value);
- else if (localName.equals("param-value"))
- param.setParamValue(value);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/webservices/WebservicesFactory.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/webservices/WebservicesFactory.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/webservices/WebservicesMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/webservices/WebservicesMetaData.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/webservices/WebservicesMetaData.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -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.
- */
-// $Id$
-package org.jboss.ws.metadata.webservices;
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.ws.Constants;
-
-// $Id$
-
-/**
- * XML Binding root element for <code>webservices.xml</code>
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 15-April-2004
- */
-public class WebservicesMetaData
-{
- // The required <webservice-description> elements
- private ArrayList<WebserviceDescriptionMetaData> webserviceDescriptions = new
ArrayList<WebserviceDescriptionMetaData>();
-
- // The URL to the webservices.xml descriptor
- private URL descriptorURL;
-
- public WebservicesMetaData()
- {
- }
-
- public WebservicesMetaData(URL descriptorURL)
- {
- this.descriptorURL = descriptorURL;
- }
-
- public URL getDescriptorURL()
- {
- return descriptorURL;
- }
-
- public void addWebserviceDescription(WebserviceDescriptionMetaData
webserviceDescription)
- {
- webserviceDescriptions.add(webserviceDescription);
- }
-
- public WebserviceDescriptionMetaData[] getWebserviceDescriptions()
- {
- WebserviceDescriptionMetaData[] array = new
WebserviceDescriptionMetaData[webserviceDescriptions.size()];
- webserviceDescriptions.toArray(array);
- return array;
- }
-
- //Serialize as a String
- public String serialize()
- {
- StringBuilder buffer = new StringBuilder();
- //Construct the webservices.xml definitions
- List qnames = new ArrayList();
- Iterator iter = webserviceDescriptions.iterator();
- while (iter != null && iter.hasNext())
- {
- WebserviceDescriptionMetaData wmd = (WebserviceDescriptionMetaData)iter.next();
- qnames.addAll(wmd.getPortComponentQNames());
- }
- createHeader(buffer, qnames);
- for (WebserviceDescriptionMetaData wm : webserviceDescriptions)
- buffer.append(wm.serialize());
- buffer.append("</webservices>");
- return buffer.toString();
- }
-
- private void createHeader(StringBuilder buf, List qnames)
- {
- buf.append("<webservices
xmlns='http://java.sun.com/xml/ns/j2ee'");
- buf.append(" xmlns:xsi='" + Constants.NS_SCHEMA_XSI +
"'");
- //Lets append the port type namespaces
- Iterator iter = qnames.iterator();
- while (iter != null && iter.hasNext())
- {
- QName qn = (QName)iter.next();
- buf.append("
xmlns:").append(qn.getPrefix()).append("='").append(qn.getNamespaceURI()).append("'");
- }
- buf.append("
xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee
http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd'");
- buf.append(" version='1.1' >");
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/webservices/WebservicesMetaData.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/webservices/WebservicesMetaData.java)
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/DOMTypes.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/DOMTypes.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/DOMTypes.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,62 +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.wsdl;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.util.NotImplementedException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- * A DOM Element based schema representation. Care should be taken to ensure
- * thread safety.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class DOMTypes extends WSDLTypes
-{
- /*
- * Perhaps we should consider moving this to JDOM, or some other DOM
- * framework that supports concurrent readers. For now callers must
- * synchronize properly.
- *
- * Also could use a cached StAX pool.
- */
- private Element element;
-
- public DOMTypes(Document doc)
- {
- this.element = doc.createElementNS(null, "types");
- }
-
- public Element getElement()
- {
- return element;
- }
-
- public QName getXMLType(QName name)
- {
- throw new NotImplementedException();
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/DOMTypes.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/DOMTypes.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/Extendable.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/Extendable.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/Extendable.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,86 +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.wsdl;
-
-// $Id$
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-import org.jboss.logging.Logger;
-
-/**
- * An abstract base class of a WSDL extendable element.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 10-Oct-2004
- */
-public abstract class Extendable implements Serializable
-{
- // provide logging
- private Logger log = Logger.getLogger(getClass());
-
- private Map features = new LinkedHashMap();
- private Map properties = new LinkedHashMap();
-
- public WSDLFeature[] getFeatures()
- {
- WSDLFeature[] arr = new WSDLFeature[features.size()];
- new ArrayList(features.values()).toArray(arr);
- return arr;
- }
-
- public void addFeature(WSDLFeature feature)
- {
- log.trace("addFeature: " + feature);
- String uri = feature.getURI();
- features.put(uri, feature);
- }
-
- public WSDLFeature getFeature(String uri)
- {
- WSDLFeature feature = (WSDLFeature)features.get(uri);
- return feature;
- }
-
- public WSDLProperty[] getProperties()
- {
- WSDLProperty[] arr = new WSDLProperty[properties.size()];
- new ArrayList(properties.values()).toArray(arr);
- return arr;
- }
-
- public void addProperty(WSDLProperty property)
- {
- log.trace("addProperty: " + property);
- String uri = property.getURI();
- properties.put(uri, property);
- }
-
- public WSDLProperty getProperty(String uri)
- {
- WSDLProperty property = (WSDLProperty)properties.get(uri);
- return property;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/Extendable.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/Extendable.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/NCName.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/NCName.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/NCName.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,76 +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.wsdl;
-
-import java.io.Serializable;
-
-import javax.xml.namespace.QName;
-
-// $Id$
-
-
-/**
- * The value space of the wsdls:NCName type is the subset of the value space of the
wsdls:Token type
- * consisting of tokens that do not contain the space (#x20) and ':' characters.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 10-Oct-2004
- */
-public class NCName implements Serializable
-{
- private static final long serialVersionUID = -4997456323552864649L;
-
- private String name;
-
- public NCName(QName qname)
- {
- this(qname != null ? qname.getLocalPart() : null);
- }
-
- public NCName(String name)
- {
- if (name == null || name.indexOf(':') >= 0 || name.indexOf(' ')
>= 0)
- throw new IllegalArgumentException("Illegal NCName: " + name);
-
- this.name = name;
- }
-
- public boolean equals(Object obj)
- {
- if (obj instanceof NCName)
- return name.equals(((NCName)obj).name);
- if (obj instanceof String)
- return name.equals(((String)obj));
-
- return false;
- }
-
- public int hashCode()
- {
- return name.hashCode();
- }
-
- public String toString()
- {
- return name;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/NCName.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/NCName.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBinding.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBinding.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBinding.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,185 +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.wsdl;
-
-// $Id$
-
-import java.io.Serializable;
-import java.util.ArrayList;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-
-/**
- * A Binding component describes a concrete message format and transmission protocol
which may be used
- * to define an endpoint (see 2.14 Endpoint [p.62] ). That is, a Binding component
defines the
- * implementation details necessary to accessing the service.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 10-Oct-2004
- */
-public class WSDLBinding implements Serializable
-{
- private static final long serialVersionUID = -7699953670233209811L;
-
- // provide logging
- private static final Logger log = Logger.getLogger(WSDLBinding.class);
-
- // The parent WSDL definitions element.
- private WSDLDefinitions wsdlDefinitions;
-
- /** The REQUIRED name attribute information item together with the targetNamespace
attribute information item
- * of the definitions element information item forms the QName of the binding.*/
- private NCName name;
-
- /** Derived QName identifier.
- */
- private QName qname;
-
- /** The OPTIONAL interface attribute information item refers, by QName, to an
Interface component. */
- private QName interfaceName;
-
- /** The REQUIRED type attribute information item identifies the kind of binding
details contained in the Binding
- * component. See wsdl20-bindings for valid values. */
- private String type;
-
- /** The set of Binding Fault components corresponding to the fault element
- * information items in [children], if any.*/
- private ArrayList<WSDLBindingFault> faults = new
ArrayList<WSDLBindingFault>();
-
- /** The set of Binding Operation components corresponding to the operation element
- * information items in [children], if any.*/
- private ArrayList<WSDLBindingOperation> operations = new
ArrayList<WSDLBindingOperation>();
-
- public WSDLBinding(WSDLDefinitions wsdlDefinitions)
- {
- log.trace("new WSDLBinding");
- this.wsdlDefinitions = wsdlDefinitions;
- }
-
- public WSDLDefinitions getWsdlDefinitions()
- {
- return wsdlDefinitions;
- }
-
- public NCName getName()
- {
- return name;
- }
-
- public void setName(NCName name)
- {
- log.trace("setName: " + name);
- this.name = name;
- }
-
- public QName getQName()
- {
- if (qname == null)
- {
- String tnsURI = wsdlDefinitions.getTargetNamespace();
- qname = new QName(tnsURI, name.toString());
- }
- return qname;
- }
-
-
- public void setQName(QName qname)
- {
- log.trace("setQName: " + qname);
- this.qname = qname;
- }
-
- public QName getInterfaceName()
- {
- return interfaceName;
- }
-
- public void setInterfaceName(QName interfaceName)
- {
- log.trace("setInterfaceName: " + name);
- this.interfaceName = interfaceName;
- }
-
- public WSDLInterface getInterface()
- {
- WSDLInterface wsdlInterface = wsdlDefinitions.getInterface(new
NCName(interfaceName.getLocalPart()));
- if (wsdlInterface == null)
- throw new WSException("Cannot get interface for name: " +
interfaceName);
- return wsdlInterface;
- }
-
- public String getType()
- {
- return type;
- }
-
- public void setType(String type)
- {
- this.type = type;
- }
-
- public WSDLBindingFault[] getFaults()
- {
- WSDLBindingFault[] arr = new WSDLBindingFault[faults.size()];
- faults.toArray(arr);
- return arr;
- }
-
- public void addFault(WSDLBindingFault fault)
- {
- faults.add(fault);
- }
-
- public WSDLBindingOperation[] getOperations()
- {
- WSDLBindingOperation[] arr = new WSDLBindingOperation[operations.size()];
- operations.toArray(arr);
- return arr;
- }
-
- public WSDLBindingOperation getOperationByRef(QName qname)
- {
- WSDLBindingOperation wsdlBindingOperation = null;
- for (WSDLBindingOperation aux : operations)
- {
- if (aux.getRef().equals(qname))
- {
- if (wsdlBindingOperation != null)
- log.warn("Multiple binding operations reference: " + qname);
- wsdlBindingOperation = aux;
- }
- }
-
- if (wsdlBindingOperation == null)
- log.warn("Cannot obtain binding operation for ref: " + qname);
-
- return wsdlBindingOperation;
- }
-
- public void addOperation(WSDLBindingOperation operation)
- {
- operations.add(operation);
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBinding.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBinding.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingFault.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingFault.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingFault.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,69 +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.wsdl;
-
-// $Id$
-
-import java.io.Serializable;
-
-import javax.xml.namespace.QName;
-
-/**
- * A Binding Fault component describes a concrete binding of a particular fault within an
interface to a
- * particular concrete message format. A particular fault of an interface is uniquely
identified by the target
- * namespace of the interface and the name of the fault within that interface.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 10-Oct-2004
- */
-public class WSDLBindingFault implements Serializable
-{
- private static final long serialVersionUID = 6306975072558524200L;
-
- // The parent WSDL binding
- private WSDLBinding wsdlBinding;
-
- /** An REQUIRED Interface Fault component in the {faults} property of the Interface
- * component identified by the {interface} property of the parent Binding component.
This is the
- * Interface Fault component for which binding information is being specified.*/
- private QName ref;
-
- public WSDLBindingFault(WSDLBinding wsdlBinding)
- {
- this.wsdlBinding = wsdlBinding;
- }
-
- public WSDLBinding getWsdlBinding()
- {
- return wsdlBinding;
- }
-
- public QName getRef()
- {
- return ref;
- }
-
- public void setRef(QName ref)
- {
- this.ref = ref;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingFault.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingFault.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingMessageReference.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingMessageReference.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingMessageReference.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,126 +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.wsdl;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-/**
- * A Binding Message Reference component describes a concrete binding of a
- * particular message participating in an operation to a particular concrete
- * message format.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public abstract class WSDLBindingMessageReference
-{
- // The parent WSDL binding operation
- private WSDLBindingOperation wsdlBindingOperation;
- private NCName messageLabel;
- private List<WSDLSOAPHeader> soapHeaders = new
ArrayList<WSDLSOAPHeader>();
- private List<WSDLMIMEPart> mimeParts = new ArrayList<WSDLMIMEPart>();
-
- public WSDLBindingMessageReference(WSDLBindingOperation wsdlBindingOperation)
- {
- this.wsdlBindingOperation = wsdlBindingOperation;
- }
-
- public WSDLBindingOperation getWsdlBindingOperation()
- {
- return wsdlBindingOperation;
- }
-
- /**
- * Gets the property that identifies the role that the message for which
- * binding details are being specified. The role is part of the {message
- * exchange pattern} of the Interface Operation component being bound by the
- * containing Binding Operation component.
- */
- public NCName getMessageLabel()
- {
- return messageLabel;
- }
-
- /**
- * Sets the property that identifies the role that the message for which
- * binding details are being specified. The role is part of the {message
- * exchange pattern} of the Interface Operation component being bound by the
- * containing Binding Operation component.
- */
- public void setMessageLabel(NCName messageLabel)
- {
- this.messageLabel = messageLabel;
- }
-
- /**
- * Gets the list of SOAP headers associated with this message reference.
- *
- * @return a list of soap headers
- */
- public List<WSDLSOAPHeader> getSoapHeaders()
- {
- return soapHeaders;
- }
-
- /**
- * Sets the list of SOAP headers associated with this message reference.
- *
- * @param soapHeaders The soapHeaders to set.
- */
- public void setSoapHeaders(List<WSDLSOAPHeader> soapHeaders)
- {
- this.soapHeaders = soapHeaders;
- }
-
- /**
- * Adds a SOAP header to the SOAP header list that is associated with this
- * message reference.
- *
- * @param soapHeader the SOAP header to add
- */
- public void addSoapHeader(WSDLSOAPHeader soapHeader)
- {
- this.soapHeaders.add(soapHeader);
- }
-
- /**
- * Adds a MIME part to this message reference. This is only used for WSDL 1.1.
- *
- * @param mimePart the mime part to add
- */
- public void addMimePart(WSDLMIMEPart mimePart)
- {
- this.mimeParts.add(mimePart);
- }
-
- /**
- * Returns a list of mime parts on this message
- *
- * @return
- */
- public Collection<WSDLMIMEPart> getMimeParts()
- {
- return mimeParts;
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingMessageReference.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingMessageReference.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingOperation.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingOperation.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingOperation.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,146 +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.wsdl;
-
-// $Id$
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.ws.Constants;
-
-/**
- * The Binding Operation component describes the concrete message format(s) and protocol
interaction(s)
- * associated with a particular interface operation for a given endpoint. A particular
operation of an interface
- * is uniquely identified by the target namespace of the interface and the name of the
operation within that
- * interface.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author Anil.Saldhana(a)jboss.org
- * @since 10-Oct-2004
- */
-public class WSDLBindingOperation implements Comparable, Serializable
-{
- private static final long serialVersionUID = -1986624862746844610L;
-
- // The parent WSDL binding
- private WSDLBinding wsdlBinding;
-
- /** An Interface Operation component in the {operations} property of the Interface
component
- * identified by the {interface} property of the parent Binding component.
- * This is the Interface Operation component for which binding information is being
specified.*/
- private QName ref;
-
- /** WSDL-1.1, style attribute from the soap:binding element */
- private String encodingStyle = Constants.URI_LITERAL_ENC;
- /** WSDL-1.1, soapAction attribute from the soap:operation element */
- private String soapAction;
-
- /** A OPTIONAL set of Binding Message Reference components */
- private List<WSDLBindingOperationInput> inputs = new
ArrayList<WSDLBindingOperationInput>();
- /** A OPTIONAL set of Binding Message Reference components */
- private List<WSDLBindingOperationOutput> outputs = new
ArrayList<WSDLBindingOperationOutput>();
-
- public WSDLBindingOperation(WSDLBinding wsdlBinding)
- {
- this.wsdlBinding = wsdlBinding;
- }
-
- public WSDLBinding getWsdlBinding()
- {
- return wsdlBinding;
- }
-
- public QName getRef()
- {
- return ref;
- }
-
- public void setRef(QName ref)
- {
- this.ref = ref;
- }
-
- public String getEncodingStyle()
- {
- return encodingStyle;
- }
-
- public void setEncodingStyle(String encodingStyle)
- {
- this.encodingStyle = encodingStyle;
- }
-
-
- public String getSOAPAction()
- {
- return soapAction;
- }
-
- public void setSOAPAction(String soapAction)
- {
- this.soapAction = soapAction;
- }
-
- public WSDLBindingOperationInput[] getInputs()
- {
- WSDLBindingOperationInput[] arr = new WSDLBindingOperationInput[inputs.size()];
- inputs.toArray(arr);
- return arr;
- }
-
- public void addInput(WSDLBindingOperationInput input)
- {
- inputs.add(input);
- }
-
- public WSDLBindingOperationOutput[] getOutputs()
- {
- WSDLBindingOperationOutput[] arr = new WSDLBindingOperationOutput[outputs.size()];
- outputs.toArray(arr);
- return arr;
- }
-
- public void addOutput(WSDLBindingOperationOutput output)
- {
- outputs.add(output);
- }
-
- /* (non-Javadoc)
- * @see java.lang.Comparable#compareTo(T)
- */
- public int compareTo(Object obj)
- {
- int c = -1;
- if (obj instanceof WSDLBindingOperation)
- {
- WSDLBindingOperation w = (WSDLBindingOperation)obj;
- String oname = w.getRef().getLocalPart();
- String myname = ref.getLocalPart();
- c = myname.compareTo(oname);
- }
- return c;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingOperation.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingOperation.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingOperationInput.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingOperationInput.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingOperationInput.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,44 +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.wsdl;
-
-import java.io.Serializable;
-
-// $Id$
-
-/**
- * A Binding Message Reference component describes a concrete binding of a particular
message
- * participating in an operation to a particular concrete message format.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @since 10-Oct-2004
- */
-public class WSDLBindingOperationInput extends WSDLBindingMessageReference implements
Serializable
-{
- private static final long serialVersionUID = -3945310906418557565L;
-
- public WSDLBindingOperationInput(WSDLBindingOperation wsdlBindingOperation)
- {
- super(wsdlBindingOperation);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingOperationInput.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingOperationInput.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingOperationOutput.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingOperationOutput.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingOperationOutput.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,44 +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.wsdl;
-
-import java.io.Serializable;
-
-// $Id$
-
-/**
- * A Binding Message Reference component describes a concrete binding of a particular
message
- * participating in an operation to a particular concrete message format.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @since 10-Oct-2004
- */
-public class WSDLBindingOperationOutput extends WSDLBindingMessageReference implements
Serializable
-{
- private static final long serialVersionUID = -999199387765793475L;
-
- public WSDLBindingOperationOutput(WSDLBindingOperation wsdlBindingOperation)
- {
- super(wsdlBindingOperation);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingOperationOutput.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingOperationOutput.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitions.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitions.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitions.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,298 +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.wsdl;
-
-// $Id$
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.wsdl.Definition;
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.jboss.xb.binding.NamespaceRegistry;
-import org.w3c.dom.Document;
-
-/**
- * The top level Definitions component is just a container for two categories of
components;
- * WSDL components and type system components. WSDL components are interfaces, bindings
and services.
- *
- * Type system components describe the constraints on a message�s content.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 10-Oct-2004
- */
-public class WSDLDefinitions implements Serializable
-{
- private static final long serialVersionUID = 1643422922694990226L;
-
- // provide logging
- private final Logger log = Logger.getLogger(WSDLDefinitions.class);
-
- /** The REQUIRED targetNamespace attribute information item defines the namespace
affiliation of top-level
- * components defined in this definitions element information item. Interfaces,
Bindings and Services
- * are top-level components. */
- private String targetNamespace;
- /** The REQUIRED wsdl namespace. For WSDL-2.0 it is
http://www.w3.org/2003/11/wsdl,
- * for WSDL-1.1 it is
http://schemas.xmlsoap.org/wsdl/ */
- private String wsdlNamespace;
- /** Zero or more import element information items */
- private List<WSDLImport> imports = new ArrayList<WSDLImport>();
- /** Zero or more include element information items */
- private List<WSDLInclude> includes = new ArrayList<WSDLInclude>();
- /** Types element information item */
- private WSDLTypes types;
- /** Zero or more interface element information items */
- private Map<NCName, WSDLInterface> interfaces = new LinkedHashMap<NCName,
WSDLInterface>();
- /** Zero or more binding element information items */
- private Map<NCName, WSDLBinding> bindings = new LinkedHashMap<NCName,
WSDLBinding>();
- /** Zero or more service element information items */
- private Map<NCName, WSDLService> services = new LinkedHashMap<NCName,
WSDLService>();
-
- // Zero or more namespace definitions
- // [TODO] What is this doing here?
- private NamespaceRegistry namespaces = new NamespaceRegistry();
-
- // The original wsdl4j definition if we have wsdl-1.1
- private Definition wsdlOneOneDefinition;
- // The WSDL document
- private Document wsdlDocument;
-
- public WSDLDefinitions() {}
-
- /** Set the wsdl4j definition if we have wsdl-1.1 */
- public void setWsdlOneOneDefinition(Definition wsdlDefinition)
- {
- this.wsdlOneOneDefinition = wsdlDefinition;
- }
-
- /**
- * Get the wsdl4j definition if we have wsdl-1.1.
- *
- * Note: This object is NOT THREAD-SAFE
- */
- public Definition getWsdlOneOneDefinition()
- {
- return wsdlOneOneDefinition;
- }
-
- public Document getWsdlDocument()
- {
- return wsdlDocument;
- }
-
- public void setWsdlDocument(Document wsdlDocument)
- {
- this.wsdlDocument = wsdlDocument;
- }
-
- /** Register the given namespaceURI/prefix combination */
- public String registerNamespaceURI(String nsURI, String prefix)
- {
- String pre = namespaces.getPrefix(nsURI);
- if (pre == null || pre == "")
- {
- pre = namespaces.registerURI(nsURI, prefix);
- log.trace("registerNamespaceURI: " + pre + "=" + nsURI);
- }
- return pre;
- }
-
- /** Register a QName and return a QName that is guarantied to have a prefix */
- public QName registerQName(QName qname)
- {
- return namespaces.registerQName(qname);
- }
-
- /** Get the prefix for a given namespaceURI */
- public String getPrefix(String namespaceURI)
- {
- return namespaces.getPrefix(namespaceURI);
- }
-
- /** Get the namespaceURI for a given prefix */
- public String getNamespaceURI(String prefix)
- {
- return namespaces.getNamespaceURI(prefix);
- }
-
- /** Get the prefix for the target namespace */
- public String getTargetPrefix()
- {
- return namespaces.getPrefix(targetNamespace);
- }
-
- /** Get an iterator for registered namespace URIs */
- public Iterator getRegisteredNamespaceURIs()
- {
- return namespaces.getRegisteredURIs();
- }
-
- /** Get an iterator for registered prefixs */
- public Iterator getRegisteredPrefix()
- {
- return namespaces.getRegisteredPrefixes();
- }
-
- public String getTargetNamespace()
- {
- return targetNamespace;
- }
-
- public void setTargetNamespace(String namespaceURI)
- {
- if(namespaceURI == null)
- throw new IllegalArgumentException("Illegal Null
Argument:namespaceURI");
-
- log.trace("setTargetNamespace: " + namespaceURI);
- this.targetNamespace = namespaceURI;
- }
-
- public String getWsdlNamespace()
- {
- return wsdlNamespace;
- }
-
- public void setWsdlNamespace(String namespaceURI)
- {
- if (Constants.NS_WSDL11.equals(namespaceURI) == false &&
Constants.NS_WSDL20.equals(namespaceURI) == false)
- throw new IllegalArgumentException("Invalid default namespace: " +
namespaceURI);
-
- this.wsdlNamespace = namespaceURI;
- }
-
- public WSDLImport[] getImports()
- {
- WSDLImport[] arr = new WSDLImport[imports.size()];
- imports.toArray(arr);
- return arr;
- }
-
- public void addImport(WSDLImport anImport)
- {
- imports.add(anImport);
- }
-
- public WSDLInclude[] getIncludes()
- {
- WSDLInclude[] arr = new WSDLInclude[includes.size()];
- includes.toArray(arr);
- return arr;
- }
-
- public void addInclude(WSDLInclude include)
- {
- includes.add(include);
- }
-
- public WSDLTypes getWsdlTypes()
- {
- return types;
- }
-
- public void setWsdlTypes(WSDLTypes types)
- {
- this.types = types;
- this.types.setWSDLDefintiions(this);
- }
-
- public WSDLInterface getInterface(NCName ncName)
- {
- return interfaces.get(ncName);
- }
-
- public WSDLInterface[] getInterfaces()
- {
- WSDLInterface[] arr = new WSDLInterface[interfaces.size()];
- new ArrayList<WSDLInterface>(interfaces.values()).toArray(arr);
- return arr;
- }
-
- public void addInterface(WSDLInterface wsdlInterface)
- {
- interfaces.put(wsdlInterface.getName(), wsdlInterface);
- }
-
- public WSDLBinding[] getBindings()
- {
- WSDLBinding[] arr = new WSDLBinding[bindings.size()];
- new ArrayList<WSDLBinding>(bindings.values()).toArray(arr);
- return arr;
- }
-
- public WSDLBinding getBinding(NCName ncName)
- {
- return bindings.get(ncName);
- }
-
- public WSDLBinding getBindingByInterfaceName(QName qname)
- {
- WSDLBinding wsdlBinding = null;
- for (WSDLBinding aux : bindings.values())
- {
- if (aux.getInterfaceName().equals(qname))
- {
- if (wsdlBinding != null)
- log.warn("Multiple WSDL bindings referrence the same interface:
" + qname);
-
- wsdlBinding = aux;
- }
- }
- return wsdlBinding;
- }
-
- public void addBinding(WSDLBinding binding)
- {
- bindings.put(binding.getName(), binding);
- }
-
- public WSDLService[] getServices()
- {
- WSDLService[] arr = new WSDLService[services.size()];
- new ArrayList<WSDLService>(services.values()).toArray(arr);
- return arr;
- }
-
- public void addService(WSDLService service)
- {
- services.put(service.getName(), service);
- }
-
- public WSDLService getService(NCName name)
- {
- return services.get(name);
- }
-
- /** Unregister the given namespaceURI/prefix combination */
- public void unRegisterNamespaceURI(String namespaceURI, String prefix)
- {
- String pre = namespaces.getPrefix(namespaceURI);
- if(pre != null && pre.equals(prefix))
- namespaces.removePrefixMapping(prefix);
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitions.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitions.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDocumentation.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDocumentation.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDocumentation.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,46 +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.wsdl;
-
-import java.io.Serializable;
-
-/**
- * Represents a WSDL Document element that can be embedded in other WSDL elements
- * such as Fault
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- */
-public class WSDLDocumentation implements Serializable
-{
- private static final long serialVersionUID = -5931204963635014975L;
-
- protected String documentContent = "";
-
- public WSDLDocumentation(String str)
- {
- this.documentContent = str;
- }
-
- public String getContent()
- {
- return this.documentContent;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDocumentation.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDocumentation.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLEndpoint.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLEndpoint.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLEndpoint.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,166 +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.wsdl;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-
-/**
- * An Endpoint component defines the particulars of a specific endpoint at which a given
service is available.
- * Endpoint components are local to a given Service component; they cannot be referred to
by QName.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 10-Oct-2004
- */
-public class WSDLEndpoint extends Extendable
-{
- private static final long serialVersionUID = 4991302339046047865L;
-
- // provide logging
- private static final Logger log = Logger.getLogger(WSDLEndpoint.class);
-
- // The parent service
- private WSDLService wsdlService;
-
- /** The REQUIRED name attribute information item together with the targetNamespace
attribute information item
- * of the definitions element information item forms the QName of the endpoint. */
- private NCName name;
-
- /** Derived QName identifier.
- */
- private QName qname;
-
- /** The REQUIRED binding attribute information item refers, by QName, to a Binding
component */
- private QName binding;
-
- /** The OPTIONAL address attribute information item specifies the address of the
endpoint. */
- private String address;
-
- public WSDLEndpoint(WSDLService wsdlService)
- {
- log.trace("new WSDLEndpoint");
- this.wsdlService = wsdlService;
- }
-
- public WSDLService getWsdlService()
- {
- return wsdlService;
- }
-
- /** Get the WSDLInteraface associated to this endpoint
- *
- * @return A WSDLInterface or null
- */
- public WSDLInterface getInterface()
- {
- WSDLInterface wsdlInterface = null;
-
- WSDLDefinitions wsdlDefinitions = wsdlService.getWsdlDefinitions();
- if (wsdlService.getInterfaceName() != null)
- {
- QName qname = wsdlService.getInterfaceName();
- wsdlInterface = wsdlDefinitions.getInterface(new NCName(qname));
- }
- else
- {
- WSDLBinding wsdlBinding = wsdlDefinitions.getBinding(new NCName(binding));
- if (wsdlBinding == null)
- throw new WSException("Cannot obtain the binding: " + binding);
-
- if (wsdlBinding.getInterfaceName() != null)
- {
- QName qname = wsdlBinding.getInterfaceName();
- wsdlInterface = wsdlDefinitions.getInterface(new NCName(qname));
- }
- }
-
- if (wsdlInterface == null)
- throw new WSException("Cannot obtain the interface associated with this
endpoint: " + name);
-
- return wsdlInterface;
- }
-
- /** Get the WSDLInterafceOperation for the given opName
- *
- * @param opName the operation name
- * @return A WSDLOperation or null
- */
- public WSDLInterfaceOperation getInterfaceOperation(NCName opName)
- {
- WSDLInterface wsdlInterface = getInterface();
- WSDLInterfaceOperation wsdlInterfaceOperation =
wsdlInterface.getWSDLInterfaceOperation(opName);
- return wsdlInterfaceOperation;
- }
-
- public NCName getName()
- {
- return name;
- }
-
- public void setName(NCName name)
- {
- log.trace("setName: " + name);
- this.name = name;
- }
-
- public QName getQName()
- {
- if (qname == null)
- {
- String tnsURI = wsdlService.getWsdlDefinitions().getTargetNamespace();
- qname = new QName(tnsURI, name.toString());
- }
- return qname;
- }
-
-
- public void setQName(QName qname)
- {
- log.trace("setQName: " + qname);
- this.qname = qname;
- }
-
- public QName getBinding()
- {
- return binding;
- }
-
- public void setBinding(QName binding)
- {
- log.trace("setBinding: " + binding);
- this.binding = binding;
- }
-
- public String getAddress()
- {
- return address;
- }
-
- public void setAddress(String address)
- {
- this.address = address;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLEndpoint.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLEndpoint.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLException.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLException.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLException.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -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.wsdl;
-
-// $Id$
-
-/**
- * An exception that may occur during WSDL processing.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 10-Oct-2004
- */
-public class WSDLException extends RuntimeException
-{
- /**
- * Constructs a new exception with <code>null</code> as its detail
message.
- * The cause is not initialized, and may subsequently be initialized by a
- * call to {@link #initCause}.
- */
- public WSDLException()
- {
- }
-
- /**
- * Constructs a new exception with the specified detail message. The
- * cause is not initialized, and may subsequently be initialized by
- * a call to {@link #initCause}.
- *
- * @param message the detail message. The detail message is saved for
- * later retrieval by the {@link #getMessage()} method.
- */
- public WSDLException(String message)
- {
- super(message);
- }
-
- /**
- * Constructs a new exception with the specified cause and a detail
- * message of <tt>(cause==null ? null : cause.toString())</tt> (which
- * typically contains the class and detail message of <tt>cause</tt>).
- * This constructor is useful for exceptions that are little more than
- * wrappers for other throwables (for example, {@link
- * java.security.PrivilegedActionException}).
- *
- * @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A <tt>null</tt> value is
- * permitted, and indicates that the cause is nonexistent or
- * unknown.)
- * @since 1.4
- */
- public WSDLException(Throwable cause)
- {
- super(cause);
- }
-
- /**
- * Constructs a new exception with the specified detail message and
- * cause. <p>Note that the detail message associated with
- * <code>cause</code> is <i>not</i> automatically incorporated
in
- * this exception's detail message.
- *
- * @param message the detail message (which is saved for later retrieval
- * by the {@link #getMessage()} method).
- * @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A <tt>null</tt> value is
- * permitted, and indicates that the cause is nonexistent or
- * unknown.)
- * @since 1.4
- */
- public WSDLException(String message, Throwable cause)
- {
- super(message, cause);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLException.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLException.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLFeature.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLFeature.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLFeature.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,84 +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.wsdl;
-
-import java.io.Serializable;
-
-// $Id$
-
-/**
- * A feature component describes an abstract piece of functionality typically associated
with the exchange of
- * messages between communicating parties. Although WSDL poses no constraints on the
potential scope of
- * such features, examples might include "reliability", "security",
"correlation", and "routing". The presence
- * of a feature component in a WSDL description indicates that the service supports the
feature and may
- * require a requester agent that interacts with the service to use that feature. Each
Feature is identified by its
- * URI.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 10-Oct-2004
- */
-public class WSDLFeature implements Serializable
-{
- private static final long serialVersionUID = 8096857958254222743L;
-
- /** A REQUIRED uri attribute information item */
- private String uri;
- /** An OPTIONAL required attribute information item */
- private boolean required;
-
- public WSDLFeature(String uri)
- {
- if (uri == null)
- throw new IllegalArgumentException("Illegal feature URI: " + uri);
-
- this.uri = uri;
- }
-
- public WSDLFeature(String uri, boolean required)
- {
- if (uri == null)
- throw new IllegalArgumentException("Illegal feature URI: " + uri);
-
- this.uri = uri;
- this.required = required;
- }
-
- public String getURI()
- {
- return uri;
- }
-
- public boolean isRequired()
- {
- return required;
- }
-
- public void setRequired(boolean required)
- {
- this.required = required;
- }
-
- public String toString()
- {
- return uri;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLFeature.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLFeature.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLImport.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLImport.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLImport.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,90 +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.wsdl;
-
-import java.io.Serializable;
-
-
-// $Id$
-
-/**
- * The WSDL import element information item, like the include element information item
(see 4.1 Including Descriptions [p.73] )
- * also allows for the separation of the different components of a WSDL description into
independent descriptions,
- * but in this case with different target namespaces, which can be imported as needed.
This technique helps writing
- * clearer WSDL descriptions by separating the definitions according to their level of
abstraction, and maximizes reusability.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 10-Oct-2004
- */
-public class WSDLImport implements Serializable
-{
- private static final long serialVersionUID = -2641009286158029207L;
-
- // The parent WSDL definitions
- private WSDLDefinitions wsdlDefinitions;
-
- /** The REQUIRED namespace attribute information item is of type xs:anyURI . Its
actual value indicates that the
- * containing WSDL document MAY contain qualified references to WSDL definitions in
that namespace
- * (via one or more prefixes declared with namespace declarations in the normal way).
This value MUST
- * NOT match the actual value of the enclosing WSDL document targetNamespace
attribute
- * information item. If the import statement results in the import of a WSDL document
then the actual value
- * of the namespace attribute information item MUST be identical to the actual value
of the imported
- * WSDL document's targetNamespace attribute information item. */
- private String namespace;
-
- /** The OPTIONAL location attribute information item is of type xs:anyURI . Its actual
value is the location of
- * some information about the namespace identified by the namespace attribute
information item.
- * The location attribute information item is optional. This allows WSDL components to
be constructed
- * from information other than serialized XML 1.0. It also allows the development of
WSDL processors that
- * have a priori (i.e., built-in) knowledge of certain namespaces. */
- private String location;
-
- public WSDLImport(WSDLDefinitions wsdlDefinitions)
- {
- this.wsdlDefinitions = wsdlDefinitions;
- }
-
- public WSDLDefinitions getWsdlDefinitions()
- {
- return wsdlDefinitions;
- }
-
- public String getNamespace()
- {
- return namespace;
- }
-
- public void setNamespace(String namespace)
- {
- this.namespace = namespace;
- }
-
- public String getLocation()
- {
- return location;
- }
-
- public void setLocation(String location)
- {
- this.location = location;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLImport.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLImport.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInclude.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInclude.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInclude.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,69 +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.wsdl;
-
-import java.io.Serializable;
-
-
-// $Id$
-
-
-/**
- * The WSDL include element information item allows for the separation of different
components of a
- * service definition, belonging the same target namespace, into independent WSDL
documents which can be
- * merged as needed.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 10-Oct-2004
- */
-public class WSDLInclude implements Serializable
-{
- private static final long serialVersionUID = 1210980063899094649L;
-
- // The parent WSDL definitions
- private WSDLDefinitions wsdlDefinitions;
-
- /** A location attribute information item is of type xs:anyURI . Its actual value is
the location of some
- * information about the namespace identified by the targetNamespace attribute
information item of the
- * containing definitions element information item.*/
- private String location;
-
- public WSDLInclude(WSDLDefinitions wsdlDefinitions)
- {
- this.wsdlDefinitions = wsdlDefinitions;
- }
-
- public WSDLDefinitions getWsdlDefinitions()
- {
- return wsdlDefinitions;
- }
-
- public String getLocation()
- {
- return location;
- }
-
- public void setLocation(String location)
- {
- this.location = location;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInclude.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInclude.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterface.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterface.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterface.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,194 +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.wsdl;
-
-// $Id$
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-
-/**
- * An Interface component describes sequences of messages that a service sends and/or
receives. It does this
- * by grouping related messages into operations. An operation is a sequence of input and
output messages,
- * and an interface is a set of operations. Thus, an interface defines the design of the
application.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 10-Oct-2004
- */
-public class WSDLInterface extends Extendable
-{
- // provide logging
- private static final Logger log = Logger.getLogger(WSDLInterface.class);
-
- private static final long serialVersionUID = 2453454924501233964L;
-
- // The parent WSDL definitions element.
- private WSDLDefinitions wsdlDefinitions;
-
- /** The REQUIRED name attribute information item together with the targetNamespace
attribute information item
- * of the [parent] definitions element information item forms the QName of the
interface.
- */
- private NCName name;
-
- /** Derived QName identifier.
- */
- private QName qname;
-
- /** The OPTIONAL extends attribute information item lists the interfaces that this
interface derives from.
- */
- private QName[] extendList;
-
- /** The OPTIONAL styleDefault attribute information item indicates the default style
used to construct the
- * {element} properties of {message references} of all operations contained within the
[owner] interface
- */
- private String styleDefault;
-
- /** Zero or more operation element information items */
- private Map operations = new LinkedHashMap();
- /** Zero or more fault element information items */
- private Map faults = new LinkedHashMap();
-
- /** Construct a WSDL interface for a given WSDL definition */
- public WSDLInterface(WSDLDefinitions wsdlDefinitions)
- {
- log.trace("new WSDLInterface");
- this.wsdlDefinitions = wsdlDefinitions;
- }
-
- /** Get a WSDLOperation for a given name
- *
- * @param name The name of the operation
- * @return A WSDLOperation or null
- */
- public WSDLInterfaceOperation getWSDLInterfaceOperation(NCName name)
- {
- return (WSDLInterfaceOperation)operations.get(name);
- }
-
- public WSDLDefinitions getWsdlDefinitions()
- {
- return wsdlDefinitions;
- }
-
- public NCName getName()
- {
- return name;
- }
-
- public void setName(NCName name)
- {
- log.trace("setName: " + name);
- this.name = name;
- }
-
- public QName getQName()
- {
- if (qname == null)
- {
- String tnsURI = wsdlDefinitions.getTargetNamespace();
- qname = new QName(tnsURI, name.toString());
- }
- return qname;
- }
-
-
- public void setQName(QName qname)
- {
- log.trace("setQName: " + qname);
- this.qname = qname;
- }
-
- public QName[] getExtendList()
- {
- return extendList;
- }
-
- public void setExtendList(QName[] extendList)
- {
- this.extendList = extendList;
- }
-
- public String getStyleDefault()
- {
- return styleDefault;
- }
-
- public void setStyleDefault(String styleDefault)
- {
- this.styleDefault = styleDefault;
- }
-
- public WSDLInterfaceOperation[] getOperations()
- {
- WSDLInterfaceOperation[] arr = new WSDLInterfaceOperation[operations.size()];
- new ArrayList(operations.values()).toArray(arr);
- return arr;
- }
-
- public WSDLInterfaceOperation[] getSortedOperations()
- {
- WSDLInterfaceOperation[] arr = new WSDLInterfaceOperation[operations.size()];
- new ArrayList(operations.values()).toArray(arr);
- Arrays.sort(arr);
- return arr;
- }
-
- public WSDLInterfaceOperation getOperation(NCName opName)
- {
- WSDLInterfaceOperation operation = (WSDLInterfaceOperation)operations.get(opName);
- return operation;
- }
-
- public void addOperation(WSDLInterfaceOperation operation)
- {
- operations.put(operation.getName(), operation);
- }
-
- public WSDLInterfaceFault[] getFaults()
- {
- WSDLInterfaceFault[] arr = new WSDLInterfaceFault[faults.size()];
- new ArrayList(faults.values()).toArray(arr);
- return arr;
- }
-
- public WSDLInterfaceFault getFault(NCName fName)
- {
- WSDLInterfaceFault fault = (WSDLInterfaceFault)faults.get(fName);
- return fault;
- }
-
- public void addFault(WSDLInterfaceFault fault)
- {
- faults.put(fault.getName(), fault);
- }
-
- public boolean containsInterfaceOperation(NCName name)
- {
- return operations.containsKey(name);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterface.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterface.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceFault.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceFault.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceFault.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,104 +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.wsdl;
-
-// $Id$
-
-import java.io.Serializable;
-
-import javax.xml.namespace.QName;
-
-/**
- * An Interface Fault component describes a fault that MAY occur during invocation of an
operation of the
- * interface. The Interface Fault component declares an abstract fault by naming it and
indicating the
- * contents of the fault message. When and how the fault message flows is indicated by
the Interface
- * Operation component 2.4 Interface Operation [p.22] .
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 10-Oct-2004
- */
-public class WSDLInterfaceFault implements Serializable
-{
- private static final long serialVersionUID = 7820459380133521551L;
-
- // The parent interface.
- private WSDLInterface wsdlInterface;
-
- /** The REQUIRED name attribute information item identifies a given fault element
information item inside a given
- * interface element information item.
- */
- private NCName name;
- /** The OPTIONAL element attribute information item refers, by QName, to an element
declaration component.
- */
- private QName element;
-
- protected WSDLDocumentation documentationElement = null;
-
- public WSDLInterfaceFault(WSDLInterface wsdlInterface)
- {
- this.wsdlInterface = wsdlInterface;
- }
-
- public WSDLInterface getWsdlInterface()
- {
- return wsdlInterface;
- }
-
- public NCName getName()
- {
- return name;
- }
-
- public void setName(NCName name)
- {
- this.name = name;
- }
-
- public QName getElement()
- {
- return element;
- }
-
- public void setElement(QName element)
- {
- this.element = element;
- }
-
- public WSDLDocumentation getDocumentation()
- {
- return this.documentationElement;
- }
-
- public void setDocumentation(WSDLDocumentation doc)
- {
- this.documentationElement = doc;
- }
-
- /** Get the xmlType for this interface fault.
- */
- public QName getXmlType()
- {
- WSDLDefinitions wsdlDefinitions = wsdlInterface.getWsdlDefinitions();
- WSDLTypes wsdlTypes = wsdlDefinitions.getWsdlTypes();
- return wsdlTypes.getXMLType(element);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceFault.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceFault.java)
Deleted:
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceMessageReference.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceMessageReference.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceMessageReference.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,246 +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.wsdl;
-
-// $Id: WSDLInterfaceOperationPart.java 275 2006-05-04 21:36:29Z
-// jason.greene(a)jboss.com $
-
-import java.util.Collection;
-import java.util.LinkedHashMap;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.jboss.ws.WSException;
-
-/**
- * A Message Reference component associates a defined type with a message
- * exchanged in an operation. By default, the type system is based upon the XML
- * Infoset
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @since 10-Oct-2004
- */
-public abstract class WSDLInterfaceMessageReference extends Extendable implements
Comparable
-{
- // provide logging
- protected Logger log = Logger.getLogger(getClass());
-
- // The parent interface operation
- private WSDLInterfaceOperation wsdlOperation;
-
- /**
- * The OPTIONAL messageLabel attribute information item identifies the role
- * of this message in the message exchange pattern of the given operation
- * element information item.
- */
- private NCName messageLabel;
-
- /**
- * The OPTIONAL element attribute information item is the element declaration
- * from the {element declarations} property resolved by the value of the
- * element attribute information item, otherwise empty.
- */
- private QName element;
-
- /**
- * Used mainly for WSDL 1.1 compatibility, indicates rpc parts.
- * Although, this could be used to represent WSDL 2.0 RPC style.
- */
- private LinkedHashMap<String, WSDLRPCPart> childParts = new
LinkedHashMap<String, WSDLRPCPart>();
-
- /**
- * Used for WSDL 1.1
- */
- private String partName;
-
- /**
- * Used for WSDL 1.1
- */
- private QName messageName;
-
- public WSDLInterfaceMessageReference(WSDLInterfaceOperation wsdlOperation)
- {
- log.trace("New part for wsdlOperation: " + wsdlOperation.getName());
- this.wsdlOperation = wsdlOperation;
- }
-
- public WSDLInterfaceOperation getWsdlOperation()
- {
- return wsdlOperation;
- }
-
- public NCName getMessageLabel()
- {
- return messageLabel;
- }
-
- public void setMessageLabel(NCName messageLabel)
- {
- log.trace("setMessageLabel: " + messageLabel);
- this.messageLabel = messageLabel;
- }
-
- public QName getElement()
- {
- return element;
- }
-
- public void setElement(QName element)
- {
- log.trace("setElement: " + element);
- this.element = element;
- }
-
- /**
- * Get the xmlType for this operation part.
- */
- public QName getXMLType()
- {
- QName xmlType = null;
-
- // First try to read it from the schema
- WSDLDefinitions wsdlDefinitions =
wsdlOperation.getWsdlInterface().getWsdlDefinitions();
- WSDLTypes wsdlTypes = wsdlDefinitions.getWsdlTypes();
- xmlType = wsdlTypes.getXMLType(element);
-
- // Fall back to the property
- if (xmlType == null)
- {
- WSDLProperty property = getProperty(Constants.WSDL_PROPERTY_RPC_XMLTYPE);
- if (property != null)
- {
- String qnameRef = property.getValue();
- int colIndex = qnameRef.indexOf(':');
- String prefix = qnameRef.substring(0, colIndex);
- String localPart = qnameRef.substring(colIndex + 1);
- String nsURI = wsdlDefinitions.getNamespaceURI(prefix);
- xmlType = new QName(nsURI, localPart, prefix);
- }
- }
-
- if (xmlType == null)
- throw new WSException("Cannot obtain xmlType for element: " +
element);
-
- return xmlType;
- }
-
- /**
- * Gets the child parts associated with this message reference. This is only
- * used for RPC style, and currently only supported by WSDL 1.1.
- *
- * @return the list of rpc parts that make up the message
- */
- public Collection<WSDLRPCPart> getChildParts()
- {
- return childParts.values();
- }
-
- /**
- * Gets the child part associated with this message reference by part name.
- * This is only used for RPC style, and currently only supported by WSDL 1.1.
- *
- * @param name the part name
- * @return the part or null if not found
- */
- public WSDLRPCPart getChildPart(String name)
- {
- return childParts.get(name);
- }
-
- /**
- * Adds a child part to this mesage reference. This is only used for RPC
- * style, and currently only supported by WSDL 1.1.
- *
- * @param childPart the list of rpc parts that make up the message
- */
- public void addChildPart(WSDLRPCPart childPart)
- {
- this.childParts.put(childPart.getName(), childPart);
- }
-
- /**
- * Removes a speficied child part. This is This is only used for RPC
- * style, and currently only supported by WSDL 1.1.
- *
- * @param name the name of the part
- */
- public void removeChildPart(String name)
- {
- this.childParts.remove(name);
- }
-
- /**
- * Gets the WSDL 1.1 part name.
- *
- * @return the part name
- */
- public String getPartName()
- {
- return partName;
- }
-
- /**
- * Sets the WSDL 1.1 message name.
- *
- * @param messageName The part name
- */
- public void setMessageName(QName messageName)
- {
- this.messageName = messageName;
- }
-
- /**
- * Gets the WSDL 1.1 message name.
- *
- * @return the message name
- */
- public QName getMessageName()
- {
- return messageName;
- }
-
- /**
- * Sets the WSDL 1.1 part name.
- *
- * @param partName The part name
- */
- public void setPartName(String partName)
- {
- this.partName = partName;
- }
-
- public int compareTo(Object o)
- {
- int c = -1;
- if (o instanceof WSDLInterfaceMessageReference)
- {
- WSDLInterfaceMessageReference w = (WSDLInterfaceMessageReference) o;
- String oname = w.getElement().getLocalPart();
- String myname = getElement().getLocalPart();
- c = myname.compareTo(oname);
- }
- return c;
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceMessageReference.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceMessageReference.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperation.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperation.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperation.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,284 +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.wsdl;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.ws.Constants;
-import org.jboss.ws.WSException;
-import org.jboss.ws.metadata.wsdl.WSDLRPCSignatureItem.Direction;
-
-// $Id$
-
-/**
- * An Interface Operation component describes an operation that a given interface
supports. An operation is
- * an interaction with the service consisting of a set (ordinary and fault) messages
exchanged between the
- * service and the other roles involved in the interaction, in particular the service
requester. The sequencing
- * and cardinality of the messages involved in a particular interaction is governed by
the message exchange
- * pattern used by the operation (see {message exchange pattern} property).
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 10-Oct-2004
- */
-public class WSDLInterfaceOperation extends Extendable implements Comparable
-{
- private static final long serialVersionUID = -5014918078197942626L;
-
- // The parent interface
- private WSDLInterface wsdlInterface;
-
- /** The REQUIRED name attribute information item identifies a given operation element
information item inside a
- * given interface element information item.
- */
- private NCName name;
-
- /** The OPTIONAL pattern attribute information item identifies the message exchange
pattern a given operation uses.
- */
- private String pattern;
-
- /** The OPTIONAL style attribute information item indicates the rules that were used
to construct the {element}
- * properties of the Message Reference components which are members of the {message
references}
- * property of the [owner] operation.
- */
- private String style = Constants.URI_STYLE_RPC;
-
- /** The OPTIONAL safe attribute information item indicates whether the operation is
safe or not.
- */
- private boolean safe;
-
- /** Zero or more input element information items */
- private Map<QName, WSDLInterfaceOperationInput> inputs = new
LinkedHashMap<QName, WSDLInterfaceOperationInput>();
- /** Zero or more output element information items */
- private Map<QName, WSDLInterfaceOperationOutput> outputs = new
LinkedHashMap<QName, WSDLInterfaceOperationOutput>();
- /** Zero or more infault element information items */
- private ArrayList<WSDLInterfaceOperationInfault> infaults = new
ArrayList<WSDLInterfaceOperationInfault>();
- /** Zero or more outfault element information items */
- private ArrayList<WSDLInterfaceOperationOutfault> outfaults = new
ArrayList<WSDLInterfaceOperationOutfault>();
- /** Zero or more signature items */
- private LinkedHashMap<String, WSDLRPCSignatureItem> rpcSignatureItems = new
LinkedHashMap<String, WSDLRPCSignatureItem>();
-
- public WSDLInterfaceOperation(WSDLInterface wsdlInterface)
- {
- this.wsdlInterface = wsdlInterface;
- }
-
- public WSDLInterface getWsdlInterface()
- {
- return wsdlInterface;
- }
-
- public NCName getName()
- {
- return name;
- }
-
- public void setName(NCName name)
- {
- this.name = name;
- }
-
- public QName getQName()
- {
- String nsURI = wsdlInterface.getQName().getNamespaceURI();
- return new QName(nsURI, name.toString());
- }
-
- public String getPattern()
- {
- return pattern;
- }
-
- public void setPattern(String pattern)
- {
- this.pattern = pattern;
- }
-
- public String getStyle()
- {
- return style;
- }
-
- public void setStyle(String style)
- {
- this.style = style;
- }
-
- public boolean isSafe()
- {
- return safe;
- }
-
- public void setSafe(boolean safe)
- {
- this.safe = safe;
- }
-
- public WSDLInterfaceOperationInput[] getInputs()
- {
- WSDLInterfaceOperationInput[] arr = new
WSDLInterfaceOperationInput[inputs.size()];
- new ArrayList<WSDLInterfaceOperationInput>(inputs.values()).toArray(arr);
- return arr;
- }
-
- public void addInput(WSDLInterfaceOperationInput input)
- {
- QName xmlName = input.getElement();
- if (inputs.get(xmlName) != null)
- throw new WSException("Attempt to map multiple operation inputs to: "
+ xmlName);
- inputs.put(xmlName, input);
- }
-
- public WSDLInterfaceOperationInput getInput(QName qname)
- {
- WSDLInterfaceOperationInput opInput =
(WSDLInterfaceOperationInput)inputs.get(qname);
- return opInput;
- }
-
- public void removeInput(QName element)
- {
- inputs.remove(element);
- }
-
- public WSDLInterfaceOperationInput getInputByPartName(String partName)
- {
- WSDLInterfaceOperationInput opInput = null;
- for (WSDLInterfaceOperationInput auxInput : inputs.values())
- {
- WSDLProperty property =
auxInput.getProperty(Constants.WSDL_PROPERTY_PART_NAME);
- if (property != null && property.getValue().equals(partName))
- opInput = auxInput;
- }
- return opInput;
- }
-
- public WSDLInterfaceOperationOutput[] getOutputs()
- {
- WSDLInterfaceOperationOutput[] arr = new
WSDLInterfaceOperationOutput[outputs.size()];
- new ArrayList<WSDLInterfaceOperationOutput>(outputs.values()).toArray(arr);
- return arr;
- }
-
- public void addOutput(WSDLInterfaceOperationOutput output)
- {
- QName xmlName = output.getElement();
- if (outputs.get(xmlName) != null)
- throw new WSException("Attempt to map multiple operation outputs to: "
+ xmlName);
- outputs.put(xmlName, output);
- }
-
- public WSDLInterfaceOperationOutput getOutput(QName qname)
- {
- WSDLInterfaceOperationOutput opOutput =
(WSDLInterfaceOperationOutput)outputs.get(qname);
- return opOutput;
- }
-
- public WSDLInterfaceOperationOutput getOutputByPartName(String partName)
- {
- WSDLInterfaceOperationOutput opOutput = null;
- for (WSDLInterfaceOperationOutput auxOutput : outputs.values())
- {
- WSDLProperty property =
auxOutput.getProperty(Constants.WSDL_PROPERTY_PART_NAME);
- if (property != null && property.getValue().equals(partName))
- opOutput = auxOutput;
- }
- return opOutput;
- }
-
- public WSDLInterfaceOperationInfault[] getInfaults()
- {
- WSDLInterfaceOperationInfault[] arr = new
WSDLInterfaceOperationInfault[infaults.size()];
- infaults.toArray(arr);
- return arr;
- }
-
- public void addInfault(WSDLInterfaceOperationInfault infault)
- {
- infaults.add(infault);
- }
-
- public WSDLInterfaceOperationOutfault[] getOutfaults()
- {
- WSDLInterfaceOperationOutfault[] arr = new
WSDLInterfaceOperationOutfault[outfaults.size()];
- outfaults.toArray(arr);
- return arr;
- }
-
- public void addOutfault(WSDLInterfaceOperationOutfault outfault)
- {
- outfaults.add(outfault);
- }
-
- public Collection<WSDLRPCSignatureItem> getRpcSignatureItems()
- {
- return rpcSignatureItems.values();
- }
-
-
- public void addRpcSignatureItem(WSDLRPCSignatureItem item)
- {
- if (item.getDirection() != Direction.RETURN)
- item.setPosition(rpcSignatureItems.size());
- rpcSignatureItems.put(item.getName(), item);
- }
-
- public WSDLRPCSignatureItem getRpcSignatureitem(String name)
- {
- return rpcSignatureItems.get(name);
- }
-
- /**
- * Attempts to locate a binding operation for this interface operation.
- *
- * @return the binding operation, or null if not found;
- */
- public WSDLBindingOperation getBindingOperation()
- {
- WSDLInterface wsdlInterface = getWsdlInterface();
- WSDLBinding binding =
wsdlInterface.getWsdlDefinitions().getBindingByInterfaceName(wsdlInterface.getQName());
- if (binding == null)
- return null;
-
- WSDLBindingOperation bindingOperation = binding.getOperationByRef(getQName());
- if (bindingOperation == null)
- return null;
-
- return bindingOperation;
- }
-
- public int compareTo(Object o)
- {
- int c = -1;
- if (o instanceof WSDLInterfaceOperation)
- {
- WSDLInterfaceOperation w = (WSDLInterfaceOperation)o;
- String oname = w.getName().toString();
- String myname = name.toString();
- c = myname.compareTo(oname);
- }
- return c;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperation.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperation.java)
Deleted:
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationInfault.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationInfault.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationInfault.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -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.wsdl;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-
-/**
- * A Fault Reference component associates a defined type, specified by an Interface Fault
component, to a
- * fault message exchanged in an operation.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 10-Oct-2004
- */
-public class WSDLInterfaceOperationInfault extends Extendable
-{
- private static final long serialVersionUID = 1124693747462594773L;
-
- // The parent interface operation
- private WSDLInterfaceOperation wsdlInterfaceOperation;
-
- /** A REQUIRED reference to an Interface Fault component in the {faults} property of
the parent
- * Interface Operation component's parent Interface component. Identifying the
Interface Fault
- * component therefore indirectly defines the actual content or payload of the fault
message.
- */
- private QName ref;
-
- /** An OPTIONAL identifier of the message this fault relates to among those defined in
the {message exchange
- * pattern} property of the Interface Operation component it is contained within. The
value of this
- * property MUST match the name of a placeholder message defined by the message
exchange pattern.
- */
- private NCName messageLabel;
-
- public WSDLInterfaceOperationInfault(WSDLInterfaceOperation wsdlInterfaceOperation)
- {
- this.wsdlInterfaceOperation = wsdlInterfaceOperation;
- }
-
- public WSDLInterfaceOperation getWsdlInterfaceOperation()
- {
- return wsdlInterfaceOperation;
- }
-
- public QName getRef()
- {
- return ref;
- }
-
- public void setRef(QName ref)
- {
- this.ref = ref;
- }
-
- public NCName getMessageLabel()
- {
- return messageLabel;
- }
-
- public void setMessageLabel(NCName messageLabel)
- {
- this.messageLabel = messageLabel;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationInfault.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationInfault.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationInput.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationInput.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationInput.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,41 +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.wsdl;
-
-// $Id$
-
-/**
- * A Message Reference component associates a defined type with a message exchanged in an
operation. By
- * default, the type system is based upon the XML Infoset
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 10-Oct-2004
- */
-public class WSDLInterfaceOperationInput extends WSDLInterfaceMessageReference
-{
- private static final long serialVersionUID = -4691488323709300920L;
-
- public WSDLInterfaceOperationInput(WSDLInterfaceOperation wsdlOperation)
- {
- super(wsdlOperation);
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationInput.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationInput.java)
Deleted:
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationOutfault.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationOutfault.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationOutfault.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -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.wsdl;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-
-/**
- * A Fault Reference component associates a defined type, specified by an Interface Fault
component, to a
- * fault message exchanged in an operation.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 10-Oct-2004
- */
-public class WSDLInterfaceOperationOutfault extends Extendable
-{
- private static final long serialVersionUID = 1365062002410904728L;
-
- // The parent interface operation
- private WSDLInterfaceOperation wsdlInterfaceOperation;
-
- /** A REQUIRED reference to an Interface Fault component in the {faults} property of
the parent
- * Interface Operation component's parent Interface component. Identifying the
Interface Fault
- * component therefore indirectly defines the actual content or payload of the fault
message.
- */
- private QName ref;
-
- /** An OPTIONAL identifier of the message this fault relates to among those defined in
the {message exchange
- * pattern} property of the Interface Operation component it is contained within. The
value of this
- * property MUST match the name of a placeholder message defined by the message
exchange pattern.
- */
- private NCName messageLabel;
-
- public WSDLInterfaceOperationOutfault(WSDLInterfaceOperation wsdlInterfaceOperation)
- {
- this.wsdlInterfaceOperation = wsdlInterfaceOperation;
- }
-
- public WSDLInterfaceOperation getWsdlInterfaceOperation()
- {
- return wsdlInterfaceOperation;
- }
-
- public QName getRef()
- {
- return ref;
- }
-
- public void setRef(QName ref)
- {
- this.ref = ref;
- }
-
- public NCName getMessageLabel()
- {
- return messageLabel;
- }
-
- public void setMessageLabel(NCName messageLabel)
- {
- this.messageLabel = messageLabel;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationOutfault.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationOutfault.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationOutput.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationOutput.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationOutput.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,41 +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.wsdl;
-
-// $Id$
-
-/**
- * A Message Reference component associates a defined type with a message exchanged in an
operation. By
- * default, the type system is based upon the XML Infoset
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 10-Oct-2004
- */
-public class WSDLInterfaceOperationOutput extends WSDLInterfaceMessageReference
-{
- private static final long serialVersionUID = 5096501821825901473L;
-
- public WSDLInterfaceOperationOutput(WSDLInterfaceOperation wsdlOperation)
- {
- super(wsdlOperation);
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationOutput.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationOutput.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLMIMEPart.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLMIMEPart.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLMIMEPart.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,78 +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.wsdl;
-
-import java.io.Serializable;
-
-import javax.xml.namespace.QName;
-
-/**
- * Represents a WSDL 1.1 MIME Multipart attachment.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class WSDLMIMEPart implements Serializable
-{
- private static final long serialVersionUID = -3102495235178249853L;
-
- private final String partName;
- private final QName xmlType;
- private final String mimeTypes;
-
- public WSDLMIMEPart(String partName, QName xmlType, String mimeTypes)
- {
- this.mimeTypes = mimeTypes;
- this.partName = partName;
- this.xmlType = xmlType;
- }
-
- /**
- * Returns the xml type of this attachment. Typically xsd:hexBinary
- *
- * @return the name of the header schema element
- */
- public QName getXmlType()
- {
- return xmlType;
- }
-
- /**
- * Returns the name of the WSDL 1.1 part, if the output is WSDL 1.1
- *
- * @return the name of the part
- */
- public String getPartName()
- {
- return partName;
- }
-
- /**
- * Returns a comma seperated list of allowed mime types.
- *
- * @return the mime types
- */
- public String getMimeTypes()
- {
- return mimeTypes;
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLMIMEPart.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLMIMEPart.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLProperty.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLProperty.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLProperty.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,117 +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.wsdl;
-
-import java.io.Serializable;
-
-import javax.xml.namespace.QName;
-
-// $Id$
-
-
-/**
- * A "property" in the Features and Properties architecture represents a named
runtime value which affects
- * the behaviour of some aspect of a Web service interaction, much like an environment
variable. For
- * example, a reliable messaging SOAP module may specify a property to control the number
of retries in the
- * case of network failure. WSDL documents may specify the value constraints for these
properties by
- * referring to a Schema type, or by specifying a particular value. Properties, and hence
property values, can
- * be shared amongst features/bindings/modules, and are named with URIs precisely to
allow this type of
- * sharing.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 10-Oct-2004
- */
-public class WSDLProperty implements Serializable
-{
- private static final long serialVersionUID = -7528676719881753461L;
-
- /** A REQUIRED uri attribute information item */
- private String uri;
- /** An OPTIONAL required attribute information item */
- private boolean required;
- /** The OPTIONAL value of the property, an ordered list of child information items,
as
- * specified by the [children] property of element information items */
- private String value;
- /** A OPTIONAL type definition constraining the value of the property, or the token
- * #value if the {value} property is not empty.*/
- private QName constraint;
-
- public WSDLProperty(String uri, String value)
- {
- if (uri == null)
- throw new IllegalArgumentException("Illegal property URI: " + uri);
-
- this.uri = uri;
- this.value = value;
- }
-
- public WSDLProperty(String uri, boolean required, String value, QName constraint)
- {
- if (uri == null)
- throw new IllegalArgumentException("Illegal property URI: " + uri);
-
- this.uri = uri;
- this.required = required;
- this.value = value;
- this.constraint = constraint;
- }
-
- public String getURI()
- {
- return uri;
- }
-
- public boolean isRequired()
- {
- return required;
- }
-
- public void setRequired(boolean required)
- {
- this.required = required;
- }
-
- public String getValue()
- {
- return value;
- }
-
- public void setValue(String value)
- {
- this.value = value;
- }
-
- public QName getConstraint()
- {
- return constraint;
- }
-
- public void setConstraint(QName constraint)
- {
- this.constraint = constraint;
- }
-
- public String toString()
- {
- return "[" + uri + "=" + value + "]";
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLProperty.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLProperty.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLRPCPart.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLRPCPart.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLRPCPart.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,63 +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.wsdl;
-
-import javax.xml.namespace.QName;
-
-/**
- * Represents a child part of a RPC style message reference. This is currently
- * only used for WSDL 1.1 compatibility.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class WSDLRPCPart
-{
- private final String name;
- private final QName type;
-
- public WSDLRPCPart(String name, QName type)
- {
- this.name = name;
- this.type = type;
- }
-
- /**
- * Gets the XML local name of this part.
- *
- * @return the XML local name
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Gets the XML type of this part.
- *
- * @return the XML type
- */
- public QName getType()
- {
- return type;
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLRPCPart.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLRPCPart.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLRPCSignatureItem.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLRPCSignatureItem.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLRPCSignatureItem.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,75 +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.wsdl;
-
-
-/**
- * Represents an individual item of a wrpc:signature
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class WSDLRPCSignatureItem
-{
- public enum Direction {IN, OUT, INOUT, RETURN};
-
- private Direction direction;
- private final String name;
- private int position;
-
- public WSDLRPCSignatureItem(String name)
- {
- this.name = name;
- this.direction = Direction.IN;
- }
-
- public WSDLRPCSignatureItem(String name, Direction direction)
- {
- this.direction = direction;
- this.name = name;
- }
-
- public String getName()
- {
- return name;
- }
-
- public Direction getDirection()
- {
- return direction;
- }
-
- public void setDirection(Direction direction)
- {
- this.direction = direction;
- }
-
- public void setPosition(int position)
- {
- this.position = position;
- }
-
- public int getPosition()
- {
- return position;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLRPCSignatureItem.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLRPCSignatureItem.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLSOAPHeader.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLSOAPHeader.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLSOAPHeader.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,144 +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.wsdl;
-
-import java.io.Serializable;
-
-import javax.xml.namespace.QName;
-
-/**
- * Represents a WSDL 2.0 SOAP Header Block. The presence of the SOAP Header
- * Block component indicates that the service supports headers and MAY require a
- * web service consumer/client to use the header. It may appear up to one time
- * in the message.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class WSDLSOAPHeader implements Serializable
-{
- private static final long serialVersionUID = -3102495235178249853L;
-
- private final QName element;
- private final String partName;
- private boolean required = false;
- private boolean mustUnderstand = false;
- private boolean includeInSignature = false;
-
- public WSDLSOAPHeader(QName element, String partName)
- {
- this.element = element;
- this.partName = partName;
- }
-
- /**
- * Returns the name of the header schema element that describes the header's
- * contents.
- *
- * @return the name of the header schema element
- */
- public QName getElement()
- {
- return element;
- }
-
- /**
- * Returns the name of the WSDL 1.1 part, if the output is WSDL 1.1
- *
- * @return the name of the part
- */
- public String getPartName()
- {
- return partName;
- }
-
- /**
- * Indicates whether the resulting SOAP header has a mustUnderstand attribute
- * set to true.
- *
- * @return the value of the SOAP mustUnderstand attribute
- */
- public boolean isMustUnderstand()
- {
- return mustUnderstand;
- }
-
- /**
- * Specifies whether the resulting SOAP Header has a mustUnderstand attribute
- * set to true.
- *
- * @param mustUnderstand the value of the SOAP mustUnderstand attribute
- */
- public void setMustUnderstand(boolean mustUnderstand)
- {
- this.mustUnderstand = mustUnderstand;
- }
-
- /**
- * Indicates whether the resulting SOAP header must be present in the
- * message.
- *
- * @return true if the header must be present, otherwise false
- */
- public boolean isRequired()
- {
- return required;
- }
-
- /**
- * Specifies whether the resulting SOAP header is required to be present on
- * the message.
- *
- * @param required true if the header must be present, otherwise false
- */
- public void setRequired(boolean required)
- {
- this.required = required;
- }
-
- /**
- * Indicates the resulting WSDL should include this header as part of the
- * interface message. This is currently only valid for WSDL 1.1, as WSDL 2.0
- * does not have an equivalent way to specify this. This serves as a hint to
- * binding tools that the header should be mapped to a Java parameter.
- *
- * @return whether the header should be part of the interface message
- */
- public boolean isIncludeInSignature()
- {
- return includeInSignature;
- }
-
- /**
- * Speficies the resulting WSDL should include this header as part of the
- * interface message. This is currently only valid for WSDL 1.1, as WSDL 2.0
- * does not have an equivalent way to specify this. This serves as a hint to
- * binding tools that the header should be mapped to a Java parameter.
- *
- * @param includeInSignature whether the header should be part of the
- * interface message
- */
- public void setIncludeInSignature(boolean includeInSignature)
- {
- this.includeInSignature = includeInSignature;
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLSOAPHeader.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLSOAPHeader.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLService.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLService.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLService.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,139 +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.wsdl;
-
-// $Id$
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-
-/**
- * A Service component describes a set of endpoints (see 2.14 Endpoint [p.62] ) at which
a particular
- * deployed implementation of the service is provided. The endpoints thus are in effect
alternate places at
- * which the service is provided.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 10-Oct-2004
- */
-public class WSDLService extends Extendable
-{
- private static final long serialVersionUID = 1274166611190648479L;
-
- // provide logging
- private static final Logger log = Logger.getLogger(WSDLService.class);
-
- // The parent WSDL definitions element.
- private WSDLDefinitions wsdlDefinitions;
-
- /** The REQUIRED name attribute information item together with the targetNamespace
attribute information item
- * of the definitions element information item forms the QName of the service.*/
- private NCName name;
-
- /** Derived QName identifier.
- */
- private QName qname;
-
- /** The interface attribute information item identifies the interface that the service
is an instance of. */
- private QName interfaceName;
-
- /** One or more endpoint element information items */
- private ArrayList<WSDLEndpoint> endpoints = new
ArrayList<WSDLEndpoint>();
-
- public WSDLService(WSDLDefinitions wsdlDefinitions)
- {
- log.trace("new WSDLService");
- this.wsdlDefinitions = wsdlDefinitions;
- }
-
- public WSDLDefinitions getWsdlDefinitions()
- {
- return wsdlDefinitions;
- }
-
- public NCName getName()
- {
- return name;
- }
-
- public void setName(NCName name)
- {
- log.trace("setName: " + name);
- this.name = name;
- }
-
- public QName getQName()
- {
- if (qname == null)
- {
- String tnsURI = wsdlDefinitions.getTargetNamespace();
- qname = new QName(tnsURI, name.toString());
- }
- return qname;
- }
-
-
- public void setQName(QName qname)
- {
- log.trace("setQName: " + qname);
- this.qname = qname;
- }
-
- public QName getInterfaceName()
- {
- return interfaceName;
- }
-
- public void setInterfaceName(QName interfaceName)
- {
- this.interfaceName = interfaceName;
- }
-
- public WSDLEndpoint[] getEndpoints()
- {
- WSDLEndpoint[] arr = new WSDLEndpoint[endpoints.size()];
- endpoints.toArray(arr);
- return arr;
- }
-
- public void addEndpoint(WSDLEndpoint endpoint)
- {
- endpoints.add(endpoint);
- }
-
- /** Get an endpoint for the given name
- */
- public WSDLEndpoint getEndpoint(QName portName)
- {
- Iterator it = endpoints.iterator();
- while (it.hasNext())
- {
- WSDLEndpoint wsdlEndpoint = (WSDLEndpoint)it.next();
- if (portName.equals(wsdlEndpoint.getQName()))
- return wsdlEndpoint;
- }
- return null;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLService.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLService.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLTypes.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLTypes.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLTypes.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,76 +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.wsdl;
-
-//$Id$
-
-import java.io.Serializable;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-
-/**
- * WSDL types.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author Anil.Saldhana(a)jboss.org
- * @since 10-Oct-2004
- */
-public abstract class WSDLTypes implements Serializable
-{
- private static final long serialVersionUID = 7919937323521372194L;
-
- // provide logging
- static private final Logger log = Logger.getLogger(WSDLTypes.class);
-
- private WSDLDefinitions wsdlDefinitions;
- private String namespace;
-
- public abstract QName getXMLType(QName name);
-
- public WSDLDefinitions getWsdlDefinitions()
- {
- return wsdlDefinitions;
- }
-
- void setWSDLDefintiions(WSDLDefinitions parent)
- {
- wsdlDefinitions = parent;
- }
-
- /**
- * Gets the namespace associate with this types declaration. Currently this is used to
filter
- * which WSDL file receives this types definition. Null means all files.
- *
- * @return the namespace associated with this type definition
- */
- public String getNamespace()
- {
- return namespace;
- }
-
- public void setNamespace(String namespace)
- {
- this.namespace = namespace;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLTypes.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLTypes.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLUtils.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLUtils.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLUtils.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,887 +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.wsdl;
-
-import java.io.File;
-import java.io.IOException;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Stack;
-import java.util.StringTokenizer;
-
-import javax.ejb.SessionBean;
-import javax.jws.WebMethod;
-import javax.jws.WebService;
-import javax.xml.namespace.QName;
-import javax.xml.rpc.holders.BigDecimalHolder;
-import javax.xml.rpc.holders.BigIntegerHolder;
-import javax.xml.rpc.holders.BooleanHolder;
-import javax.xml.rpc.holders.BooleanWrapperHolder;
-import javax.xml.rpc.holders.ByteArrayHolder;
-import javax.xml.rpc.holders.ByteHolder;
-import javax.xml.rpc.holders.ByteWrapperHolder;
-import javax.xml.rpc.holders.CalendarHolder;
-import javax.xml.rpc.holders.DoubleHolder;
-import javax.xml.rpc.holders.DoubleWrapperHolder;
-import javax.xml.rpc.holders.FloatHolder;
-import javax.xml.rpc.holders.FloatWrapperHolder;
-import javax.xml.rpc.holders.Holder;
-import javax.xml.rpc.holders.IntHolder;
-import javax.xml.rpc.holders.IntegerWrapperHolder;
-import javax.xml.rpc.holders.LongHolder;
-import javax.xml.rpc.holders.LongWrapperHolder;
-import javax.xml.rpc.holders.ObjectHolder;
-import javax.xml.rpc.holders.QNameHolder;
-import javax.xml.rpc.holders.ShortHolder;
-import javax.xml.rpc.holders.ShortWrapperHolder;
-import javax.xml.rpc.holders.StringHolder;
-
-import org.apache.xerces.xs.XSComplexTypeDefinition;
-import org.apache.xerces.xs.XSTypeDefinition;
-import org.jboss.ws.Constants;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.jaxrpc.ParameterWrapping;
-import org.jboss.ws.core.utils.HolderUtils;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
-import org.jboss.xb.binding.Util;
-
-/**
- * Singleton utils class used for Java2WSDL and WSDL2Java operations
- *
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- * @since Nov 3, 2004
- */
-
-public class WSDLUtils
-{
- private String newline = "\n";
- private static WSDLUtils instance = new WSDLUtils();
-
- private List wrapperlist = null;
- private List primlist = null;
-
- private final Map primitiveMap = new HashMap();
-
- private final static Map<String,Class> schemaBasicTypes = new
HashMap<String,Class>();
-
- private final static Map<Class,Class> holderTypes = new
HashMap<Class,Class>();
- private final static Map<Class,Class> reverseHolderTypes = new
HashMap<Class,Class>();
-
- // Skip these methods when generating wsdl operations
- private List<String> ignoredMethods;
-
- static
- {
- schemaBasicTypes.put("anyURI", java.net.URI.class);
- schemaBasicTypes.put("boolean", Boolean.TYPE);
- schemaBasicTypes.put("byte", Byte.TYPE);
- schemaBasicTypes.put("decimal", java.math.BigDecimal.class);
- schemaBasicTypes.put("double", Double.TYPE);
- schemaBasicTypes.put("dateTime", Calendar.class);
- schemaBasicTypes.put("float", Float.TYPE);
- schemaBasicTypes.put("int", Integer.TYPE);
- schemaBasicTypes.put("integer", BigInteger.class);
- schemaBasicTypes.put("long", Long.TYPE);
- schemaBasicTypes.put("QName", QName.class);
- schemaBasicTypes.put("short", Short.TYPE);
- schemaBasicTypes.put("String", String.class);
- }
-
- static
- {
- holderTypes.put(BigDecimal.class,BigDecimalHolder.class);
- holderTypes.put(BigInteger.class,BigIntegerHolder.class);
- holderTypes.put(boolean.class,BooleanHolder.class);
- holderTypes.put(Boolean.class,BooleanWrapperHolder.class);
- holderTypes.put(byte.class,ByteHolder.class);
- holderTypes.put(Byte.class,ByteWrapperHolder.class);
- holderTypes.put(Byte[].class,ByteArrayHolder.class);
- holderTypes.put(Calendar.class,CalendarHolder.class);
- holderTypes.put(double.class,DoubleHolder.class);
- holderTypes.put(Double.class,DoubleWrapperHolder.class);
- holderTypes.put(float.class, FloatHolder.class);
- holderTypes.put(Float.class, FloatWrapperHolder.class);
- holderTypes.put(int.class,IntHolder.class);
- holderTypes.put(Integer.class,IntegerWrapperHolder.class);
- holderTypes.put(long.class,LongHolder.class);
- holderTypes.put(Long.class,LongWrapperHolder.class);
- holderTypes.put(Object.class,ObjectHolder.class);
- holderTypes.put(QName.class,QNameHolder.class);
- holderTypes.put(short.class,ShortHolder.class);
- holderTypes.put(Short.class,ShortWrapperHolder.class);
- holderTypes.put(String.class,StringHolder.class);
- }
-
- static
- {
- reverseHolderTypes.put(BigDecimalHolder.class , BigDecimal.class);
- reverseHolderTypes.put(BigIntegerHolder.class , BigInteger.class);
- reverseHolderTypes.put(BooleanHolder.class , boolean.class);
- reverseHolderTypes.put(BooleanWrapperHolder.class, Boolean.class);
- reverseHolderTypes.put(ByteArrayHolder.class, Byte[].class);
- reverseHolderTypes.put(ByteHolder.class, byte.class);
- reverseHolderTypes.put(ByteWrapperHolder.class,Byte.class );
- reverseHolderTypes.put(CalendarHolder.class,Calendar.class);
- reverseHolderTypes.put(DoubleHolder.class,double.class );
- reverseHolderTypes.put(DoubleWrapperHolder.class,Double.class);
- reverseHolderTypes.put(FloatHolder.class,float.class);
- reverseHolderTypes.put(FloatWrapperHolder.class, Float.class);
- reverseHolderTypes.put(IntHolder.class,int.class );
- reverseHolderTypes.put(IntegerWrapperHolder.class,Integer.class );
- reverseHolderTypes.put(LongHolder.class, long.class);
- reverseHolderTypes.put(LongWrapperHolder.class,Long.class);
- reverseHolderTypes.put(ObjectHolder.class,Object.class);
- reverseHolderTypes.put(QNameHolder.class,QName.class);
- reverseHolderTypes.put(ShortHolder.class,short.class);
- reverseHolderTypes.put(ShortWrapperHolder.class,Short.class);
- reverseHolderTypes.put(StringHolder.class,String.class);
- }
-
-
- /**
- * Singleton - Only way to get an instance
- * @return
- */
- public static WSDLUtils getInstance()
- {
- return instance;
- }
-
- private WSDLUtils()
- {
- wrapperlist = new ArrayList();
- primlist = new ArrayList();
- populatePrimList();
- populateWrapperList();
- createPrimitiveMap();
- }
-
- /**
- * Check if it is of Primitive Type
- * @param str
- * @return
- */
- public boolean isPrimitive(String str)
- {
- return primlist.contains(str);
- }
-
- /**
- * Check if it is of Wrapper Type
- * @param str
- * @return
- */
- public boolean isWrapper(String str)
- {
- return wrapperlist.contains(str);
- }
-
- /**
- * For the given complex type, check if its base type is the regular xsd type
(xsd:anyType)
- * which can be ignored
- * @param baseType
- * @param t ComplexTypeDefinition
- * @return true:ignorable, false-otherwise(user defined base type)
- */
- public boolean isBaseTypeIgnorable(XSTypeDefinition baseType, XSComplexTypeDefinition
t)
- {
- boolean bool = false;
-
- //Check baseType is xsd:anyType
- if (baseType != null)
- {
- if (baseType.getNamespace() == Constants.NS_SCHEMA_XSD &&
- baseType.getName().equals("anyType"))
- bool = true; //Ignore this baseType
- }
- if (XSComplexTypeDefinition.CONTENTTYPE_SIMPLE == t.getContentType())
- {
- bool = true; //ComplexType has a simplecontent
- }
-
- return bool;
-
- }
-
-
- /**
- * Check if the class is a Java standard class
- * @param cls
- * @return true if class belongs to java.* or javax.* package
- */
- public boolean checkIgnoreClass(Class cls)
- {
- if(cls == null)
- throw new IllegalArgumentException("Illegal null argument:cls");
- //if (cls.isArray()) cls = cls.getComponentType();
- if (!cls.isArray())
- {
- String pkgname = cls.getPackage() != null ? cls.getPackage().getName() : null;
- if (pkgname != null && pkgname.startsWith("java")) return
true;
-
- if (ParameterWrapping.WrapperType.class.isAssignableFrom(cls))
- return true;
-
- }
- return false;
- }
-
-
- /** Check if this method should be ignored
- */
- public boolean checkIgnoreMethod(Method method)
- {
- String methodname = method.getName();
- if (ignoredMethods == null)
- {
- ignoredMethods = new ArrayList<String>();
- Method[] objMethods = Object.class.getMethods();
- for (int i = 0; i < objMethods.length; i++)
- {
- ignoredMethods.add(objMethods[i].getName());
- }
- //Add the SessionBean Methods to the ignore list
- Method[] sbMethods = SessionBean.class.getMethods();
- for (int i = 0; i < sbMethods.length; i++)
- {
- ignoredMethods.add(sbMethods[i].getName());
- }
- }
-
- boolean ignoreMethod = ignoredMethods.contains(methodname);
-
- // FIXME: This code is a duplicate, it should read from the UMDM
- if (method.getDeclaringClass().isAnnotationPresent(WebService.class) &&
method.isAnnotationPresent(WebMethod.class) == false)
- ignoreMethod = true;
-
- return ignoreMethod;
- }
-
-
- /**
- * Chop "PortType" at the end of the String
- * @param name
- * @return
- */
- public String chopPortType(String name)
- {
- int index = name.lastIndexOf("PortType");
- if (index > 0) return name.substring(0, index);
-
- return name;
- }
-
- /**
- * Chop chopstr at the end of the String
- * @param name
- * @param chopstr the string that is the key Eg: Fault
- * @return
- */
- public String chop(String name, String chopstr)
- {
- int index = name.lastIndexOf(chopstr);
- if (index > 0) return name.substring(0, index);
-
- return name;
- }
-
- /**
- * Given a packageName, start creating the package structure
- * @param packageName
- */
- public File createPackage(String path, String packageName)
- {
- if(packageName == null )
- throw new IllegalArgumentException("Illegal Null Argument:
packageName");
- if(path == null)
- throw new IllegalArgumentException("Illegal Null Argument: path");
- String pac = packageName.replace('.', '/');
- File dir = new File(path + "/" + pac);
- dir.mkdirs();
- return dir;
- }
-
- /**
- * Create a file on the disk
- * @param loc Location where the file has to be created
- * @param fname File Name to which '.java' will be appended
- * @return
- * @throws IOException Problem creating the file
- */
- public File createPhysicalFile(File loc, String fname)
- throws IOException
- {
- if(loc == null )
- throw new IllegalArgumentException("Illegal Null Argument: loc");
- if(fname == null)
- throw new IllegalArgumentException("Illegal Null Argument: fname");
- File sei = new File(loc.getAbsolutePath() + "/" + fname +
".java");
- //Delete the sei if already exists
- if (sei.exists()) sei.delete();
- boolean boolCreate = sei.createNewFile();
- if (!boolCreate)
- throw new WSException("SEI " + fname + ".java cannot be
created");
- return sei;
- }
-
-
- /**
- * Create the basic template of a class
- * @param pkgname Package Name
- * @param fname File Name to which '.java' will be appended
- * @param type XSDType to obtain base class info (if Complex Type)
- * @param importList Strings representing imports
- * @return
- */
- public StringBuilder createClassBasicStructure(String pkgname,
- String fname,
- XSTypeDefinition type,
- List importList, String baseName)
- {
- StringBuilder buf = new StringBuilder();
- writeJbossHeader(buf);
- buf.append(newline);
- buf.append("package " + pkgname + ";");
- buf.append(newline);
- buf.append(newline);
- if (importList != null)
- {
- Iterator iter = importList.iterator();
- while (iter.hasNext())
- {
- buf.append("import " + (String)iter.next() + ";");
- buf.append(newline);
- }
- }
- buf.append(newline);
- XSTypeDefinition baseType = null;
- if (type instanceof XSComplexTypeDefinition)
- {
- XSComplexTypeDefinition t = (XSComplexTypeDefinition)type;
-
- baseType = t.getBaseType();
- //Check baseType is xsd:anyType
- if (baseType != null)
- {
- if (baseType.getNamespace() == Constants.NS_SCHEMA_XSD &&
- baseType.getName().equals("anyType"))
- baseType = null; //Ignore this baseType
- }
- if (XSComplexTypeDefinition.CONTENTTYPE_SIMPLE == t.getContentType())
- {
- baseType = null; //ComplexType has a simplecontent
- }
- }
-
- buf.append("public class " + fname);
- if(baseName == null && baseType != null)
- baseName = baseType.getName();
- if(baseName != null)
- buf.append(" extends " + baseName);
- buf.append(newline);
- buf.append("{");
- buf.append(newline);
-
- return buf;
- }
-
- /**
- * Checks whether there exists a public field with the given name
- * @param javaType Class Object
- * @param name Field name to check
- * @return true - if public field exists, false-otherwise
- */
- public boolean doesPublicFieldExist( Class javaType, String name)
- {
- Field fld = null;
- try
- {
- fld = javaType.getField(name);
- }
- catch (SecurityException e)
- {
- throw e;
- }
- catch (NoSuchFieldException e)
- {
- return false;
- }
- int mod = fld.getModifiers();
- if ((mod == Modifier.PUBLIC))
- return true;
- return false;
- }
-
-
- /**
- * Ensure that the first alphabet is uppercase
- * @param fname
- * @return
- */
- public String firstLetterUpperCase(String fname)
- {
- if (fname == "" || fname == null)
- throw new WSException("String passed is null");
- //Ensure that the first character is uppercase
- if (Character.isLowerCase(fname.charAt(0)))
- {
- char[] chars = fname.toCharArray();
- char f = Character.toUpperCase(chars[0]);
- chars[0] = f;
- fname = new String(chars);
- }
- return fname;
- }
-
- /**
- * Get the dimension of an array
- * @param arr
- * @return dimension of an array
- */
- public int getArrayDimension(Class arr)
- {
- if(arr == null || arr.isArray() == false)
- throw new IllegalArgumentException("Illegal null or array arg:arr");
- int counter = 0;
- while(arr.isArray()) {
- counter += 1;
- arr = arr.getComponentType();
- }
- return counter;
- }
-
- /**
- * Return the Jaxrpc holder that
- * represents the class
- * @param cls
- * @return Jaxrpc Holder object if exists
- */
- public Class getHolder(Class cls)
- {
- return holderTypes.get(cls);
- }
-
- /**
- * Return the Java class that is represented by
- * the Jaxrpc holder
- * @param cls The jaxrpc holder type
- * @return Jaxrpc Holder object if exists
- */
- public Class getJavaTypeForHolder(Class cls)
- {
- if(Holder.class.isAssignableFrom(cls))
- return HolderUtils.getValueType(cls);
- else
- return cls;
- //return reverseHolderTypes.get(cls);
- }
-
-
- /**
- * An input of "HelloObjArray" is converted into arrayOfHelloObj
- * Applied in the input part for WSDL 1.1 Messages
- * @param arrayStr
- * @return
- */
-
- public String getMessagePartForArray(Class javaType)
- {
- StringBuilder sb = new StringBuilder();
- while (javaType.isArray())
- {
- sb.append("arrayOf");
- javaType = javaType.getComponentType();
- }
-
- sb.append(getJustClassName(javaType));
- return sb.toString();
- }
-
- /**
- * Given a class, strip out the package name
- *
- * @param cls
- * @return just the classname
- */
-
- public static String getJustClassName(Class cls)
- {
- if (cls == null) return null;
- if (cls.isArray())
- {
- Class c = cls.getComponentType();
- return getJustClassName(c.getName());
- }
-
- return getJustClassName(cls.getName());
- }
-
- /**
- * Given a FQN of a class, strip out the package name
- *
- * @param classname
- * @return just the classname
- */
- public static String getJustClassName(String classname)
- {
- int index = classname.lastIndexOf(".");
- if (index < 0)
- index = 0;
- else
- index = index + 1;
- return classname.substring(index);
- }
-
- /**
- * From the list of fields defined by this class (not superclasses)
- * get the fields that are relevant (public)
- */
- public Field[] getPublicFields(Class cls)
- {
- ArrayList list = new ArrayList();
-
- Field[] fld = cls.getDeclaredFields();
- for (int i = 0; i < fld.length; i++)
- {
- Field field = fld[i];
- int mod = field.getModifiers();
- if ((mod == Modifier.PUBLIC))
- list.add(field);
- }//end for
-
- Field[] retarr = new Field[list.size()];
- list.toArray(retarr);
-
- return retarr;
- }
-
- /**
- * From the list of fields defined by this class (not superclasses)
- * get the fields that are relevant (public/protected)
- *
- * @param methods
- * @return
- */
- public Method[] getPublicProtectedMethods(Method[] methods)
- {
- ArrayList list = new ArrayList();
- int len = methods.length;
-
- for (int i = 0; i < len; i++)
- {
- Method method = methods[i];
- int mod = method.getModifiers();
- if ((mod == Modifier.PUBLIC || mod == Modifier.PROTECTED))
- list.add(method);
- }//end for
-
- Method[] retarr = new Method[list.size()];
- list.toArray(retarr);
- return retarr;
- }
-
- /**
- * Given the XMLType, we will check if it is of basic schema
- * types that are mapped to Java primitives and wrappers
- * Jaxrpc 1.1 Section 5.3
- * @param xmlType
- * @return
- */
- public Class getJavaType(QName xmlType)
- {
- if (xmlType == null) return null;
- String localPart = xmlType.getLocalPart();
- return (Class)schemaBasicTypes.get(localPart);
- }
-
- /**
- * Change the first character to uppercase
- * @param str
- * @return
- */
- public String getMixedCase(String str)
- {
- if (str == null || str.length() == 0)
- throw new IllegalArgumentException("String passed to WSDLUtils.getMixedCase
is null");
-
- if (str.length() == 1) return str.toUpperCase();
- char[] charr = str.toCharArray();
- charr[0] = Character.toUpperCase(charr[0]);
- return new String(charr);
- }
-
-
-
- /**
- * Given a QName, provide a string that is prefix:localpart
- * @param qn
- * @return formatted string
- */
- public String getFormattedString(QName qn)
- {
- if (qn == null)
- throw new IllegalArgumentException(" QName passed is null");
- StringBuilder sb = new StringBuilder();
- String prefix = qn.getPrefix();
- String localpart = qn.getLocalPart();
- if (prefix == null || prefix == "") prefix = Constants.PREFIX_TNS;
- sb.append(prefix + ":");
- sb.append(localpart);
-
- return sb.toString();
- }
-
- /**
- * Return a QName given a formatted string
- * @param formattedStr string that is prefix:localpart
- * @return QName
- */
- public QName getQName( String formattedStr)
- {
- QName qn = null;
- int ind = formattedStr.lastIndexOf(":");
- if(ind < 0)
- throw new IllegalArgumentException("Formatted String is not of format
prefix:localpart");
- String prefix = formattedStr.substring(0,ind);
- String nsuri = null;
- if(Constants.PREFIX_XSD.equals(prefix)) nsuri = Constants.NS_SCHEMA_XSD;
- if(nsuri == null)
- qn = new QName( formattedStr.substring(ind+1) );
- else
- qn = new QName( nsuri,formattedStr.substring(ind+1),prefix);
- return qn;
- }
-
-
- /**
- * Return the primitive for a wrapper equivalent (Integer -> int)
- * @param str
- * @return
- */
- public String getPrimitive(String str)
- {
- return (String)primitiveMap.get(str);
- }
-
- /**
- * Extracts the package name from the typeNS
- * @param typeNS
- * @return
- */
- public String getPackageName(String typeNS)
- {
- String pkgname = Util.xmlNamespaceToJavaPackage(typeNS);
- int len = pkgname.length();
- return pkgname;
- }
-
- public String getTypeNamespace(Class javaType)
- {
- return getTypeNamespace(javaType.getPackage().getName());
- }
-
- /**
- * Extracts the typeNS given the package name
- * Algorithm is based on the one specified in JAWS v2.0 spec
- * @param packageName
- * @return the type namespace
- */
- public String getTypeNamespace(String packageName)
- {
- StringBuilder sb = new StringBuilder("http://");
-
- //Generate tokens with '.' as delimiter
- StringTokenizer st = new StringTokenizer(packageName,".");
-
- //Have a LIFO queue for the tokens
- Stack<String> stk = new Stack<String>();
- while(st != null && st.hasMoreTokens())
- {
- stk.push(st.nextToken());
- }
-
- String next;
- while(!stk.isEmpty() && (next=stk.pop())!=null)
- {
- if(sb.toString().equals("http://") == false)
sb.append(".");
- sb.append(next);
- }
-
- // trailing slash
- sb.append("/");
-
- return sb.toString();
- }
-
- /**
- * Given WSDLDefinitions, detect the wsdl style
- *
- * @param wsdl
- * @return Constants.RPC_LITERAL or Constants.DOCUMENT_LITERAL
- */
- public String getWSDLStyle(WSDLDefinitions wsdl)
- {
- WSDLInterface wi = wsdl.getInterfaces()[0];
- WSDLInterfaceOperation wio = wi.getOperations()[0];
- String style = wio.getStyle();
- if(style == null || style.equals(Constants.URI_STYLE_RPC) ||
"rpc".equalsIgnoreCase(style))
- return Constants.RPC_LITERAL;
- else
- return Constants.DOCUMENT_LITERAL;
- }
-
- public static JBossXSModel getSchemaModel(WSDLTypes types)
- {
- if (types instanceof XSModelTypes)
- return ((XSModelTypes) types).getSchemaModel();
-
- throw new WSException("WSDLTypes is not an XSModelTypes");
- }
-
- public static void addSchemaModel(WSDLTypes types, String namespace, JBossXSModel
model)
- {
- if (! (types instanceof XSModelTypes))
- throw new WSException("WSDLTypes is not an XSModelTypes");
-
- XSModelTypes modelTypes = (XSModelTypes) types;
- modelTypes.addSchemaModel(namespace, model);
- }
-
- /**
- * Checks whether the class is a standard jaxrpc holder
- *
- * @param cls a Class object
- * @return true: A Standard jaxrpc holder
- */
- public boolean isStandardHolder(Class cls)
- {
- if(Holder.class.isAssignableFrom(cls) == false)
- return false; //Not even a holder
- //It is a holder. Is it a standard holder?
- if(cls.getPackage().getName().startsWith("javax.xml.rpc"))
- return true;
- return false;
- }
-
- /**
- * Write the JBoss License Header at the top of generated class source files
- * @param buf
- */
- public void writeJbossHeader(StringBuilder buf)
- {
- buf.append("/*").append(newline);
- buf.append(" * JBossWS WS-Tools Generated Source").append(newline);
- buf.append(" *").append(newline);
- buf.append(" * Generation Date: " + new Date() + newline);
- buf.append(" *").append(newline);
- buf.append(" * This generated source code represents a derivative work of the
input to").append(newline);
- buf.append(" * the generator that produced it. Consult the input for the
copyright and").append(newline);
- buf.append(" * terms of use that apply to this source
code.").append(newline);
- buf.append(" */").append(newline);
- }
-
- protected void populatePrimList()
- {
- primlist.add("int");
- primlist.add("boolean");
- primlist.add("short");
- primlist.add("byte");
- primlist.add("long");
- primlist.add("float");
- primlist.add("double");
- }
-
- protected void populateWrapperList()
- {
- wrapperlist.add("java.lang.Integer");
- wrapperlist.add("java.lang.Boolean");
- wrapperlist.add("java.lang.Short");
- wrapperlist.add("java.lang.Byte");
- wrapperlist.add("java.lang.Long");
- wrapperlist.add("java.lang.Float");
- wrapperlist.add("java.lang.Double");
- wrapperlist.add("java.lang.String");
-
- wrapperlist.add("java.math.BigInteger");
- wrapperlist.add("java.math.BigDecimal");
- wrapperlist.add("java.util.Calendar");
- wrapperlist.add("javax.xml.namespace.QName");
- }
-
- private void createPrimitiveMap()
- {
- primitiveMap.put("Integer", "int");
- primitiveMap.put("Float", "float");
- primitiveMap.put("Long", "long");
- primitiveMap.put("Double", "double");
- primitiveMap.put("Short", "short");
- primitiveMap.put("Boolean", "boolean");
- primitiveMap.put("Byte", "byte");
- primitiveMap.put("java.lang.Integer", "int");
- primitiveMap.put("java.lang.Float", "float");
- primitiveMap.put("java.lang.Long", "long");
- primitiveMap.put("java.lang.Double", "double");
- primitiveMap.put("java.lang.Short", "short");
- primitiveMap.put("java.lang.Boolean", "boolean");
- primitiveMap.put("java.lang.Byte", "byte");
- }
-
- public static WSDLInterfaceOperationOutput getWsdl11Output(WSDLInterfaceOperation
operation)
- {
- WSDLInterfaceOperationOutput[] outputs = operation.getOutputs();
- if (outputs == null)
- return null;
-
- switch (outputs.length)
- {
- case 0: return null;
- case 1: return outputs[0];
- }
-
- throw new WSException("Only Request-Only and Request-Response MEPs are
allowed");
- }
-
- public static WSDLInterfaceOperationInput getWsdl11Input(WSDLInterfaceOperation
operation)
- {
- WSDLInterfaceOperationInput[] inputs = operation.getInputs();
- if (inputs == null)
- return null;
-
- switch (inputs.length)
- {
- case 0: return null;
- case 1: return inputs[0];
- }
-
- throw new WSException("Only Request-Only and Request-Response MEPs are
allowed");
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLUtils.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLUtils.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/XSModelTypes.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/XSModelTypes.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/XSModelTypes.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,110 +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.wsdl;
-
-import javax.xml.namespace.QName;
-
-import org.apache.xerces.xs.XSElementDeclaration;
-import org.apache.xerces.xs.XSTypeDefinition;
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
-
-/**
- * A JBossXSModel based type definition.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class XSModelTypes extends WSDLTypes
-{
- private static final Logger log = Logger.getLogger(XSModelTypes.class);
-
- private JBossXSModel schemaModel;
-
- public XSModelTypes()
- {
- this.schemaModel = new JBossXSModel();
- }
-
- /**
- * Add a schema model for a given namespaceURI
- * @param nsURI the namespaceURI under which the model has been generated
- * @param schema the Schema Model that needs to be added to existing schema
- * model in WSDLTypes
- * <dt>Warning:</dd>
- * <p>Passing a null nsURI will replace the internal schema model
- * held by WSDLTypes by the model passed as an argument.</p>
- */
- public void addSchemaModel(String nsURI, JBossXSModel schema)
- {
- if(nsURI == null)
- {
- log.trace("nsURI passed to addSchemaModel is null. Replacing Schema
Model");
- schemaModel = schema;
- }
- else
- schemaModel.merge(schema);
- }
-
- /**
- * Return the global Schema Model
- * @return
- */
- public JBossXSModel getSchemaModel()
- {
- return schemaModel;
- }
-
- /** Get the xmlType from a given element xmlName
- */
- public QName getXMLType(QName xmlName)
- {
- QName xmlType = null;
- String nsURI = xmlName.getNamespaceURI();
- String localPart = xmlName.getLocalPart();
- XSElementDeclaration xsel = schemaModel.getElementDeclaration(localPart, nsURI);
- if (xsel != null)
- {
- XSTypeDefinition xstype = xsel.getTypeDefinition();
- if (xstype == null)
- throw new WSException("Cannot obtain XSTypeDefinition for: " +
xmlName);
-
- if (xstype.getAnonymous() == false)
- {
- xmlType = new QName(xstype.getNamespace(), xstype.getName());
- }
- else
- {
- xmlType = new QName(xstype.getNamespace(), ">" + localPart);
- }
- }
- return xmlType;
- }
-
- public String toString()
- {
- StringBuilder buffer = new StringBuilder("WSDLTypes:\n");
- buffer.append(schemaModel != null ? schemaModel.serialize() :
"<schema/>");
- return buffer.toString();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/XSModelTypes.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/XSModelTypes.java)
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema)
Deleted:
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSComplexTypeDefinition.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSComplexTypeDefinition.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSComplexTypeDefinition.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,259 +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.wsdl.xmlschema;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.xerces.xs.XSAttributeUse;
-import org.apache.xerces.xs.XSComplexTypeDefinition;
-import org.apache.xerces.xs.XSConstants;
-import org.apache.xerces.xs.XSObjectList;
-import org.apache.xerces.xs.XSParticle;
-import org.apache.xerces.xs.XSSimpleTypeDefinition;
-import org.apache.xerces.xs.XSTypeDefinition;
-import org.apache.xerces.xs.XSWildcard;
-
-/**
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- * @since Apr 21, 2005
- */
-public class JBossXSComplexTypeDefinition
- extends JBossXSTypeDefinition
- implements XSComplexTypeDefinition
-{
- private boolean isAbstract;
- private XSSimpleTypeDefinition xsSimple;
- private XSParticle xspart;
- private XSObjectList annots;
-
- private String prefix;
-
- private List<XSAttributeUse> attList = new ArrayList<XSAttributeUse>();
-
- //Content Type
- private short contentType = XSComplexTypeDefinition.CONTENTTYPE_ELEMENT;
-
- private short deriveMethod = XSConstants.DERIVATION_NONE;
-
- public JBossXSComplexTypeDefinition( )
- {
- }
-
- public JBossXSComplexTypeDefinition(String name, String namespace)
- {
- super(name, namespace);
- }
-
- public JBossXSComplexTypeDefinition(XSComplexTypeDefinition xc)
- {
- super(xc.getName(),xc.getNamespace());
- setAnonymous(xc.getAnonymous());
- xspart = xc.getParticle();
- xsSimple = xc.getSimpleType();
- deriveMethod = xc.getDerivationMethod();
- this.baseType = new JBossXSTypeDefinition(xc.getBaseType());
- }
-
- /**
- * [derivation method]: either <code>DERIVATION_EXTENSION</code>,
- * <code>DERIVATION_RESTRICTION</code>, or
<code>DERIVATION_NONE</code>
- * (see <code>XSConstants</code>).
- */
- public short getDerivationMethod()
- {
- return deriveMethod;
- }
-
- /**
- * [abstract]: a boolean. Complex types for which <code>abstract</code>
is
- * true must not be used as the type definition for the validation of
- * element information items.
- */
- public boolean getAbstract()
- {
- return isAbstract;
- }
-
- /**
- * A set of attribute uses if it exists, otherwise an empty
- * <code>XSObjectList</code>.
- */
- public XSObjectList getAttributeUses()
- {
- JBossXSObjectList oblist = new JBossXSObjectList();
- for(XSAttributeUse xa:attList)
- {
- oblist.addItem(xa);
- }
- return oblist;
- }
-
- /**
- * An attribute wildcard if it exists, otherwise <code>null</code>.
- */
- public XSWildcard getAttributeWildcard()
- {
- return null;
- }
-
- /**
- * [content type]: one of empty (<code>CONTENTTYPE_EMPTY</code>), a
simple
- * type definition (<code>CONTENTTYPE_SIMPLE</code>), mixed (
- * <code>CONTENTTYPE_MIXED</code>), or element-only (
- * <code>CONTENTTYPE_ELEMENT</code>).
- */
- public short getContentType()
- {
- return contentType;
- }
-
- /**
- * A simple type definition corresponding to a simple content model,
- * otherwise <code>null</code>.
- */
- public XSSimpleTypeDefinition getSimpleType()
- {
- return xsSimple;
- }
-
- /**
- * A particle for a mixed or element-only content model, otherwise
- * <code>null</code>.
- */
- public XSParticle getParticle()
- {
- return xspart;
- }
-
- /**
- * [prohibited substitutions]: a subset of {extension, restriction}
- * @param restriction Extension or restriction constants (see
- * <code>XSConstants</code>).
- * @return True if <code>restriction</code> is a prohibited substitution,
- * otherwise false.
- */
- public boolean isProhibitedSubstitution(short restriction)
- {
- return false;
- }
-
- /**
- * [prohibited substitutions]: A subset of {extension, restriction} or
- * <code>DERIVATION_NONE</code> represented as a bit flag (see
- * <code>XSConstants</code>).
- */
- public short getProhibitedSubstitutions()
- {
- return 0;
- }
-
- /**
- * A set of [annotations] if it exists, otherwise an empty
- * <code>XSObjectList</code>.
- */
- public XSObjectList getAnnotations()
- {
- return annots;
- }
-
- /**
- * Get the type
- */
- @Override
- public short getType()
- {
- return XSTypeDefinition.COMPLEX_TYPE;
- }
-
- /**
- * Return whether this type definition is a simple type or complex type.
- */
- @Override
- public short getTypeCategory()
- {
- return XSTypeDefinition.COMPLEX_TYPE;
- }
-
- public void setAbstract(boolean anAbstract)
- {
- isAbstract = anAbstract;
- }
-
- public void setDerivationMethod(short deriveMethod)
- {
- this.deriveMethod = deriveMethod;
- }
-
- /**
- * A simple type definition corresponding to a simple content model,
- * otherwise <code>null</code>.
- */
- public void setSimpleType(XSSimpleTypeDefinition xsSimple)
- {
- this.xsSimple = xsSimple;
- }
-
- /**
- * A particle for a mixed or element-only content model, otherwise
- * <code>null</code>.
- */
- public void setParticle(XSParticle xspart)
- {
- this.xspart = xspart;
- }
-
- /**
- * A set of [annotations] if it exists, otherwise an empty
- * <code>XSObjectList</code>.
- */
- public void setAnnotations(XSObjectList annots)
- {
- this.annots = annots;
- }
-
- /**
- * @see XSComplexTypeDefinition.CONTENTTYPE_EMPTY
- * @see XSComplexTypeDefinition.CONTENTTYPE_SIMPLE
- * @see XSComplexTypeDefinition.CONTENTTYPE_MIXED
- * @see XSComplexTypeDefinition.CONTENTTYPE_ELEMENT
- *
- * @param contentType
- */
- public void setContentType(short contentType)
- {
- this.contentType = contentType;
- }
-
- //*********************************************************************
- // Custom Methods
- //*********************************************************************
- public void addXSAttributeUse(XSAttributeUse at)
- {
- attList.add(at);
- }
-
- public String toString()
- {
- return "";
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSComplexTypeDefinition.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSComplexTypeDefinition.java)
Deleted:
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSElementDeclaration.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSElementDeclaration.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSElementDeclaration.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,243 +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.wsdl.xmlschema;
-
-import org.apache.xerces.xs.ShortList;
-import org.apache.xerces.xs.XSAnnotation;
-import org.apache.xerces.xs.XSComplexTypeDefinition;
-import org.apache.xerces.xs.XSConstants;
-import org.apache.xerces.xs.XSElementDeclaration;
-import org.apache.xerces.xs.XSException;
-import org.apache.xerces.xs.XSNamedMap;
-import org.apache.xerces.xs.XSTypeDefinition;
-
-
-/**
- * Represents an XS Element Declaration
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- * @since May 3, 2005
- */
-public class JBossXSElementDeclaration
- extends JBossXSObject
- implements XSElementDeclaration
-{
- protected String targetNamespace = null;
- protected JBossXSTypeDefinition xstype = null;
- protected boolean nillable = false;
- private XSElementDeclaration xsed;
-
- /**
- * Sole Annotation object
- */
- protected XSAnnotation annotation = null;
-
- /**
- *
- */
- public JBossXSElementDeclaration()
- {
- super();
- }
-
- /**
- * @param name
- * @param namespace
- */
- public JBossXSElementDeclaration(String name, String namespace)
- {
- super(name, namespace);
- }
-
- /**
- * Create a new JBossXSElementDeclaration while
- * reading data from XSElementDeclaration.
- * @param xe
- */
- public JBossXSElementDeclaration(XSElementDeclaration xe)
- {
- if(xe == null)
- throw new IllegalArgumentException("Illegal Null Argument:xe");
-
- xsed = xe;
- name= xe.getName();
- namespace = xe.getNamespace();
- XSTypeDefinition xt = xe.getTypeDefinition();
- if(xt instanceof JBossXSTypeDefinition == false
- && xt instanceof XSComplexTypeDefinition)
- {
- xstype = new JBossXSComplexTypeDefinition((XSComplexTypeDefinition)xt);
- }
- else
- if(xt instanceof JBossXSTypeDefinition == false)
- {
- xstype = new JBossXSTypeDefinition(xt);
- }
- this.annotation = xe.getAnnotation();
- }
-
- public XSElementDeclaration getXSElementDeclaration()
- {
- return xsed;
- }
-
- /**
- * One of XSConstants.SCOPE_GLOBAL, XSConstants.SCOPE_LOCAL
- * or XSConstants.SCOPE_ABSENT
- */
- protected short scope = 0;
-
- protected XSComplexTypeDefinition enclosingCTDefinition;
-
- public XSTypeDefinition getTypeDefinition()
- {
- return this.xstype;
- }
-
- public void setTypeDefinition(XSTypeDefinition xst )
- {
- if(xst instanceof JBossXSTypeDefinition)
- this.xstype = (JBossXSTypeDefinition)xst ;
- else
- if(xst instanceof XSComplexTypeDefinition)
- this.xstype = new JBossXSComplexTypeDefinition((XSComplexTypeDefinition)xst);
- }
-
- /**
- * One of XSConstants.SCOPE_GLOBAL, XSConstants.SCOPE_LOCAL
- * or XSConstants.SCOPE_ABSENT
- * @return
- */
- public short getScope()
- {
- return this.scope;
- }
-
- public void setScope(short scope)
- {
- this.scope = scope;
- }
-
- public XSComplexTypeDefinition getEnclosingCTDefinition()
- {
- return this.enclosingCTDefinition;
- }
-
- public void setEnclosingCTDefinition( XSComplexTypeDefinition enclosingCTDefinition)
- {
- this.enclosingCTDefinition = enclosingCTDefinition;
- }
-
- public String getTargetNamespace()
- {
- return targetNamespace;
- }
-
- public void setTargetNamespace(String targetNamespace)
- {
- this.targetNamespace = targetNamespace;
- this.setNamespace( targetNamespace );
- }
-
- public short getConstraintType()
- {
- return 0;
- }
-
- public String getConstraintValue()
- {
- return null;
- }
-
- public Object getActualVC() throws XSException
- {
- return null;
- }
-
- public short getActualVCType() throws XSException
- {
- return 0;
- }
-
- public ShortList getItemValueTypes() throws XSException
- {
- return null;
- }
-
- public boolean getNillable()
- {
- return this.nillable;
- }
-
- public void setNillable(boolean nillable)
- {
- this.nillable = nillable;
- }
-
- public XSNamedMap getIdentityConstraints()
- {
- return null;
- }
-
- public XSElementDeclaration getSubstitutionGroupAffiliation()
- {
- return null;
- }
-
- public boolean isSubstitutionGroupExclusion(short i)
- {
- return false;
- }
-
- public short getSubstitutionGroupExclusions()
- {
- return 0;
- }
-
- public boolean isDisallowedSubstitution(short i)
- {
- return false;
- }
-
- public short getDisallowedSubstitutions()
- {
- return 0;
- }
-
- public boolean getAbstract()
- {
- return false;
- }
-
- public XSAnnotation getAnnotation()
- {
- return this.annotation;
- }
-
- /**
- * Get the type
- */
- @Override
- public short getType()
- {
- return XSConstants.ELEMENT_DECLARATION;
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSElementDeclaration.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSElementDeclaration.java)
Deleted:
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSEntityResolver.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSEntityResolver.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSEntityResolver.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -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.wsdl.xmlschema;
-
-// $Id$
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.xerces.xni.XMLResourceIdentifier;
-import org.apache.xerces.xni.XNIException;
-import org.apache.xerces.xni.parser.XMLEntityResolver;
-import org.apache.xerces.xni.parser.XMLInputSource;
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-/**
- * Entity Resolver for the default Xerces Reference parser
- * @author <a href="mailto:Anil.Saldhana@jboss.org">Anil
Saldhana</a>
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-Aug-2005
- */
-public class JBossXSEntityResolver implements XMLEntityResolver
-{
- // provide logging
- private static final Logger log = Logger.getLogger(JBossXSEntityResolver.class);
-
- private Map<String, URL> schemaLocationByNamespace = new HashMap<String,
URL>();
-
- private EntityResolver delegate;
-
- public JBossXSEntityResolver(EntityResolver resolver, Map<String, URL>
schemaLocationByNamespace)
- {
- this.schemaLocationByNamespace = schemaLocationByNamespace;
- this.delegate = resolver;
- }
-
- /**
- * Resolves an external parsed entity. If the entity cannot be
- * resolved, this method should return null.
- *
- * @param resourceIdentifier description of the resource to be resolved
- * @throws XNIException Thrown on general error.
- * @throws IOException Thrown if resolved entity stream cannot be
- * opened or some other i/o error occurs.
- */
- public XMLInputSource resolveEntity(XMLResourceIdentifier resId) throws XNIException,
IOException
- {
- log.trace("Resolve entity: " + resId);
-
- // First try the JBossEntityResolver
- String publicId = resId.getPublicId();
- String systemId = resId.getLiteralSystemId();
- String namespace = resId.getNamespace();
- try
- {
- String publicURI = (publicId != null ? publicId : namespace);
- InputSource inputSource = delegate.resolveEntity(publicURI, systemId);
- if (inputSource != null)
- {
- XMLInputSource source = getXMLInputSource(inputSource, resId);
- return source;
- }
- }
- catch (Exception ex)
- {
- log.trace(ex);
- }
-
- try
- {
- String expandedSysId = resId.getExpandedSystemId();
- if (expandedSysId != null)
- {
- log.trace("Use ExpandedSystemId: " + expandedSysId);
- return getXMLInputSource(new URL(expandedSysId), resId);
- }
- }
- catch (IOException e)
- {
- log.trace(e);
- }
-
- try
- {
- if (systemId != null)
- {
- log.trace("Use LiteralSystemId: " + systemId);
- return getXMLInputSource(new URL(systemId), resId);
- }
- }
- catch (IOException e)
- {
- log.trace(e);
- }
-
- // in case of a DOCTYPE declaration ew refer to systemId
- String namespaceURI = resId.getNamespace() != null ? resId.getNamespace() :
resId.getLiteralSystemId();
-
- // The schema parser will obviously know this schema already
- if (Constants.NS_SCHEMA_XSD.equals(namespaceURI))
- return null;
-
- try
- {
- URL url = schemaLocationByNamespace.get(namespaceURI);
- if (url != null)
- {
- log.trace("Use SchemaLocationByNamespace: " + url);
- return getXMLInputSource(url, resId);
- }
-
- // Delegate to JBoss Entity Resolver
- XMLInputSource source = getXMLInputSource(
- delegate.resolveEntity(null, namespaceURI), resId);
- if (source != null)
- return source;
- }
- catch (SAXException e)
- {
- log.trace(e);
- }
-
- try
- {
- log.trace("Use NamespaceURI: " + namespaceURI);
- return getXMLInputSource(new URL(namespaceURI), resId);
- }
- catch (IOException e)
- {
- log.trace(e);
- }
-
- log.trace("Cannot obtain XMLInputSource for: " + resId);
- return null;
- }
-
- private XMLInputSource getXMLInputSource(URL url, XMLResourceIdentifier resId) throws
IOException
- {
- InputStream inputStream = url.openStream();
- InputSource inputSource = new InputSource(inputStream);
- return getXMLInputSource(inputSource, resId);
- }
-
- private XMLInputSource getXMLInputSource(InputSource inputSource,
XMLResourceIdentifier resId)
- {
- String encoding = inputSource.getEncoding();
- InputStream byteStream = inputSource.getByteStream();
- return new XMLInputSource(resId.getPublicId(), resId.getExpandedSystemId(),
resId.getBaseSystemId(), byteStream, encoding);
- }
-}
\ No newline at end of file
Copied:
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSEntityResolver.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSEntityResolver.java)
Deleted:
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSErrorHandler.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSErrorHandler.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSErrorHandler.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,116 +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.wsdl.xmlschema;
-
-import org.apache.xerces.xni.XNIException;
-import org.apache.xerces.xni.parser.XMLErrorHandler;
-import org.apache.xerces.xni.parser.XMLParseException;
-import org.jboss.logging.Logger;
-/**
- * Error Handler for the Xerces schema parser default implementation
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- * @since Aug 11, 2005
- */
-public class JBossXSErrorHandler implements XMLErrorHandler
-{
- private static final Logger log = Logger.getLogger(JBossXSErrorHandler.class);
-
- /**
- * Reports a warning. Warnings are non-fatal and can be safely ignored by most
applications.
- * @param domain - The domain of the warning. The domain can be any string but is
suggested to be a valid URI. The domain can be used to conveniently specify a web site
location of the relevent specification or document pertaining to this warning.
- * @param key - The warning key. This key can be any string and is implementation
dependent.
- * @param exception - Exception.
- * @throws XNIException Thrown to signal that the parser should stop parsing the
document.
- */
- public void warning(String domain, String key, XMLParseException xexp) throws
XNIException
- {
- log.trace(getFormattedString(domain,key,xexp));
- }
-
- /**
- * Reports an error. Errors are non-fatal and usually signify that the document is
invalid with respect to its grammar(s).
- * @param domain - The domain of the warning. The domain can be any string but is
suggested to be a valid URI. The domain can be used to conveniently specify a web site
location of the relevent specification or document pertaining to this warning.
- * @param key - The warning key. This key can be any string and is implementation
dependent.
- * @param exception - Exception.
- * @throws XNIException Thrown to signal that the parser should stop parsing the
document.
- */
- public void error(String domain, String key, XMLParseException xexp) throws
XNIException
- {
- if("src-include.2.1".equals(key))
- throw new XNIException("Parser should stop:",xexp);
- log.error(getFormattedString(domain,key,xexp));
- }
-
- /**
- * Report a fatal error. Fatal errors usually occur when the document is not
well-formed
- * and signifies that the parser cannot continue normal operation.
- * @param domain - The domain of the warning. The domain can be any string but is
suggested to be a valid URI. The domain can be used to conveniently specify a web site
location of the relevent specification or document pertaining to this warning.
- * @param key - The warning key. This key can be any string and is implementation
dependent.
- * @param exception - Exception.
- * @throws XNIException Thrown to signal that the parser should stop parsing the
document.
- */
- public void fatalError(String domain, String key, XMLParseException xexp) throws
XNIException
- {
- log.fatal(getFormattedString(domain,key,xexp));
- throw new XNIException("Parser should stop:",xexp);
- }
-
- /**
- * Get the name of the schema file in question
- *
- * @param xexp
- * @return
- */
- private String getFileName(XMLParseException xexp)
- {
- String fname = xexp.getExpandedSystemId();
- if (fname != null) {
- int index = fname.lastIndexOf('/');
- if (index != -1)
- fname = fname.substring(index + 1);
- }
- else
- {
- fname = "";
- }
-
- return fname;
- }
-
- /**
- * Return a formatted string that gives as much information
- * as possible to the user
- * @param domain
- * @param key
- * @param xexp
- * @return
- */
- private String getFormattedString(String domain, String key, XMLParseException xexp)
- {
- StringBuilder buf = new StringBuilder(getFileName(xexp));
- buf.append("[domain:");
-
buf.append(domain).append("]::[key=").append(key).append("]::");
- buf.append("Message=");
- buf.append(xexp.getLocalizedMessage());
- return buf.toString();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSErrorHandler.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSErrorHandler.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModel.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModel.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModel.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,745 +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.wsdl.xmlschema;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.Serializable;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.xerces.xs.StringList;
-import org.apache.xerces.xs.XSAnnotation;
-import org.apache.xerces.xs.XSAttributeDeclaration;
-import org.apache.xerces.xs.XSAttributeGroupDefinition;
-import org.apache.xerces.xs.XSComplexTypeDefinition;
-import org.apache.xerces.xs.XSConstants;
-import org.apache.xerces.xs.XSElementDeclaration;
-import org.apache.xerces.xs.XSModel;
-import org.apache.xerces.xs.XSModelGroup;
-import org.apache.xerces.xs.XSModelGroupDefinition;
-import org.apache.xerces.xs.XSNamedMap;
-import org.apache.xerces.xs.XSNamespaceItem;
-import org.apache.xerces.xs.XSNamespaceItemList;
-import org.apache.xerces.xs.XSNotationDeclaration;
-import org.apache.xerces.xs.XSObjectList;
-import org.apache.xerces.xs.XSParticle;
-import org.apache.xerces.xs.XSSimpleTypeDefinition;
-import org.apache.xerces.xs.XSTerm;
-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.core.utils.DOMUtils;
-import org.jboss.ws.core.utils.DOMWriter;
-import org.jboss.xb.binding.NamespaceRegistry;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * Represents a schema model
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- * @since Apr 20, 2005
- */
-
-public class JBossXSModel implements XSModel, Cloneable
-{
- // provide logging
- private static final Logger log = Logger.getLogger(JBossXSModel.class);
-
- private AnonymousMapper anonymousMapper = new AnonymousMapper();
-
- private boolean qualifiedElements = false;
-
- private NamespaceRegistry namespaceRegistry = new NamespaceRegistry();
-
- protected XSNamespaceItemList nslist = null;
-
- protected HashMap<String, JBossXSNamespaceItem> nsimap = new HashMap<String,
JBossXSNamespaceItem>();
-
- public JBossXSModel()
- {
- }
-
- @Override
- public JBossXSModel clone() throws CloneNotSupportedException
- {
- return (JBossXSModel)super.clone();
- }
-
- /**
- * Convenience method. Returns a list of all namespaces that belong to
- * this schema. The value <code>null</code> is not a valid namespace
- * name, but if there are components that do not have a target namespace
- * , <code>null</code> is included in this list.
- */
- public StringList getNamespaces()
- {
- return new JBossXSStringList(nsimap.keySet());
- }
-
- /**
- * A set of namespace schema information information items (of type
- * <code>XSNamespaceItem</code>), one for each namespace name which
- * appears as the target namespace of any schema component in the schema
- * used for that assessment, and one for absent if any schema component
- * in the schema had no target namespace. For more information see
- * schema information.
- */
- public XSNamespaceItemList getNamespaceItems()
- {
-
- nslist = new JBossXSNamespaceItemList(nsimap.values());
-
- //One for the default xsd
- JBossXSNamespaceItem nsxsd = new JBossXSNamespaceItem(Constants.NS_SCHEMA_XSD,
namespaceRegistry, qualifiedElements);
- ((JBossXSNamespaceItemList)nslist).addItem(nsxsd);
- return nslist;
- }
-
- /**
- * Returns a list of top-level components, i.e. element declarations,
- * attribute declarations, etc.
- * @param objectType The type of the declaration, i.e.
- * <code>ELEMENT_DECLARATION</code>. Note that
- * <code>XSTypeDefinition.SIMPLE_TYPE</code> and
- * <code>XSTypeDefinition.COMPLEX_TYPE</code> can also be used as the
- * <code>objectType</code> to retrieve only complex types or simple
- * types, instead of all types.
- * @return A list of top-level definitions of the specified type in
- * <code>objectType</code> or an empty
<code>XSNamedMap</code> if no
- * such definitions exist.
- */
- public XSNamedMap getComponents(short objectType)
- {
- JBossXSNamedMap map = new JBossXSNamedMap();
- JBossXSStringList sl = (JBossXSStringList)getNamespaces();
- int len = sl != null ? sl.getLength() : 0;
-
- for (int i = 0; i < len; i++)
- {
- String ns = sl.item(i);
- JBossXSNamespaceItem ni = nsimap.get(ns);
- JBossXSNamedMap nm = null;
- if (ni != null)
- {
- nm = (JBossXSNamedMap)ni.getComponents(objectType);
- map.addItems(nm.toList());
- }
- }
-
- return map;
- }
-
- /**
- * Convenience method. Returns a list of top-level component declarations
- * that are defined within the specified namespace, i.e. element
- * declarations, attribute declarations, etc.
- * @param objectType The type of the declaration, i.e.
- * <code>ELEMENT_DECLARATION</code>.
- * @param namespace The namespace to which the declaration belongs or
- * <code>null</code> (for components with no target namespace).
- * @return A list of top-level definitions of the specified type in
- * <code>objectType</code> and defined in the specified
- * <code>namespace</code> or an empty
<code>XSNamedMap</code>.
- */
- public XSNamedMap getComponentsByNamespace(short objectType, String namespace)
- {
- JBossXSNamedMap map = new JBossXSNamedMap();
-
- JBossXSNamespaceItem ni = nsimap.get(namespace);
- if (ni == null)
- return map;
-
- return ni.getComponents(objectType);
- }
-
- /**
- * [annotations]: a set of annotations if it exists, otherwise an empty
- * <code>XSObjectList</code>.
- */
- public XSObjectList getAnnotations()
- {
- List lst = new ArrayList();
- JBossXSObjectList objlist = new JBossXSObjectList(lst);
- Set<String> keyset = nsimap.keySet();
- for (String ns : keyset)
- {
- XSNamespaceItem xs = nsimap.get(ns);
- objlist.addObjects(xs.getAnnotations());
- }
- return objlist;
- }
-
- /**
- * Convenience method. Returns a top-level element declaration.
- * @param name The name of the declaration.
- * @param namespace The namespace of the declaration, otherwise
- * <code>null</code>.
- * @return A top-level element declaration or <code>null</code> if such a
- * declaration does not exist.
- */
- public XSElementDeclaration getElementDeclaration(String name, String namespace)
- {
- if (name == null)
- return null;
-
- if (name.startsWith(">") || name.endsWith("]"))
- return anonymousMapper.getElementDeclaration(name, namespace);
-
- JBossXSNamespaceItem ni = nsimap.get(namespace);
- if (ni == null)
- return null;
- return ni.getElementDeclaration(name);
- }
-
- /**
- * Convenience method. Returns a top-level attribute declaration.
- * @param name The name of the declaration.
- * @param namespace The namespace of the declaration, otherwise
- * <code>null</code>.
- * @return A top-level attribute declaration or <code>null</code> if such
- * a declaration does not exist.
- */
- public XSAttributeDeclaration getAttributeDeclaration(String name, String namespace)
- {
- JBossXSNamespaceItem ni = nsimap.get(namespace);
- if (ni == null)
- return null;
- return ni.getAttributeDeclaration(name);
- }
-
- /**
- * Convenience method. Returns a top-level simple or complex type
- * definition.
- * @param name The name of the definition.
- * @param namespace The namespace of the declaration, otherwise
- * <code>null</code>.
- * @return An <code>XSTypeDefinition</code> or
<code>null</code> if such
- * a definition does not exist.
- */
- public XSTypeDefinition getTypeDefinition(String name, String namespace)
- {
- if (name == null)
- return null;
-
- if (name.startsWith(">") || name.endsWith("]"))
- return anonymousMapper.getTypeDefinition(name, namespace);
-
- JBossXSNamespaceItem ni = nsimap.get(namespace);
- if (ni == null)
- return null;
- return ni.getTypeDefinition(name);
- }
-
- /**
- * Convenience method. Returns a top-level attribute group definition.
- * @param name The name of the definition.
- * @param namespace The namespace of the definition, otherwise
- * <code>null</code>.
- * @return A top-level attribute group definition or <code>null</code> if
- * such a definition does not exist.
- */
- public XSAttributeGroupDefinition getAttributeGroup(String name, String namespace)
- {
- return null;
- }
-
- /**
- * Convenience method. Returns a top-level model group definition.
- * @param name The name of the definition.
- * @param namespace The namespace of the definition, otherwise
- * <code>null</code>.
- * @return A top-level model group definition or <code>null</code> if
- * such a definition does not exist.
- */
- public XSModelGroupDefinition getModelGroupDefinition(String name, String namespace)
- {
- return null;
- }
-
- /**
- * Convenience method. Returns a top-level notation declaration.
- * @param name The name of the declaration.
- * @param namespace The namespace of the declaration, otherwise
- * <code>null</code>.
- * @return A top-level notation declaration or <code>null</code> if such
- * a declaration does not exist.
- */
- public XSNotationDeclaration getNotationDeclaration(String name, String namespace)
- {
- return null;
- }
-
- public void addXSAnnotation(XSAnnotation xa)
- {
- String ns = xa.getNamespace();
- if (ns == null && nsimap.keySet().size() == 1)
- {
- ns = nsimap.keySet().iterator().next();
- }
- if (ns != null)
- {
- createNamespaceItemIfNotExistent(ns);
- JBossXSNamespaceItem jbnm = nsimap.get(ns);
- jbnm.addXSAnnotation(xa);
- }
- else
- {
- log.trace("Cannot assign XSAnnotation to null namespace");
- }
- }
-
- public void addXSAttributeDeclaration(XSAttributeDeclaration attr)
- {
- //Add attribute to the namespace item
- String ns = attr.getNamespace();
- JBossXSNamespaceItem jbnm = createNamespaceItemIfNotExistent(ns);
- jbnm.addXSAttributeDeclaration(attr);
- }
-
- public void addXSTypeDefinition(XSTypeDefinition xst)
- {
- //Add type to the namespace item
- String ns = xst.getNamespace();
- if (ns == null)
- throw new WSException("Illegal namespace:null");
- JBossXSNamespaceItem jbnm = createNamespaceItemIfNotExistent(ns);
- jbnm.addXSTypeDefinition(xst);
-
- anonymousMapper.rebuild();
- }
-
- public void addXSComplexTypeDefinition(XSTypeDefinition xst)
- {
- this.addXSTypeDefinition(xst);
-
- anonymousMapper.rebuild();
- }
-
- public void addXSElementDeclaration(XSElementDeclaration xsel)
- {
- //Add element to the namespace item
- String ns = xsel.getNamespace();
- JBossXSNamespaceItem jbnm = createNamespaceItemIfNotExistent(ns);
- jbnm.addXSElementDeclaration(xsel);
-
- anonymousMapper.rebuild();
- }
-
- public void addSchemaLocation(String nsURI, URL locationURL)
- {
- JBossXSNamespaceItem ni = createNamespaceItemIfNotExistent(nsURI);
- ni.addDocumentLocation(locationURL.toExternalForm());
- }
-
- public void addXSNamespaceItem(XSNamespaceItem xsitem)
- {
- ((JBossXSNamespaceItemList)nslist).addItem(xsitem);
-
- anonymousMapper.rebuild();
- }
-
- public void setXSNamespaceItemList(XSNamespaceItemList list)
- {
- this.nslist = list;
- }
-
- public void merge(JBossXSModel xsm)
- {
- JBossXSNamespaceItemList jxsm = (JBossXSNamespaceItemList)xsm.getNamespaceItems();
- int len = jxsm.getLength();
- for (int i = 0; i < len; i++)
- {
- JBossXSNamespaceItem ni = (JBossXSNamespaceItem)jxsm.item(i);
- String sns = ni.getSchemaNamespace();
- JBossXSNamespaceItem mynsi = nsimap.get(sns);
- if (mynsi != null)
- mynsi.merge(ni);
- else
- {
- //add the namespaceitem
- nsimap.put(sns, ni);
- ni.setNamespaceRegistry(namespaceRegistry);
- }
- }
-
- NamespaceRegistry xsmRegistry = xsm.getNamespaceRegistry();
- Iterator iter = xsmRegistry.getRegisteredPrefixes();
- while (iter.hasNext())
- {
- String prefix = (String)iter.next();
- String ns = xsmRegistry.getNamespaceURI(prefix);
- this.namespaceRegistry.registerURI(ns, prefix);
- }
-
- anonymousMapper.rebuild();
- }
-
- public void removeXSTypeDefinition(XSTypeDefinition xst)
- {
- String ns = xst.getNamespace();
- JBossXSNamespaceItem ni = nsimap.get(ns);
- ni.removeXSTypeDefinition(xst);
-
- anonymousMapper.rebuild();
- }
-
- /**
- * Given a namespaceuri, return the NamespaceItem that represents it
- * @param nsuri Namespace URI
- * @return JBossXSNamespaceItem
- */
- public JBossXSNamespaceItem getNamespaceItem(String nsuri)
- {
- return nsimap.get(nsuri);
- }
-
- public void writeTo(OutputStream out) throws IOException
- {
- out.write(serialize().getBytes());
- }
-
- public String serialize()
- {
- StringBuilder sb = serializeNamespaceItems();
-
- /**
- * Since the serialized string can contain multiple schema
- * definitions, we have to embed in a root element before
- * parsing for layout
- */
- sb.insert(0, "<root>");
- sb.append("</root>");
- // Layout schema
- String xsModelString = sb.toString();
-
- if (xsModelString.length() > 0)
- {
- try
- {
- Element root = DOMUtils.parse(xsModelString);
- //xsModelString = DOMWriter.printNode(root, true);
- xsModelString = this.getChildNodesSerialized(root);
- }
- catch (IOException e)
- {
- log.error("Cannot parse xsModelString: " + xsModelString, e);
- }
-
- }
-
- return xsModelString;
- }
-
- public Map<String, XSTypeDefinition> getAnonymousTypes()
- {
- return anonymousMapper.getTypes();
- }
-
- public Map<String, XSElementDeclaration> getAnonymousElements()
- {
- return anonymousMapper.getElements();
- }
-
- public boolean isQualifiedElements()
- {
- return qualifiedElements;
- }
-
- public void setQualifiedElements(boolean qualifiedElements)
- {
- this.qualifiedElements = qualifiedElements;
- for (JBossXSNamespaceItem item : nsimap.values())
- item.setQualifiedElements(qualifiedElements);
- }
-
- public NamespaceRegistry getNamespaceRegistry()
- {
- return namespaceRegistry;
- }
-
- public void eagerInitialize()
- {
- anonymousMapper.build();
- }
-
- private String registerNamespace(String ns)
- {
- String prefix = namespaceRegistry.getPrefix(ns);
-
- if (prefix != null)
- return prefix;
-
- // XML Namespace MUST ALWAYS BE the "xml" prefix
- if (Constants.NS_XML.equals(ns))
- prefix = Constants.PREFIX_XML;
-
- return namespaceRegistry.registerURI(ns, prefix);
- }
-
- private JBossXSNamespaceItem createNamespaceItemIfNotExistent(String ns)
- {
- if (ns == null)
- throw new IllegalArgumentException("Illegal null argument:ns");
-
- JBossXSNamespaceItem jbnm = nsimap.get(ns);
- if (jbnm == null)
- {
- jbnm = new JBossXSNamespaceItem(ns, namespaceRegistry, qualifiedElements);
- nsimap.put(ns, jbnm);
- registerNamespace(ns);
- }
-
- return jbnm;
- }
-
- private StringBuilder serializeNamespaceItems()
- {
- StringBuilder sb = new StringBuilder();
- //Write a schema definition for each namespaceitem that is custom
- Collection<JBossXSNamespaceItem> col = nsimap.values();
- for (JBossXSNamespaceItem i : col)
- {
- String nameS = i.getSchemaNamespace();
- if (Constants.NS_SCHEMA_XSD.equals(nameS) ||
Constants.URI_SOAP11_ENC.equals(nameS))
- continue;
-
- sb.append(i.toString());
- }
-
- return sb;
- }
-
- private String getChildNodesSerialized(Element root)
- {
- StringBuilder sb = new StringBuilder();
- Iterator iter = DOMUtils.getChildElements(root);
- while (iter != null && iter.hasNext())
- {
- Node n = (Node)iter.next();
- sb.append(DOMWriter.printNode(n, true));
- sb.append("\n");
- }
- return sb.toString();
- }
-
- private class AnonymousMapper implements Serializable
- {
- private static final long serialVersionUID = 5572350092914194023L;
-
- private HashMap<String, XSTypeDefinition> anonymousTypeMap;
-
- private HashMap<String, XSElementDeclaration> anonymousElementMap;
-
- // not really a stack, but it does contain items on the stack
- private HashSet<XSComplexTypeDefinition> stack = new
HashSet<XSComplexTypeDefinition>();
-
- /**
- * Triggers a rebuild of anonymous types only if a build has occured before.
- */
- public void rebuild()
- {
- if (anonymousTypeMap != null)
- build();
- }
-
- /**
- * Builds the anonymous type mapping. This is intended to be called lazily.
- */
- public void build()
- {
- XSModel model = JBossXSModel.this;
-
- anonymousTypeMap = new HashMap<String, XSTypeDefinition>();
-
- anonymousElementMap = new HashMap<String, XSElementDeclaration>();
-
- XSNamedMap namedMap = model.getComponents(XSConstants.TYPE_DEFINITION);
- for (int i = 0; i < namedMap.getLength(); i++)
- {
- XSTypeDefinition type = (XSTypeDefinition)namedMap.item(i);
- if (type.getTypeCategory() != XSTypeDefinition.COMPLEX_TYPE)
- continue;
-
- analyzeComplexType((XSComplexTypeDefinition)type, null,
type.getNamespace());
- }
-
- namedMap = model.getComponents(XSConstants.ELEMENT_DECLARATION);
- for (int i = 0; i < namedMap.getLength(); i++)
- {
- XSElementDeclaration element = (XSElementDeclaration)namedMap.item(i);
- analyzeElement(element, null, element.getNamespace(), null, null);
- }
- }
-
- private void analyzeElement(XSElementDeclaration element, String parentName, String
namespace, Integer minOccurs, Integer maxOccurs)
- {
- String name = element.getName();
-
- if (element.getScope() != XSConstants.SCOPE_GLOBAL)
- {
- name = parentName + ">" + name;
- anonymousElementMap.put(namespace + ":" + name, element);
- }
-
- if (maxOccurs != null && maxOccurs.intValue() > 1)
- {
- String key = namespace + ":" + name + "[" +
minOccurs.intValue() + "," + maxOccurs.intValue() + "]";
- anonymousTypeMap.put(key, createArrayWrapperComplexType(element, name,
namespace, minOccurs, maxOccurs));
- if (minOccurs.intValue() == 1)
- {
- key = namespace + ":" + name + "[" + "," +
maxOccurs.intValue() + "]";
- anonymousTypeMap.put(key, createArrayWrapperComplexType(element, name,
namespace, minOccurs, maxOccurs));
- }
- }
-
- XSTypeDefinition type = element.getTypeDefinition();
- if (type.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE)
- analyzeComplexType((XSComplexTypeDefinition)type, name, namespace);
-
- if (type.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE)
- analyzeSimpleType((XSSimpleTypeDefinition)type, name, namespace);
- }
-
- private XSComplexTypeDefinition createArrayWrapperComplexType(XSElementDeclaration
element, String name, String namespace, Integer minOccurs, Integer maxOccurs)
- {
- JBossXSComplexTypeDefinition definition = new JBossXSComplexTypeDefinition(name,
namespace);
- definition.setAnonymous(true);
-
- JBossXSModelGroup group = new JBossXSModelGroup();
- group.setCompositor(XSModelGroup.COMPOSITOR_SEQUENCE);
- List<XSParticle> particles = new ArrayList<XSParticle>(1);
- JBossXSParticle particle = new JBossXSParticle();
- particle.setMaxOccurs(maxOccurs);
- particle.setMinOccurs(minOccurs);
- particle.setTerm(element);
- particles.add(particle);
- group.setParticles(particles);
-
- particle = new JBossXSParticle();
- particle.setTerm(group);
- definition.setParticle(particle);
-
- return definition;
- }
-
- private String analyzeType(XSTypeDefinition type, String parentName, String
namespace)
- {
- String name;
- if (type.getAnonymous())
- name = ">" + parentName;
- else name = type.getName();
-
- if (type.getAnonymous())
- {
- anonymousTypeMap.put(namespace + ":" + name, type);
- log.debug("Registered as anon type: {" + namespace + ":"
+ name + "} -> " + type);
- }
- return name;
- }
-
- private void analyzeSimpleType(XSSimpleTypeDefinition simpleType, String
parentName, String namespace)
- {
- analyzeType(simpleType, parentName, namespace);
- }
-
- private void analyzeComplexType(XSComplexTypeDefinition complexType, String
parentName, String namespace)
- {
- // Prevent reentrancy
- if (stack.contains(complexType))
- return;
-
- stack.add(complexType);
- String name = analyzeType(complexType, parentName, namespace);
- analyzeParticle(complexType.getParticle(), name, namespace);
- stack.remove(complexType);
- }
-
- private void analyzeParticle(XSParticle particle, String parentName, String
namespace)
- {
- // Is this right, can a particle be null?
- if (particle == null)
- return;
- XSTerm term = particle.getTerm();
-
- // Is this right, can a term be null?
- if (term == null)
- return;
- switch (term.getType())
- {
- case XSConstants.MODEL_GROUP:
- XSModelGroup group = (XSModelGroup)term;
- XSObjectList list = group.getParticles();
- for (int i = 0; i < list.getLength(); i++)
- analyzeParticle((XSParticle)list.item(i), parentName, namespace);
- break;
- case XSConstants.ELEMENT_DECLARATION:
- XSElementDeclaration decl = (XSElementDeclaration)term;
- analyzeElement(decl, parentName, namespace, new
Integer(particle.getMinOccurs()), new Integer(particle.getMaxOccurs()));
- }
- }
-
- public XSTypeDefinition getTypeDefinition(String name, String namespace)
- {
- // We lazily build this, after the first anonymous type name lookup
- if (anonymousTypeMap == null)
- build();
-
- return anonymousTypeMap.get(namespace + ":" + name);
- }
-
- public XSElementDeclaration getElementDeclaration(String name, String namespace)
- {
- // We lazily build this, after the first anonymous type name lookup
- if (anonymousElementMap == null)
- build();
-
- return anonymousElementMap.get(namespace + ":" + name);
- }
-
- public Map<String, XSElementDeclaration> getElements()
- {
- if (anonymousElementMap == null)
- build();
-
- // avoid the copy, trust the client
- return anonymousElementMap;
- }
-
- public Map<String, XSTypeDefinition> getTypes()
- {
- if (anonymousTypeMap == null)
- build();
-
- // avoid the copy, trust the client
- return anonymousTypeMap;
- }
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModel.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModel.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModelGroup.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModelGroup.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModelGroup.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -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.wsdl.xmlschema;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.xerces.xs.XSAnnotation;
-import org.apache.xerces.xs.XSConstants;
-import org.apache.xerces.xs.XSModelGroup;
-import org.apache.xerces.xs.XSObjectList;
-
-/**
- * Implements a ModelGroup of the Xerces Schema API
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- * @since Apr 21, 2005
- */
-public class JBossXSModelGroup extends JBossXSObject
- implements XSModelGroup
-{
- private JBossXSObjectList xsparts = new JBossXSObjectList();;
- protected short compositor = 0;
-
- /**
- * [compositor]: one of all, choice or sequence. The valid constant values
- * are:
- * <code>COMPOSITOR_SEQUENCE, COMPOSITOR_CHOICE, COMPOSITOR_ALL</code>.
- */
- public short getCompositor()
- {
- return compositor;
- }
-
- /**
- * A list of [particles] if it exists, otherwise an empty
- * <code>XSObjectList</code>.
- */
- public XSObjectList getParticles()
- {
- return xsparts;
- }
-
- /**
- * An [annotation] if it exists, otherwise <code>null</code>.
- */
- public XSAnnotation getAnnotation()
- {
- return null;
- }
-
- public void setParticles(List p)
- {
- xsparts = new JBossXSObjectList();
- Iterator iter = p.iterator();
- while (iter.hasNext())
- {
- xsparts.addItem((JBossXSParticle)iter.next());
- }
- }
-
- public void setParticles(List p, boolean shouldSort)
- {
- xsparts = new JBossXSObjectList();
- if(shouldSort)
- setParticles(p);
- else
- {
- Iterator iter = p.iterator();
- while (iter.hasNext())
- {
- xsparts.addItem((JBossXSParticle)iter.next(), false);
- }
- }
-
- }
-
- public void setCompositor(short compositor)
- {
- this.compositor = compositor;
- }
-
- /**
- * Get the type
- */
- @Override
- public short getType()
- {
- return XSConstants.MODEL_GROUP;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModelGroup.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModelGroup.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSNamedMap.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSNamedMap.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSNamedMap.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,105 +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.wsdl.xmlschema;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.apache.xerces.xs.XSNamedMap;
-import org.apache.xerces.xs.XSObject;
-
-/**
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- * @since Apr 20, 2005
- */
-public class JBossXSNamedMap implements XSNamedMap
-{
- protected List<XSObject> list = new ArrayList<XSObject>();
- /**
- * The number of <code>XSObjects</code> in the
<code>XSObjectList</code>.
- * The range of valid child object indices is 0 to <code>length-1</code>
- * inclusive.
- */
- public int getLength()
- {
- return list.size();
- }
-
- /**
- * Returns the <code>index</code>th item in the collection or
- * <code>null</code> if <code>index</code> is greater than or
equal to
- * the number of objects in the list. The index starts at 0.
- * @param index index into the collection.
- * @return The <code>XSObject</code> at the
<code>index</code>th
- * position in the <code>XSObjectList</code>, or
<code>null</code> if
- * the index specified is not valid.
- */
- public XSObject item(int index)
- {
- return (XSObject)list.get(index);
- }
-
- /**
- * Retrieves an <code>XSObject</code> specified by local name and
- * namespace URI.
- * <br>Per XML Namespaces, applications must use the value
<code>null</code> as the
- * <code>namespace</code> parameter for methods if they wish to specify
- * no namespace.
- * @param namespace The namespace URI of the <code>XSObject</code> to
- * retrieve, or <code>null</code> if the
<code>XSObject</code> has no
- * namespace.
- * @param localName The local name of the <code>XSObject</code> to
- * retrieve.
- * @return A <code>XSObject</code> (of any type) with the specified local
- * name and namespace URI, or <code>null</code> if they do not
- * identify any object in this map.
- */
- public XSObject itemByName(String namespace, String localName)
- {
- XSObject xso = null;
- //Since our list may contain types from xerces implementation
- for(XSObject obj: list)
- {
- if(localName.equals(obj.getName()) &&
- namespace.equals(obj.getNamespace()))
- return obj;
- }
-
- return xso;
- }
-
- public void addItem(XSObject obj)
- {
- list.add(obj);
- }
-
- public void addItems(Collection col)
- {
- list.addAll(col);
- }
-
- public List<XSObject> toList()
- {
- return list;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSNamedMap.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSNamedMap.java)
Deleted:
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSNamespaceItem.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSNamespaceItem.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSNamespaceItem.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,495 +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.wsdl.xmlschema;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeSet;
-
-import org.apache.xerces.xs.StringList;
-import org.apache.xerces.xs.XSAnnotation;
-import org.apache.xerces.xs.XSAttributeDeclaration;
-import org.apache.xerces.xs.XSAttributeGroupDefinition;
-import org.apache.xerces.xs.XSComplexTypeDefinition;
-import org.apache.xerces.xs.XSConstants;
-import org.apache.xerces.xs.XSElementDeclaration;
-import org.apache.xerces.xs.XSModelGroupDefinition;
-import org.apache.xerces.xs.XSNamedMap;
-import org.apache.xerces.xs.XSNamespaceItem;
-import org.apache.xerces.xs.XSNotationDeclaration;
-import org.apache.xerces.xs.XSObjectList;
-import org.apache.xerces.xs.XSSimpleTypeDefinition;
-import org.apache.xerces.xs.XSTypeDefinition;
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.jboss.xb.binding.NamespaceRegistry;
-
-/**
- * Xerces Schema API Implementation
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- * @since Apr 20, 2005
- */
-public class JBossXSNamespaceItem implements XSNamespaceItem
-{
- // provide logging
- private static final Logger log = Logger.getLogger(JBossXSNamespaceItem.class);
-
- private String schemaNamespace = null;
- private List<String> docLocations = null;
-
- private Map<String,XSAnnotation> anns = new
HashMap<String,XSAnnotation>();
- private Map<String,XSAttributeDeclaration> attrs = new
HashMap<String,XSAttributeDeclaration>();
- private Map<String,XSElementDeclaration> elements = new
HashMap<String,XSElementDeclaration>();
- private Map<String,XSTypeDefinition> types = new
HashMap<String,XSTypeDefinition>();
-
- private boolean qualifiedElements = false;
-
- private NamespaceRegistry namespaceRegistry;
-
- public JBossXSNamespaceItem(String ns, NamespaceRegistry namespaceRegistry, boolean
qualifiedElements)
- {
- this.schemaNamespace = ns;
- this.namespaceRegistry = namespaceRegistry;
- this.qualifiedElements = qualifiedElements;
- }
-
- /**
- * [schema namespace]: A namespace name or <code>null</code> if absent.
- */
- public String getSchemaNamespace()
- {
- return schemaNamespace;
- }
-
- /**
- * [schema components]: a list of top-level components, i.e. element
- * declarations, attribute declarations, etc.
- * @param objectType The type of the declaration, i.e.
- * <code>ELEMENT_DECLARATION</code>. Note that
- * <code>XSTypeDefinition.SIMPLE_TYPE</code> and
- * <code>XSTypeDefinition.COMPLEX_TYPE</code> can also be used as the
- * <code>objectType</code> to retrieve only complex types or simple
- * types, instead of all types.
- * @return A list of top-level definition of the specified type in
- * <code>objectType</code> or an empty
<code>XSNamedMap</code> if no
- * such definitions exist.
- */
- public XSNamedMap getComponents(short objectType)
- {
- JBossXSNamedMap jbnm = new JBossXSNamedMap();
- if(objectType == XSConstants.ELEMENT_DECLARATION && elements.size() >
0)
- jbnm.addItems(elements.values());
- else
- {
- if(objectType == XSConstants.ATTRIBUTE_DECLARATION && attrs.size() >
0)
- {
- jbnm.addItems(attrs.values());
- }
- else
- if(objectType == XSConstants.TYPE_DEFINITION && types.size() > 0)
- {
- jbnm.addItems(types.values());
- }
- else
- if(objectType == XSTypeDefinition.COMPLEX_TYPE)
- {
- Collection col = types.values();
- jbnm.addItems(getTypes(col,XSTypeDefinition.COMPLEX_TYPE));
- }
- else
- if(objectType == XSTypeDefinition.SIMPLE_TYPE)
- {
- Collection col = types.values();
- jbnm.addItems(getTypes(col,XSTypeDefinition.SIMPLE_TYPE));
- }
- }
-
- return jbnm;
- }
-
- /**
- * [annotations]: a set of annotations if it exists, otherwise an empty
- * <code>XSObjectList</code>.
- */
- public XSObjectList getAnnotations()
- {
- List lst = new ArrayList();
- lst.addAll(anns.values());
- return new JBossXSObjectList(lst);
- }
-
- /**
- * Convenience method. Returns a top-level element declaration.
- * @param name The name of the declaration.
- * @return A top-level element declaration or <code>null</code> if such a
- * declaration does not exist.
- */
- public XSElementDeclaration getElementDeclaration(String name)
- {
- JBossXSElementDeclaration jbe = null;
- //Ensure we return JBossXSElementDeclaration
- if(elements != null)
- {
- XSElementDeclaration xe = elements.get(name);
- if(xe != null && !(xe instanceof JBossXSElementDeclaration))
- jbe = new JBossXSElementDeclaration(xe);
- else
- return xe;
- }
- return jbe;
- }
-
- /**
- * Convenience method. Returns a top-level attribute declaration.
- * @param name The name of the declaration.
- * @return A top-level attribute declaration or <code>null</code> if such
- * a declaration does not exist.
- */
- public XSAttributeDeclaration getAttributeDeclaration(String name)
- {
- if(attrs != null) return attrs.get(name);
- return null;
- }
-
- /**
- * Convenience method. Returns a top-level simple or complex type
- * definition.
- * @param name The name of the definition.
- * @return An <code>XSTypeDefinition</code> or
<code>null</code> if such
- * a definition does not exist.
- */
- public XSTypeDefinition getTypeDefinition(String name)
- {
- if(types != null) return types.get(name);
- return null;
- }
-
- /**
- * Convenience method. Returns a top-level attribute group definition.
- * @param name The name of the definition.
- * @return A top-level attribute group definition or <code>null</code> if
- * such a definition does not exist.
- */
- public XSAttributeGroupDefinition getAttributeGroup(String name)
- {
- return null;
- }
-
- /**
- * Convenience method. Returns a top-level model group definition.
- * @param name The name of the definition.
- * @return A top-level model group definition definition or
- * <code>null</code> if such a definition does not exist.
- */
- public XSModelGroupDefinition getModelGroupDefinition(String name)
- {
- return null;
- }
-
- /**
- * Convenience method. Returns a top-level notation declaration.
- * @param name The name of the declaration.
- * @return A top-level notation declaration or <code>null</code> if such
- * a declaration does not exist.
- */
- public XSNotationDeclaration getNotationDeclaration(String name)
- {
- return null;
- }
-
- /**
- * [document location] - a list of location URIs for the documents that
- * contributed to the <code>XSModel</code>.
- */
- public StringList getDocumentLocations()
- {
- if(docLocations == null) return new JBossXSStringList();
- JBossXSStringList strList = new JBossXSStringList(docLocations);
- return strList;
- }
-
- //Setters
-
- //Custom methods
- public void addDocumentLocation(String uri)
- {
- if(docLocations == null)
- docLocations = new ArrayList<String>();
- docLocations.add(uri);
- }
-
- public void addDocumentLocations(List<String> uri)
- {
- if(docLocations == null)
- docLocations = new ArrayList<String>();
- docLocations.addAll(uri);
- }
-
- /**
- * Add an XSAnnotation
- */
- public void addXSAnnotation(XSAnnotation xa)
- {
- if(xa == null)
- throw new IllegalArgumentException("Illegal Null Argument:xa");
- anns.put(xa.getName(),xa);
- }
-
- /**
- * Add an XSAttributeDeclaration
- */
- public void addXSAttributeDeclaration(XSAttributeDeclaration att)
- {
- if(att == null)
- throw new IllegalArgumentException("att is null");
- attrs.put(att.getName(),att);
- }
-
- /**
- * Add an XSElementDeclaration
- * @param el
- */
- public void addXSElementDeclaration(XSElementDeclaration el)
- {
- if(el == null)
- throw new IllegalArgumentException("Element is null");
- elements.put(el.getName(),el);
- }
-
- /**
- * Add an XSTypeDefinition
- * @param xsType
- */
- public void addXSTypeDefinition(XSTypeDefinition xsType)
- {
- if(xsType == null)
- throw new IllegalArgumentException("type is null");
-
- String xsTypeName = xsType.getName();
- log.trace("addXSTypeDefinition: " + xsTypeName);
-
- types.put(xsTypeName,xsType);
- }
-
-
- /**
- * Overrides the toString method
- */
- @Override
- public String toString()
- {
- /*
- * FIXME - The SOAP Encoding namespace handling should be revisited. This
- * routine should really operate purely off of the registry, instead of
- * printing constant declarations, and having to double check that the
- * registry does not contain them.
- *
- * This order is currently maintained to preserve the format of the
- * generated schema files in the test harness.
- */
- if(isEmpty()) return "";
-
- WSSchemaUtils sutils = WSSchemaUtils.getInstance(namespaceRegistry,
schemaNamespace);
-
- StringBuilder buffer = new StringBuilder();
- buffer.append( "<schema targetNamespace='" + schemaNamespace +
"'");
- buffer.append(" xmlns:" + Constants.PREFIX_SOAP11_ENC +
"='" + Constants.URI_SOAP11_ENC + "'");
- // XML Namespace can only be assigned to the XML prefix
- if (! schemaNamespace.equals(Constants.NS_XML))
- buffer.append(" xmlns:" + Constants.PREFIX_TNS + "='" +
schemaNamespace + "'");
- buffer.append(" xmlns:" + Constants.PREFIX_XSI + "='" +
Constants.NS_SCHEMA_XSI + "'");
- buffer.append(" xmlns='" + Constants.NS_SCHEMA_XSD +
"'");
-
- //Append any custom prefixes
- Iterator iter = namespaceRegistry.getRegisteredPrefixes();
- while (iter.hasNext())
- {
- String prefix = (String) iter.next();
- String ns = namespaceRegistry.getNamespaceURI(prefix);
- if (ns.equals(schemaNamespace) && ns.equals(Constants.NS_XML) == false)
- continue;
- if (ns.equals(Constants.URI_SOAP11_ENC))
- continue;
- if (ns.equals(Constants.NS_SCHEMA_XSI))
- continue;
- buffer.append(" xmlns:" + prefix + "='" + ns
+"'");
- }
-
- if (qualifiedElements)
- buffer.append(" elementFormDefault='qualified'");
-
- buffer.append(">");
-
- //Write the import namespaces
- iter = namespaceRegistry.getRegisteredURIs();
- while (iter.hasNext())
- {
- String ns = (String) iter.next();
- if (ns.equals(schemaNamespace))
- continue;
- if (ns.equals(Constants.URI_SOAP11_ENC))
- continue;
- if (ns.equals(Constants.NS_SCHEMA_XSI))
- continue;
- buffer.append("<import namespace='" + ns +
"'/>");
- }
-
- //Sort the types
- //TreeSet<String> treeset = new TreeSet<String>(types.keySet());
- TreeSet<String> treeset = new TreeSet<String>(new XSComparator());
- treeset.addAll(types.keySet());
- for(String key: treeset)
- {
- buffer.append(sutils.write(types.get(key)));
- }
-
- // Serialize the elements
- //treeset = new TreeSet<String>(elements.keySet());
- treeset = new TreeSet<String>(new XSComparator());
- treeset.addAll(elements.keySet());
- for( String key: treeset)
- {
- buffer.append(sutils.write(elements.get(key) ));
- }
- buffer.append("</schema>");
- return buffer.toString();
- }
-
- public void merge(JBossXSNamespaceItem nsi)
- {
- //Merge the attributes
- JBossXSNamedMap nmap =
(JBossXSNamedMap)nsi.getComponents(XSConstants.ATTRIBUTE_DECLARATION);
- int len = nmap.getLength();
- for(int i=0;i<len;i++)
- {
- XSAttributeDeclaration xatt = (XSAttributeDeclaration)nmap.item(i);
- this.addXSAttributeDeclaration(xatt);
- }
-
- //Merge the types
- nmap = (JBossXSNamedMap)nsi.getComponents(XSConstants.TYPE_DEFINITION);
- len = nmap.getLength();
- for(int i=0;i<len;i++)
- {
- XSTypeDefinition xt = (XSTypeDefinition)nmap.item(i);
- this.addXSTypeDefinition(xt);
- }
-
- // Merge the elements
- nmap = (JBossXSNamedMap)nsi.getComponents(XSConstants.ELEMENT_DECLARATION);
- len = nmap.getLength();
- for(int i=0;i<len;i++)
- {
- XSElementDeclaration xe = (XSElementDeclaration)nmap.item(i);
- this.addXSElementDeclaration(xe);
- }
- }
-
- /**
- * Delete a XSTypeDefinition
- *
- * @param xst
- */
- public void removeXSTypeDefinition(XSTypeDefinition xst)
- {
- String name = xst.getName();
- types.remove(name);
- }
-
- /**
- * Delete a XSTypeDefinition
- *
- * @param xst
- */
- public void removeXSElementDeclaration(XSElementDeclaration xel)
- {
- String name = xel.getName();
- elements.remove(name);
- }
-
- public boolean isQualifiedElements()
- {
- return qualifiedElements;
- }
-
- public void setQualifiedElements(boolean qualifiedElements)
- {
- this.qualifiedElements = qualifiedElements;
- }
-
- public NamespaceRegistry getNamespaceRegistry()
- {
- return namespaceRegistry;
- }
-
- public void setNamespaceRegistry(NamespaceRegistry namespaceRegistry)
- {
- this.namespaceRegistry = namespaceRegistry;
- }
-
- //PRIVATE METHODS
- private Collection getTypes(Collection col, short objectType)
- {
- if(objectType != XSTypeDefinition.SIMPLE_TYPE && objectType !=
XSTypeDefinition.COMPLEX_TYPE)
- throw new IllegalArgumentException("objectType should be simple type or
complex type");
- Collection values = new ArrayList();
- for(Object obj : col)
- {
- if(objectType == XSTypeDefinition.COMPLEX_TYPE &&
- obj instanceof XSComplexTypeDefinition )
- values.add(obj);
- else
- if(objectType == XSTypeDefinition.SIMPLE_TYPE &&
- obj instanceof XSSimpleTypeDefinition )
- values.add(obj);
- }
- return values;
- }
-
- private boolean isEmpty()
- {
- boolean bool = true;
- if(attrs.size() > 0) return false;
- if(types.size() > 0 ) return false;
- if(elements.size()>0) return false;
- return bool;
- }
-
- private class XSComparator implements Comparator
- {
- public int compare(Object arg0, Object arg1)
- {
- String str1 = (String)arg0;
- String str2 = (String)arg1;
-
- if(Character.isUpperCase(str1.charAt(0))
- && Character.isLowerCase(str2.charAt(0)) )
- return 1;
- return str1.compareTo(str2);
- }
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSNamespaceItem.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSNamespaceItem.java)
Deleted:
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSNamespaceItemList.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSNamespaceItemList.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSNamespaceItemList.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,85 +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.wsdl.xmlschema;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.apache.xerces.xs.XSNamespaceItem;
-import org.apache.xerces.xs.XSNamespaceItemList;
-
-/**
- *
- *
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- * @since Apr 20, 2005
- */
-public class JBossXSNamespaceItemList implements XSNamespaceItemList
-{
- protected List xsnsList = new ArrayList();
-
- public JBossXSNamespaceItemList()
- {
- super();
- }
-
- public JBossXSNamespaceItemList(List list)
- {
- super();
- xsnsList = list;
- }
-
- public JBossXSNamespaceItemList(Collection col)
- {
- super();
- xsnsList.addAll(col);
- }
-
- /**
- * The number of <code>XSNamespaceItem</code>s in the list. The range of
- * valid child object indices is 0 to <code>length-1</code> inclusive.
- */
- public int getLength()
- {
- return xsnsList.size();
- }
-
- /**
- * Returns the <code>index</code>th item in the collection or
- * <code>null</code> if <code>index</code> is greater than or
equal to
- * the number of objects in the list. The index starts at 0.
- * @param index index into the collection.
- * @return The <code>XSNamespaceItem</code> at the
<code>index</code>th
- * position in the <code>XSNamespaceItemList</code>, or
- * <code>null</code> if the index specified is not valid.
- */
- public XSNamespaceItem item(int index)
- {
- return (XSNamespaceItem)xsnsList.get(index);
- }
-
- public void addItem(XSNamespaceItem item)
- {
- xsnsList.add(item);
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSNamespaceItemList.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSNamespaceItemList.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSObject.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSObject.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSObject.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,133 +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.wsdl.xmlschema;
-
-import org.apache.xerces.xs.XSNamespaceItem;
-import org.apache.xerces.xs.XSObject;
-
-/**
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- * @since Apr 20, 2005
- */
-public class JBossXSObject implements XSObject
-{
- protected String name;
- protected String namespace;
- private String prefix;
- private XSNamespaceItem xsNSItem;
- private short type;
-
- public JBossXSObject()
- {
-
- }
-
- public JBossXSObject(String name, String namespace)
- {
- this.name = name;
- this.namespace = namespace;
- }
-
- /**
- * The <code>type</code> of this object, i.e.
- * <code>ELEMENT_DECLARATION</code>.
- */
- public short getType()
- {
- return type;
- }
-
- /**
- * The name of type <code>NCName</code>, as defined in XML Namespaces, of
- * this declaration specified in the <code>{name}</code> property of the
- * component or <code>null</code> if the definition of this component
- * does not have a <code>{name}</code> property. For anonymous types,
- * the processor must construct and expose an anonymous type name that
- * is distinct from the name of every named type and the name of every
- * other anonymous type.
- */
- public String getName()
- {
- return name;
- }
-
- public void setName(String n)
- {
- name = n;
- }
-
- /**
- * The [target namespace] of this object, or <code>null</code> if it is
- * unspecified.
- */
- public String getNamespace()
- {
- return namespace;
- }
-
- public void setNamespace(String namespace)
- {
- this.namespace = namespace;
- }
-
- /**
- * A namespace schema information item corresponding to the target
- * namespace of the component, if it is globally declared; or
- * <code>null</code> otherwise.
- */
- public XSNamespaceItem getNamespaceItem()
- {
- return xsNSItem;
- }
-
- public void setNamespaceItem(XSNamespaceItem xsNSItem)
- {
- this.xsNSItem = xsNSItem;
- }
-
- public void setType(short t)
- {
- type = t;
- }
-
- public boolean equals(Object o)
- {
- if (this == o) return true;
- if (!(o instanceof JBossXSObject)) return false;
-
- final JBossXSObject jBossXSObject = (JBossXSObject)o;
-
- if (name != null ? !name.equals(jBossXSObject.name) : jBossXSObject.name != null)
return false;
- if (namespace != null ? !namespace.equals(jBossXSObject.namespace) :
jBossXSObject.namespace != null) return false;
-
- return true;
- }
-
- public int hashCode()
- {
- int result;
- result = (name != null ? name.hashCode() : 0);
- result = 29 * result + (namespace != null ? namespace.hashCode() : 0);
- return result;
- }
-
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSObject.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSObject.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSObjectList.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSObjectList.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSObjectList.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,105 +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.wsdl.xmlschema;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.xerces.xs.XSObject;
-import org.apache.xerces.xs.XSObjectList;
-
-/**
- * Xerces Schema API
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- * @since Apr 20, 2005
- */
-public class JBossXSObjectList implements XSObjectList
-{
- protected List list = new ArrayList();
-
- public JBossXSObjectList()
- {
- }
-
- public JBossXSObjectList(List lst)
- {
- this.list = lst;
- }
-
-
- /**
- * The number of <code>XSObjects</code> in the list. The range of valid
- * child object indices is 0 to <code>length-1</code> inclusive.
- */
- public int getLength()
- {
- int len = list.size();
- return len;
- }
-
- /**
- * Returns the <code>index</code>th item in the collection or
- * <code>null</code> if <code>index</code> is greater than or
equal to
- * the number of objects in the list. The index starts at 0.
- * @param index index into the collection.
- * @return The <code>XSObject</code> at the
<code>index</code>th
- * position in the <code>XSObjectList</code>, or
<code>null</code> if
- * the index specified is not valid.
- */
- public XSObject item(int index)
- {
- return (XSObject)list.get(index);
- }
-
- public void addItem(XSObject xsobj)
- {
- list.add(xsobj);
- }
-
- public void addItem(XSObject xsobj, boolean shouldSort)
- {
- if(shouldSort)
- addItem(xsobj);
- else
- list.add(xsobj);
- }
-
- //CUSTOM METHODS
- public void addObjects(XSObjectList lst)
- {
- if(lst instanceof JBossXSObjectList)
- list.addAll(((JBossXSObjectList)lst).toList());
- else
- {
- int len = lst != null ? lst.getLength() : 0 ;
- for(int i=0; i < len; i++)
- {
- list.add(lst.item(i));
- }
- }
- }
-
- public List toList()
- {
- return list;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSObjectList.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSObjectList.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSParticle.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSParticle.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSParticle.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,132 +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.wsdl.xmlschema;
-
-import org.apache.xerces.xs.XSConstants;
-import org.apache.xerces.xs.XSParticle;
-import org.apache.xerces.xs.XSTerm;
-
-/**
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- * @since Apr 21, 2005
- */
-public class JBossXSParticle
- extends JBossXSObject implements XSParticle, Comparable
-{
- protected int minOccurs = 0;
- protected int maxOccurs = 0;
- protected XSTerm term = null;
-
- public JBossXSParticle()
- {
- }
-
- public JBossXSParticle(String name, String namespace)
- {
- super(name, namespace);
- }
-
- /**
- * [min occurs]: determines the minimum number of terms that can occur.
- */
- public int getMinOccurs()
- {
- return minOccurs;
- }
-
- /**
- * [max occurs]: determines the maximum number of terms that can occur.
- * To query for the value of unbounded use
- * <code>maxOccursUnbounded</code>. When the value of
- * <code>maxOccursUnbounded</code> is <code>true</code>, the
value of
- * <code>maxOccurs</code> is unspecified.
- */
- public int getMaxOccurs()
- {
- return maxOccurs;
- }
-
- /**
- * [max occurs]: whether the maxOccurs value is unbounded.
- */
- public boolean getMaxOccursUnbounded()
- {
- return (maxOccurs == -1);
- }
-
- /**
- * [term]: one of a model group, a wildcard, or an element declaration.
- */
- public XSTerm getTerm()
- {
- return term;
- }
-
- /**
- * Get the type
- */
- @Override
- public short getType()
- {
- return XSConstants.PARTICLE;
- }
-
- public void setMinOccurs(int minOccurs)
- {
- this.minOccurs = minOccurs;
- }
-
- public void setMaxOccurs(int maxOccurs)
- {
- this.maxOccurs = maxOccurs;
- }
-
- public void setTerm(XSTerm term)
- {
- this.term = term;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Comparable#compareTo(T)
- */
- public int compareTo(Object o)
- {
- int c = -1;
- if(o instanceof JBossXSParticle)
- {
- JBossXSParticle w = (JBossXSParticle)o;
- String oname = w.getTerm().getName();
- String termName = term.getName() ;
- if( termName != null )
- c = termName.compareTo(oname);
- //In the case of doclit, need to be careful about String_1,SimpleType_2
- if( termName != null)
- {
- char num1 = termName.charAt(termName.length()-1);
- char num2 = oname.charAt(oname.length()-1);
- if(Character.isDigit(num1) && Character.isDigit(num2))
- c = (""+num1).compareTo((""+num2));
- }
- }
- return c;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSParticle.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSParticle.java)
Deleted:
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSSimpleTypeDefinition.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSSimpleTypeDefinition.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSSimpleTypeDefinition.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,194 +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.wsdl.xmlschema;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.xerces.xs.StringList;
-import org.apache.xerces.xs.XSObjectList;
-import org.apache.xerces.xs.XSSimpleTypeDefinition;
-import org.apache.xerces.xs.XSTypeDefinition;
-
-/**
- * XSSimpleTypeDefinition
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- * @since Aug 4, 2005
- */
-public class JBossXSSimpleTypeDefinition
-extends JBossXSTypeDefinition
-implements XSSimpleTypeDefinition
-{
- private XSSimpleTypeDefinition xsSimple = null;
-
- private List<String> enumerations = new ArrayList<String>();
-
- public JBossXSSimpleTypeDefinition()
- {
- }
-
- public JBossXSSimpleTypeDefinition(XSSimpleTypeDefinition xs)
- {
- this.xsSimple = xs;
- }
-
- public short getVariety()
- {
- return xsSimple.getVariety();
- }
-
- public XSSimpleTypeDefinition getPrimitiveType()
- {
- return xsSimple.getPrimitiveType();
- }
-
- public short getBuiltInKind()
- {
- return xsSimple.getBuiltInKind();
- }
-
- public XSSimpleTypeDefinition getItemType()
- {
- return xsSimple.getItemType();
- }
-
- public XSObjectList getMemberTypes()
- {
- return xsSimple.getMemberTypes();
- }
-
- public short getDefinedFacets()
- {
- return xsSimple.getDefinedFacets();
- }
-
- public boolean isDefinedFacet(short arg0)
- {
- return xsSimple.isDefinedFacet(arg0);
- }
-
- public short getFixedFacets()
- {
- return xsSimple.getFixedFacets();
- }
-
- public boolean isFixedFacet(short arg0)
- {
- return xsSimple.isFixedFacet(arg0);
- }
-
- public String getLexicalFacetValue(short arg0)
- {
- return xsSimple.getLexicalFacetValue(arg0);
- }
-
- public StringList getLexicalEnumeration()
- {
- if (xsSimple == null)
- return new JBossXSStringList(enumerations);
-
- return xsSimple.getLexicalEnumeration();
- }
-
- public void addLexicalEnumeration(String enumeration)
- {
- this.enumerations.add(enumeration);
- }
-
- public StringList getLexicalPattern()
- {
- return xsSimple.getLexicalPattern();
- }
-
- public short getOrdered()
- {
- return xsSimple.getOrdered();
- }
-
- public boolean getFinite()
- {
- return xsSimple.getFinite();
- }
-
- public boolean getBounded()
- {
- return xsSimple.getBounded();
- }
-
- public boolean getNumeric()
- {
- return xsSimple.getNumeric();
- }
-
- public XSObjectList getFacets()
- {
- return xsSimple.getFacets();
- }
-
- public XSObjectList getMultiValueFacets()
- {
- return xsSimple.getMultiValueFacets();
- }
-
- public XSObjectList getAnnotations()
- {
- return xsSimple.getAnnotations();
- }
-
- /**
- * Get the type
- */
- @Override
- public short getType()
- {
- return XSTypeDefinition.SIMPLE_TYPE;
- }
-
- /**
- * Return whether this type definition is a simple type or complex type.
- */
- @Override
- public short getTypeCategory()
- {
- return XSTypeDefinition.SIMPLE_TYPE;
- }
-
-
- //***************************
- //Override base class methods
- //****************************
- @Override
- public String getName()
- {
- if (xsSimple == null)
- return name;
- return xsSimple.getName();
- }
-
- @Override
- public String getNamespace()
- {
- if (xsSimple == null)
- return namespace;
- return xsSimple.getNamespace();
- }
-}
Copied:
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSSimpleTypeDefinition.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSSimpleTypeDefinition.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSStringList.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSStringList.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSStringList.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,103 +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.wsdl.xmlschema;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.apache.xerces.xs.StringList;
-
-/**
- * Implements the StringList interface
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- * @since Apr 20, 2005
- */
-public class JBossXSStringList implements StringList
-{
- protected List<String> strList = new ArrayList<String>();
-
- public JBossXSStringList()
- {
- }
-
- public JBossXSStringList(List<String> alist)
- {
- this.strList = alist;
- }
-
- public JBossXSStringList(Collection<String> col)
- {
- this.strList.addAll(col);
- }
-
- /**
- * The number of <code>GenericString</code>s in the list. The range of
- * valid child object indices is 0 to <code>length-1</code> inclusive.
- */
- public int getLength()
- {
- return strList.size();
- }
-
- /**
- * Checks if the <code>GenericString</code> <code>item</code>
is a member
- * of this list.
- * @param item <code>GenericString</code> whose presence in this list is
- * to be tested.
- * @return True if this list contains the <code>GenericString</code>
- * <code>item</code>.
- */
- public boolean contains(String item)
- {
- return strList.contains(item);
- }
-
- /**
- * Returns the <code>index</code>th item in the collection or
- * <code>null</code> if <code>index</code> is greater than or
equal to
- * the number of objects in the list. The index starts at 0.
- * @param index index into the collection.
- * @return The <code>GenericString</code> at the
<code>index</code>th
- * position in the <code>StringList</code>, or
<code>null</code> if
- * the index specified is not valid.
- */
- public String item(int index)
- {
- return (String)strList.get(index);
- }
-
- public List<String> toList()
- {
- return strList;
- }
-
- public void addItem(String str)
- {
- strList.add(str);
- }
-
- public String toString()
- {
- return strList.toString();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSStringList.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSStringList.java)
Deleted:
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSTypeDefinition.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSTypeDefinition.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSTypeDefinition.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -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.wsdl.xmlschema;
-
-import org.apache.xerces.xs.XSTypeDefinition;
-import org.jboss.ws.WSException;
-
-/**
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- * @since Apr 20, 2005
- */
-public class JBossXSTypeDefinition extends JBossXSObject implements XSTypeDefinition
-{
- private static final long serialVersionUID = -3317350531846406564L;
-
- protected boolean anonymous = false;
- protected JBossXSTypeDefinition baseType;
- protected boolean isFinal = false;
-
- public JBossXSTypeDefinition()
- {
- }
-
- public JBossXSTypeDefinition(String name, String namespace)
- {
- super(name, namespace);
- }
-
- /**
- * Create a new JBossXSTypeDefinition
- * while reading data from a XSTypeDefinition
- *
- * @param xt
- */
- public JBossXSTypeDefinition(XSTypeDefinition xt)
- {
- super(xt.getName(), xt.getNamespace());
- setAnonymous(xt.getAnonymous());
-
- XSTypeDefinition xbase = xt.getBaseType();
- if (xbase != null)
- {
- if (xbase instanceof JBossXSTypeDefinition == false &&
!("anyType".equals(xbase.getName())))
- baseType = new JBossXSTypeDefinition(xbase);
- }
-
- }
-
- /**
- * Return whether this type definition is a simple type or complex type.
- */
- public short getTypeCategory()
- {
- throw new WSException("Type unidentified");
- }
-
- /**
- * {base type definition}: either a simple type definition or a complex
- * type definition.
- */
- public XSTypeDefinition getBaseType()
- {
- return baseType;
- }
-
- /**
- * {final}. For a complex type definition it is a subset of {extension,
- * restriction}. For a simple type definition it is a subset of
- * {extension, list, restriction, union}.
- * @param restriction Extension, restriction, list, union constants
- * (defined in <code>XSConstants</code>).
- * @return True if <code>restriction</code> is in the final set,
- * otherwise false.
- */
- public boolean isFinal(short restriction)
- {
- return isFinal;
- }
-
- /**
- * For complex types the returned value is a bit combination of the subset
- * of {<code>DERIVATION_EXTENSION, DERIVATION_RESTRICTION</code>}
- * corresponding to <code>final</code> set of this type or
- * <code>DERIVATION_NONE</code>. For simple types the returned value is
- * a bit combination of the subset of {
- * <code>DERIVATION_RESTRICTION, DERIVATION_EXTENSION, DERIVATION_UNION,
DERIVATION_LIST</code>
- * } corresponding to <code>final</code> set of this type or
- * <code>DERIVATION_NONE</code>.
- */
- public short getFinal()
- {
- return 0;
- }
-
- /** Convenience attribute. A boolean that specifies if the type definition is
anonymous.
- */
- public boolean getAnonymous()
- {
- return anonymous;
- }
-
- public void setAnonymous(boolean anonymous)
- {
- this.anonymous = anonymous;
- }
-
- /**
- * Convenience method which checks if this type is derived from the given
- * <code>ancestorType</code>.
- * @param ancestorType An ancestor type definition.
- * @param derivationMethod A bit combination representing a subset of {
- * <code>DERIVATION_RESTRICTION, DERIVATION_EXTENSION, DERIVATION_UNION,
DERIVATION_LIST</code>
- * }.
- * @return True if this type is derived from <code>ancestorType</code>
- * using only derivation methods from the <code>derivationMethod</code>
- * .
- */
- public boolean derivedFromType(XSTypeDefinition ancestorType, short derivationMethod)
- {
- return false;
- }
-
- /**
- * Convenience method which checks if this type is derived from the given
- * ancestor type.
- * @param namespace An ancestor type namespace.
- * @param name An ancestor type name.
- * @param derivationMethod A bit combination representing a subset of {
- * <code>DERIVATION_RESTRICTION, DERIVATION_EXTENSION, DERIVATION_UNION,
DERIVATION_LIST</code>
- * }.
- * @return True if this type is derived from <code>ancestorType</code>
- * using only derivation methods from the <code>derivationMethod</code>
- * .
- */
- public boolean derivedFrom(String namespace, String name, short derivationMethod)
- {
- return false;
- }
-
- public void setBaseType(XSTypeDefinition baseT)
- {
- if (baseT instanceof JBossXSTypeDefinition)
- {
- this.baseType = (JBossXSTypeDefinition)baseT;
- }
- else
- {
- this.baseType = new JBossXSTypeDefinition(baseT);
- }
- }
-
- public void setFinal(boolean aFinal)
- {
- isFinal = aFinal;
- }
-
-}
Copied:
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSTypeDefinition.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSTypeDefinition.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/WSSchemaUtils.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/WSSchemaUtils.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/WSSchemaUtils.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,775 +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.wsdl.xmlschema;
-
-import java.io.IOException;
-import java.io.Writer;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.xerces.xs.StringList;
-import org.apache.xerces.xs.XSAnnotation;
-import org.apache.xerces.xs.XSAttributeDeclaration;
-import org.apache.xerces.xs.XSAttributeUse;
-import org.apache.xerces.xs.XSComplexTypeDefinition;
-import org.apache.xerces.xs.XSConstants;
-import org.apache.xerces.xs.XSElementDeclaration;
-import org.apache.xerces.xs.XSModel;
-import org.apache.xerces.xs.XSModelGroup;
-import org.apache.xerces.xs.XSNamedMap;
-import org.apache.xerces.xs.XSNamespaceItem;
-import org.apache.xerces.xs.XSNamespaceItemList;
-import org.apache.xerces.xs.XSObjectList;
-import org.apache.xerces.xs.XSParticle;
-import org.apache.xerces.xs.XSSimpleTypeDefinition;
-import org.apache.xerces.xs.XSTerm;
-import org.apache.xerces.xs.XSTypeDefinition;
-import org.jboss.ws.Constants;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.utils.DOMWriter;
-import org.jboss.ws.metadata.wsdl.xsd.SchemaUtils;
-import org.jboss.xb.binding.NamespaceRegistry;
-
-/**
- * Singleton class that works on the JBoss version of XSModel
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- * @since Jun 3, 2005
- */
-
-public class WSSchemaUtils
-{
- private static final String xsNS = Constants.NS_SCHEMA_XSD;
- private static SchemaUtils utils = SchemaUtils.getInstance();
-
- private NamespaceRegistry namespaceRegistry;
-
- private String targetNamespace = null;
-
- public static WSSchemaUtils getInstance(NamespaceRegistry namespaceRegistry, String
targetNamespace)
- {
- return new WSSchemaUtils(namespaceRegistry, targetNamespace);
- }
-
- private WSSchemaUtils(NamespaceRegistry namespaceRegistry, String targetNamespace)
- {
- this.namespaceRegistry = namespaceRegistry;
- this.targetNamespace = targetNamespace;
- }
-
-
- /**
- * Checks whether given a targetNS and other regular schema namespaces,
- * the passed "checkNS" is a custom namespace
- * @param targetNS Target Namespace of the schema
- * @param checkNS Namespace that needs to be checked if its a custom namespace
- * @return true - if checkNS is a custom namespace, false - otherwise
- */
- public boolean checkCustomNamespace(String targetNS, String checkNS)
- {
- String[] nsarr = new String[] {xsNS,Constants.NS_SCHEMA_XSI };
- List<String> knownNamespaces = Arrays.asList(nsarr);
- boolean isCustom = false;
- if(xsNS.equals(targetNS))
- throw new IllegalArgumentException("targetNamespace cannot be "+xsNS
);
- if(checkNS == null)
- throw new IllegalArgumentException("checkNS is null");
- if(knownNamespaces.contains(checkNS) == false &&
- targetNS.equals(checkNS) == false)
- isCustom = true;
- return isCustom;
- }
-
- /**
- * Create a global XSElementDeclaration object
- * @param name
- * @param xstype
- * @param targetNS
- * @return
- */
-
- public JBossXSElementDeclaration createGlobalXSElementDeclaration(String name,
XSTypeDefinition xstype,
- String targetNS)
- {
- JBossXSElementDeclaration xsel = new JBossXSElementDeclaration();
- xsel.setName(name);
- xsel.setTypeDefinition(xstype);
- xsel.setTargetNamespace(targetNS);
- xsel.setNamespace(targetNS);
- xsel.setScope(XSConstants.SCOPE_GLOBAL);
- return xsel;
- }
-
- /**
- * Generate a Schema Model for a namespace
- * @return
- */
-
- public JBossXSModel createXSModel()
- {
- return new JBossXSModel();
- }
-
- public JBossXSComplexTypeDefinition createXSComplexTypeDefinition( String name,
- XSTypeDefinition baseType, List<XSParticle> xsparts, String typens)
- {
- //No complex type if particles are null
- if(xsparts == null)
- return null;
-
- JBossXSComplexTypeDefinition ct = new JBossXSComplexTypeDefinition();
- ct.setName(name);
- ct.setNamespace(typens);
- JBossXSModelGroup group = new JBossXSModelGroup();
-
- group.setCompositor(XSModelGroup.COMPOSITOR_SEQUENCE);
- group.setParticles(xsparts);
- // Plug the particle array into the modelgroup
- JBossXSParticle xspa = new JBossXSParticle(null, typens);
- xspa.setTerm(group);
- ((JBossXSComplexTypeDefinition) ct).setParticle(xspa);
-
- if (baseType != null)
- {
- ((JBossXSComplexTypeDefinition)
ct).setDerivationMethod(XSConstants.DERIVATION_EXTENSION);
- ((JBossXSComplexTypeDefinition) ct).setBaseType(baseType);
- }
-
- return ct;
- }
-
-
- /**
- * Create a local XSElementDeclaration object
- * @param name
- * @param xstype
- * @param targetNS
- * @param isNillable
- * @return
- */
-
- public JBossXSElementDeclaration createXSElementDeclaration(String name,
XSTypeDefinition xstype,boolean isNillable)
- {
- JBossXSElementDeclaration xsel = new JBossXSElementDeclaration();
- xsel.setName(name);
- xsel.setTypeDefinition(xstype);
- xsel.setNillable(isNillable);
- return xsel;
- }
-
- public JBossXSParticle createXSParticle(String targetNS, boolean isArray, XSTerm
xsterm)
- {
- JBossXSParticle xsp = new JBossXSParticle(null, targetNS);
- if (isArray)
- xsp.setMaxOccurs(-1);
- xsp.setTerm(xsterm);
- return xsp;
- }
-
-
- /**
- * Creates a XSTypeDefinition object given a QName
- *
- * @param qname
- * @return a XSTypeDefinition
- */
- public JBossXSTypeDefinition createXSTypeDefinition(QName qname)
- {
- JBossXSTypeDefinition jbxs = new JBossXSTypeDefinition();
- jbxs.setName(qname.getLocalPart());
- jbxs.setNamespace(qname.getNamespaceURI());
- return jbxs;
- }
-
-
- /**
- * Generate a complex type for a custom exception
- * @param exname
- * @param ns
- * @return
- */
-
- public XSComplexTypeDefinition getExceptionType(String exname, String ns)
- {
- JBossXSParticle xsp = new JBossXSParticle();
- /*xsp.setType(XSConstants.ELEMENT_DECLARATION);
- xsp.setMaxOccurs(-1);
- JBossXSElementDeclaration xsel =
(JBossXSElementDeclaration)createXSElementDeclaration("name",
utils.getSchemaBasicType("string"), true);
-
- xsp.setTerm(xsel); */
- XSComplexTypeDefinition ct =
- new JBossXSComplexTypeDefinition(exname, ns);
-
- ((JBossXSComplexTypeDefinition)ct).setParticle(xsp);
- return ct;
- }
-
- /**
- * Convert the read-only Xerces implementation of XSModel
- * into JBossXSModel.
- * If the input is JBossXSModel, it will be returned back.
- * @param xsmodel XSModel object
- * @return JBossXSModel (RW Model)
- */
- public JBossXSModel getJBossXSModel(XSModel xsmodel)
- {
- if(xsmodel instanceof JBossXSModel)
- return (JBossXSModel)xsmodel;
- JBossXSModel jbxs = new JBossXSModel();
- copyXSModel(xsmodel,jbxs);
- return jbxs;
- }
-
- /**
- * Checks if the XSModel is empty given a namespace
- * @param xsmodel Schema Model to check
- * @param namespace namespace to check components for
- * @return true (if empty) and false (if not empty)
- */
- public boolean isEmptySchema(JBossXSModel xsmodel, String namespace)
- {
- if(xsmodel == null) return true;
- if(namespace == null) throw new WSException("Target Namespace of xsmodel is
null");
- XSNamedMap tmap = xsmodel.getComponentsByNamespace(XSConstants.TYPE_DEFINITION,
namespace);
- XSNamedMap emap = xsmodel.getComponentsByNamespace(XSConstants.ELEMENT_DECLARATION,
namespace);
-
- if (tmap != null && tmap.getLength() > 0) return false;
- if (emap != null && emap.getLength() > 0) return false;
-
- return true;
- }
-
-
- /**
- * Serialize the SchemaModel into a Writer
- * @param xsmodel Schema Model which needs to be serialized
- * @param writer a Writer to which serialization should happen
- * @throws IOException
- */
- public void serialize(XSModel xsmodel, Writer writer) throws IOException
- {
- StringBuilder buffer = new StringBuilder();
- if(xsmodel instanceof JBossXSModel)
- {
- String str = ((JBossXSModel)xsmodel).serialize();
- buffer.append(str);
- }
- else
- {
- buffer.append("<schema ");
- XSNamespaceItemList itemlist = xsmodel.getNamespaceItems();
- appendSchemaDefinitions(buffer, itemlist);
- appendTypes(buffer, xsmodel);
- appendGlobalElements(buffer, xsmodel);
- buffer.append("</schema>");
- }
- writer.write(buffer.toString());
- }
-
-
- /**
- * Serialize the SchemaModel (with no types and elements) into a Writer
- * @param xsmodel Schema Model which needs to be serialized
- * @param writer a Writer to which serialization should happen
- * @throws IOException
- */
-
- public void serializeEmptySchema(XSModel xsmodel, Writer writer) throws IOException
- {
- StringBuilder buffer = new StringBuilder();
- buffer.append("<schema ");
- XSNamespaceItemList itemlist = xsmodel.getNamespaceItems();
- appendSchemaDefinitions(buffer, itemlist);
- appendTypes(buffer, xsmodel);
- appendGlobalElements(buffer, xsmodel);
- buffer.append("</schema>");
- writer.write(buffer.toString());
- }
-
- /**
- * Return a string for the element declaration
- * @param xsel
- * @param xsp
- * @return
- */
-
- public String write(XSElementDeclaration xsel, XSParticle xsp)
- {
- XSTypeDefinition xst = xsel.getTypeDefinition();
- if(xst == null)
- throw new IllegalStateException("Type xst is null");
-
- boolean isGlobalRef = (xsel.getScope() == XSConstants.SCOPE_GLOBAL);
- boolean isAnonType = xst.getAnonymous();
-
- StringBuilder buf = new StringBuilder();
- String elname = xsel.getName();
- String prefix = null;
-
- if(isGlobalRef)
- {
- String namespace = xsel.getNamespace();
- prefix = getPrefix(namespace);
- buf.append("<element ref='" + prefix + ":" + elname +
"'");
- }
- else
- {
- String namespace = xst.getNamespace();
- String typename = xst.getName();
-
- if (! Constants.NS_SCHEMA_XSD.equals(namespace))
- {
- prefix = getPrefix(namespace);
- typename = prefix + ":" + typename;
- }
- buf.append("<element name='" + elname + "'");
-
- if(! isAnonType)
- buf.append(" type='" + typename + "' ");
- }
-
- if (xsel.getNillable())
- buf.append(" nillable='true' ");
-
- int minoccurs = xsp.getMinOccurs();
- int maxoccurs = xsp.getMaxOccurs();
- if (!(minoccurs == 0 && maxoccurs == 0) && !(minoccurs == 1
&& maxoccurs == 1))
- {
- if (xsp.getMaxOccursUnbounded())
- buf.append(" maxOccurs='unbounded' ");
- else
- buf.append(" maxOccurs='" + xsp.getMaxOccurs() +
"'");
-
- buf.append(" minOccurs='" + xsp.getMinOccurs() +
"'");
- }
-
- if(! isAnonType)
- buf.append("/>");
- else
-
buf.append(">").append(write(xst)).append("</element>");
-
- return buf.toString();
- }
-
- public String write(XSAttributeDeclaration decl)
- {
- XSTypeDefinition xst = decl.getTypeDefinition();
- if(xst == null)
- throw new IllegalStateException("Type xst is null");
-
- boolean isGlobalRef = (decl.getScope() == XSConstants.SCOPE_GLOBAL);
- boolean isAnonType = xst.getAnonymous();
-
- StringBuilder buf = new StringBuilder();
- String name = decl.getName();
- String prefix = null;
-
- if (isGlobalRef)
- {
- String namespace = decl.getNamespace();
- prefix = getPrefix(namespace);
- buf.append("<attribute ref='" + prefix + ":" + name +
"'");
- }
- else
- {
- String namespace = xst.getNamespace();
- String typename = xst.getName();
-
- if (! Constants.NS_SCHEMA_XSD.equals(namespace))
- {
- prefix = getPrefix(namespace);
- typename = prefix + ":" + typename;
- }
- buf.append("<attribute name='" + name + "'");
-
- if(! isAnonType)
- buf.append(" type='" + typename + "' ");
- }
-
- if(! isAnonType)
- buf.append("/>");
- else
-
buf.append(">").append(write(xst)).append("</attribute>");
-
- return buf.toString();
- }
-
- /**
- * Return a string for the global element declaration
- * @param xsel
- * @param xsp
- * @return
- */
- public String write(XSElementDeclaration xsel)
- {
- boolean isAnonType = false;
- if (XSConstants.SCOPE_GLOBAL != xsel.getScope())
- throw new IllegalArgumentException("Element is not a global
element");
-
- StringBuilder buf = new StringBuilder();
- String elname = xsel.getName();
- XSTypeDefinition xst = xsel.getTypeDefinition();
- isAnonType = xst.getAnonymous();
- String typename = xst.getName();
- String namespace = xst.getNamespace();
- String prefix = null;
-
- if (! Constants.NS_SCHEMA_XSD.equals(namespace))
- {
- prefix = getPrefix(namespace);
- typename = prefix + ":" + typename;
- }
-
- buf.append("<element name='" + elname + "'");
- if(!isAnonType)
- buf.append(" type='" + typename + "' ");
- else
- buf.append(">").append(write(xst));
-
- if (xsel.getNillable() &&
- xsel.getScope() != XSConstants.SCOPE_GLOBAL)
- buf.append(" nillable='true' ");
- if(!isAnonType)
- buf.append("/>");
- else
- buf.append("</element>");
-
- return buf.toString();
- }
-
- /**
- * Return a string for the xs model group
- * @param xstype
- * @return
- */
- public String write(XSModelGroup xsm)
- {
- StringBuilder buf = new StringBuilder();
- XSObjectList objlist = xsm.getParticles();
-
- int lenobj = objlist != null ? objlist.getLength() : 0;
-
- for (int i = 0; i < lenobj; i++)
- {
- XSParticle jxsp = (XSParticle)objlist.item(i);
- XSTerm xterm = jxsp.getTerm();
- short termType = xterm.getType();
- if(termType == XSConstants.ELEMENT_DECLARATION)
- {
- XSElementDeclaration xsel = (XSElementDeclaration)jxsp.getTerm();
- buf.append(this.write(xsel, jxsp));
- }
- else
- if ( termType == XSConstants.MODEL_GROUP)
- {
- XSObjectList olist = ((XSModelGroup)xterm).getParticles();
- int lobj = olist != null ? olist.getLength() : 0;
- for (int k = 0; k < lobj; k++)
- {
- XSParticle jxp = (XSParticle)olist.item(k);
- XSTerm xsterm = jxp.getTerm();
- termType = xsterm.getType();
- if(termType == XSConstants.ELEMENT_DECLARATION)
- buf.append(write((XSElementDeclaration)xsterm, jxsp));
- else
- if(termType == XSConstants.MODEL_GROUP && k > 0)
- buf.append(write((XSModelGroup)xsterm));
- }
- }
- }
- return buf.toString();
- }
-
-
- /**
- * Return a string for the xs type
- * @param xstype
- * @return
- */
- public String write(XSTypeDefinition xstype)
- {
- StringBuilder buf = new StringBuilder();
-
- //Handle Complex Type
- if (xstype instanceof XSComplexTypeDefinition)
- {
- XSComplexTypeDefinition jxstype = (XSComplexTypeDefinition)xstype;
- String jxsTypeName = jxstype.getName();
- boolean isSimple = jxstype.getContentType() ==
XSComplexTypeDefinition.CONTENTTYPE_SIMPLE;
-
- if(xstype.getAnonymous()) buf.append("<complexType>");
- else
- buf.append("<complexType name='" + jxsTypeName +
"'>");
-
- XSTypeDefinition xsbase = (XSTypeDefinition)jxstype.getBaseType();
- String baseType = null;
- if (xsbase != null && !("anyType".equals(xsbase.getName())))
- baseType = getPrefix(xsbase.getNamespace()) + ":" +
xsbase.getName();
-
- if (baseType != null)
- {
- buf.append((isSimple) ? "<simpleContent>" :
"<complexContent>");
- buf.append("<extension base='" + baseType +
"'>");
- }
-
- XSParticle xsp = jxstype.getParticle();
- if (xsp != null) appendComplexTypeDefinition(buf,jxstype);
-
- XSObjectList list = jxstype.getAttributeUses();
- for (int i = 0; i < list.getLength(); i++)
- {
- XSAttributeUse use = (XSAttributeUse) list.item(i);
- XSAttributeDeclaration decl = use.getAttrDeclaration();
- buf.append(write(decl));
- }
-
- if (baseType != null)
- {
- buf.append("</extension>");
- buf.append((isSimple) ? "</simpleContent>" :
"</complexContent>");
- }
-
- buf.append("</complexType>");
-
- }
- else if (xstype instanceof XSSimpleTypeDefinition)
- {
- XSTypeDefinition xsbase = (XSTypeDefinition)xstype.getBaseType();
- buf.append("<simpleType name='" + xstype.getName() +
"'>");
- if (xsbase != null && !"anyType".equals(xsbase.getName()))
- {
- String baseType = xsbase.getName();
- String ns = xsbase.getNamespace();
- if (! Constants.NS_SCHEMA_XSD.equals(ns))
- {
- String prefix = getPrefix(ns);
- baseType = prefix + ":" + baseType;
- }
-
- // currently only handle enumerations
- buf.append("<restriction base='" + baseType +
"'>");
- StringList list = ((XSSimpleTypeDefinition)xstype).getLexicalEnumeration();
- for (int i = 0; i < list.getLength(); i++)
- {
- String listItem = DOMWriter.normalize(list.item(i), false);
- buf.append("<enumeration value='" + listItem
+"'/>");
- }
- buf.append("</restriction>");
- }
- buf.append("</simpleType>");
- }
-
- return buf.toString();
- }
-
-// Private methods
-
- private void appendSchemaDefinitions(StringBuilder buffer, XSNamespaceItemList
itemlist)
- {
- int len = itemlist != null ? itemlist.getLength() : 0;
-
- for (int i = 0; i < len; i++)
- {
- XSNamespaceItem nsitem = (XSNamespaceItem)itemlist.item(i);
- String ns = nsitem.getSchemaNamespace();
- //Ignore the one for xsd
-
- if (Constants.NS_SCHEMA_XSD.equals(ns)) continue;
- buffer.append(utils.getSchemaDefinitions(ns));
-
- } //end for
- }
-
- private void appendComplexTypeDefinition(StringBuilder buf , XSComplexTypeDefinition
jxstype)
- {
- XSParticle xsp = jxstype.getParticle();
- XSTerm xsterm = xsp.getTerm();
- short deriveMethod = jxstype.getDerivationMethod();
-
- if (xsterm instanceof XSElementDeclaration)
- {
- // FIXME This is horribly wrong, but too much depends on this broken behavior
- buf.append("<sequence>");
-
- XSElementDeclaration xsel = (XSElementDeclaration)xsterm;
- buf.append(this.write(xsel, xsp));
- buf.append("</sequence>");
- }
- else if (xsterm instanceof XSModelGroup)
- {
- XSModelGroup jmg = (XSModelGroup)xsterm;
- XSObjectList objlist = jmg.getParticles();
- String end = null;
-
- switch (jmg.getCompositor())
- {
- case XSModelGroup.COMPOSITOR_ALL:
- buf.append("<all>");
- end = "</all>";
- break;
- case XSModelGroup.COMPOSITOR_CHOICE:
- buf.append("<choice>");
- end = "</choice>";
- break;
- default:
- case XSModelGroup.COMPOSITOR_SEQUENCE:
- buf.append("<sequence>");
- end = "</sequence>";
- break;
- }
-
- int lenobj = objlist != null ? objlist.getLength() : 0;
-
- for (int i = 0; i < lenobj; i++)
- {
- XSParticle jxsp = (XSParticle)objlist.item(i);
- XSTerm xterm = jxsp.getTerm();
- if (xterm instanceof XSElementDeclaration)
- {
- XSElementDeclaration xsel = (XSElementDeclaration)jxsp.getTerm();
- buf.append(this.write(xsel, jxsp));
- }
- else if (xterm instanceof XSModelGroup)
- {
- if(deriveMethod == XSConstants.DERIVATION_EXTENSION && i != lenobj
-1)
- continue;
-
- if (i == 0) continue;//Ignore as it provides the baseclass sequence of
elements
- XSObjectList olist = ((XSModelGroup)xterm).getParticles();
- int lobj = olist != null ? olist.getLength() : 0;
- for (int k = 0; k < lobj; k++)
- {
- XSParticle jxp = (XSParticle)olist.item(k);
- XSTerm jxpterm = jxp.getTerm();
- short termType = jxpterm.getType();
- if(termType == XSConstants.ELEMENT_DECLARATION)
- buf.append(write((XSElementDeclaration)jxpterm, jxsp));
- else
- if(termType == XSConstants.MODEL_GROUP)
- buf.append(write((XSModelGroup)jxpterm));
- }
- }
- }
-
- buf.append(end);
- }
- }
-
- private void appendTypes(StringBuilder buffer, XSModel xsmodel)
- {
- XSNamedMap xsmap = xsmodel.getComponents(XSConstants.TYPE_DEFINITION);
- int len = xsmap != null ? xsmap.getLength() : 0;
- for (int i = 0; i < len; i++)
- {
- XSTypeDefinition xstype = (XSTypeDefinition)xsmap.item(i);
- if (Constants.NS_SCHEMA_XSD.equals(xstype.getNamespace())) continue;
- buffer.append(this.write(xstype));
- }
- }
-
-
- private void appendGlobalElements(StringBuilder buffer, XSModel xsmodel)
- {
- XSNamedMap xsmap = xsmodel.getComponents(XSConstants.ELEMENT_DECLARATION);
- int len = xsmap != null ? xsmap.getLength() : 0;
- for (int i = 0; i < len; i++)
- {
- XSElementDeclaration xsel = (XSElementDeclaration)xsmap.item(i);
- if (Constants.NS_SCHEMA_XSD.equals(xsel.getNamespace())) continue;
- buffer.append(this.write(xsel));
- }
- }
-
- //Copy the Xerces implementation of XSModel into JBossXSModel
- public void copyXSModel(XSModel xsmodel, JBossXSModel jb)
- {
- if(xsmodel == null)
- throw new IllegalArgumentException("Illegal Null Argument:xsmodel");
- if(jb == null)
- throw new IllegalArgumentException("Illegal Null Argument:jb");
- //Copy all the Namespace Items
- jb.setXSNamespaceItemList(xsmodel.getNamespaceItems());
- //Copy all the elements
- XSNamedMap xsmp = xsmodel.getComponents(XSConstants.ELEMENT_DECLARATION);
- int len = xsmp != null ? xsmp.getLength() : 0;
-
- for (int i = 0; i < len; i++)
- {
- XSElementDeclaration xsel = (XSElementDeclaration)xsmp.item(i);
- jb.addXSElementDeclaration(xsel);
- }
- //Copy all the types
- xsmp = xsmodel.getComponents(XSConstants.TYPE_DEFINITION);
- len = xsmp != null ? xsmp.getLength() : 0;
- for (int i = 0; i < len; i++)
- {
- XSTypeDefinition xstype = (XSTypeDefinition)xsmp.item(i);
- if (!this.xsNS.equals(xstype.getNamespace())) jb.addXSTypeDefinition(xstype);
- }
-
- //Copy all the attributes
- xsmp = xsmodel.getComponents(XSConstants.ATTRIBUTE_DECLARATION);
- len = xsmp != null ? xsmp.getLength() : 0;
- for (int i = 0; i < len; i++)
- {
- XSAttributeDeclaration xsattr = (XSAttributeDeclaration)xsmp.item(i);
- jb.addXSAttributeDeclaration(xsattr);
- }
-
- //copy all the global annotations
- //xsmp = xsmodel.getComponents(XSConstants.ANNOTATION);
- XSObjectList xo = xsmodel.getAnnotations();
- len = xo != null ? xo.getLength():0;
- //len = xsmp != null ? xsmp.getLength() : 0;
- for (int i = 0; i < len; i++)
- {
- //XSAnnotation xa = (XSAnnotation)xsmp.item(i);
- XSAnnotation xa = (XSAnnotation)xo.item(i);
- jb.addXSAnnotation(xa);
- }
- }
-
- private String getPrefix(String namespace)
- {
- if (namespaceRegistry == null)
- throw new IllegalArgumentException("nameespaceRegistry can not be
null!");
-
- if (namespace == null)
- throw new IllegalArgumentException("namespace can not be null");
-
- // XML Namespace can only legally be assigned the XML prefix
- if (namespace.equals(Constants.NS_XML))
- return Constants.PREFIX_XML;
- if (namespace.equals(targetNamespace))
- return Constants.PREFIX_TNS;
- if (namespace.equals(Constants.URI_SOAP11_ENC))
- return Constants.PREFIX_SOAP11_ENC;
- if (namespace.equals(Constants.NS_SCHEMA_XSI))
- return Constants.PREFIX_XSI;
-
- String prefix = namespaceRegistry.getPrefix(namespace);
-
- // Assume target namespace
- return (prefix == null) ? Constants.PREFIX_TNS : prefix;
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/WSSchemaUtils.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/WSSchemaUtils.java)
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/xsd (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xsd)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/xsd/SchemaUtils.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xsd/SchemaUtils.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/xsd/SchemaUtils.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,567 +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.wsdl.xsd;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.apache.xerces.impl.dv.xs.SchemaDVFactoryImpl;
-import org.apache.xerces.impl.xs.XMLSchemaLoader;
-import org.apache.xerces.xni.parser.XMLEntityResolver;
-import org.apache.xerces.xni.parser.XMLErrorHandler;
-import org.apache.xerces.xs.StringList;
-import org.apache.xerces.xs.XSComplexTypeDefinition;
-import org.apache.xerces.xs.XSConstants;
-import org.apache.xerces.xs.XSElementDeclaration;
-import org.apache.xerces.xs.XSLoader;
-import org.apache.xerces.xs.XSModel;
-import org.apache.xerces.xs.XSModelGroup;
-import org.apache.xerces.xs.XSNamedMap;
-import org.apache.xerces.xs.XSObjectList;
-import org.apache.xerces.xs.XSParticle;
-import org.apache.xerces.xs.XSSimpleTypeDefinition;
-import org.apache.xerces.xs.XSTerm;
-import org.apache.xerces.xs.XSTypeDefinition;
-import org.jboss.ws.Constants;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.server.ServerConfig;
-import org.jboss.ws.core.server.ServerConfigFactory;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSComplexTypeDefinition;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSElementDeclaration;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSErrorHandler;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSSimpleTypeDefinition;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSStringList;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSTypeDefinition;
-
-/**
- * Util class that deals with XML Schema
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- * @since Apr 12, 2005
- */
-public class SchemaUtils
-{
- private static SchemaUtils ourInstance = new SchemaUtils();
-
- protected static String xsNS = Constants.NS_SCHEMA_XSD;
-
- private static Map<Class, QName> toolsTypeMappingOverride = new
HashMap<Class, QName>();
-
- static
- {
- toolsTypeMappingOverride.put(byte[].class, Constants.TYPE_LITERAL_BASE64BINARY);
- }
-
- public static SchemaUtils getInstance()
- {
- return ourInstance;
- }
-
- private SchemaUtils()
- {
- }
-
- /**
- * Checks if the XS Particle is of array type
- * @param xsparticle
- * @return
- */
-
- public boolean isArrayType(XSParticle xsparticle)
- {
- //Determine if it is an arrayType
- int maxOccurs = xsparticle.getMaxOccurs();
- return xsparticle.getMaxOccursUnbounded() || maxOccurs > 1;
- }
-
- public static boolean isWrapperArrayType(XSTypeDefinition xst)
- {
- return unwrapArrayType(xst) != null;
- }
-
- public static XSElementDeclaration unwrapArrayType(XSTypeDefinition xst)
- {
- if (xst instanceof XSComplexTypeDefinition == false)
- return null;
-
- XSComplexTypeDefinition xc = (XSComplexTypeDefinition)xst;
- if (xc.getContentType() == XSComplexTypeDefinition.CONTENTTYPE_EMPTY)
- return null;
-
- XSParticle xsp = xc.getParticle();
- if (xsp == null)
- return null;
-
- XSTerm xsterm = xsp.getTerm();
- if (xsterm instanceof XSModelGroup == false)
- return null;
-
- XSModelGroup xm = (XSModelGroup)xsterm;
- XSObjectList xo = xm.getParticles();
- if (xo.getLength() != 1)
- return null;
-
- XSParticle xp = (XSParticle)xo.item(0);
- XSTerm term = xp.getTerm();
- if ((xp.getMaxOccursUnbounded() || xp.getMaxOccurs() > 1) == false || term
instanceof XSElementDeclaration == false)
- return null;
-
- return (XSElementDeclaration)term;
- }
-
- /**
- * Generate a QName for a simple type
- * @param simple
- * @return
- */
- public static QName handleSimpleType(XSSimpleTypeDefinition simple)
- {
- if (simple == null)
- throw new IllegalArgumentException("XSSimpleTypeDefinition passed is
null");
-
- //Check if the type of SimpleType is a plain xsd type
- if (Constants.NS_SCHEMA_XSD.equals(simple.getNamespace()))
- return createQNameFromXSSimpleType(simple);
-
- switch (simple.getVariety())
- {
- case XSSimpleTypeDefinition.VARIETY_LIST:
- return handleSimpleType(simple.getItemType());
- case XSSimpleTypeDefinition.VARIETY_UNION:
- XSObjectList list = simple.getMemberTypes();
- if (list.getLength() > 0)
- return handleSimpleType((XSSimpleTypeDefinition)list.item(0));
- throw new WSException("Empty union type not expected");
- case XSSimpleTypeDefinition.VARIETY_ABSENT:
- throw new WSException("Absent variety is not supported in simple
types");
- }
-
- XSTypeDefinition base = simple.getBaseType();
- while (!Constants.NS_SCHEMA_XSD.equals(base.getNamespace()))
- base = base.getBaseType();
-
- if (!(base instanceof XSSimpleTypeDefinition))
- throw new WSException("Expected base type to be a simple type");
-
- return new QName(base.getNamespace(), base.getName());
- }
-
- /**
- * For the basic xsd types, patch prefix and ns uri
- * @param qname
- * @return
- */
- public QName patchXSDQName(QName qname)
- {
- if (qname == null)
- return null;
- return new QName(Constants.NS_SCHEMA_XSD, qname.getLocalPart(),
Constants.PREFIX_XSD);
- }
-
- /**
- * Given a XSTypeDefinition and the QName for the element,
- * create a XSElementDeclaration object
- * @param xmlName Name of the element
- * @param xst Type of the element
- * @return XSElementDeclaration
- */
- public XSElementDeclaration createXSElementDeclaration(QName xmlName, XSTypeDefinition
xst)
- {
- String name = xmlName.getLocalPart();
- String ns = xmlName.getNamespaceURI();
- JBossXSElementDeclaration jbel = new JBossXSElementDeclaration(name, ns);
- jbel.setTypeDefinition(xst);
- jbel.setScope(XSConstants.SCOPE_GLOBAL);
- return jbel;
- }
-
- /**
- * Create a QName given a Simple Type
- * @param xs
- * @return qname
- */
- public static QName createQNameFromXSSimpleType(XSSimpleTypeDefinition xs)
- {
- String nsuri = xs.getNamespace();
- String localpart = xs.getName();
- if (xsNS.equals(nsuri))
- return new QName(nsuri, localpart, Constants.PREFIX_XSD);
- else return new QName(nsuri, localpart);
- }
-
- /**
- * Return typemapping override for tools if any
- *
- * @param javaType
- * @return
- */
- public QName getToolsOverrideInTypeMapping(Class javaType)
- {
- return toolsTypeMappingOverride.get(javaType);
- }
-
- /**
- * Check if a global element exists
- * @param xmlName QName of the element that needs to be checked
- * @param xsmodel Schema model that is passed
- * @return
- */
- public boolean hasGlobalElement(QName xmlName, XSModel xsmodel)
- {
- if (xmlName == null)
- throw new IllegalArgumentException("xmlName is null");
- if (xsmodel == null)
- throw new IllegalArgumentException("XSModel is null");
- boolean bool = false;
- String name = xmlName.getLocalPart();
- if (name == null)
- throw new IllegalArgumentException("xmlName has a null name");
- String ns = xmlName.getNamespaceURI();
- if (ns == null)
- throw new IllegalArgumentException("xmlName has a null namespace");
- if (xsmodel.getElementDeclaration(name, ns) != null)
- bool = true;
- return bool;
- }
-
- /**
- * Check if a Complex Type exists
- * @param xmlType QName of the Complex Type that needs to be checked
- * @param xsmodel Schema model that is passed
- * @return
- */
- public boolean hasComplexTypeDefinition(QName xmlType, URL xsdLocation)
- {
- if (xsdLocation == null)
- throw new IllegalArgumentException("xsdLocation is null");
- XSModel xsmodel = parseSchema(xsdLocation);
- return this.hasComplexTypeDefinition(xmlType, xsmodel);
- }
-
- /**
- * Check if a Global Element exists
- * @param xmlType QName of the global element that needs to be checked
- * @param xsmodel Schema model that is passed
- * @return
- */
- public boolean hasGlobalElement(QName xmlName, URL xsdLocation)
- {
- if (xmlName == null)
- throw new IllegalArgumentException("xmlName is null");
- if (xsdLocation == null)
- throw new IllegalArgumentException("xsdLocation is null");
- XSModel xsmodel = parseSchema(xsdLocation);
- boolean bool = false;
- String name = xmlName.getLocalPart();
- if (name == null)
- throw new IllegalArgumentException("xmlName has a null name");
- String ns = xmlName.getNamespaceURI();
- if (ns == null)
- throw new IllegalArgumentException("xmlName has a null namespace");
- if (xsmodel.getElementDeclaration(name, ns) != null)
- bool = true;
- return bool;
- }
-
- /**
- * Check if a Complex Type exists
- * @param xmlType QName of the Complex Type that needs to be checked
- * @param xsmodel Schema model that is passed
- * @return
- */
- public boolean hasComplexTypeDefinition(QName xmlType, XSModel xsmodel)
- {
- if (xmlType == null)
- throw new IllegalArgumentException("xmlType is null");
- if (xsmodel == null)
- throw new IllegalArgumentException("XSModel is null");
- boolean bool = false;
- String name = xmlType.getLocalPart();
- if (name == null)
- throw new IllegalArgumentException("xmlName has a null name");
- String ns = xmlType.getNamespaceURI();
- if (ns == null)
- throw new IllegalArgumentException("xmlName has a null namespace");
- if (xsmodel.getTypeDefinition(name, ns) != null)
- bool = true;
- return bool;
- }
-
- /**
- * Get formatted string for the qname representing the xstype
- * @param xstype
- * @return
- */
- public String getFormattedString(XSTypeDefinition xstype)
- {
- String ns = xstype.getNamespace();
- String name = xstype.getName();
- if (!ns.equals(xsNS))
- name = getPrefix(ns) + ":" + name;
-
- return name;
- }
-
- /**
- * Get a QName for a xs type
- * @param xstype
- * @return
- */
- public QName getQName(XSTypeDefinition xstype)
- {
- String prefix = null;
- String ns = xstype.getNamespace();
- String name = xstype.getName();
- if (!ns.equals(xsNS))
- prefix = Constants.PREFIX_TNS;
- else prefix = Constants.PREFIX_XSD;
-
- return new QName(ns, name, prefix);
- }
-
- /**
- * Get a schema basic type
- * TODO: Migrate this off of the Xerces Impl
- * @param localpart
- * @return
- */
- public JBossXSTypeDefinition getSchemaBasicType(String localpart)
- {
- JBossXSTypeDefinition xt = null;
- /**
- * Special case: xs:anyType
- */
- if ("anyType".equals(localpart))
- {
- JBossXSComplexTypeDefinition ct = new JBossXSComplexTypeDefinition(localpart,
Constants.NS_SCHEMA_XSD);
- ct.setContentType(XSComplexTypeDefinition.CONTENTTYPE_EMPTY);
- xt = ct;
- }
- else
- {
- XSSimpleTypeDefinition xstype = (new
SchemaDVFactoryImpl()).getBuiltInType(localpart);
- xt = new JBossXSSimpleTypeDefinition(xstype);
-
- }
- return xt;
- }
-
- /**
- * Get an instance of XSLoader that is capable of
- * parsing schema files
- *
- * @return
- */
- public XSLoader getXSLoader()
- {
- XMLSchemaLoader xsloader = new XMLSchemaLoader();
- JBossXSErrorHandler eh = new JBossXSErrorHandler();
- xsloader.setErrorHandler(eh);
- return xsloader;
- }
-
- /**
- * Get an instance of XSLoader that is capable of
- * parsing schema files
- * @param xeh XML Error handler
- * @param xer XML Entity Resolver
- * @return
- */
- public XSLoader getXSLoader(XMLErrorHandler xeh, XMLEntityResolver xer)
- {
- XMLSchemaLoader xsloader = new XMLSchemaLoader();
- xsloader.setEntityResolver(xer);
- xsloader.setErrorHandler(xeh);
- return xsloader;
- }
-
- /**
- * Given a schema file, generate a schema model
- * @param schemaLoc java.net.URL object to the schema file
- * @return schema model
- */
- public XSModel parseSchema(URL schemaLoc)
- {
- return parseSchema(schemaLoc.toExternalForm());
- }
-
- /**
- * Given a schema file, generate a schema model
- * @param schemaLoc string representation to the location of schema
- * @return schema model
- */
- public XSModel parseSchema(String schemaLoc)
- {
- XSLoader xsloader = getXSLoader();
- XSModel xsModel = xsloader.loadURI(schemaLoc);
- if (xsModel == null)
- throw new WSException("Cannot parse schema: " + schemaLoc);
- return xsModel;
- }
-
- /**
- * Given a list of schema locations, parse and
- * provide a Xerces XSModel
- *
- * @param locations
- * @return
- */
- public XSModel parseSchema(List<String> locations)
- {
- JBossXSStringList slist = new JBossXSStringList(locations);
- XSLoader xsloader = getXSLoader();
- return xsloader.loadURIList(slist);
- }
-
- /**
- * Checks if the XSModel is empty
- * @param xsmodel
- * @return true (if empty) and false (if not empty)
- */
- public boolean isEmptySchema(XSModel xsmodel)
- {
- if (xsmodel == null)
- return true;
- String targetNS = getTargetNamespace(xsmodel);
- if (targetNS == null)
- throw new WSException("Target Namespace of xsmodel is null");
- XSNamedMap tmap = xsmodel.getComponentsByNamespace(XSConstants.TYPE_DEFINITION,
targetNS);
- XSNamedMap emap = xsmodel.getComponentsByNamespace(XSConstants.ELEMENT_DECLARATION,
targetNS);
-
- if (tmap != null && tmap.getLength() > 0)
- return false;
- if (emap != null && emap.getLength() > 0)
- return false;
-
- return true;
- }
-
- /**
- * Checks if the XSModel is empty given a namespace
- * @param xsmodel Schema Model to check
- * @param namespace namespace to check components for
- * @return true (if empty) and false (if not empty)
- */
- public boolean isEmptySchema(XSModel xsmodel, String namespace)
- {
- if (xsmodel == null)
- return true;
- if (namespace == null)
- throw new WSException("Target Namespace of xsmodel is null");
- XSNamedMap tmap = xsmodel.getComponentsByNamespace(XSConstants.TYPE_DEFINITION,
namespace);
- XSNamedMap emap = xsmodel.getComponentsByNamespace(XSConstants.ELEMENT_DECLARATION,
namespace);
-
- if (tmap != null && tmap.getLength() > 0)
- return false;
- if (emap != null && emap.getLength() > 0)
- return false;
-
- return true;
- }
-
- /**
- * Get the schema definitions as a String
- * @param targetNS The Target Namespace
- * @return
- */
- public static String getSchemaDefinitions(String targetNS)
- {
- StringBuilder buffer = new StringBuilder();
- buffer.append(" targetNamespace='" + targetNS + "'");
- buffer.append(" xmlns='" + Constants.NS_SCHEMA_XSD +
"'");
- buffer.append(" xmlns:" + Constants.PREFIX_SOAP11_ENC +
"='" + Constants.URI_SOAP11_ENC + "'");
- buffer.append(" xmlns:" + Constants.PREFIX_TNS + "='" +
targetNS + "'");
- //buffer.append(" xmlns:" + WSDLConstants.PREFIX_XSD + "='"
+ WSDLConstants.NS_SCHEMA_XSD + "'");
- buffer.append(" xmlns:" + Constants.PREFIX_XSI + "='" +
Constants.NS_SCHEMA_XSI + "'");
- buffer.append(">");
- return buffer.toString();
- }
-
- /** Get the temp file for a given namespace
- */
- public static File getSchemaTempFile(String targetNS) throws IOException
- {
- if (targetNS.length() == 0)
- throw new IllegalArgumentException("Invalid null target namespace");
-
- String fname = targetNS;
- if (fname.indexOf("://") > 0)
- fname = fname.substring(fname.indexOf("://") + 3);
-
- File tmpdir = null;
- try
- {
- ServerConfigFactory factory = ServerConfigFactory.getInstance();
- ServerConfig serverConfig = factory.getServerConfig();
- tmpdir = serverConfig.getServerTempDir();
- tmpdir = new File(tmpdir.getCanonicalPath() + "/jbossws");
- tmpdir.mkdirs();
- }
- catch (Throwable th)
- {
- // ignore if the server config cannot be found
- // this would be the case if we are on the client side
- }
-
- fname = fname.replace('/', '_');
- fname = fname.replace(':', '_');
- File file = File.createTempFile("JBossWS_" + fname, ".xsd",
tmpdir);
- return file;
- }
-
- /**
- * Get the TargetNamespace from the schema model
- */
- public static String getTargetNamespace(XSModel xsmodel)
- {
- if (xsmodel == null)
- throw new IllegalArgumentException("Illegal Null Argument: xsmodel");
- String targetNS = null;
- StringList slist = xsmodel.getNamespaces();
- int len = slist != null ? slist.getLength() : 0;
- for (int i = 0; i < len; i++)
- {
- String ns = slist.item(i);
- if (Constants.NS_SCHEMA_XSD.equals(ns))
- continue;
- targetNS = ns;
- break;
- }
- return targetNS;
- }
-
- private String getPrefix(String namespace)
- {
- if (Constants.URI_SOAP11_ENC.equals(namespace))
- return Constants.PREFIX_SOAP11_ENC;
- else if (Constants.NS_SOAP11_ENV.equals(namespace) ||
Constants.NS_SOAP12_ENV.equals(namespace))
- return Constants.PREFIX_ENV;
-
- // Fall back to target namespace even though this is incorrect
- return Constants.PREFIX_TNS;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/xsd/SchemaUtils.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xsd/SchemaUtils.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsdl/xsd/XSDWriter.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xsd/XSDWriter.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/xsd/XSDWriter.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,118 +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.wsdl.xsd;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.net.URL;
-
-import org.apache.xerces.xs.XSModel;
-import org.jboss.logging.Logger;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
-import org.jboss.ws.metadata.wsdl.xmlschema.WSSchemaUtils;
-
-/**
- * XML Schema File Writer
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- */
-public class XSDWriter
-{
- // provide logging
- protected static final Logger log = Logger.getLogger(XSDWriter.class);
-
- protected WSDLDefinitions wsdl = null;
-
- protected SchemaUtils schemautils = SchemaUtils.getInstance();
-
- protected WSSchemaUtils sutils = WSSchemaUtils.getInstance(null, null);
-
- public void writeXSD(Writer writer, XSModel xsmodel, WSDLDefinitions wsdl)
- {
- if (xsmodel == null)
- throw new IllegalArgumentException("xsmodel is NULL");
-
- this.wsdl = wsdl;
-
- if (schemautils.isEmptySchema(xsmodel)) return;
- }
-
- /**
- * Serialize the schema into a temp file
- * @param xsmodel Schema model
- * @param ns Target Namespace
- * @return URL of the temp file where the schema exists
- * @throws IOException
- */
- public URL serialize( XSModel xsmodel, String ns)
- throws IOException
- {
- if(ns == null)
- throw new IllegalArgumentException("Illegal Null Argument:ns");
- String xsdString = "";
- if(xsmodel instanceof JBossXSModel)
- {
- JBossXSModel jbxs = (JBossXSModel)xsmodel;
- xsdString = jbxs.serialize();
- }
- else
- {
- // Serialize XSD model
- StringWriter strwr = new StringWriter();
- sutils.serialize(xsmodel, strwr);
- xsdString = strwr.toString();
- }
-
- log.trace("serialize:\n" + xsdString);
-
- // Write updated xsd file
- File xsdFile = SchemaUtils.getSchemaTempFile(ns);
- FileWriter writer = new FileWriter(xsdFile);
- writer.write(xsdString);
- writer.close();
-
- return xsdFile.toURL();
- }
-
- /**
- * Serialize the schema into a output stream
- * @param xsmodel Schema model
- * @param ns Target Namespace
- * @param os OutputStream to write into
- * @throws IOException
- */
- public void serialize( XSModel xsmodel, String ns, OutputStream os)
- throws IOException
- {
- // Serialize XSD model
- StringWriter strwr = new StringWriter();
- sutils.serialize(xsmodel, strwr);
- String xsdString = strwr.toString();
- log.trace("serialize:" + xsdString);
-
- os.write(xsdString.getBytes());
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsdl/xsd/XSDWriter.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xsd/XSDWriter.java)
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsse (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsse/Config.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Config.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsse/Config.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,95 +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.wsse;
-
-import java.io.Serializable;
-
-/**
- * <code>Config</code> represents the config tag.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class Config implements Serializable
-{
- private static final long serialVersionUID = 4219543242657899910L;
-
- private Timestamp timestamp;
-
- private Username username;
-
- private Sign sign;
-
- private Encrypt encrypt;
-
- private Requires requires;
-
- public Encrypt getEncrypt()
- {
- return encrypt;
- }
-
- public void setEncrypt(Encrypt encrypt)
- {
- this.encrypt = encrypt;
- }
-
- public Sign getSign()
- {
- return sign;
- }
-
- public void setSign(Sign sign)
- {
- this.sign = sign;
- }
-
- public Timestamp getTimestamp()
- {
- return timestamp;
- }
-
- public void setTimestamp(Timestamp timestamp)
- {
- this.timestamp = timestamp;
- }
-
- public Username getUsername()
- {
- return username;
- }
-
- public void setUsername(Username username)
- {
- this.username = username;
- }
-
- public Requires getRequires()
- {
- return requires;
- }
-
- public void setRequires(Requires requires)
- {
- this.requires = requires;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsse/Config.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Config.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsse/Encrypt.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Encrypt.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsse/Encrypt.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,79 +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.wsse;
-
-import java.io.Serializable;
-
-/**
- * <code>Encrypt</code> represents the encrypt tag, which signifies that the
- * message should be encrypted.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class Encrypt extends Targetable implements Serializable
-{
- private static final long serialVersionUID = -2802677183149218760L;
-
- private String type;
-
- private String alias;
-
- private String algorithm;
-
- public Encrypt(String type, String alias, String algorithm)
- {
- this.type = type;
- this.alias = alias;
- this.algorithm = algorithm;
- }
-
- public String getAlias()
- {
- return alias;
- }
-
- public void setAlias(String alias)
- {
- this.alias = alias;
- }
-
- public String getType()
- {
- return type;
- }
-
- public void setType(String type)
- {
- this.type = type;
- }
-
- public String getAlgorithm()
- {
- return algorithm;
- }
-
- public void setAlgorithm(String algorithm)
- {
- this.algorithm = algorithm;
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsse/Encrypt.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Encrypt.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsse/Operation.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Operation.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsse/Operation.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,65 +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.wsse;
-
-import java.io.Serializable;
-
-/**
- * <code>Operation</code> represents a wsdl operation. Used to declare per
- * operation configurations.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class Operation implements Serializable
-{
- private static final long serialVersionUID = 4223295703633326725L;
-
- private Config config;
-
- private String name;
-
- public Operation(String name)
- {
- this.name = name;
- }
-
- public Config getConfig()
- {
- return config;
- }
-
- public void setConfig(Config config)
- {
- this.config = config;
- }
-
- public String getName()
- {
- return name;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsse/Operation.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Operation.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsse/Port.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Port.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsse/Port.java 2006-12-07 10:43:36 UTC (rev
1600)
@@ -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.wsse;
-
-import java.io.Serializable;
-import java.util.HashMap;
-
-/**
- * <code>Port</code> represents a per wsdl port configuration for a
- * security configuration.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class Port implements Serializable
-{
- private static final long serialVersionUID = 8294850341855208663L;
-
- private String name;
-
- private Config defaultConfig;
-
- private HashMap<String, Operation> operations = new HashMap<String,
Operation>();
-
- public Port(String name)
- {
- this.name = name;
- }
-
- public Config getDefaultConfig()
- {
- return defaultConfig;
- }
-
- public void setDefaultConfig(Config defaultConfig)
- {
- this.defaultConfig = defaultConfig;
- }
-
- public HashMap<String, Operation> getOperations()
- {
- return operations;
- }
-
- public void setOperations(HashMap<String, Operation> operations)
- {
- this.operations = operations;
- }
-
- public String getName()
- {
- return name;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-
- public void addOperation(Operation operation)
- {
- operations.put(operation.getName(), operation);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsse/Port.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Port.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsse/RequireEncryption.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/RequireEncryption.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsse/RequireEncryption.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,34 +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.wsse;
-
-/**
- * <code>Sign</code> represents the sign tag, which declares that a message
- * should be signed.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class RequireEncryption extends Targetable
-{
- private static final long serialVersionUID = 3765798680988205647L;
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsse/RequireEncryption.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/RequireEncryption.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsse/RequireSignature.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/RequireSignature.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsse/RequireSignature.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,34 +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.wsse;
-
-/**
- * <code>Sign</code> represents the sign tag, which declares that a message
- * should be signed.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class RequireSignature extends Targetable
-{
- private static final long serialVersionUID = -3854930944550152309L;
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsse/RequireSignature.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/RequireSignature.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsse/RequireTimestamp.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/RequireTimestamp.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsse/RequireTimestamp.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,47 +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.wsse;
-
-import java.io.Serializable;
-
-
-public class RequireTimestamp implements Serializable
-{
- private static final long serialVersionUID = 278316358447518411L;
-
- private String maxAge;
-
- public RequireTimestamp(String maxAge)
- {
- this.maxAge = maxAge;
- }
-
- public String getMaxAge()
- {
- return maxAge;
- }
-
- public void setMaxAge(String maxAge)
- {
- this.maxAge = maxAge;
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsse/RequireTimestamp.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/RequireTimestamp.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsse/Requires.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Requires.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsse/Requires.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,71 +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.wsse;
-
-import java.io.Serializable;
-
-/**
- * <code>Requires</code> represents the require tag.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class Requires implements Serializable
-{
- private static final long serialVersionUID = 6899913633295989845L;
-
- private RequireTimestamp requireTimestamp;
-
- private RequireSignature requireSignature;
-
- private RequireEncryption requireEncryption;
-
- public RequireEncryption getRequireEncryption()
- {
- return requireEncryption;
- }
-
- public void setRequireEncryption(RequireEncryption requireEncryption)
- {
- this.requireEncryption = requireEncryption;
- }
-
- public RequireSignature getRequireSignature()
- {
- return requireSignature;
- }
-
- public void setRequireSignature(RequireSignature requireSignature)
- {
- this.requireSignature = requireSignature;
- }
-
- public RequireTimestamp getRequireTimestamp()
- {
- return requireTimestamp;
- }
-
- public void setRequireTimestamp(RequireTimestamp requireTimestamp)
- {
- this.requireTimestamp = requireTimestamp;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsse/Requires.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Requires.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsse/Sign.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Sign.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsse/Sign.java 2006-12-07 10:43:36 UTC (rev
1600)
@@ -1,77 +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.wsse;
-
-/**
- * <code>Sign</code> represents the sign tag, which declares that a message
- * should be signed.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class Sign extends Targetable
-{
- private static final long serialVersionUID = -2645745357707804441L;
-
- private String type;
-
- private String alias;
-
- private boolean includeTimestamp;
-
- public Sign(String type, String alias, boolean includeTimestamp)
- {
- this.type = type;
- this.alias = alias;
- this.includeTimestamp = includeTimestamp;
- }
-
- public String getAlias()
- {
- return alias;
- }
-
- public void setAlias(String alias)
- {
- this.alias = alias;
- }
-
- public String getType()
- {
- return type;
- }
-
- public void setType(String type)
- {
- this.type = type;
- }
-
- public boolean isIncludeTimestamp()
- {
- return includeTimestamp;
- }
-
- public void setIncludeTimestamp(boolean includeTimestamp)
- {
- this.includeTimestamp = includeTimestamp;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsse/Sign.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Sign.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsse/Target.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Target.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsse/Target.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,76 +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.wsse;
-
-import java.io.Serializable;
-
-/**
- * <code>Target</code> represents the target tag.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class Target implements Serializable
-{
- private static final long serialVersionUID = 5718485529854012480L;
-
- private String type;
-
- private String value;
-
- private boolean contentOnly;
-
- public Target(String type)
- {
- this.type = type;
- }
-
- public String getType()
- {
- return type;
- }
-
- public void setType(String type)
- {
- this.type = type;
- }
-
- public String getValue()
- {
- return value;
- }
-
- public void setValue(String value)
- {
- this.value = value;
- }
-
- public boolean isContentOnly()
- {
- return contentOnly;
- }
-
- public void setContentOnly(boolean contentOnly)
- {
- this.contentOnly = contentOnly;
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsse/Target.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Target.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsse/Targetable.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Targetable.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsse/Targetable.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,57 +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.wsse;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-
-/**
- * <code>Targetable</code> is the base class for tags which support target
- * tags as child elements.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class Targetable implements Serializable
-{
- private static final long serialVersionUID = -4034435076127402668L;
-
- private ArrayList<Target> targets;
-
- public ArrayList<Target> getTargets()
- {
- return targets;
- }
-
- public void setTargets(ArrayList<Target> targets)
- {
- this.targets = targets;
- }
-
- public void addTarget(Target target)
- {
- if (targets == null)
- targets = new ArrayList<Target>();
-
- targets.add(target);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsse/Targetable.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Targetable.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsse/Timestamp.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Timestamp.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsse/Timestamp.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,47 +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.wsse;
-
-import java.io.Serializable;
-
-
-public class Timestamp implements Serializable
-{
- private static final long serialVersionUID = 8273360977250180943L;
-
- private String ttl;
-
- public Timestamp(String ttl)
- {
- this.ttl = ttl;
- }
-
- public String getTtl()
- {
- return ttl;
- }
-
- public void setTtl(String ttl)
- {
- this.ttl = ttl;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsse/Timestamp.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Timestamp.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsse/Username.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Username.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsse/Username.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,30 +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.wsse;
-
-import java.io.Serializable;
-
-
-public class Username implements Serializable
-{
- private static final long serialVersionUID = 8273360977250180943L;
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsse/Username.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Username.java)
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfiguration.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfiguration.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfiguration.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,162 +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.wsse;
-
-import java.io.Serializable;
-import java.net.URL;
-import java.util.HashMap;
-
-/**
- * Root configuration class, represents the "jboss-ws-security" tag.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class WSSecurityConfiguration implements Serializable
-{
- private static final long serialVersionUID = 1022564645797303076L;
-
- private Config defaultConfig;
-
- private HashMap<String, Port> ports = new HashMap<String, Port>();
-
- private String keyStoreFile;
-
- private URL keyStoreURL;
-
- private String keyStoreType;
-
- private String keyStorePassword;
-
- private String trustStoreFile;
-
- private URL trustStoreURL;
-
- private String trustStoreType;
-
- private String trustStorePassword;
-
- public Config getDefaultConfig()
- {
- return defaultConfig;
- }
-
- public void setDefaultConfig(Config defaultConfig)
- {
- this.defaultConfig = defaultConfig;
- }
-
- public HashMap<String, Port> getPorts()
- {
- return ports;
- }
-
- public void setPorts(HashMap<String, Port> ports)
- {
- this.ports = ports;
- }
-
- public String getKeyStoreFile()
- {
- return keyStoreFile;
- }
-
- public void setKeyStoreFile(String keyStoreFile)
- {
- this.keyStoreFile = keyStoreFile;
- }
-
- public URL getKeyStoreURL()
- {
- return keyStoreURL;
- }
-
- public void setKeyStoreURL(URL keyStoreURL)
- {
- this.keyStoreURL = keyStoreURL;
- }
-
- public void addPort(Port port)
- {
- this.ports.put(port.getName(), port);
- }
-
- public String getKeyStorePassword()
- {
- return keyStorePassword;
- }
-
- public void setKeyStorePassword(String keyStorePassword)
- {
- this.keyStorePassword = keyStorePassword;
- }
-
- public String getKeyStoreType()
- {
- return keyStoreType;
- }
-
- public void setKeyStoreType(String keyStoreType)
- {
- this.keyStoreType = keyStoreType;
- }
-
- public String getTrustStorePassword()
- {
- return trustStorePassword;
- }
-
- public void setTrustStorePassword(String trustStorePassword)
- {
- this.trustStorePassword = trustStorePassword;
- }
-
- public String getTrustStoreType()
- {
- return trustStoreType;
- }
-
- public void setTrustStoreType(String trustStoreType)
- {
- this.trustStoreType = trustStoreType;
- }
-
- public URL getTrustStoreURL()
- {
- return trustStoreURL;
- }
-
- public void setTrustStoreURL(URL trustStoreURL)
- {
- this.trustStoreURL = trustStoreURL;
- }
-
- public String getTrustStoreFile()
- {
- return trustStoreFile;
- }
-
- public void setTrustStoreFile(String trustStoreFile)
- {
- this.trustStoreFile = trustStoreFile;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfiguration.java (from
rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfiguration.java)
Deleted:
trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigurationFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigurationFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigurationFactory.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,460 +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.wsse;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.HashMap;
-
-import org.jboss.logging.Logger;
-import org.jboss.xb.binding.JBossXBException;
-import org.jboss.xb.binding.ObjectModelFactory;
-import org.jboss.xb.binding.SimpleTypeBindings;
-import org.jboss.xb.binding.Unmarshaller;
-import org.jboss.xb.binding.UnmarshallerFactory;
-import org.jboss.xb.binding.UnmarshallingContext;
-import org.xml.sax.Attributes;
-
-/**
- * A JBossXB Object Model Factory that represets a JBoss WS-Security
- * configuration. See the jboss-ws-security_1_0.xsd file for more info.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class WSSecurityConfigurationFactory implements ObjectModelFactory
-{
-
- public static String SERVER_RESOURCE_NAME = "jboss-wsse-server.xml";
-
- public static String CLIENT_RESOURCE_NAME = "jboss-wsse-client.xml";
-
- private static HashMap options = new HashMap(6);
-
- static
- {
- options.put("key-store-file", "setKeyStoreFile");
- options.put("key-store-type", "setKeyStoreType");
- options.put("key-store-password", "setKeyStorePassword");
- options.put("trust-store-file", "setTrustStoreFile");
- options.put("trust-store-type", "setTrustStoreType");
- options.put("trust-store-password", "setTrustStorePassword");
- }
-
- // provide logging
- private static final Logger log =
Logger.getLogger(WSSecurityConfigurationFactory.class);
-
- // Hide constructor
- private WSSecurityConfigurationFactory()
- {
- }
-
- /**
- * Create a new instance of a jaxrpc-mapping factory
- */
- public static WSSecurityConfigurationFactory newInstance()
- {
- return new WSSecurityConfigurationFactory();
- }
-
- /**
- * Factory method for JavaWsdlMapping
- */
- public WSSecurityConfiguration parse(URL configurationFile) throws IOException
- {
- if (configurationFile == null)
- {
- throw new IllegalArgumentException("URL cannot be null");
- }
-
- // setup the XML binding Unmarshaller
- Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
- InputStream is = configurationFile.openStream();
- try
- {
- WSSecurityConfiguration configuration = (WSSecurityConfiguration)
unmarshaller.unmarshal(is, this, null);
- return configuration;
- }
- catch (JBossXBException e)
- {
- IOException ioex = new IOException("Cannot parse: " +
configurationFile);
- Throwable cause = e.getCause();
- if (cause != null)
- ioex.initCause(cause);
- throw ioex;
- }
- finally
- {
- is.close();
- }
- }
-
- /**
- * This method is called on the factory by the object model builder when the
- * parsing starts.
- */
- public Object newRoot(Object root, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
- {
- return new WSSecurityConfiguration();
- }
-
- public Object completeRoot(Object root, UnmarshallingContext ctx, String uri, String
name)
- {
- return root;
- }
-
- public void setValue(WSSecurityConfiguration configuration, UnmarshallingContext
navigator, String namespaceURI,
- String localName, String value)
- {
- log.trace("setValue: [obj=" + configuration + ",value=" + value
+ "]");
- String method = (String) options.get(localName);
- if (method == null)
- return;
-
- // Dispatch to propper initializer
- try
- {
- WSSecurityConfiguration.class.getMethod(method, new Class[]
{String.class}).invoke(configuration, new Object[]{value});
- }
- catch (Exception e)
- {
- log.error("Could not set option: " + method + " to: " +
value, e);
- }
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(WSSecurityConfiguration configuration, UnmarshallingContext
navigator, String namespaceURI,
- String localName, Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("config".equals(localName))
- {
- return new Config();
- }
- if ("port".equals(localName))
- {
- return new Port(attrs.getValue("", "name"));
- }
- return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(WSSecurityConfiguration configuration, Config defaultConfig,
UnmarshallingContext navigator,
- String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + configuration + ",child=" +
defaultConfig + "]");
- configuration.setDefaultConfig(defaultConfig);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(WSSecurityConfiguration configuration, Port port,
UnmarshallingContext navigator, String namespaceURI,
- String localName)
- {
- log.trace("addChild: [obj=" + configuration + ",child=" + port
+ "]");
- configuration.addPort(port);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(Config config, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("sign".equals(localName))
- {
- // By default, we alwyas include a timestamp
- Boolean include = new Boolean(true);
- String timestamp = attrs.getValue("", "includeTimestamp");
- if (timestamp != null)
- include = (Boolean) SimpleTypeBindings.unmarshal(timestamp,
SimpleTypeBindings.XS_BOOLEAN_NAME, null);
-
- return new Sign(attrs.getValue("", "type"),
attrs.getValue("", "alias"), include.booleanValue());
- }
- else if ("encrypt".equals(localName))
- {
- return new Encrypt(attrs.getValue("", "type"),
attrs.getValue("", "alias"), attrs.getValue("",
"algorithm"));
- }
- else if ("timestamp".equals(localName))
- {
- return new Timestamp(attrs.getValue("", "ttl"));
- }
- else if ("requires".equals(localName))
- {
- return new Requires();
- }
- else if ("username".equals(localName))
- {
- return new Username();
- }
-
- return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Config config, Encrypt encrypt, UnmarshallingContext navigator,
String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + config + ",child=" + encrypt +
"]");
- config.setEncrypt(encrypt);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Config config, Sign sign, UnmarshallingContext navigator, String
namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + config + ",child=" + sign +
"]");
- config.setSign(sign);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Config config, Timestamp timestamp, UnmarshallingContext
navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + config + ",child=" + timestamp +
"]");
- config.setTimestamp(timestamp);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Config config, Username username, UnmarshallingContext navigator,
String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + config + ",child=" + username +
"]");
- config.setUsername(username);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Config config, Requires requires, UnmarshallingContext navigator,
String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + config + ",child=" + requires +
"]");
- config.setRequires(requires);
- }
-
-
- private Object handleTargets(Object object, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("target".equals(localName))
- {
- Target target = new Target(attrs.getValue("", "type"));
- if ("true".equals(attrs.getValue("",
"contentOnly")))
- target.setContentOnly(true);
-
- return target;
- }
- return null;
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(Encrypt encrypt, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
- {
- return handleTargets(encrypt, navigator, namespaceURI, localName, attrs);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(Sign sign, UnmarshallingContext navigator, String namespaceURI,
String localName, Attributes attrs)
- {
- return handleTargets(sign, navigator, namespaceURI, localName, attrs);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(Requires requires, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("signature".equals(localName))
- {
- return new RequireSignature();
- }
- else if ("encryption".equals(localName))
- {
- return new RequireEncryption();
- }
- else if ("timestamp".equals(localName))
- {
- return new RequireTimestamp(attrs.getValue("", "maxAge"));
- }
-
- return null;
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(RequireSignature requireSignature, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
- {
- return handleTargets(requireSignature, navigator, namespaceURI, localName, attrs);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(RequireEncryption requireEncryption, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
- {
- return handleTargets(requireEncryption, navigator, namespaceURI, localName,
attrs);
- }
-
- public void setValue(Target target, UnmarshallingContext navigator, String
namespaceURI, String localName, String value)
- {
- log.trace("setValue: [obj=" + target + ",value=" + value +
"]");
-
- target.setValue(value);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Encrypt encrypt, Target target, UnmarshallingContext navigator,
String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + encrypt + ",child=" + target +
"]");
- encrypt.addTarget(target);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Sign sign, Target target, UnmarshallingContext navigator, String
namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + sign + ",child=" + target +
"]");
- sign.addTarget(target);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Requires requires, RequireEncryption requireEncryption,
UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + requires + ",child=" +
requireEncryption + "]");
- requires.setRequireEncryption(requireEncryption);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Requires requires, RequireSignature requireSignature,
UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + requires + ",child=" +
requireSignature + "]");
- requires.setRequireSignature(requireSignature);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Requires requires, RequireTimestamp requireTimestamp,
UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + requires + ",child=" +
requireTimestamp + "]");
- requires.setRequireTimestamp(requireTimestamp);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(RequireEncryption requireEncryption, Target target,
UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + requireEncryption + ",child=" +
target + "]");
- requireEncryption.addTarget(target);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(RequireSignature requireSignature, Target target,
UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + requireSignature + ",child=" +
target + "]");
- requireSignature.addTarget(target);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(Port port, UnmarshallingContext navigator, String namespaceURI,
String localName, Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("operation".equals(localName))
- {
- return new Operation(attrs.getValue("", "name"));
- }
- else if ("config".equals(localName))
- {
- return new Config();
- }
- return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Port port, Operation operation, UnmarshallingContext navigator,
String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + port + ",child=" + operation +
"]");
- port.addOperation(operation);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Port port, Config config, UnmarshallingContext navigator, String
namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + port + ",child=" + config +
"]");
- port.setDefaultConfig(config);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(Operation operation, UnmarshallingContext navigator, String
namespaceURI, String localName,
- Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("config".equals(localName))
- {
- return new Config();
- }
- return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Operation operation, Config config, UnmarshallingContext
navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + operation + ",child=" + config +
"]");
- operation.setConfig(config);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigurationFactory.java
(from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigurationFactory.java)
Modified: trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL.java 2006-12-07 10:45:48 UTC (rev
1599)
+++ trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL.java 2006-12-07 10:43:36 UTC (rev
1600)
@@ -34,14 +34,15 @@
import org.jboss.logging.Logger;
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.core.jaxrpc.Style;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
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;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
+import org.jboss.ws.tools.wsdl.WSDLWriter;
import org.w3c.dom.Element;
/**
@@ -339,7 +340,7 @@
// Debug the generated wsdl
StringWriter sw = new StringWriter();
- wsdlDefinitions.write(sw, Constants.DEFAULT_XML_CHARSET);
+ new WSDLWriter(wsdlDefinitions).write(sw, Constants.DEFAULT_XML_CHARSET);
log.debug("Generated WSDL:\n" + sw.toString());
// Debug the generated mapping file
Modified: trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL11.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL11.java 2006-12-07 10:45:48 UTC (rev
1599)
+++ trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL11.java 2006-12-07 10:43:36 UTC (rev
1600)
@@ -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: trunk/src/main/java/org/jboss/ws/tools/JavaToXSD.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/tools/JavaToXSD.java 2006-12-07 10:45:48 UTC (rev
1599)
+++ trunk/src/main/java/org/jboss/ws/tools/JavaToXSD.java 2006-12-07 10:43:36 UTC (rev
1600)
@@ -35,6 +35,7 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
+import org.jboss.ws.core.utils.JBossWSEntityResolver;
import org.jboss.ws.metadata.wsdl.WSDLUtils;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSEntityResolver;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSErrorHandler;
@@ -45,7 +46,6 @@
import org.jboss.ws.tools.helpers.JavaToXSDHelper;
import org.jboss.ws.tools.interfaces.JavaToXSDIntf;
import org.jboss.ws.tools.interfaces.SchemaCreatorIntf;
-import org.jboss.ws.utils.JBossWSEntityResolver;
import org.jboss.xb.binding.sunday.unmarshalling.LSInputAdaptor;
import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver;
Modified: trunk/src/main/java/org/jboss/ws/tools/SourceWrapperGenerator.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/tools/SourceWrapperGenerator.java 2006-12-07 10:45:48
UTC (rev 1599)
+++ trunk/src/main/java/org/jboss/ws/tools/SourceWrapperGenerator.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -33,12 +33,12 @@
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.utils.JavaUtils;
+import org.jboss.ws.core.jaxws.WrapperGenerator;
+import org.jboss.ws.core.utils.JavaUtils;
+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 com.sun.codemodel.JAnnotationArrayMember;
import com.sun.codemodel.JAnnotationUse;
Modified: trunk/src/main/java/org/jboss/ws/tools/ToolsUtils.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/tools/ToolsUtils.java 2006-12-07 10:45:48 UTC (rev
1599)
+++ trunk/src/main/java/org/jboss/ws/tools/ToolsUtils.java 2006-12-07 10:43:36 UTC (rev
1600)
@@ -32,11 +32,8 @@
import java.math.BigInteger;
import java.net.URI;
import java.rmi.Remote;
-import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
-import java.util.List;
-import java.util.StringTokenizer;
import javax.xml.namespace.QName;
import javax.xml.rpc.holders.ByteArrayHolder;
@@ -45,12 +42,12 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
-import org.jboss.ws.jaxrpc.encoding.SimpleDeserializerFactory;
-import org.jboss.ws.jaxrpc.encoding.SimpleSerializerFactory;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.binding.SimpleDeserializerFactory;
+import org.jboss.ws.core.jaxrpc.binding.SimpleSerializerFactory;
+import org.jboss.ws.core.utils.JavaUtils;
import org.jboss.ws.metadata.wsdl.WSDLUtils;
import org.jboss.ws.metadata.wsdl.xsd.SchemaUtils;
-import org.jboss.ws.utils.JavaUtils;
/**
* Util class for the JBossWS Tools project
Modified: trunk/src/main/java/org/jboss/ws/tools/WSDLToJava.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/tools/WSDLToJava.java 2006-12-07 10:45:48 UTC (rev
1599)
+++ trunk/src/main/java/org/jboss/ws/tools/WSDLToJava.java 2006-12-07 10:43:36 UTC (rev
1600)
@@ -43,10 +43,10 @@
import org.apache.xerces.xs.XSTypeDefinition;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.utils.JavaUtils;
import org.jboss.ws.metadata.wsdl.NCName;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.metadata.wsdl.WSDLException;
import org.jboss.ws.metadata.wsdl.WSDLInterface;
import org.jboss.ws.metadata.wsdl.WSDLInterfaceFault;
@@ -59,7 +59,7 @@
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
import org.jboss.ws.metadata.wsdl.xsd.SchemaUtils;
import org.jboss.ws.tools.interfaces.WSDLToJavaIntf;
-import org.jboss.ws.utils.JavaUtils;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
import org.w3c.dom.Element;
/**
Modified: trunk/src/main/java/org/jboss/ws/tools/WSDotXMLCreator.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/tools/WSDotXMLCreator.java 2006-12-07 10:45:48 UTC
(rev 1599)
+++ trunk/src/main/java/org/jboss/ws/tools/WSDotXMLCreator.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -30,12 +30,12 @@
import javax.xml.namespace.QName;
import org.jboss.logging.Logger;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
import org.jboss.ws.WSException;
-import org.jboss.ws.metadata.jsr109.PortComponentMetaData;
-import org.jboss.ws.metadata.jsr109.WebserviceDescriptionMetaData;
-import org.jboss.ws.metadata.jsr109.WebservicesMetaData;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
+import org.jboss.ws.metadata.webservices.PortComponentMetaData;
+import org.jboss.ws.metadata.webservices.WebserviceDescriptionMetaData;
+import org.jboss.ws.metadata.webservices.WebservicesMetaData;
import org.jboss.ws.tools.interfaces.WSDotXMLCreatorIntf;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified: trunk/src/main/java/org/jboss/ws/tools/XSDToJava.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/tools/XSDToJava.java 2006-12-07 10:45:48 UTC (rev
1599)
+++ trunk/src/main/java/org/jboss/ws/tools/XSDToJava.java 2006-12-07 10:43:36 UTC (rev
1600)
@@ -34,7 +34,7 @@
import org.apache.xerces.xs.XSSimpleTypeDefinition;
import org.apache.xerces.xs.XSTypeDefinition;
import org.jboss.ws.Constants;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
import org.jboss.ws.metadata.wsdl.WSDLUtils;
import org.jboss.ws.metadata.wsdl.xsd.SchemaUtils;
import org.jboss.ws.tools.interfaces.XSDToJavaIntf;
Modified: trunk/src/main/java/org/jboss/ws/tools/XSDTypeToJava.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/tools/XSDTypeToJava.java 2006-12-07 10:45:48 UTC (rev
1599)
+++ trunk/src/main/java/org/jboss/ws/tools/XSDTypeToJava.java 2006-12-07 10:43:36 UTC (rev
1600)
@@ -49,10 +49,10 @@
import org.apache.xerces.xs.XSWildcard;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.utils.JavaUtils;
import org.jboss.ws.metadata.wsdl.WSDLUtils;
import org.jboss.ws.metadata.wsdl.xsd.SchemaUtils;
-import org.jboss.ws.utils.JavaUtils;
/** Class that converts a XSD Type into Java class
* @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
Modified: trunk/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -22,7 +22,6 @@
package org.jboss.ws.tools.helpers;
import java.io.IOException;
-import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -32,23 +31,14 @@
import java.util.Set;
import javax.xml.namespace.QName;
-import javax.xml.rpc.ParameterMode;
import javax.xml.rpc.encoding.TypeMapping;
-import javax.xml.rpc.holders.ByteArrayHolder;
import javax.xml.rpc.holders.Holder;
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.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.core.jaxrpc.Style;
+import org.jboss.ws.core.utils.JavaUtils;
import org.jboss.ws.metadata.jaxrpcmapping.ExceptionMapping;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.jaxrpcmapping.JavaXmlTypeMapping;
@@ -61,21 +51,13 @@
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.wsdl.NCName;
+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.WrappedParameter;
import org.jboss.ws.metadata.wsdl.WSDLBinding;
-import org.jboss.ws.metadata.wsdl.WSDLBindingFault;
-import org.jboss.ws.metadata.wsdl.WSDLBindingOperation;
-import org.jboss.ws.metadata.wsdl.WSDLBindingOperationInput;
-import org.jboss.ws.metadata.wsdl.WSDLBindingOperationOutput;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
import org.jboss.ws.metadata.wsdl.WSDLInterface;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceFault;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperation;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationInput;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutfault;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutput;
-import org.jboss.ws.metadata.wsdl.WSDLProperty;
import org.jboss.ws.metadata.wsdl.WSDLService;
import org.jboss.ws.metadata.wsdl.WSDLTypes;
import org.jboss.ws.metadata.wsdl.WSDLUtils;
@@ -88,7 +70,6 @@
import org.jboss.ws.tools.interfaces.JavaToXSDIntf;
import org.jboss.ws.tools.interfaces.SchemaCreatorIntf;
import org.jboss.ws.tools.jaxws.WSDLGenerator;
-import org.jboss.ws.utils.JavaUtils;
/**
* Java To WSDL Helper which uses UnifiedMetaData
Modified: trunk/src/main/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/main/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -41,7 +41,8 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.utils.JavaUtils;
import org.jboss.ws.metadata.jaxrpcmapping.ExceptionMapping;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.jaxrpcmapping.JavaXmlTypeMapping;
@@ -75,7 +76,6 @@
import org.jboss.ws.tools.ToolsUtils;
import org.jboss.ws.tools.WSToolsConstants;
import org.jboss.ws.tools.mapping.MappingFileGenerator;
-import org.jboss.ws.utils.JavaUtils;
import org.w3c.dom.Element;
/**
Modified: trunk/src/main/java/org/jboss/ws/tools/helpers/ReformatXML.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/tools/helpers/ReformatXML.java 2006-12-07 10:45:48
UTC (rev 1599)
+++ trunk/src/main/java/org/jboss/ws/tools/helpers/ReformatXML.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -21,15 +21,15 @@
*/
package org.jboss.ws.tools.helpers;
-import org.w3c.dom.Element;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
-
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
+import org.w3c.dom.Element;
+
/**
* @author Heiko Braun <heiko.braun(a)jboss.com>
* @version $Id$
Modified: trunk/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java 2006-12-07 10:45:48
UTC (rev 1599)
+++ trunk/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -38,16 +38,20 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
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.core.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
+import org.jboss.ws.core.utils.IOUtils;
+import org.jboss.ws.core.utils.JavaUtils;
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;
@@ -64,10 +68,7 @@
import org.jboss.ws.tools.client.ServiceCreator;
import org.jboss.ws.tools.interfaces.WSDotXMLCreatorIntf;
import org.jboss.ws.tools.mapping.MappingFileGenerator;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
-import org.jboss.ws.utils.IOUtils;
-import org.jboss.ws.utils.JavaUtils;
+import org.jboss.ws.tools.wsdl.WSDLWriter;
/**
* Helper class used by the command line tool "jbossws"
@@ -125,7 +126,7 @@
String wsdlPath = outDir + "/wsdl/" + j2wc.serviceName +
".wsdl";
//Generate the WSDL
Writer fw = IOUtils.getCharsetFileWriter(new File(wsdlPath),
Constants.DEFAULT_XML_CHARSET);
- wsdl.write(fw, Constants.DEFAULT_XML_CHARSET);
+ new WSDLWriter(wsdl).write(fw, Constants.DEFAULT_XML_CHARSET);
fw.close();
//Generate the Mapping File
Modified: trunk/src/main/java/org/jboss/ws/tools/interfaces/SchemaCreatorIntf.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/tools/interfaces/SchemaCreatorIntf.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/main/java/org/jboss/ws/tools/interfaces/SchemaCreatorIntf.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -26,7 +26,7 @@
import javax.xml.namespace.QName;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSTypeDefinition;
Modified: trunk/src/main/java/org/jboss/ws/tools/interfaces/WSDLToJavaIntf.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/tools/interfaces/WSDLToJavaIntf.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/main/java/org/jboss/ws/tools/interfaces/WSDLToJavaIntf.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -26,7 +26,7 @@
import java.net.URL;
import java.util.Map;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLException;
Modified: trunk/src/main/java/org/jboss/ws/tools/interfaces/XSDToJavaIntf.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/tools/interfaces/XSDToJavaIntf.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/main/java/org/jboss/ws/tools/interfaces/XSDToJavaIntf.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -25,7 +25,7 @@
import java.io.IOException;
import org.apache.xerces.xs.XSModel;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
/**
* Defines the contract for all Schema Types to Java Types converters
Modified: trunk/src/main/java/org/jboss/ws/tools/jaxws/JAXBWSDLGenerator.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/tools/jaxws/JAXBWSDLGenerator.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/main/java/org/jboss/ws/tools/jaxws/JAXBWSDLGenerator.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -31,8 +31,8 @@
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
+import org.jboss.ws.extensions.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: trunk/src/main/java/org/jboss/ws/tools/jaxws/WSDLGenerator.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/tools/jaxws/WSDLGenerator.java 2006-12-07 10:45:48
UTC (rev 1599)
+++ trunk/src/main/java/org/jboss/ws/tools/jaxws/WSDLGenerator.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -27,13 +27,12 @@
import javax.xml.rpc.ParameterMode;
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.core.jaxrpc.Style;
+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.ServiceMetaData;
import org.jboss.ws.metadata.wsdl.NCName;
import org.jboss.ws.metadata.wsdl.WSDLBinding;
import org.jboss.ws.metadata.wsdl.WSDLBindingFault;
@@ -309,7 +308,7 @@
/**
* Generate a WSDL object model from the passed in ServiceMetaData.
*
- * @param service the service
+ * @param service the service
* @return the WSDL object model
*/
public WSDLDefinitions generate(ServiceMetaData service)
@@ -330,4 +329,4 @@
return wsdl;
}
-}
\ No newline at end of file
+}
Modified: trunk/src/main/java/org/jboss/ws/tools/mapping/MappingFileGenerator.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/tools/mapping/MappingFileGenerator.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/main/java/org/jboss/ws/tools/mapping/MappingFileGenerator.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -32,7 +32,7 @@
import org.apache.xerces.xs.XSSimpleTypeDefinition;
import org.apache.xerces.xs.XSTypeDefinition;
import org.jboss.ws.Constants;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.jaxrpcmapping.MethodParamPartsMapping;
import org.jboss.ws.metadata.jaxrpcmapping.ServiceEndpointInterfaceMapping;
Modified: trunk/src/main/java/org/jboss/ws/tools/metadata/ReflectiveMetaDataBuilder.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/tools/metadata/ReflectiveMetaDataBuilder.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/main/java/org/jboss/ws/tools/metadata/ReflectiveMetaDataBuilder.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -35,16 +35,16 @@
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.core.jaxrpc.ParameterWrapping;
+import org.jboss.ws.core.utils.HolderUtils;
+import org.jboss.ws.core.utils.JavaUtils;
+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;
-import org.jboss.ws.utils.HolderUtils;
-import org.jboss.ws.utils.JavaUtils;
/**
* Builds the Tools Endpoint Meta Data using Java Reflection
Modified:
trunk/src/main/java/org/jboss/ws/tools/metadata/ToolsAnnotationMetaDataBuilder.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/tools/metadata/ToolsAnnotationMetaDataBuilder.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/main/java/org/jboss/ws/tools/metadata/ToolsAnnotationMetaDataBuilder.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -36,10 +36,10 @@
import javax.xml.rpc.holders.Holder;
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.core.jaxrpc.Style;
+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: trunk/src/main/java/org/jboss/ws/tools/metadata/ToolsEndpointMetaData.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/tools/metadata/ToolsEndpointMetaData.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/main/java/org/jboss/ws/tools/metadata/ToolsEndpointMetaData.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -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:
trunk/src/main/java/org/jboss/ws/tools/metadata/ToolsUnifiedMetaDataBuilder.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/tools/metadata/ToolsUnifiedMetaDataBuilder.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/main/java/org/jboss/ws/tools/metadata/ToolsUnifiedMetaDataBuilder.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -32,9 +32,9 @@
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.core.jaxrpc.Style;
+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: trunk/src/main/java/org/jboss/ws/tools/schema/SchemaTypeCreator.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/tools/schema/SchemaTypeCreator.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/main/java/org/jboss/ws/tools/schema/SchemaTypeCreator.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -53,8 +53,8 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
-import org.jboss.ws.jaxrpc.ParameterWrapping;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.ParameterWrapping;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.jaxrpcmapping.JavaXmlTypeMapping;
import org.jboss.ws.metadata.jaxrpcmapping.PackageMapping;
Copied: trunk/src/main/java/org/jboss/ws/tools/wsdl (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl)
Deleted: trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11DefinitionFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11DefinitionFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11DefinitionFactory.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,96 +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.tools.wsdl;
-
-// $Id$
-
-import java.net.URL;
-
-import javax.wsdl.Definition;
-import javax.wsdl.WSDLException;
-import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLReader;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.utils.JBossWSEntityResolver;
-import org.xml.sax.EntityResolver;
-
-import com.ibm.wsdl.xml.WSDLReaderImpl;
-
-/**
- * A factory that creates a WSDL-1.1 <code>Definition</code> from an URL.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 15-April-2004
- */
-public class WSDL11DefinitionFactory
-{
- // provide logging
- private static Logger log = Logger.getLogger(WSDL11DefinitionFactory.class);
-
- // This feature is set by default in wsdl4j, it means the object structore contains
the imported arguments
- public static final String FEATURE_IMPORT_DOCUMENTS =
"javax.wsdl.importDocuments";
- // Set this feature for additional debugging output
- public static final String FEATURE_VERBOSE = "javax.wsdl.verbose";
-
- // The WSDLReader that is used by this factory
- private WSDLReader wsdlReader;
-
- // Hide constructor
- private WSDL11DefinitionFactory() throws WSDLException
- {
- WSDLFactory wsdlFactory = WSDLFactory.newInstance();
- wsdlReader = wsdlFactory.newWSDLReader();
- wsdlReader.setFeature(WSDL11DefinitionFactory.FEATURE_VERBOSE, false);
- }
-
- /** Create a new instance of a wsdl factory */
- public static WSDL11DefinitionFactory newInstance() throws WSDLException
- {
- return new WSDL11DefinitionFactory();
- }
-
- /** Set a feature on the underlying reader */
- public void setFeature(String name, boolean value) throws IllegalArgumentException
- {
- wsdlReader.setFeature(name, value);
- }
-
- /**
- * Read the wsdl document from the given URL
- */
- public Definition parse(URL wsdlLocation) throws WSDLException
- {
- if (wsdlLocation == null)
- throw new IllegalArgumentException("URL cannot be null");
-
- log.trace("parse: " + wsdlLocation.toExternalForm());
-
- EntityResolver entityResolver = new JBossWSEntityResolver();
-
- // Set EntityResolver in patched version of wsdl4j-1.5.2jboss
- ((WSDLReaderImpl)wsdlReader).setEntityResolver(entityResolver);
-
- Definition wsdlDefinition = wsdlReader.readWSDL(new WSDLLocatorImpl(entityResolver,
wsdlLocation));
- return wsdlDefinition;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11DefinitionFactory.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11DefinitionFactory.java)
Deleted: trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,1219 +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.tools.wsdl;
-
-// $Id$
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.wsdl.Binding;
-import javax.wsdl.BindingInput;
-import javax.wsdl.BindingOperation;
-import javax.wsdl.BindingOutput;
-import javax.wsdl.Definition;
-import javax.wsdl.Fault;
-import javax.wsdl.Import;
-import javax.wsdl.Input;
-import javax.wsdl.Message;
-import javax.wsdl.Operation;
-import javax.wsdl.Output;
-import javax.wsdl.Part;
-import javax.wsdl.Port;
-import javax.wsdl.PortType;
-import javax.wsdl.Service;
-import javax.wsdl.Types;
-import javax.wsdl.extensions.ExtensibilityElement;
-import javax.wsdl.extensions.UnknownExtensibilityElement;
-import javax.wsdl.extensions.mime.MIMEContent;
-import javax.wsdl.extensions.mime.MIMEMultipartRelated;
-import javax.wsdl.extensions.mime.MIMEPart;
-import javax.wsdl.extensions.schema.Schema;
-import javax.wsdl.extensions.soap.SOAPAddress;
-import javax.wsdl.extensions.soap.SOAPBinding;
-import javax.wsdl.extensions.soap.SOAPBody;
-import javax.wsdl.extensions.soap.SOAPHeader;
-import javax.wsdl.extensions.soap.SOAPOperation;
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.jaxrpc.Style;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.core.utils.DOMWriter;
-import org.jboss.ws.metadata.wsdl.NCName;
-import org.jboss.ws.metadata.wsdl.WSDLBinding;
-import org.jboss.ws.metadata.wsdl.WSDLBindingMessageReference;
-import org.jboss.ws.metadata.wsdl.WSDLBindingOperation;
-import org.jboss.ws.metadata.wsdl.WSDLBindingOperationInput;
-import org.jboss.ws.metadata.wsdl.WSDLBindingOperationOutput;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
-import org.jboss.ws.metadata.wsdl.WSDLInterface;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceFault;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperation;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationInput;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutfault;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutput;
-import org.jboss.ws.metadata.wsdl.WSDLMIMEPart;
-import org.jboss.ws.metadata.wsdl.WSDLProperty;
-import org.jboss.ws.metadata.wsdl.WSDLRPCPart;
-import org.jboss.ws.metadata.wsdl.WSDLRPCSignatureItem;
-import org.jboss.ws.metadata.wsdl.WSDLSOAPHeader;
-import org.jboss.ws.metadata.wsdl.WSDLService;
-import org.jboss.ws.metadata.wsdl.WSDLTypes;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
-import org.jboss.ws.metadata.wsdl.XSModelTypes;
-import org.jboss.ws.metadata.wsdl.WSDLRPCSignatureItem.Direction;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
-import org.jboss.ws.metadata.wsdl.xsd.SchemaUtils;
-import org.jboss.ws.tools.JavaToXSD;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * A helper that translates a WSDL-1.1 object graph into a WSDL-2.0 object graph.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author Anil.Saldhana(a)jboss.org
- * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
- * @since 10-Oct-2004
- */
-public class WSDL11Reader
-{
- // provide logging
- private static final Logger log = Logger.getLogger(WSDL11Reader.class);
-
- private static QName SOAP12_BINDING = new QName(Constants.NS_SOAP12,
"binding");
- private static QName SOAP12_BODY = new QName(Constants.NS_SOAP12, "body");
- private static QName SOAP12_OPERATION = new QName(Constants.NS_SOAP12,
"operation");
- private static QName SOAP12_ADDRESS = new QName(Constants.NS_SOAP12,
"address");
-
- private WSDLDefinitions destWsdl;
-
- // Maps wsdl message parts to their corresponding element names
- private Map<String, QName> messagePartToElementMap = new HashMap<String,
QName>();
-
- // Map of <ns,URL> for schemalocation keyed by namespace
- private Map<String, URL> schemaLocationsMap = new HashMap<String, URL>();
-
- private LinkedHashMap<QName, Binding> allBindings;
- private LinkedHashMap<QName, Binding> portTypeBindings;
-
- // Temporary files used by this reader.
- private List<File> tempFiles = new ArrayList<File>();
-
- /**
- * Takes a WSDL11 Definition element and converts into
- * our object graph that has been developed for WSDL20
- *
- * @param srcWsdl The src WSDL11 definition
- * @param wsdlLoc The source location, if null we cannot process imports or includes
- */
- public WSDLDefinitions processDefinition(Definition srcWsdl, URL wsdlLoc) throws
IOException
- {
- log.trace("processDefinition: " + wsdlLoc);
-
- destWsdl = new WSDLDefinitions();
- destWsdl.setWsdlTypes(new XSModelTypes());
- destWsdl.setWsdlOneOneDefinition(srcWsdl);
- destWsdl.setWsdlNamespace(Constants.NS_WSDL11);
-
- processNamespaces(srcWsdl);
- processTypes(srcWsdl, wsdlLoc);
- processServices(srcWsdl);
-
- if (getAllDefinedBindings(srcWsdl).size() != destWsdl.getBindings().length)
- processUnreachableBindings(srcWsdl);
-
- cleanupTemporaryFiles();
-
- return destWsdl;
- }
-
- private void cleanupTemporaryFiles()
- {
- for (File current : tempFiles)
- {
- current.delete();
- }
- }
-
- // process all bindings not within service separetly
- private void processUnreachableBindings(Definition srcWsdl)
- {
- log.trace("processUnreachableBindings");
-
- Iterator it = getAllDefinedBindings(srcWsdl).values().iterator();
- while (it.hasNext())
- {
- Binding srcBinding = (Binding)it.next();
- QName srcQName = srcBinding.getQName();
-
- WSDLBinding destBinding = destWsdl.getBinding(new NCName(srcQName));
- if (destBinding == null)
- {
- processBinding(srcWsdl, srcBinding);
- }
- }
- }
-
- private void processNamespaces(Definition srcWsdl)
- {
- String targetNS = srcWsdl.getTargetNamespace();
- destWsdl.setTargetNamespace(targetNS);
-
- // Copy wsdl namespaces
- Map nsMap = srcWsdl.getNamespaces();
- Iterator iter = nsMap.entrySet().iterator();
- while (iter.hasNext())
- {
- Map.Entry entry = (Map.Entry)iter.next();
- String prefix = (String)entry.getKey();
- String nsURI = (String)entry.getValue();
- destWsdl.registerNamespaceURI(nsURI, prefix);
- }
- }
-
- private void processTypes(Definition srcWsdl, URL wsdlLoc) throws IOException
- {
- log.trace("BEGIN processTypes: " + wsdlLoc);
-
- WSDLTypes destTypes = destWsdl.getWsdlTypes();
-
- Types srcTypes = srcWsdl.getTypes();
- if (srcTypes != null && srcTypes.getExtensibilityElements().size() > 0)
- {
- List extElements = srcTypes.getExtensibilityElements();
- int len = extElements.size();
-
- for (int i = 0; i < len; i++)
- {
- ExtensibilityElement extElement = (ExtensibilityElement)extElements.get(i);
-
- Element domElement;
- if (extElement instanceof Schema)
- {
- domElement = ((Schema)extElement).getElement();
- }
- else if (extElement instanceof UnknownExtensibilityElement)
- {
- domElement = ((UnknownExtensibilityElement)extElement).getElement();
- }
- else
- {
- throw new WSException("Unsupported extensibility element: " +
extElement);
- }
-
- Element domElementClone = (Element)domElement.cloneNode(true);
- copyParentNamespaceDeclarations(domElementClone, domElement);
-
- String localname = domElementClone.getLocalName();
- try
- {
- if ("import".equals(localname))
- {
- processSchemaImport(destTypes, wsdlLoc, domElementClone);
- }
- else if ("schema".equals(localname))
- {
- processSchemaInclude(destTypes, wsdlLoc, domElementClone);
- }
- else
- {
- throw new IllegalArgumentException("Unsuported schema element:
" + localname);
- }
- }
- catch (IOException e)
- {
- throw new WSException("Cannot extract schema definition", e);
- }
- }
-
- if (len > 0)
- {
- JavaToXSD jxsd = new JavaToXSD();
- JBossXSModel xsmodel = jxsd.parseSchema(schemaLocationsMap);
- WSDLUtils.addSchemaModel(destTypes, destWsdl.getTargetNamespace(), xsmodel);
- }
- }
- else
- {
- log.trace("Empty wsdl types element, processing imports");
- Iterator it = srcWsdl.getImports().values().iterator();
- while (it.hasNext())
- {
- List<Import> srcImports = (List<Import>)it.next();
- for (Import srcImport : srcImports)
- {
- Definition impDefinition = srcImport.getDefinition();
- String impLoc = impDefinition.getDocumentBaseURI();
- processTypes(impDefinition, new URL(impLoc));
- }
- }
- }
-
- log.trace("END processTypes: " + wsdlLoc + "\n" + destTypes);
- }
-
- private void copyParentNamespaceDeclarations(Element destElement, Element srcElement)
- {
- Node parent = srcElement.getParentNode();
- while (parent != null)
- {
- if (parent.hasAttributes())
- {
- NamedNodeMap attributes = parent.getAttributes();
- for (int i = 0; i < attributes.getLength(); i++)
- {
- Attr attr = (Attr)attributes.item(i);
- String name = attr.getName();
- String value = attr.getValue();
- if (name.startsWith("xmlns:") &&
destElement.hasAttribute(name) == false)
- destElement.setAttribute(name, value);
- }
- }
- parent = parent.getParentNode();
- }
- }
-
- private void processSchemaImport(WSDLTypes types, URL wsdlLoc, Element importEl)
throws IOException
- {
- if (wsdlLoc == null)
- throw new IllegalArgumentException("Cannot process import, parent location
not set");
-
- log.trace("processSchemaImport: " + wsdlLoc);
-
- String location = getOptionalAttribute(importEl, "schemaLocation");
- if (location == null)
- throw new IllegalArgumentException("schemaLocation is null for
xsd:import");
-
- URL locationURL = getLocationURL(wsdlLoc, location);
- Element rootElement = DOMUtils.parse(locationURL.openStream());
- URL newloc = processSchemaInclude(types, locationURL, rootElement);
- if (newloc != null)
- importEl.setAttribute("schemaLocation", newloc.toExternalForm());
- }
-
- private URL processSchemaInclude(WSDLTypes types, URL wsdlLoc, Element schemaEl)
throws IOException
- {
- if (wsdlLoc == null)
- throw new IllegalArgumentException("Cannot process iclude, parent location
not set");
-
- File tmpFile = null;
- if (wsdlLoc == null)
- throw new IllegalArgumentException("Cannot process include, parent location
not set");
-
- log.trace("processSchemaInclude: " + wsdlLoc);
-
- String schemaPrefix = schemaEl.getPrefix();
-
- String importTag = (schemaPrefix == null) ? "import" : schemaPrefix +
":import";
- Element importElement =
schemaEl.getOwnerDocument().createElementNS(Constants.NS_SCHEMA_XSD, importTag);
- importElement.setAttribute("namespace", Constants.URI_SOAP11_ENC);
- schemaEl.insertBefore(importElement, DOMUtils.getFirstChildElement(schemaEl));
-
- // Handle schema includes
- Iterator it = DOMUtils.getChildElements(schemaEl, new
QName(Constants.NS_SCHEMA_XSD, "include"));
- while (it.hasNext())
- {
- Element includeEl = (Element)it.next();
- String location = getOptionalAttribute(includeEl, "schemaLocation");
- if (location == null)
- throw new IllegalArgumentException("schemaLocation is null for
xsd:include");
-
- URL locationURL = getLocationURL(wsdlLoc, location);
- Element rootElement = DOMUtils.parse(locationURL.openStream());
- URL newloc = processSchemaInclude(types, locationURL, rootElement);
- if (newloc != null)
- includeEl.setAttribute("schemaLocation", newloc.toExternalForm());
- }
-
- String targetNS = getOptionalAttribute(schemaEl, "targetNamespace");
- if (targetNS != null)
- {
- log.trace("processSchemaInclude: [targetNS=" + targetNS +
",parentURL=" + wsdlLoc + "]");
-
- tmpFile = SchemaUtils.getSchemaTempFile(targetNS);
- tempFiles.add(tmpFile);
-
- FileWriter fwrite = new FileWriter(tmpFile);
- new DOMWriter(fwrite).setPrettyprint(true).print(schemaEl);
- fwrite.close();
-
- schemaLocationsMap.put(targetNS, tmpFile.toURL());
- }
-
- // schema elements that have no target namespace are skipped
- //
- // <xsd:schema>
- // <xsd:import
namespace="http://org.jboss.webservice/example/types"
schemaLocation="Hello.xsd"/>
- // <xsd:import
namespace="http://org.jboss.webservice/example/types/arrays/org/jboss/test/webservice/admindevel"
schemaLocation="subdir/HelloArr.xsd"/>
- // </xsd:schema>
- if (targetNS == null)
- {
- log.trace("Schema element without target namespace in: " + wsdlLoc);
- }
-
- handleSchemaImports(schemaEl, wsdlLoc);
-
- return tmpFile != null ? tmpFile.toURL() : null;
- }
-
- private void handleSchemaImports(Element schemaEl, URL wsdlLoc) throws
MalformedURLException
- {
- if (wsdlLoc == null)
- throw new IllegalArgumentException("Cannot process import, parent location
not set");
-
- Iterator it = DOMUtils.getChildElements(schemaEl, new
QName(Constants.NS_SCHEMA_XSD, "import"));
- while (it.hasNext())
- {
- Element includeEl = (Element)it.next();
- String schemaLocation = getOptionalAttribute(includeEl,
"schemaLocation");
- String namespace = getOptionalAttribute(includeEl, "namespace");
-
- log.trace("handleSchemaImport: [namespace=" + namespace +
",schemaLocation=" + schemaLocation + "]");
-
- // Skip, let the entity resolver resolve these
- if (namespace != null && schemaLocation != null)
- {
- URL currLoc = getLocationURL(wsdlLoc, schemaLocation);
- schemaLocationsMap.put(namespace, currLoc);
- }
- else
- {
- log.trace("Skip schema import: [namespace=" + namespace +
",schemaLocation=" + schemaLocation + "]");
- }
- }
- }
-
- private URL getLocationURL(URL parentURL, String location) throws
MalformedURLException
- {
- log.trace("getLocationURL: [location=" + location + ",parent="
+ parentURL + "]");
-
- URL locationURL = null;
- try
- {
- locationURL = new URL(location);
- }
- catch (MalformedURLException e)
- {
- // ignore malformed URL
- }
-
- if (locationURL == null)
- {
- String parentProtocol = parentURL.getProtocol();
- if (parentProtocol.equals("file") &&
!location.startsWith("/"))
- {
- String path = parentURL.toExternalForm();
- path = path.substring(0, path.lastIndexOf("/"));
- locationURL = new URL(path + "/" + location);
- }
- else if (parentProtocol.startsWith("http") &&
location.startsWith("/"))
- {
- String path = parentProtocol + "://" + parentURL.getHost() +
":" + parentURL.getPort();
- locationURL = new URL(path + location);
- }
- else if (parentProtocol.equals("jar") &&
!location.startsWith("/"))
- {
- String path = parentURL.toExternalForm();
- path = path.substring(0, path.lastIndexOf("/"));
- locationURL = new URL(path + "/" + location);
- }
- else
- {
- throw new WSException("Unsupported schemaLocation: " + location);
- }
- }
-
- log.trace("Modified schemaLocation: " + locationURL);
- return locationURL;
- }
-
- private void processPortType(Definition srcWsdl, PortType srcPortType)
- {
- log.trace("processPortType: " + srcPortType.getQName());
-
- QName qname = srcPortType.getQName();
- NCName ncName = new NCName(qname);
- if (destWsdl.getInterface(ncName) == null)
- {
- WSDLInterface destInterface = new WSDLInterface(destWsdl);
- destInterface.setName(ncName);
- destInterface.setQName(qname);
-
- // eventing extensions
- QName eventSourceProp =
(QName)srcPortType.getExtensionAttribute(Constants.WSDL_ATTRIBUTE_WSE_EVENTSOURCE);
- if (eventSourceProp != null &&
eventSourceProp.getLocalPart().equals(Boolean.TRUE.toString()))
- {
- destInterface.addProperty(new
WSDLProperty(Constants.WSDL_PROPERTY_EVENTSOURCE, eventSourceProp.getLocalPart()));
- }
-
- destWsdl.addInterface(destInterface);
-
- processPortTypeOperations(srcWsdl, destInterface, srcPortType);
- }
- }
-
- private void processPortTypeOperations(Definition srcWsdl, WSDLInterface
destInterface, PortType srcPortType)
- {
- Iterator itOperations = srcPortType.getOperations().iterator();
- while (itOperations.hasNext())
- {
- Operation srcOperation = (Operation)itOperations.next();
-
- WSDLInterfaceOperation destOperation = new
WSDLInterfaceOperation(destInterface);
- destOperation.setName(new NCName(srcOperation.getName()));
- destOperation.setStyle(getOperationStyle(srcWsdl, srcPortType, srcOperation));
-
- processOperationInput(srcWsdl, srcOperation, destOperation, srcPortType);
- processOperationOutput(srcWsdl, srcOperation, destOperation, srcPortType);
- processOperationFaults(srcOperation, destOperation, destInterface);
-
- destInterface.addOperation(destOperation);
- }
- }
-
- private void processOperationInput(Definition srcWsdl, Operation srcOperation,
WSDLInterfaceOperation destOperation, PortType srcPortType)
- {
- Input srcInput = srcOperation.getInput();
- if (srcInput != null)
- {
- Message srcMessage = srcInput.getMessage();
- log.trace("processOperationInput: " + srcMessage.getQName());
-
- QName wsaAction =
(QName)srcInput.getExtensionAttribute(Constants.WSDL_ATTRIBUTE_WSA_ACTION);
- if (wsaAction != null)
- destOperation.addProperty(new WSDLProperty(Constants.WSDL_PROPERTY_ACTION_IN,
wsaAction.getLocalPart()));
-
- List<String> paramOrder = (List<String>)
srcOperation.getParameterOrdering();
- if (paramOrder != null)
- {
- for (String name : paramOrder)
- {
- if (srcMessage.getPart(name) != null)
- destOperation.addRpcSignatureItem(new WSDLRPCSignatureItem(name));
- }
- }
-
- WSDLInterfaceOperationInput rpcInput = new
WSDLInterfaceOperationInput(destOperation);
- for (Part srcPart : (List<Part>) srcMessage.getOrderedParts(paramOrder))
- {
- if (Constants.URI_STYLE_IRI == destOperation.getStyle())
- {
- WSDLInterfaceOperationInput destInput = new
WSDLInterfaceOperationInput(destOperation);
- QName elementName = messagePartToElementName(srcWsdl, srcPortType,
srcOperation, srcMessage, srcPart);
- destInput.setElement(elementName);
-
- //Lets remember the Message name
- destInput.setMessageName(srcMessage.getQName());
- destOperation.addProperty(new
WSDLProperty(Constants.WSDL_PROPERTY_MESSAGE_NAME_IN,
srcMessage.getQName().getLocalPart()));
-
- destInput.setPartName(srcPart.getName());
-
- destOperation.addInput(destInput);
- }
- else
- {
- // If we don't have a type then we aren't a valid RPC parameter
- // This could happen on a header element, in which case the
- // binding will pick it up
- QName xmlType = srcPart.getTypeName();
- if (xmlType != null)
- rpcInput.addChildPart(new WSDLRPCPart(srcPart.getName(),
destWsdl.registerQName(xmlType)));
- else
- messagePartToElementName(srcWsdl, srcPortType, srcOperation,
srcMessage, srcPart);
- }
- }
- if (Constants.URI_STYLE_RPC == destOperation.getStyle())
- {
- // This is really a place holder, but also the actual value used in
- // WSDL 2.0 RPC bindings
- rpcInput.setElement(destOperation.getQName());
- rpcInput.setMessageName(srcMessage.getQName());
- destOperation.addInput(rpcInput);
- }
- }
- }
-
- private void processOperationOutput(Definition srcWsdl, Operation srcOperation,
WSDLInterfaceOperation destOperation, PortType srcPortType)
- {
- Output srcOutput = srcOperation.getOutput();
- if (srcOutput == null)
- {
- destOperation.setPattern(Constants.WSDL20_PATTERN_IN_ONLY);
- return;
- }
-
- Message srcMessage = srcOutput.getMessage();
- log.trace("processOperationOutput: " + srcMessage.getQName());
-
- destOperation.setPattern(Constants.WSDL20_PATTERN_IN_OUT);
- QName wsaAction = (QName)
srcOutput.getExtensionAttribute(Constants.WSDL_ATTRIBUTE_WSA_ACTION);
- if (wsaAction != null)
- destOperation.addProperty(new WSDLProperty(Constants.WSDL_PROPERTY_ACTION_OUT,
wsaAction.getLocalPart()));
-
- List<String> paramOrder = (List<String>)
srcOperation.getParameterOrdering();
- if (paramOrder != null)
- {
- for (String name : paramOrder)
- {
- if (srcMessage.getPart(name) != null)
- {
- WSDLRPCSignatureItem item = destOperation.getRpcSignatureitem(name);
- if (item != null)
- item.setDirection(Direction.INOUT);
- else
- destOperation.addRpcSignatureItem(new WSDLRPCSignatureItem(name,
Direction.OUT));
- }
- }
- }
-
- WSDLInterfaceOperationOutput rpcOutput = new
WSDLInterfaceOperationOutput(destOperation);
- for (Part srcPart : (List<Part>) srcMessage.getOrderedParts(null))
- {
- if (Constants.URI_STYLE_IRI == destOperation.getStyle())
- {
- WSDLInterfaceOperationOutput destOutput = new
WSDLInterfaceOperationOutput(destOperation);
-
- QName elementName = messagePartToElementName(srcWsdl, srcPortType,
srcOperation, srcMessage, srcPart);
- destOutput.setElement(elementName);
-
- // Lets remember the Message name
- destOutput.setMessageName(srcMessage.getQName());
- destOperation.addProperty(new
WSDLProperty(Constants.WSDL_PROPERTY_MESSAGE_NAME_OUT, srcMessage.getQName()
- .getLocalPart()));
-
- // Remember the original part name
- destOutput.setPartName(srcPart.getName());
-
- destOperation.addOutput(destOutput);
- }
- else
- {
- // If we don't have a type then we aren't a valid RPC parameter
- // This could happen on a header element, in which case the
- // binding will pick it up
- QName xmlType = srcPart.getTypeName();
- if (xmlType != null)
- rpcOutput.addChildPart(new WSDLRPCPart(srcPart.getName(),
destWsdl.registerQName(xmlType)));
- else
- messagePartToElementName(srcWsdl, srcPortType, srcOperation, srcMessage,
srcPart);
- }
- }
-
- if (Constants.URI_STYLE_RPC == destOperation.getStyle())
- {
- // This is really a place holder, but also the actual value used in
- // WSDL 2.0 RPC bindings
- QName name = destOperation.getQName();
- rpcOutput.setElement(new QName(name.getNamespaceURI(), name.getLocalPart() +
"Response"));
- rpcOutput.setMessageName(srcMessage.getQName());
- destOperation.addOutput(rpcOutput);
- }
- }
-
- private void processOperationFaults(Operation srcOperation, WSDLInterfaceOperation
destOperation, WSDLInterface destInterface)
- {
-
- Map faults = srcOperation.getFaults();
- Iterator itFaults = faults.values().iterator();
- while (itFaults.hasNext())
- {
- Fault srcFault = (Fault)itFaults.next();
- processOperationFault(destOperation, destInterface, srcFault);
- }
- }
-
- private void processOperationFault(WSDLInterfaceOperation destOperation, WSDLInterface
destInterface, Fault srcFault)
- {
- String faultName = srcFault.getName();
- log.trace("processOperationFault: " + faultName);
-
- WSDLInterfaceFault destFault = new WSDLInterfaceFault(destInterface);
- NCName ncName = new NCName(faultName);
- destFault.setName(ncName);
-
- Message message = srcFault.getMessage();
- QName messageName = message.getQName();
-
- Map partsMap = message.getParts();
- if (partsMap.size() != 1)
- throw new WSException("Unsupported number of fault parts in message "
+ messageName);
-
- Part part = (Part)partsMap.values().iterator().next();
- QName xmlName = part.getElementName();
-
- if (xmlName != null)
- {
- destFault.setElement(xmlName);
- }
- else
- {
- destFault.setElement(messageName);
- log.warn("Unsupported fault message part in message: " +
messageName);
- }
-
- WSDLInterfaceFault prevFault = destInterface.getFault(ncName);
- if (prevFault != null && prevFault.getName().equals(ncName) == false)
- throw new WSException("Fault name must be unique: " + faultName);
-
- // Add the fault to the interface
- destInterface.addFault(destFault);
-
- // Add the fault refererence to the operation
- WSDLInterfaceOperationOutfault opOutFault = new
WSDLInterfaceOperationOutfault(destOperation);
- opOutFault.setRef(new QName(destWsdl.getTargetNamespace(), faultName));
- destOperation.addOutfault(opOutFault);
- }
-
- /** Translate the message part name into an XML element name.
- */
- private QName messagePartToElementName(Definition srcWsdl, PortType srcPortType,
Operation srcOperation, Message srcMessage, Part srcPart)
- {
- // <part name="param" element="tns:SomeType" />
- QName xmlName = srcPart.getElementName();
-
- // <part name="param" type="xsd:string" />
- if (xmlName == null)
- xmlName = new QName(srcPart.getName());
-
- xmlName = destWsdl.registerQName(xmlName);
- String key = srcMessage.getQName() + "->" + srcPart.getName();
- messagePartToElementMap.put(key, xmlName);
-
- return xmlName;
- }
-
- private BindingOperation getBindingOperation(Definition srcWsdl, PortType srcPortType,
Operation srcOperation)
- {
- Binding srcBinding = getPortTypeBindings(srcWsdl).get(srcPortType.getQName());
-
- if (srcBinding == null)
- throw new WSException("Cannot find binding for: " +
srcPortType.getQName());
-
- String srcOperationName = srcOperation.getName();
- BindingOperation srcBindingOperation =
srcBinding.getBindingOperation(srcOperationName, null, null);
- if (srcBindingOperation == null)
- throw new WSException("Cannot find binding operation for: " +
srcOperationName);
- return srcBindingOperation;
- }
-
- private String getOperationStyle(Definition srcWsdl, PortType srcPortType, Operation
srcOperation)
- {
- Binding srcBinding = getPortTypeBindings(srcWsdl).get(srcPortType.getQName());
- BindingOperation srcBindingOperation = getBindingOperation(srcWsdl, srcPortType,
srcOperation);
-
- String operationStyle = null;
- List<ExtensibilityElement> extList =
srcBindingOperation.getExtensibilityElements();
- for (ExtensibilityElement extElement : extList)
- {
- QName elementType = extElement.getElementType();
- if (extElement instanceof SOAPOperation)
- {
- SOAPOperation soapOp = (SOAPOperation)extElement;
- operationStyle = soapOp.getStyle();
- }
- else if (SOAP12_OPERATION.equals(elementType))
- {
- Element domElement = ((UnknownExtensibilityElement)extElement).getElement();
- operationStyle = getOptionalAttribute(domElement, "style");
- }
- }
-
- if (operationStyle == null)
- {
- for (ExtensibilityElement extElement : (List<ExtensibilityElement>)
srcBinding.getExtensibilityElements())
- {
- QName elementType = extElement.getElementType();
- if (extElement instanceof SOAPBinding)
- {
- SOAPBinding soapBinding = (SOAPBinding) extElement;
- operationStyle = soapBinding.getStyle();
- }
- else if (SOAP12_BINDING.equals(elementType))
- {
- Element domElement = ((UnknownExtensibilityElement)
extElement).getElement();
- operationStyle = getOptionalAttribute(domElement, "style");
- }
- }
- }
-
- return ("rpc".equals(operationStyle)) ? Constants.URI_STYLE_RPC :
Constants.URI_STYLE_IRI;
- }
-
- private void processBinding(Definition srcWsdl, Binding srcBinding)
- {
- QName srcBindingQName = srcBinding.getQName();
- log.trace("processBinding: " + srcBindingQName);
-
- NCName ncName = new NCName(srcBindingQName);
- if (destWsdl.getBinding(ncName) == null)
- {
- PortType srcPortType = srcBinding.getPortType();
- if (srcPortType == null)
- throw new WSException("Cannot find port type for binding: " +
ncName);
-
- processPortType(srcWsdl, srcPortType);
-
- WSDLBinding destBinding = new WSDLBinding(destWsdl);
- destBinding.setQName(srcBindingQName);
- destBinding.setName(ncName);
- destBinding.setInterfaceName(srcPortType.getQName());
-
- String bindingStyle = Style.getDefaultStyle().toString();
- List<ExtensibilityElement> extList =
srcBinding.getExtensibilityElements();
- for (ExtensibilityElement extElement : extList)
- {
- QName elementType = extElement.getElementType();
- if (extElement instanceof SOAPBinding)
- {
- destBinding.setType(Constants.NS_SOAP11);
- SOAPBinding soapBinding = (SOAPBinding)extElement;
- bindingStyle = soapBinding.getStyle();
- }
- else if (SOAP12_BINDING.equals(elementType))
- {
- destBinding.setType(Constants.NS_SOAP12);
- Element domElement =
((UnknownExtensibilityElement)extElement).getElement();
- bindingStyle = getOptionalAttribute(domElement, "style");
- }
- }
- destWsdl.addBinding(destBinding);
- processBindingOperations(destBinding, srcBinding, bindingStyle);
- }
- }
-
- private Map<QName, Binding> getPortTypeBindings(Definition srcWsdl)
- {
- getAllDefinedBindings(srcWsdl);
- return portTypeBindings;
- }
-
- private Map<QName, Binding> getAllDefinedBindings(Definition srcWsdl)
- {
- if (allBindings != null)
- return allBindings;
-
- allBindings = new LinkedHashMap<QName, Binding>();
- portTypeBindings = new LinkedHashMap<QName, Binding>();
- Map srcBindings = srcWsdl.getBindings();
- Iterator itBinding = srcBindings.values().iterator();
- while (itBinding.hasNext())
- {
- Binding srcBinding = (Binding)itBinding.next();
- allBindings.put(srcBinding.getQName(), srcBinding);
- portTypeBindings.put(srcBinding.getPortType().getQName(), srcBinding);
- }
-
- // Bindings not available when pulled in through <wsdl:import>
- //
http://sourceforge.net/tracker/index.php?func=detail&aid=1240323&...
- Iterator itService = srcWsdl.getServices().values().iterator();
- while (itService.hasNext())
- {
- Service srcService = (Service)itService.next();
- Iterator itPort = srcService.getPorts().values().iterator();
- while (itPort.hasNext())
- {
- Port srcPort = (Port)itPort.next();
- Binding srcBinding = srcPort.getBinding();
- allBindings.put(srcBinding.getQName(), srcBinding);
- portTypeBindings.put(srcBinding.getPortType().getQName(), srcBinding);
- }
- }
-
- return allBindings;
- }
-
- private void processBindingOperations(WSDLBinding destBinding, Binding srcBinding,
String bindingStyle)
- {
- Iterator it = srcBinding.getBindingOperations().iterator();
- while (it.hasNext())
- {
- BindingOperation srcBindingOperation = (BindingOperation)it.next();
- processBindingOperation(destBinding, bindingStyle, srcBindingOperation);
- }
- }
-
- private void processBindingOperation(WSDLBinding destBinding, String bindingStyle,
BindingOperation srcBindingOperation)
- {
- String srcBindingName = srcBindingOperation.getName();
- log.trace("processBindingOperation: " + srcBindingName);
-
- WSDLInterface destInterface = destBinding.getInterface();
- String namespaceURI = destInterface.getQName().getNamespaceURI();
-
- WSDLBindingOperation destBindingOperation = new WSDLBindingOperation(destBinding);
- QName refQName = new QName(namespaceURI, srcBindingName);
- destBindingOperation.setRef(refQName);
- destBinding.addOperation(destBindingOperation);
-
- String opName = srcBindingName;
- WSDLInterfaceOperation destIntfOperation = destInterface.getOperation(new
NCName(opName));
-
- // Process soap:operation@soapAction, soap:operation@style
- List<ExtensibilityElement> extList =
srcBindingOperation.getExtensibilityElements();
- for (ExtensibilityElement extElement : extList)
- {
- QName elementType = extElement.getElementType();
- if (extElement instanceof SOAPOperation)
- {
- SOAPOperation soapOp = (SOAPOperation)extElement;
- destBindingOperation.setSOAPAction(soapOp.getSoapActionURI());
- }
- else if (SOAP12_OPERATION.equals(elementType))
- {
- Element domElement = ((UnknownExtensibilityElement)extElement).getElement();
- destBindingOperation.setSOAPAction(getOptionalAttribute(domElement,
"soapAction"));
- }
- }
-
- BindingInput srcBindingInput = srcBindingOperation.getBindingInput();
- if (srcBindingInput != null)
- {
- processBindingInput(destBindingOperation, destIntfOperation,
srcBindingOperation, srcBindingInput);
- }
-
- BindingOutput srcBindingOutput = srcBindingOperation.getBindingOutput();
- if (srcBindingOutput != null)
- {
- processBindingOutput(destBindingOperation, destIntfOperation,
srcBindingOperation, srcBindingOutput);
- }
- }
-
- interface ReferenceCallback
- {
- void removeReference(QName element);
- void removeRPCPart(String partName);
- QName getXmlType(String partName);
- }
-
- private void processBindingInput(WSDLBindingOperation destBindingOperation, final
WSDLInterfaceOperation destIntfOperation, final BindingOperation srcBindingOperation,
BindingInput srcBindingInput)
- {
- log.trace("processBindingInput");
-
- QName soap11Body = new QName(Constants.NS_SOAP11, "body");
- List<ExtensibilityElement> extList =
srcBindingInput.getExtensibilityElements();
- WSDLBindingOperationInput input = new
WSDLBindingOperationInput(destBindingOperation);
- destBindingOperation.addInput(input);
-
- ReferenceCallback cb = new ReferenceCallback()
- {
- public QName getXmlType(String partName)
- {
- return
srcBindingOperation.getOperation().getInput().getMessage().getPart(partName).getTypeName();
- }
-
- public void removeReference(QName element)
- {
- WSDLInterfaceOperationInput destIntfInput =
destIntfOperation.getInput(element);
- if (destIntfInput == null)
- destIntfOperation.removeInput(element);
- }
-
- public void removeRPCPart(String partName)
- {
- WSDLInterfaceOperationInput operationInput =
destIntfOperation.getInput(destIntfOperation.getQName());
- operationInput.removeChildPart(partName);
- }
- };
-
- processBindingReference(destBindingOperation, destIntfOperation, soap11Body,
extList, input, cb);
- }
-
- private void processBindingOutput(WSDLBindingOperation destBindingOperation, final
WSDLInterfaceOperation destIntfOperation, final BindingOperation srcBindingOperation,
BindingOutput srcBindingOutput)
- {
- log.trace("processBindingInput");
-
- QName soap11Body = new QName(Constants.NS_SOAP11, "body");
- List<ExtensibilityElement> extList =
srcBindingOutput.getExtensibilityElements();
- WSDLBindingOperationOutput output = new
WSDLBindingOperationOutput(destBindingOperation);
- destBindingOperation.addOutput(output);
-
- ReferenceCallback cb = new ReferenceCallback()
- {
- public QName getXmlType(String partName)
- {
- return
srcBindingOperation.getOperation().getOutput().getMessage().getPart(partName).getTypeName();
- }
-
- public void removeReference(QName element)
- {
- WSDLInterfaceOperationOutput destIntfOutput =
destIntfOperation.getOutput(element);
- if (destIntfOutput == null)
- destIntfOperation.removeInput(element);
- }
-
- public void removeRPCPart(String partName)
- {
- QName name = destIntfOperation.getQName();
- WSDLInterfaceOperationOutput operationOutput =
destIntfOperation.getOutput(new QName(name.getNamespaceURI(), name.getLocalPart() +
"Response"));
- operationOutput.removeChildPart(partName);
- }
- };
-
- processBindingReference(destBindingOperation, destIntfOperation, soap11Body,
extList, output, cb);
- }
-
-
- private void processBindingReference(WSDLBindingOperation destBindingOperation,
WSDLInterfaceOperation destIntfOperation,
- QName soap11Body, List<ExtensibilityElement> extList,
WSDLBindingMessageReference reference, ReferenceCallback callback)
- {
- for (ExtensibilityElement extElement : extList)
- {
- QName elementType = extElement.getElementType();
- if (soap11Body.equals(elementType) || SOAP12_BODY.equals(elementType))
- {
- processEncodingStyle(extElement, destBindingOperation);
- }
- else if (extElement instanceof SOAPHeader)
- {
- SOAPHeader header = (SOAPHeader)extElement;
- QName messageQName = header.getMessage();
- String partName = header.getPart();
-
- String key = messageQName + "->" + partName;
- QName elementName = (QName)messagePartToElementMap.get(key);
- if (elementName == null)
- throw new WSException("Could not determine element name from header:
" + partName);
-
- reference.addSoapHeader(new WSDLSOAPHeader(elementName, partName));
- if (Constants.URI_STYLE_IRI == destIntfOperation.getStyle())
- {
- callback.removeReference(elementName);
- }
- else
- {
- // Just in case
- callback.removeRPCPart(partName);
- }
- }
- else if (extElement instanceof MIMEMultipartRelated)
- {
- MIMEMultipartRelated related = (MIMEMultipartRelated)extElement;
- Iterator i = related.getMIMEParts().iterator();
- while (i.hasNext())
- {
- MIMEPart part = (MIMEPart)i.next();
- Iterator j = part.getExtensibilityElements().iterator();
- String name = null;
- String types = null;
-
- while (j.hasNext())
- {
- ExtensibilityElement inner = (ExtensibilityElement)j.next();
- if (inner instanceof MIMEContent)
- {
- MIMEContent content = (MIMEContent)inner;
- name = content.getPart();
- if (types == null)
- {
- types = content.getType();
- }
- else
- {
- types += "," + content.getType();
- }
- }
- }
-
- // Found content types in this part
- if (name != null)
- {
- QName xmlType = callback.getXmlType(name);
- reference.addMimePart(new WSDLMIMEPart(name, xmlType, types));
- if (Constants.URI_STYLE_IRI == destIntfOperation.getStyle())
- {
- // A mime part must be defined as <part type="">
- callback.removeReference(new QName(name));
- }
- else
- {
- callback.removeRPCPart(name);
- }
- }
- }
- }
- }
- }
-
-
- private void processEncodingStyle(ExtensibilityElement extElement,
WSDLBindingOperation destBindingOperation)
- {
- log.trace("processEncodingStyle");
-
- String encStyle = null;
- QName elementType = extElement.getElementType();
- if (extElement instanceof SOAPBody)
- {
- SOAPBody body = (SOAPBody)extElement;
- List encStyleList = body.getEncodingStyles();
- if (encStyleList != null)
- {
- if (encStyleList.size() > 1)
- log.warn("Multiple encoding styles not supported: " +
encStyleList);
-
- if (encStyleList.size() > 0)
- {
- encStyle = (String)encStyleList.get(0);
- }
- }
- }
- else if (SOAP12_BODY.equals(elementType))
- {
- Element domElement = ((UnknownExtensibilityElement)extElement).getElement();
- encStyle = getOptionalAttribute(domElement, "encodingStyle");
- }
-
- if (encStyle != null)
- {
- String setStyle = destBindingOperation.getEncodingStyle();
- if (encStyle.equals(setStyle) == false)
- log.warn("Encoding style '" + encStyle + "' not
supported for: " + destBindingOperation.getRef());
-
- destBindingOperation.setEncodingStyle(encStyle);
- }
- }
-
- private void processServices(Definition srcWsdl)
- {
- log.trace("BEGIN processServices: " + srcWsdl.getDocumentBaseURI());
-
- // Each definition needs a clear binding cache
- allBindings = null;
-
- if (srcWsdl.getServices().size() > 0)
- {
- Iterator it = srcWsdl.getServices().values().iterator();
- while (it.hasNext())
- {
- Service srcService = (Service)it.next();
- QName qname = srcService.getQName();
- WSDLService destService = new WSDLService(destWsdl);
- destService.setName(new NCName(qname));
- destService.setQName(qname);
- destWsdl.addService(destService);
- processPorts(srcWsdl, destService, srcService);
- }
- }
- else
- {
- log.trace("Empty wsdl services, processing imports");
- Iterator it = srcWsdl.getImports().values().iterator();
- while (it.hasNext())
- {
- List<Import> srcImports = (List<Import>)it.next();
- for (Import srcImport : srcImports)
- {
- Definition importDefinition = srcImport.getDefinition();
- processServices(importDefinition);
- }
- }
-
- // The binding cache must be clear after imports, so that undefined bindings can
be located
- allBindings = null;
- }
-
- log.trace("END processServices: " + srcWsdl.getDocumentBaseURI());
- }
-
- private void processPorts(Definition srcWsdl, WSDLService destService, Service
srcService)
- {
- Iterator it = srcService.getPorts().values().iterator();
- while (it.hasNext())
- {
- Port srcPort = (Port)it.next();
- processPort(srcWsdl, destService, srcPort);
- }
- }
-
- private void processPort(Definition srcWsdl, WSDLService destService, Port srcPort)
- {
- log.trace("processPort: " + srcPort.getName());
-
- Binding srcBinding = srcPort.getBinding();
-
- WSDLEndpoint destEndpoint = new WSDLEndpoint(destService);
- destEndpoint.setName(new NCName(srcPort.getName()));
- destEndpoint.setBinding(srcBinding.getQName());
- destEndpoint.setQName(new QName(srcWsdl.getTargetNamespace(), srcPort.getName()));
- destEndpoint.setAddress(getSOAPAddress(srcPort));
- destService.addEndpoint(destEndpoint);
-
- processBinding(srcWsdl, srcBinding);
- }
-
- /** Get the endpoint address from the ports extensible element
- */
- private String getSOAPAddress(Port srcPort)
- {
- String soapAddress = "dummy";
-
- Iterator it = srcPort.getExtensibilityElements().iterator();
- while (it.hasNext())
- {
- ExtensibilityElement extElement = (ExtensibilityElement)it.next();
- QName elementType = extElement.getElementType();
-
- if (extElement instanceof SOAPAddress)
- {
- SOAPAddress addr = (SOAPAddress)extElement;
- soapAddress = addr.getLocationURI();
- break;
- }
- else if (SOAP12_ADDRESS.equals(elementType))
- {
- Element domElement = ((UnknownExtensibilityElement)extElement).getElement();
- soapAddress = getOptionalAttribute(domElement, "location");
- break;
- }
- else if ("address".equals(elementType.getLocalPart()))
- {
- log.warn("Unprocessed extension element: " + elementType);
- }
- }
-
- if (soapAddress == null)
- throw new WSException("Cannot obtain SOAP address");
-
- return soapAddress;
- }
-
- private String getOptionalAttribute(Element domElement, String attrName)
- {
- String attrValue = domElement.getAttribute(attrName);
- return (attrValue.length() > 0 ? attrValue : null);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java)
Deleted: trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,538 +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.tools.wsdl;
-
-import java.io.IOException;
-import java.io.Writer;
-import java.util.Arrays;
-import java.util.HashSet;
-
-import javax.wsdl.Definition;
-import javax.wsdl.WSDLException;
-import javax.wsdl.factory.WSDLFactory;
-import javax.xml.namespace.QName;
-
-import org.jboss.ws.Constants;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.core.utils.DOMWriter;
-import org.jboss.ws.metadata.wsdl.NCName;
-import org.jboss.ws.metadata.wsdl.WSDLBinding;
-import org.jboss.ws.metadata.wsdl.WSDLBindingMessageReference;
-import org.jboss.ws.metadata.wsdl.WSDLBindingOperation;
-import org.jboss.ws.metadata.wsdl.WSDLBindingOperationInput;
-import org.jboss.ws.metadata.wsdl.WSDLBindingOperationOutput;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
-import org.jboss.ws.metadata.wsdl.WSDLImport;
-import org.jboss.ws.metadata.wsdl.WSDLInterface;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceFault;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceMessageReference;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperation;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationInput;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutfault;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutput;
-import org.jboss.ws.metadata.wsdl.WSDLRPCPart;
-import org.jboss.ws.metadata.wsdl.WSDLRPCSignatureItem;
-import org.jboss.ws.metadata.wsdl.WSDLSOAPHeader;
-import org.jboss.ws.metadata.wsdl.WSDLService;
-import org.jboss.ws.metadata.wsdl.WSDLRPCSignatureItem.Direction;
-import org.w3c.dom.Element;
-
-/**
- * A WSDL Writer that writes a WSDL 1.1 file. It works off
- * of the WSDL20 Object Graph.
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- */
-public class WSDL11Writer extends WSDLWriter
-{
- //Used Internally
- private String wsdlStyle = Constants.RPC_LITERAL;
-
- // Used to prevent duplicates
- private HashSet<String> writtenFaultMessages = new HashSet<String>();
-
- /** Use WSDLDefinitions.writeWSDL instead. */
- public WSDL11Writer(WSDLDefinitions wsdl)
- {
- super(wsdl);
- }
-
- public void write(Writer writer) throws IOException
- {
- write(writer, null);
- }
-
-
- public void write(Writer writer, String charset) throws IOException
- {
- write(writer, charset, null);
- }
-
- public void write(Writer writer, String charset, WSDLWriterResolver resolver) throws
IOException
- {
- // Write out the wsdl-1.1 represention (only path to obtain is from WSDL11Reader)
- if (wsdl.getWsdlOneOneDefinition() != null)
- {
- Definition wsdlDefinition = wsdl.getWsdlOneOneDefinition();
- try
- {
- WSDLFactory wsdlFactory = WSDLFactory.newInstance();
- javax.wsdl.xml.WSDLWriter wsdlWriter = wsdlFactory.newWSDLWriter();
- wsdlWriter.writeWSDL(wsdlDefinition, writer);
- }
- catch (WSDLException e)
- {
- this.logException(e);
- throw new IOException(e.toString());
- }
- }
- else
- {
- StringBuilder buffer = new StringBuilder();
-
- //Detect the WSDL Style early
- wsdlStyle = utils.getWSDLStyle(wsdl);
-
- StringBuilder importBuffer = new StringBuilder();
- for (WSDLImport wsdlImport : wsdl.getImports())
- {
- if (resolver == null)
- continue;
-
- WSDLWriterResolver resolved = resolver.resolve(wsdlImport.getLocation());
- if (resolved == null)
- continue;
-
- String namespace = wsdlImport.getNamespace();
- importBuffer.append("<import namespace='" + namespace +
"' location='" + resolved.actualFile + "'/>");
- if (resolved != null)
- {
- StringBuilder builder = new StringBuilder();
-
- appendDefinitions(builder, namespace);
- appendBody(builder, namespace);
- writeBuilder(builder, resolved.writer, resolved.charset);
- resolved.writer.close();
- }
- }
-
- appendDefinitions(buffer, wsdl.getTargetNamespace());
- if (importBuffer.length() > 0)
- buffer.append(importBuffer);
-
- appendBody(buffer, wsdl.getTargetNamespace());
- writeBuilder(buffer, writer, charset);
- }
- }
-
- private void writeBuilder(StringBuilder builder, Writer writer, String charset) throws
IOException
- {
- Element element = DOMUtils.parse(builder.toString());
-
- if (charset != null)
- writer.write("<?xml version=\"1.0\" encoding=\"" +
charset + "\"?>\n");
- new DOMWriter(writer).setPrettyprint(true).print(element);
- }
-
- protected void appendBody(StringBuilder builder, String namespace)
- {
- writtenFaultMessages.clear();
-
- appendTypes(builder, namespace);
- appendMessages(builder, namespace);
- appendInterfaces(builder, namespace);
- appendBindings(builder, namespace);
- appendServices(builder, namespace);
- builder.append("</definitions>");
- }
-
- protected void appendMessages(StringBuilder buffer, String namespace)
- {
- WSDLInterface[] interfaces = wsdl.getInterfaces();
- int len = interfaces != null ? interfaces.length : 0;
- for (int i = 0; i < len; i++)
- {
- WSDLInterface intf = interfaces[i];
- if (! namespace.equals(intf.getQName().getNamespaceURI()))
- continue;
-
- WSDLInterfaceOperation[] operations = intf.getSortedOperations();
- int lenOps = operations.length;
- for (int j = 0; j < lenOps; j++)
- {
- appendMessage(buffer, operations[j]);
- appendMessagesForExceptions(buffer, operations[j]);
- }
- }
- }
-
- private void appendMessage(StringBuilder buffer, WSDLInterfaceOperation operation)
- {
- String opname = operation.getName().toString();
- //Determine the style of the wsdl
- if (Constants.URI_STYLE_RPC.equals(operation.getStyle()) == false)
- wsdlStyle = Constants.DOCUMENT_LITERAL; //Not RPC/Literal
-
- String interfaceName = operation.getWsdlInterface().getName().toString();
- buffer.append("<message name='" + interfaceName + "_" +
opname + "' >");
- for (WSDLInterfaceOperationInput input : operation.getInputs())
- appendMessageParts(buffer, input);
- buffer.append("</message>");
-
- if (! Constants.WSDL20_PATTERN_IN_ONLY.equals(operation.getPattern()))
- {
- buffer.append("<message name='" + interfaceName + "_"
+ opname + "Response' >");
- WSDLInterfaceOperationOutput[] outputs = operation.getOutputs();
- for (WSDLInterfaceOperationOutput output : outputs)
- appendMessageParts(buffer, output);
- buffer.append("</message>");
- }
- }
-
- private void appendMessagesForExceptions(StringBuilder buffer, WSDLInterfaceOperation
operation)
- {
- //Get the outfaults
- WSDLInterfaceOperationOutfault[] faults = operation.getOutfaults();
- int len = faults != null ? faults.length : 0;
-
- for (int i = 0; i < len; i++)
- {
- WSDLInterfaceOperationOutfault fault = faults[i];
- String exceptionName = fault.getRef().getLocalPart();
- if (writtenFaultMessages.contains(exceptionName))
- continue;
-
- WSDLInterfaceFault interfaceFault = operation.getWsdlInterface().getFault(new
NCName(exceptionName));
- QName xmlName = interfaceFault.getElement();
-
- buffer.append("<message name='" + exceptionName + "'
>");
- String prefix = wsdl.getPrefix(xmlName.getNamespaceURI());
- String xmlNameStr = prefix + ":" + xmlName.getLocalPart();
- buffer.append("<part name='" + exceptionName + "'
element='" + xmlNameStr + "' />");
- buffer.append("</message>");
-
- writtenFaultMessages.add(exceptionName);
- }
- }
-
- private String getReferenceString(QName name)
- {
- String namespaceURI = name.getNamespaceURI();
- String prefix = wsdl.getPrefix(namespaceURI);
- if (prefix == null)
- throw new WSException("Prefix not bound for namespace: " +
namespaceURI);
-
- return prefix + ":" + name.getLocalPart();
- }
-
- private void appendMessageParts(StringBuilder buffer, WSDLInterfaceMessageReference
reference)
- {
- if (wsdlStyle.equals(Constants.RPC_LITERAL))
- {
- for (WSDLRPCPart part : reference.getChildParts())
- {
- buffer.append("<part name='" +
part.getName()).append('\'');
- buffer.append(" type='" + getReferenceString(part.getType()) +
"'/>");
- }
- }
- else
- {
- QName element = reference.getElement();
- // Null represents empty message
- if (element != null)
- {
- buffer.append("<part name='" + reference.getPartName() +
'\'');
- buffer.append(" element='" + getReferenceString(element) +
"'/>");
- }
- }
-
- WSDLBindingMessageReference bindingReference = getBindingReference(reference);
- if (bindingReference == null)
- return;
-
- for (WSDLSOAPHeader header : bindingReference.getSoapHeaders())
- {
- if (header.isIncludeInSignature());
- {
- QName element = header.getElement();
- buffer.append("<part name='" + header.getPartName() +
'\'');
- buffer.append(" element='" + getReferenceString(element) +
"'/>");
- }
- }
- }
-
- private WSDLBindingMessageReference getBindingReference(WSDLInterfaceMessageReference
reference)
- {
- WSDLInterfaceOperation operation = reference.getWsdlOperation();
- WSDLInterface wsdlInterface = operation.getWsdlInterface();
- WSDLBinding binding =
wsdlInterface.getWsdlDefinitions().getBindingByInterfaceName(wsdlInterface.getQName());
- WSDLBindingOperation bindingOperation =
binding.getOperationByRef(operation.getQName());
- WSDLBindingMessageReference[] bindingReferences;
-
- if (reference instanceof WSDLInterfaceOperationInput)
- bindingReferences = bindingOperation.getInputs();
- else
- bindingReferences = bindingOperation.getOutputs();
-
- if (bindingReferences.length > 1)
- throw new IllegalArgumentException("WSDl 1.1 only supports In-Only, and
In-Out MEPS, more than reference input found");
-
- if (bindingReferences.length == 1)
- return bindingReferences[0];
-
- return null;
- }
-
- protected void appendInterfaces(StringBuilder buffer, String namespace)
- {
- WSDLInterface[] intfs = wsdl.getInterfaces();
- for (int i = 0; i < intfs.length; i++)
- {
- WSDLInterface intf = intfs[i];
- if (!namespace.equals(intf.getQName().getNamespaceURI()))
- continue;
-
- buffer.append("<portType name='" + intf.getName() +
"'>");
- appendPortOperations(buffer, intf);
- buffer.append("</portType>");
- }
- }
-
- private String getParameterOrder(WSDLInterfaceOperation operation)
- {
- StringBuilder builder = new StringBuilder();
- for (WSDLRPCSignatureItem item : operation.getRpcSignatureItems())
- {
- if (item.getDirection() != Direction.RETURN)
- {
- if (builder.length() > 0)
- builder.append(' ');
- builder.append(item.getName());
- }
- }
-
- return builder.toString();
- }
-
- protected void appendPortOperations(StringBuilder buffer, WSDLInterface intf)
- {
- String prefix = wsdl.getPrefix(intf.getQName().getNamespaceURI());
- WSDLInterfaceOperation[] operations = intf.getSortedOperations();
- for (int i = 0; i < operations.length; i++)
- {
- WSDLInterfaceOperation operation = operations[i];
- buffer.append("<operation name='" +
operation.getName().toString() + "'");
-
- String parameterOrder = getParameterOrder(operation);
- if (parameterOrder.length() > 0)
- buffer.append("
parameterOrder='").append(parameterOrder).append("'");
- buffer.append(">");
-
- String opname = operation.getName().toString();
- String interfaceName = operation.getWsdlInterface().getName().toString();
- String msgEl = prefix + ":" + interfaceName + "_" + opname;
-
- buffer.append("<input message='" + msgEl +
"'>").append("</input>");
-
- if (! Constants.WSDL20_PATTERN_IN_ONLY.equals(operation.getPattern()))
- {
- buffer.append("<output message='" + msgEl +
"Response'>");
- buffer.append("</output>");
- }
-
- //Append the Faults
- for (WSDLInterfaceOperationOutfault fault : operation.getOutfaults())
- {
- QName element = fault.getRef();
- buffer.append("<fault message='" +
utils.getFormattedString(element));
- buffer.append("' name='" + element.getLocalPart() +
"'/>");
- }
-
- buffer.append("</operation>");
- }
- }
-
- protected void appendBindings(StringBuilder buffer, String namespace)
- {
- WSDLBinding[] bindings = wsdl.getBindings();
- for (int i = 0; i < bindings.length; i++)
- {
- WSDLBinding binding = bindings[i];
- if (!namespace.equals(binding.getQName().getNamespaceURI()))
- continue;
- buffer.append("<binding name='" + binding.getName() +
"' type='" + getQNameRef(binding.getInterfaceName()) +
"'>");
- //TODO:Need to derive the WSDLStyle from the Style attribute of
InterfaceOperation
- if (wsdlStyle == null)
- throw new IllegalArgumentException("WSDL Style is null (should be rpc or
document");
- String style = "rpc";
- if (wsdlStyle.equals(Constants.DOCUMENT_LITERAL))
- style = "document";
- buffer.append("<" + soapPrefix + ":binding
transport='http://schemas.xmlsoap.org/soap/http' style='" + style +
"'/>");
- appendBindingOperations(buffer, binding);
- buffer.append("</binding>");
- }
- }
-
- protected void appendBindingOperations(StringBuilder buffer, WSDLBinding binding)
- {
- WSDLBindingOperation[] operations = binding.getOperations();
- Arrays.sort(operations);
-
- for (int i = 0; i < operations.length; i++)
- {
- WSDLBindingOperation operation = operations[i];
- String interfaceName =
operation.getWsdlBinding().getInterfaceName().getLocalPart();
-
- WSDLInterface wsdlInterface = wsdl.getInterface(new NCName(interfaceName));
- if (wsdlInterface == null)
- throw new WSException("WSDL Interface should not be null");
- WSDLInterfaceOperation interfaceOperation = wsdlInterface.getOperation(new
NCName(operation.getRef().getLocalPart()));
-
- buffer.append("<operation name='" +
interfaceOperation.getName() + "'>");
- String soapAction = (operation.getSOAPAction() != null ?
operation.getSOAPAction() : "");
- buffer.append("<" + soapPrefix + ":operation
soapAction=\"" + soapAction + "\"/>");
-
- WSDLBindingOperationInput[] inputs = operation.getInputs();
- if (inputs.length != 1)
- throw new WSException("WSDl 1.1 only supports In-Only, and In-Out
MEPS.");
-
- buffer.append("<input>");
- appendSOAPBinding(buffer, wsdlInterface, operation, inputs);
- buffer.append("</input>");
-
- if (!
Constants.WSDL20_PATTERN_IN_ONLY.equals(getBindingOperationPattern(operation)))
- {
- buffer.append("<output>");
- WSDLBindingOperationOutput[] outputs = operation.getOutputs();
- appendSOAPBinding(buffer, wsdlInterface, operation, outputs);
- buffer.append("</output>");
- }
-
- //Append faults
- WSDLInterfaceOperationOutfault[] faults = interfaceOperation.getOutfaults();
- if (faults != null)
- {
- for (WSDLInterfaceOperationOutfault fault : faults)
- {
- String n = "name='" + fault.getRef().getLocalPart() +
"'";
- buffer.append("<fault " + n + ">");
- buffer.append("<" + soapPrefix + ":fault " + n +
" use='literal' />");
- buffer.append("</fault>");
- }
- buffer.append("</operation>");
- }
- }
- }
-
- private void appendSOAPBinding(StringBuilder buffer, WSDLInterface wsdlInterface,
WSDLBindingOperation operation, WSDLBindingMessageReference[] inputs)
- {
- String tns = wsdl.getTargetNamespace();
- WSDLInterfaceOperation interfaceOperation = wsdlInterface.getOperation(new
NCName(operation.getRef().getLocalPart()));
- WSDLInterfaceMessageReference reference = (inputs instanceof
WSDLBindingOperationInput[]) ? interfaceOperation.getInputs()[0]
- : interfaceOperation.getOutputs()[0];
-
- StringBuilder bodyParts = new StringBuilder();
- if (Constants.DOCUMENT_LITERAL == wsdlStyle)
- {
- bodyParts.append(reference.getPartName());
- }
- else
- {
- for (WSDLRPCPart part : reference.getChildParts())
- {
- if (bodyParts.length() > 0)
- bodyParts.append(" ");
- bodyParts.append(part.getName());
- }
- }
-
- StringBuilder soapHeader = new StringBuilder();
- for (WSDLSOAPHeader header : inputs[0].getSoapHeaders())
- {
- if (header.isIncludeInSignature())
- {
- String messageName = wsdlInterface.getName() + "_" +
operation.getRef().getLocalPart();
- if (reference instanceof WSDLInterfaceOperationOutput)
- messageName += "Response";
- soapHeader.append("<").append(soapPrefix).append(":header
use='literal' message='tns:").append(messageName);
- soapHeader.append("'
part='").append(header.getElement().getLocalPart()).append("'/>");
- }
- }
-
- buffer.append("<" + soapPrefix + ":body
use='literal'");
- if (wsdlStyle != Constants.DOCUMENT_LITERAL)
- buffer.append(" namespace='" + tns + "'");
- if (soapHeader.length() > 0)
- {
- buffer.append("
parts='").append(bodyParts).append("'/>");
- buffer.append(soapHeader);
- }
- else
- {
- buffer.append("/>");
- }
- }
-
- private String getBindingOperationPattern(WSDLBindingOperation operation)
- {
- WSDLBinding binding = operation.getWsdlBinding();
- String pattern = binding.getInterface().getOperation(new
NCName(operation.getRef().getLocalPart())).getPattern();
-
- return pattern;
- }
-
- protected void appendServices(StringBuilder buffer, String namespace)
- {
- WSDLService[] services = wsdl.getServices();
- int len = services.length;
- for (int i = 0; i < len; i++)
- {
-
- WSDLService service = services[i];
- if (!namespace.equals(service.getQName().getNamespaceURI()))
- continue;
- buffer.append("<service name='" + service.getName() +
"'>");
- WSDLEndpoint[] endpoints = service.getEndpoints();
- int lenend = endpoints.length;
- for (int j = 0; j < lenend; j++)
- {
- WSDLEndpoint endpoint = endpoints[j];
- appendServicePort(buffer, endpoint);
- }
-
- buffer.append("</service>");
- }
- }
-
- protected void appendServicePort(StringBuilder buffer, WSDLEndpoint endpoint)
- {
- String name = endpoint.getName().toString();
- QName endpointBinding = endpoint.getBinding();
- String prefix = endpointBinding.getPrefix();
- prefix = wsdl.getPrefix(endpointBinding.getNamespaceURI());
- String ebname = prefix + ":" + endpointBinding.getLocalPart();
- buffer.append("<port name='" + name + "'
binding='" + ebname + "'>");
- buffer.append("<" + soapPrefix + ":address location='" +
endpoint.getAddress() + "'/>");
- buffer.append("</port>");
- }
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java)
Deleted: trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,196 +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.tools.wsdl;
-
-// $Id$
-
-import java.io.InputStream;
-import java.io.StringWriter;
-import java.net.ConnectException;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.wsdl.Definition;
-import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLReader;
-import javax.xml.parsers.DocumentBuilder;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.core.utils.JBossWSEntityResolver;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.xml.sax.EntityResolver;
-
-import com.ibm.wsdl.xml.WSDLReaderImpl;
-
-/**
- * A factory that creates a <code>WSDLDefinitions</code> object from an URL.
- *
- * This implementations deals with different WSDL versions so that clients of this
- * factory do need to know about WSDL version specifics. The Java object view of the
- * WSDL document (WSDLDefinitions) is modeled on WSDL-2.0
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 10-Oct-2004
- */
-public class WSDLDefinitionsFactory
-{
- // provide logging
- private static final Logger log = Logger.getLogger(WSDLDefinitionsFactory.class);
-
- // This feature is set by default in wsdl4j, it means the object structure contains
the imported arguments
- public static final String FEATURE_IMPORT_DOCUMENTS =
"javax.wsdl.importDocuments";
- // Set this feature for additional debugging output
- public static final String FEATURE_VERBOSE = "javax.wsdl.verbose";
-
- // The WSDL reader features
- private Map features = new HashMap();
-
- // Hide constructor
- private WSDLDefinitionsFactory()
- {
- }
-
- /**
- * Create a new instance of a wsdl factory
- */
- public static WSDLDefinitionsFactory newInstance()
- {
- return new WSDLDefinitionsFactory();
- }
-
- /**
- * Set a feature on the underlying reader
- */
- public void setFeature(String name, boolean value) throws IllegalArgumentException
- {
- features.put(name, new Boolean(value));
- }
-
- /**
- * Read the wsdl document from the given URL
- */
- public WSDLDefinitions parse(URL wsdlLocation) throws WSDLException
- {
- if (wsdlLocation == null)
- throw new IllegalArgumentException("URL cannot be null");
-
- log.debug("parse: " + wsdlLocation.toExternalForm());
-
- EntityResolver entityResolver = new JBossWSEntityResolver();
- WSDLDefinitions wsdlDefinitions = null;
- try
- {
- Document wsdlDoc = getDocument(wsdlLocation);
- String defaultNamespace = getDefaultNamespace(wsdlDoc);
- if (Constants.NS_WSDL11.equals(defaultNamespace))
- {
- WSDLFactory wsdlFactory = WSDLFactory.newInstance();
- WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
- wsdlReader.setFeature("javax.wsdl.verbose", false);
-
- // Setup reader features
- Iterator it = features.entrySet().iterator();
- while (it.hasNext())
- {
- Map.Entry entry = (Map.Entry)it.next();
- String key = (String)entry.getKey();
- Boolean flag = (Boolean)entry.getValue();
- wsdlReader.setFeature(key, flag.booleanValue());
- }
-
- // Set EntityResolver in patched version of wsdl4j-1.5.2jboss
- ((WSDLReaderImpl)wsdlReader).setEntityResolver(entityResolver);
-
- Definition definition = wsdlReader.readWSDL(new
WSDLLocatorImpl(entityResolver, wsdlLocation));
- wsdlDefinitions = new WSDL11Reader().processDefinition(definition,
wsdlLocation);
- wsdlDefinitions.setWsdlDocument(wsdlDoc);
- }
- else
- throw new WSDLException("Invalid default namespace: " +
defaultNamespace);
-
- if (log.isTraceEnabled())
- {
- StringWriter stwr = new StringWriter();
- WSDL11Writer wsdlWriter = new WSDL11Writer(wsdlDefinitions);
- wsdlWriter.write(stwr);
- log.trace("\n" + stwr.toString());
- }
- }
- catch (WSDLException e)
- {
- throw e;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception e)
- {
- throw new WSDLException(e);
- }
-
- return wsdlDefinitions;
- }
-
- /** Get the WSDL document.
- */
- private Document getDocument(URL wsdlLocation) throws WSDLException
- {
- try
- {
- InputStream wsdlInputStream = wsdlLocation.openStream();
- try
- {
- DocumentBuilder builder = DOMUtils.getDocumentBuilder();
- return builder.parse(wsdlInputStream);
- }
- finally
- {
- wsdlInputStream.close();
- }
- }
- catch (ConnectException ex)
- {
- throw new WSDLException("Cannot connect to: " + wsdlLocation);
- }
- catch (Exception ex)
- {
- throw new WSDLException("Cannot parse wsdlLocation: " + wsdlLocation,
ex);
- }
- }
-
- /** Get the default namespace for the given WSDL
- */
- private String getDefaultNamespace(Document wsdlDoc) throws WSDLException
- {
- Element root = wsdlDoc.getDocumentElement();
- String defaultNamespace = root.getNamespaceURI();
- return defaultNamespace;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java)
Deleted: trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLLocatorImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLLocatorImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLLocatorImpl.java 2006-12-07 10:43:36
UTC (rev 1600)
@@ -1,159 +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.tools.wsdl;
-
-// $Id$
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import javax.wsdl.xml.WSDLLocator;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-
-/* A WSDLLocator that can handle wsdl imports
- */
-class WSDLLocatorImpl implements WSDLLocator
-{
- // provide logging
- private static final Logger log = Logger.getLogger(WSDLDefinitionsFactory.class);
-
- private EntityResolver entityResolver;
- private URL wsdlURL;
- private String latestImportURI;
-
- public WSDLLocatorImpl(EntityResolver entityResolver, URL wsdlFile)
- {
- if (wsdlFile == null)
- throw new IllegalArgumentException("WSDL file argument cannot be
null");
-
- this.entityResolver = entityResolver;
- this.wsdlURL = wsdlFile;
- }
-
- public InputSource getBaseInputSource()
- {
- log.trace("getBaseInputSource [wsdlUrl=" + wsdlURL + "]");
- try
- {
- InputStream is = wsdlURL.openStream();
- if (is == null)
- throw new IllegalArgumentException("Cannot obtain wsdl from [" +
wsdlURL + "]");
-
- return new InputSource(is);
- }
- catch (IOException e)
- {
- throw new RuntimeException("Cannot access wsdl from [" + wsdlURL +
"], " + e.getMessage());
- }
- }
-
- public String getBaseURI()
- {
- return wsdlURL.toExternalForm();
- }
-
- public InputSource getImportInputSource(String parent, String resource)
- {
- log.trace("getImportInputSource [parent=" + parent +
",resource=" + resource + "]");
-
- URL parentURL = null;
- try
- {
- parentURL = new URL(parent);
- }
- catch (MalformedURLException e)
- {
- log.error("Not a valid URL: " + parent);
- return null;
- }
-
- String wsdlImport = null;
- String external = parentURL.toExternalForm();
-
- // An external URL
- if (resource.startsWith("http://") ||
resource.startsWith("https://"))
- {
- wsdlImport = resource;
- }
-
- // Absolute path
- else if (resource.startsWith("/"))
- {
- String beforePath = external.substring(0,
external.indexOf(parentURL.getPath()));
- wsdlImport = beforePath + resource;
- }
-
- // A relative path
- else
- {
- String parentDir = external.substring(0, external.lastIndexOf("/"));
-
- // remove references to current dir
- while (resource.startsWith("./"))
- resource = resource.substring(2);
-
- // remove references to parentdir
- while (resource.startsWith("../"))
- {
- parentDir = parentDir.substring(0, parentDir.lastIndexOf("/"));
- resource = resource.substring(3);
- }
-
- wsdlImport = parentDir + "/" + resource;
- }
-
- try
- {
- log.trace("Trying to resolve: " + wsdlImport);
- InputSource inputSource = entityResolver.resolveEntity(wsdlImport, wsdlImport);
- if (inputSource != null)
- {
- latestImportURI = wsdlImport;
- }
- else
- {
- throw new IllegalArgumentException("Cannot resolve imported resource:
" + wsdlImport);
- }
-
- return inputSource;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception e)
- {
- throw new WSException("Cannot access imported wsdl [" + wsdlImport +
"], " + e.getMessage());
- }
- }
-
- public String getLatestImportURI()
- {
- return latestImportURI;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLLocatorImpl.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLLocatorImpl.java)
Deleted: trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLWriter.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLWriter.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLWriter.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -1,228 +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.tools.wsdl;
-
-// $Id$
-
-import java.io.IOException;
-import java.io.Writer;
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.core.utils.DOMWriter;
-import org.jboss.ws.metadata.wsdl.DOMTypes;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLService;
-import org.jboss.ws.metadata.wsdl.WSDLTypes;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
-import org.jboss.ws.metadata.wsdl.XSModelTypes;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
-import org.w3c.dom.Element;
-
-/**
- * A helper that writes out a WSDL definition
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author Anil.Saldhana(a)jboss.org
- * @since 10-Oct-2004
- */
-public class WSDLWriter
-{
- // provide logging
- protected static final Logger log = Logger.getLogger(WSDLWriter.class);
-
- protected WSDLDefinitions wsdl;
- protected WSDLUtils utils = WSDLUtils.getInstance();
-
- // The soap prefix
- protected String soapPrefix = "soap";
-
- /**
- * Include or import WSDL Types
- */
- protected boolean includeSchemaInWSDL = true;
-
- /** Use WSDLDefinitions.writeWSDL instead. */
- public WSDLWriter(WSDLDefinitions wsdl)
- {
- if (wsdl == null)
- throw new IllegalArgumentException("WSDL definitions is NULL");
-
- this.wsdl = wsdl;
- }
-
- /** Write the wsdl definition to the given writer, clients should not care about the
wsdl version. */
- public void write(Writer writer, String charset) throws IOException
- {
- write(writer, charset, null);
- }
-
- public void write(Writer writer, String charset, WSDLWriterResolver resolver) throws
IOException
- {
- String wsdlNamespace = wsdl.getWsdlNamespace();
- if (Constants.NS_WSDL11.equals(wsdlNamespace))
- {
- WSDL11Writer wsdl11Writer = new WSDL11Writer(wsdl);
- wsdl11Writer.write(writer, charset, resolver);
- }
- else
- {
- throw new WSException("Unsupported wsdl version: " + wsdlNamespace);
- }
- }
-
- public void write(Writer writer) throws IOException
- {
- StringBuilder buffer = new StringBuilder();
- buffer.append(Constants.XML_HEADER);
-
- appendDefinitions(buffer, wsdl.getTargetNamespace());
- appendTypes(buffer, wsdl.getTargetNamespace());
- appendInterfaces(buffer, wsdl.getTargetNamespace());
- appendBindings(buffer, wsdl.getTargetNamespace());
- appendServices(buffer, wsdl.getTargetNamespace());
-
- buffer.append("</definitions>");
-
- Element element = DOMUtils.parse(buffer.toString());
- new DOMWriter(writer).setPrettyprint(true).print(element);
- }
-
- protected void appendDefinitions(StringBuilder buffer, String namespace)
- {
- buffer.append("<definitions");
- //Append service name as done by wscompile, if there is just one
- WSDLService[] services = wsdl.getServices();
- if (services != null && services.length == 1)
- {
- WSDLService ser = services[0];
- buffer.append(" name='" + ser.getName() + "'");
- }
- buffer.append(" targetNamespace='" + namespace + "'");
- buffer.append(" xmlns='" + wsdl.getWsdlNamespace() +
"'");
-
- Iterator it = wsdl.getRegisteredNamespaceURIs();
- while (it.hasNext())
- {
- String namespaceURI = (String)it.next();
- String prefix = wsdl.getPrefix(namespaceURI);
- if (prefix.length() > 0)
- {
- buffer.append(" xmlns:" + prefix + "='" +
namespaceURI + "'");
- if (Constants.PREFIX_SOAP11.equals(prefix) ||
Constants.PREFIX_SOAP12.equals(prefix))
- soapPrefix = prefix;
- }
- }
- buffer.append(">");
- }
-
- protected void appendTypes(StringBuilder buffer, String namespace)
- {
- WSDLTypes wsdlTypes = wsdl.getWsdlTypes();
- // If the type section is bound to a particular namespace, verify it mataches,
otherwise skip
- if (wsdlTypes.getNamespace() != null &&
!wsdlTypes.getNamespace().equals(namespace))
- return;
-
- if (wsdlTypes instanceof XSModelTypes)
- {
- buffer.append("<types>");
- JBossXSModel xsM = WSDLUtils.getSchemaModel(wsdlTypes);
- String schema = xsM.serialize();
- buffer.append(schema);
- buffer.append("</types>");
- }
- else if (wsdlTypes instanceof DOMTypes)
- {
- synchronized (wsdlTypes)
- {
- buffer.append(DOMWriter.printNode(((DOMTypes)wsdlTypes).getElement(),
true));
- }
- }
- }
-
- protected void appendInterfaces(StringBuilder buffer, String namespace)
- {
- }
-
- protected void appendBindings(StringBuilder buffer, String namespace)
- {
- }
-
- protected void appendServices(StringBuilder buffer, String namespace)
- {
- }
-
- /** Get a prefixed name of form prefix:localPart */
- protected String getQNameRef(QName qname)
- {
- String retStr = qname.getLocalPart();
-
- String prefix = qname.getPrefix();
- String nsURI = qname.getNamespaceURI();
- if (prefix.length() == 0 && nsURI.length() > 0)
- {
- qname = wsdl.registerQName(qname);
- prefix = qname.getPrefix();
- }
-
- if (prefix.length() > 0)
- retStr = prefix + ":" + retStr;
-
- return retStr;
- }
-
- public WSDLDefinitions getWsdl()
- {
- return wsdl;
- }
-
- public void setWsdl(WSDLDefinitions wsdl)
- {
- this.wsdl = wsdl;
- }
-
- public boolean isIncludeTypesInWSDL()
- {
- return includeSchemaInWSDL;
- }
-
- public void logException(Exception e)
- {
- if (log.isTraceEnabled())
- {
- log.trace(e);
- }
- }
-
- public void logMessage(String msg)
- {
- if (log.isTraceEnabled())
- {
- log.trace(msg);
- }
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLWriter.java (from rev 1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLWriter.java)
Deleted: trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLWriterResolver.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLWriterResolver.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLWriterResolver.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,43 +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.tools.wsdl;
-
-// $Id$
-
-import java.io.IOException;
-import java.io.Writer;
-
-/**
- * A helper that writes out a WSDL definition
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author Anil.Saldhana(a)jboss.org
- * @since 10-Oct-2004
- */
-public abstract class WSDLWriterResolver
-{
- public String actualFile;
- public String charset;
- public Writer writer;
-
- public abstract WSDLWriterResolver resolve(String suggestedFile) throws IOException;
-}
Copied: trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLWriterResolver.java (from rev
1598,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLWriterResolver.java)
Modified: trunk/src/main/resources/jbossws.beans/META-INF/jboss-beans.xml
===================================================================
--- trunk/src/main/resources/jbossws.beans/META-INF/jboss-beans.xml 2006-12-07 10:45:48
UTC (rev 1599)
+++ trunk/src/main/resources/jbossws.beans/META-INF/jboss-beans.xml 2006-12-07 10:43:36
UTC (rev 1600)
@@ -4,7 +4,7 @@
xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
xmlns="urn:jboss:bean-deployer:2.0">
- <bean name="ServiceEndpointManager"
class="org.jboss.ws.server.ServiceEndpointManager">
+ <bean name="ServiceEndpointManager"
class="org.jboss.ws.core.server.ServiceEndpointManager">
<!--
The WSDL, that is a required deployment artifact for an endpoint, has a
<soap:address>
@@ -20,7 +20,7 @@
<property name="webServicePort">8080</property>
<property name="alwaysModifySOAPAddress">true</property>
- <property
name="serviceEndpointInvokerJSE">org.jboss.ws.server.ServiceEndpointInvokerJSE</property>
+ <property
name="serviceEndpointInvokerJSE">org.jboss.ws.core.server.ServiceEndpointInvokerJSE</property>
<property
name="serviceEndpointInvokerEJB3">org.jboss.ws.integration.jboss50.ServiceEndpointInvokerEJB3</property>
<!-- Not implemented
<property
name="serviceEndpointInvokerEJB21">org.jboss.ws.integration.jboss50.ServiceEndpointInvokerEJB21</property>
@@ -28,7 +28,7 @@
-->
</bean>
- <bean name="ServiceEndpointDeployer"
class="org.jboss.ws.deployment.ServiceEndpointDeployer">
+ <bean name="ServiceEndpointDeployer"
class="org.jboss.ws.core.server.ServiceEndpointDeployer">
<property name="serviceEndpointManager">
<inject bean="ServiceEndpointManager"/>
</property>
@@ -43,11 +43,11 @@
<bean name="ServiceRefHandler"
class="org.jboss.ws.integration.jboss50.ServiceRefHandler"/>
<!-- A subscription manager for WS-Eventing -->
- <bean name="SubscriptionManager"
class="org.jboss.ws.eventing.mgmt.SubscriptionManager"/>
+ <bean name="SubscriptionManager"
class="org.jboss.ws.extensions.eventing.mgmt.SubscriptionManager"/>
<bean name="ServerConfig"
class="org.jboss.ws.integration.jboss50.ServerConfigImpl"/>
- <bean name="KernelLocator"
class="org.jboss.ws.server.KernelLocator">
+ <bean name="KernelLocator"
class="org.jboss.ws.core.server.KernelLocator">
<!--property name="kernel">
<inject bean="jboss.kernel:service=Kernel"/>
</property-->
Modified: trunk/src/main/resources/jbossws.sar/META-INF/jboss-service.xml
===================================================================
--- trunk/src/main/resources/jbossws.sar/META-INF/jboss-service.xml 2006-12-07 10:45:48
UTC (rev 1599)
+++ trunk/src/main/resources/jbossws.sar/META-INF/jboss-service.xml 2006-12-07 10:43:36
UTC (rev 1600)
@@ -3,47 +3,7 @@
<!-- $Id$ -->
<server>
-
- <!--
- A deployer service for WS clients.
- <mbean name="jboss.ws:service=WebServiceClientDeployer"
code="org.jboss.ws.integration.jboss.WebServiceClientDeployer">
- <depends>jboss:service=Naming</depends>
- </mbean>
- -->
-
- <!--
- A deployer service for JSE endpoints.
- <mbean name="jboss.ws:service=WebServiceDeployerJSE"
code="org.jboss.ws.integration.jboss.DeployerInterceptorJSE">
- <depends-list optional-attribute-name="Interceptables">
-
<depends-list-element>jboss.web:service=WebServer</depends-list-element>
- </depends-list>
- </mbean>
- -->
-
- <!--
- A deployer service for EJB2.1 endpoints.
- <mbean name="jboss.ws:service=DeployerInterceptorEJB21"
code="org.jboss.ws.integration.jboss.DeployerInterceptorEJB21">
- <depends-list optional-attribute-name="Interceptables">
-
<depends-list-element>jboss.ejb:service=EJBDeployer</depends-list-element>
- </depends-list>
- </mbean>
- -->
-
- <!--
- A deployer service for EJB3 endpoints.
- <mbean name="jboss.ws:service=DeployerInterceptorEJB3"
code="org.jboss.ws.integration.jboss.DeployerInterceptorEJB3">
- <depends-list optional-attribute-name="Interceptables">
-
<depends-list-element>jboss.ejb3:service=EJB3Deployer</depends-list-element>
- </depends-list>
- </mbean>
- -->
-
- <!--
- A deployer service for JSE endpoints that are nested in service archives (sar).
- <mbean name="jboss.ws:service=DeployerInterceptorNestedJSE"
code="org.jboss.ws.integration.jboss.DeployerInterceptorNestedJSE">
- <depends optional-attribute-name="MainDeployer"
proxy-type="attribute">jboss.system:service=MainDeployer</depends>
- <depends>jboss.ws:service=WebServiceDeployerJSE</depends>
- </mbean>
- -->
-
+
+ <!-- no mbeans, this is a pojo service -->
+
</server>
Modified: trunk/src/main/resources/jbossws.sar/META-INF/standard-jaxrpc-client-config.xml
===================================================================
---
trunk/src/main/resources/jbossws.sar/META-INF/standard-jaxrpc-client-config.xml 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/main/resources/jbossws.sar/META-INF/standard-jaxrpc-client-config.xml 2006-12-07
10:43:36 UTC (rev 1600)
@@ -15,7 +15,7 @@
<handler-chain-name>MTOM handler</handler-chain-name>
<handler>
<j2ee:handler-name>DisableMTOMHandler</j2ee:handler-name>
-
<j2ee:handler-class>org.jboss.ws.xop.DisableMTOMHandler</j2ee:handler-class>
+
<j2ee:handler-class>org.jboss.ws.extensions.xop.DisableMTOMHandler</j2ee:handler-class>
</handler>
</post-handler-chain>
</client-config>
@@ -26,7 +26,7 @@
<handler-chain-name>WSAddressing Handlers</handler-chain-name>
<handler>
<j2ee:handler-name>WSAddressingClientHandler</j2ee:handler-name>
-
<j2ee:handler-class>org.jboss.ws.addressing.jaxrpc.WSAddressingClientHandler</j2ee:handler-class>
+
<j2ee:handler-class>org.jboss.ws.extensions.addressing.jaxrpc.WSAddressingClientHandler</j2ee:handler-class>
</handler>
</post-handler-chain>
</client-config>
@@ -37,7 +37,7 @@
<handler-chain-name>WSSecurity Handlers</handler-chain-name>
<handler>
<j2ee:handler-name>WSSecurityHandlerOutbound</j2ee:handler-name>
-
<j2ee:handler-class>org.jboss.ws.wsse.jaxrpc.WSSecurityHandlerOutbound</j2ee:handler-class>
+
<j2ee:handler-class>org.jboss.ws.extensions.security.jaxrpc.WSSecurityHandlerOutbound</j2ee:handler-class>
</handler>
</post-handler-chain>
</client-config>
Modified:
trunk/src/main/resources/jbossws.sar/META-INF/standard-jaxrpc-endpoint-config.xml
===================================================================
---
trunk/src/main/resources/jbossws.sar/META-INF/standard-jaxrpc-endpoint-config.xml 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/main/resources/jbossws.sar/META-INF/standard-jaxrpc-endpoint-config.xml 2006-12-07
10:43:36 UTC (rev 1600)
@@ -15,7 +15,7 @@
<handler-chain-name>MTOM handlers</handler-chain-name>
<handler>
<j2ee:handler-name>DisableMTOMHandler</j2ee:handler-name>
-
<j2ee:handler-class>org.jboss.ws.xop.DisableMTOMHandler</j2ee:handler-class>
+
<j2ee:handler-class>org.jboss.ws.extensions.xop.DisableMTOMHandler</j2ee:handler-class>
</handler>
</pre-handler-chain>
</endpoint-config>
@@ -26,7 +26,7 @@
<handler-chain-name>WSAddressing Handlers</handler-chain-name>
<handler>
<j2ee:handler-name>WSAddressing Handler</j2ee:handler-name>
-
<j2ee:handler-class>org.jboss.ws.addressing.jaxrpc.WSAddressingServerHandler</j2ee:handler-class>
+
<j2ee:handler-class>org.jboss.ws.extensions.addressing.jaxrpc.WSAddressingServerHandler</j2ee:handler-class>
</handler>
</pre-handler-chain>
</endpoint-config>
@@ -37,7 +37,7 @@
<handler-chain-name>WSSecurity Handlers</handler-chain-name>
<handler>
<j2ee:handler-name>WSSecurityHandlerInbound</j2ee:handler-name>
-
<j2ee:handler-class>org.jboss.ws.wsse.jaxrpc.WSSecurityHandlerInbound</j2ee:handler-class>
+
<j2ee:handler-class>org.jboss.ws.extensions.security.jaxrpc.WSSecurityHandlerInbound</j2ee:handler-class>
</handler>
</pre-handler-chain>
</endpoint-config>
Modified: trunk/src/main/resources/jbossws.sar/META-INF/standard-jaxws-client-config.xml
===================================================================
---
trunk/src/main/resources/jbossws.sar/META-INF/standard-jaxws-client-config.xml 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/main/resources/jbossws.sar/META-INF/standard-jaxws-client-config.xml 2006-12-07
10:43:36 UTC (rev 1600)
@@ -16,7 +16,7 @@
<javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
<javaee:handler>
<javaee:handler-name>WSAddressing Handler</javaee:handler-name>
-
<javaee:handler-class>org.jboss.ws.addressing.jaxws.WSAddressingClientHandler</javaee:handler-class>
+
<javaee:handler-class>org.jboss.ws.extensions.addressing.jaxws.WSAddressingClientHandler</javaee:handler-class>
</javaee:handler>
</javaee:handler-chain>
</post-handler-chains>
@@ -29,7 +29,7 @@
<javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
<javaee:handler>
<javaee:handler-name>WSSecurityHandlerOutbound</javaee:handler-name>
-
<javaee:handler-class>org.jboss.ws.wsse.jaxws.WSSecurityHandlerOutbound</javaee:handler-class>
+
<javaee:handler-class>org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerOutbound</javaee:handler-class>
</javaee:handler>
</javaee:handler-chain>
</post-handler-chains>
Modified:
trunk/src/main/resources/jbossws.sar/META-INF/standard-jaxws-endpoint-config.xml
===================================================================
---
trunk/src/main/resources/jbossws.sar/META-INF/standard-jaxws-endpoint-config.xml 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/main/resources/jbossws.sar/META-INF/standard-jaxws-endpoint-config.xml 2006-12-07
10:43:36 UTC (rev 1600)
@@ -16,7 +16,7 @@
<javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
<javaee:handler>
<javaee:handler-name>WSAddressing Handler</javaee:handler-name>
-
<javaee:handler-class>org.jboss.ws.addressing.jaxws.WSAddressingServerHandler</javaee:handler-class>
+
<javaee:handler-class>org.jboss.ws.extensions.addressing.jaxws.WSAddressingServerHandler</javaee:handler-class>
</javaee:handler>
</javaee:handler-chain>
</pre-handler-chains>
@@ -29,7 +29,7 @@
<javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
<javaee:handler>
<javaee:handler-name>WSSecurity Handler</javaee:handler-name>
-
<javaee:handler-class>org.jboss.ws.wsse.jaxws.WSSecurityHandlerInbound</javaee:handler-class>
+
<javaee:handler-class>org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerInbound</javaee:handler-class>
</javaee:handler>
</javaee:handler-chain>
</pre-handler-chains>
Modified: trunk/src/main/resources/jbossws.war/Tomcat/META-INF/jboss-beans.xml
===================================================================
--- trunk/src/main/resources/jbossws.war/Tomcat/META-INF/jboss-beans.xml 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/main/resources/jbossws.war/Tomcat/META-INF/jboss-beans.xml 2006-12-07
10:43:36 UTC (rev 1600)
@@ -4,7 +4,7 @@
xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd"
xmlns="urn:jboss:bean-deployer">
- <bean name="ServiceEndpointManager"
class="org.jboss.ws.server.ServiceEndpointManager">
+ <bean name="ServiceEndpointManager"
class="org.jboss.ws.core.server.ServiceEndpointManager">
<!--
The WSDL, that is a required deployment artifact for an endpoint, has a
<soap:address>
element which points to the location of the endpoint. JBossWS supports rewriting of
that SOAP address.
@@ -16,10 +16,10 @@
<property name="webServiceHost">localhost</property>
<property name="webServiceSecurePort">8443</property>
<property name="webServicePort">8080</property>
- <property
name="serviceEndpointInvokerJSE">org.jboss.ws.server.ServiceEndpointInvokerJSE</property>
+ <property
name="serviceEndpointInvokerJSE">org.jboss.ws.core.server.ServiceEndpointInvokerJSE</property>
</bean>
- <bean name="ServiceEndpointDeployer"
class="org.jboss.ws.deployment.ServiceEndpointDeployer">
+ <bean name="ServiceEndpointDeployer"
class="org.jboss.ws.core.server.ServiceEndpointDeployer">
<property name="serviceEndpointManager"><inject
bean="ServiceEndpointManager"/></property>
</bean>
@@ -33,10 +33,10 @@
<!--
A subscription manager for WS-Eventing
-->
- <bean name="SubscriptionManager"
class="org.jboss.ws.eventing.mgmt.SubscriptionManager"/>
+ <bean name="SubscriptionManager"
class="org.jboss.ws.extensions.eventing.mgmt.SubscriptionManager"/>
<bean name="ServerConfig"
class="org.jboss.ws.integration.tomcat.ServerConfigImpl"/>
- <bean name="KernelLocator"
class="org.jboss.ws.server.KernelLocator"/>
+ <bean name="KernelLocator"
class="org.jboss.ws.core.server.KernelLocator"/>
</deployment>
Modified: trunk/src/test/build.xml
===================================================================
--- trunk/src/test/build.xml 2006-12-07 10:45:48 UTC (rev 1599)
+++ trunk/src/test/build.xml 2006-12-07 10:43:36 UTC (rev 1600)
@@ -163,6 +163,9 @@
<pathelement location="${jboss.client}/jboss-logging-spi.jar"/>
<pathelement location="${jboss.client}/jboss-logging-log4j.jar"/>
<pathelement location="${jboss.client}/${jbossws.client.jar}"/>
+ <pathelement location="${jboss.client}/jboss-jaxrpc.jar"/>
+ <pathelement location="${jboss.client}/jboss-jaxws.jar"/>
+ <pathelement location="${jboss.client}/jboss-saaj.jar"/>
<pathelement location="${jboss.client}/log4j.jar"/>
<pathelement location="${jboss.client}/mail.jar"/>
<pathelement location="${jboss.server.lib}/jbosssx.jar"/>
Modified: trunk/src/test/java/org/jboss/test/ws/JBossWSTest.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/JBossWSTest.java 2006-12-07 10:45:48 UTC (rev
1599)
+++ trunk/src/test/java/org/jboss/test/ws/JBossWSTest.java 2006-12-07 10:43:36 UTC (rev
1600)
@@ -34,7 +34,7 @@
import junit.framework.TestCase;
import org.jboss.logging.Logger;
-import org.jboss.ws.utils.DOMWriter;
+import org.jboss.ws.core.utils.DOMWriter;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
Modified: trunk/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -36,20 +36,20 @@
import org.jboss.test.ws.JBossWSTest;
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.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.soap.MessageContextAssociation;
-import org.jboss.ws.soap.MessageFactoryImpl;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.EndpointInvocation;
+import org.jboss.ws.core.jaxrpc.CallImpl;
+import org.jboss.ws.core.jaxrpc.binding.CommonBinding;
+import org.jboss.ws.core.jaxrpc.binding.CommonBindingProvider;
+import org.jboss.ws.core.jaxrpc.binding.CommonSOAPBinding;
+import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.core.soap.MessageFactoryImpl;
+import org.jboss.ws.core.soap.UnboundHeader;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
/**
* Test the SOAPBindingProvider
Modified: trunk/src/test/java/org/jboss/test/ws/common/config/WSConfigTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/common/config/WSConfigTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/common/config/WSConfigTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -71,6 +71,6 @@
assertEquals(1, preChain.getHandlers().size());
UnifiedHandlerMetaData h1 = (UnifiedHandlerMetaData)preChain.getHandlers().get(0);
assertEquals("WSSecurityHandlerInbound", h1.getHandlerName());
- assertEquals("org.jboss.ws.wsse.jaxrpc.WSSecurityHandlerInbound",
h1.getHandlerClass());
+
assertEquals("org.jboss.ws.extensions.security.jaxrpc.WSSecurityHandlerInbound",
h1.getHandlerClass());
}
}
Modified:
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/SerializerDeserializerTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/SerializerDeserializerTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/SerializerDeserializerTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -32,14 +32,14 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.Constants;
-import org.jboss.ws.binding.DeserializerSupport;
-import org.jboss.ws.binding.SerializationContext;
-import org.jboss.ws.binding.SerializerSupport;
-import org.jboss.ws.jaxrpc.SerializationContextJAXRPC;
-import org.jboss.ws.jaxrpc.TypeMappingImpl;
-import org.jboss.ws.jaxrpc.TypeMappingRegistryImpl;
-import org.jboss.ws.jaxrpc.encoding.DeserializerFactoryBase;
-import org.jboss.ws.jaxrpc.encoding.SerializerFactoryBase;
+import org.jboss.ws.core.jaxrpc.SerializationContextJAXRPC;
+import org.jboss.ws.core.jaxrpc.TypeMappingImpl;
+import org.jboss.ws.core.jaxrpc.TypeMappingRegistryImpl;
+import org.jboss.ws.core.jaxrpc.binding.DeserializerFactoryBase;
+import org.jboss.ws.core.jaxrpc.binding.DeserializerSupport;
+import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
+import org.jboss.ws.core.jaxrpc.binding.SerializerFactoryBase;
+import org.jboss.ws.core.jaxrpc.binding.SerializerSupport;
import org.jboss.xb.binding.NamespaceRegistry;
/**
Modified:
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/BigDecimalArrayMarshallerTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/BigDecimalArrayMarshallerTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/BigDecimalArrayMarshallerTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -28,10 +28,10 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.test.ws.tools.WSToolsTest;
-import org.jboss.ws.jbossxb.JBossXBConstants;
-import org.jboss.ws.jbossxb.JBossXBMarshallerImpl;
+import org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBConstants;
+import org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBMarshallerImpl;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.utils.DOMUtils;
/**
* Test the JAXB marshalling of array types
Modified:
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/BigDecimalArrayUnmarshallerTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/BigDecimalArrayUnmarshallerTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/BigDecimalArrayUnmarshallerTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -28,10 +28,10 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.test.ws.tools.WSToolsTest;
-import org.jboss.ws.jbossxb.JBossXBConstants;
-import org.jboss.ws.jbossxb.JBossXBUnmarshallerImpl;
+import org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBConstants;
+import org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBUnmarshallerImpl;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.utils.DOMUtils;
/**
* Test the JAXB marshalling of array types
Modified:
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/CalendarArrayMarshallerTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/CalendarArrayMarshallerTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/CalendarArrayMarshallerTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -30,10 +30,10 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.test.ws.tools.WSToolsTest;
-import org.jboss.ws.jbossxb.JBossXBConstants;
-import org.jboss.ws.jbossxb.JBossXBMarshallerImpl;
+import org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBConstants;
+import org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBMarshallerImpl;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.utils.DOMUtils;
/**
* Test the JAXB marshalling of array types
Modified:
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/CalendarArrayUnmarshallerTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/CalendarArrayUnmarshallerTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/CalendarArrayUnmarshallerTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -30,10 +30,10 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.test.ws.tools.WSToolsTest;
-import org.jboss.ws.jbossxb.JBossXBConstants;
-import org.jboss.ws.jbossxb.JBossXBUnmarshallerImpl;
+import org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBConstants;
+import org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBUnmarshallerImpl;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.utils.DOMUtils;
/**
* Test the JAXB marshalling of array types
Modified:
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/QNameArrayMarshallerTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/QNameArrayMarshallerTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/QNameArrayMarshallerTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -27,10 +27,10 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.test.ws.tools.WSToolsTest;
-import org.jboss.ws.jbossxb.JBossXBConstants;
-import org.jboss.ws.jbossxb.JBossXBMarshallerImpl;
+import org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBConstants;
+import org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBMarshallerImpl;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.utils.DOMUtils;
/**
* Test the JAXB marshalling of array types
Modified:
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/QNameArrayUnmarshallerTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/QNameArrayUnmarshallerTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/QNameArrayUnmarshallerTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -27,10 +27,10 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.test.ws.tools.WSToolsTest;
-import org.jboss.ws.jbossxb.JBossXBConstants;
-import org.jboss.ws.jbossxb.JBossXBUnmarshallerImpl;
+import org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBConstants;
+import org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBUnmarshallerImpl;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.utils.DOMUtils;
/**
* Test the JAXB marshalling of array types
Modified:
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/complex/ComplexTypeMarshallerTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/complex/ComplexTypeMarshallerTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/complex/ComplexTypeMarshallerTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -30,11 +30,11 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.test.ws.tools.WSToolsTest;
-import org.jboss.ws.jbossxb.JBossXBConstants;
-import org.jboss.ws.jbossxb.JBossXBMarshallerImpl;
+import org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBConstants;
+import org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBMarshallerImpl;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
-import org.jboss.ws.utils.DOMUtils;
/**
* Test the JAXB marshalling of complex types
Modified:
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/complex/ComplexTypeUnmarshallerTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/complex/ComplexTypeUnmarshallerTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/complex/ComplexTypeUnmarshallerTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -30,8 +30,8 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.test.ws.tools.WSToolsTest;
-import org.jboss.ws.jbossxb.JBossXBConstants;
-import org.jboss.ws.jbossxb.JBossXBUnmarshallerImpl;
+import org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBConstants;
+import org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBUnmarshallerImpl;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
import org.jboss.ws.tools.JavaToXSD;
Modified:
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/docstyle/DocumentStyleMarshallerTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/docstyle/DocumentStyleMarshallerTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/docstyle/DocumentStyleMarshallerTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -30,11 +30,11 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.test.ws.tools.WSToolsTest;
-import org.jboss.ws.jbossxb.JBossXBConstants;
-import org.jboss.ws.jbossxb.JBossXBMarshallerImpl;
+import org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBConstants;
+import org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBMarshallerImpl;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
-import org.jboss.ws.utils.DOMUtils;
/**
* Test the JAXB marshalling of complex types
Modified:
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/docstyle/DocumentStyleUnmarshallerTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/docstyle/DocumentStyleUnmarshallerTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/docstyle/DocumentStyleUnmarshallerTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -29,8 +29,8 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.test.ws.tools.WSToolsTest;
-import org.jboss.ws.jbossxb.JBossXBConstants;
-import org.jboss.ws.jbossxb.JBossXBUnmarshallerImpl;
+import org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBConstants;
+import org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBUnmarshallerImpl;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
Modified:
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeMarshallerTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeMarshallerTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeMarshallerTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -27,11 +27,11 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.test.ws.tools.WSToolsTest;
-import org.jboss.ws.jbossxb.JBossXBConstants;
-import org.jboss.ws.jbossxb.JBossXBMarshallerImpl;
+import org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBConstants;
+import org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBMarshallerImpl;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.jaxrpcmapping.PackageMapping;
-import org.jboss.ws.utils.DOMUtils;
/**
* Test the JAXB marshalling of a SimpleUserType
Modified:
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeUnmarshallerTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeUnmarshallerTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeUnmarshallerTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -27,11 +27,11 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.test.ws.tools.WSToolsTest;
-import org.jboss.ws.jbossxb.JBossXBConstants;
-import org.jboss.ws.jbossxb.JBossXBUnmarshallerImpl;
+import org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBConstants;
+import org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBUnmarshallerImpl;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.jaxrpcmapping.PackageMapping;
-import org.jboss.ws.utils.DOMUtils;
/**
* Test the JAXB unmarshalling of a SimpleUserType
Modified: trunk/src/test/java/org/jboss/test/ws/common/soap/MessageFactoryTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/common/soap/MessageFactoryTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/common/soap/MessageFactoryTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -31,8 +31,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.Constants;
-import org.jboss.ws.soap.MessageFactoryImpl;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.soap.MessageFactoryImpl;
+import org.jboss.ws.core.utils.DOMUtils;
import org.w3c.dom.Element;
/**
Modified: trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPConnectionTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPConnectionTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPConnectionTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -38,7 +38,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.soap.SOAPBodyElementRpc;
+import org.jboss.ws.core.soap.SOAPBodyElementRpc;
/** Test call on a SOAPConnection
*
Modified:
trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPContentElementTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPContentElementTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPContentElementTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -33,8 +33,8 @@
import javax.xml.soap.Text;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.soap.NameImpl;
-import org.jboss.ws.soap.SOAPContentElement;
+import org.jboss.ws.core.soap.NameImpl;
+import org.jboss.ws.core.soap.SOAPContentElement;
/**
* Test the SOAPContentElement
Modified: trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPEnvelopeTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPEnvelopeTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPEnvelopeTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -32,8 +32,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.Constants;
-import org.jboss.ws.soap.MessageFactoryImpl;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.soap.MessageFactoryImpl;
+import org.jboss.ws.core.utils.DOMUtils;
import org.w3c.dom.Element;
/**
Modified: trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPFactoryTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPFactoryTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPFactoryTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -39,7 +39,7 @@
public void testSOAPFactoryCreation() throws Exception
{
SOAPFactory factory = SOAPFactory.newInstance();
- assertEquals(org.jboss.ws.soap.SOAPFactoryImpl.class, factory.getClass());
+ assertEquals(org.jboss.ws.core.soap.SOAPFactoryImpl.class, factory.getClass());
}
public void testCreateDetail() throws Exception
Modified: trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPFaultTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPFaultTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPFaultTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -37,8 +37,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.Constants;
-import org.jboss.ws.jaxrpc.SOAPFaultHelperJAXRPC;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.jaxrpc.SOAPFaultHelperJAXRPC;
+import org.jboss.ws.core.utils.DOMUtils;
/**
* Test the SOAPFault
Modified:
trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPHeaderElementTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPHeaderElementTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPHeaderElementTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -32,9 +32,9 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.soap.MessageFactoryImpl;
-import org.jboss.ws.soap.NameImpl;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.soap.MessageFactoryImpl;
+import org.jboss.ws.core.soap.NameImpl;
+import org.jboss.ws.core.utils.DOMUtils;
/**
* Test the SOAPHeaderElement
Modified: trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPHeaderTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPHeaderTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPHeaderTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -34,9 +34,9 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.Constants;
-import org.jboss.ws.soap.MessageFactoryImpl;
-import org.jboss.ws.soap.NameImpl;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.soap.MessageFactoryImpl;
+import org.jboss.ws.core.soap.NameImpl;
+import org.jboss.ws.core.utils.DOMUtils;
/**
* Test the SOAPHeader
Modified:
trunk/src/test/java/org/jboss/test/ws/common/soap/attachment/GenericAttachmentTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/common/soap/attachment/GenericAttachmentTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/common/soap/attachment/GenericAttachmentTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -41,17 +41,17 @@
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.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.soap.MessageContextAssociation;
-import org.jboss.ws.soap.MessageFactoryImpl;
-import org.jboss.ws.soap.attachment.MimeConstants;
+import org.jboss.ws.core.EndpointInvocation;
+import org.jboss.ws.core.jaxrpc.CallImpl;
+import org.jboss.ws.core.jaxrpc.binding.CommonBinding;
+import org.jboss.ws.core.jaxrpc.binding.CommonBindingProvider;
+import org.jboss.ws.core.jaxrpc.binding.CommonSOAPBinding;
+import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.core.soap.MessageFactoryImpl;
+import org.jboss.ws.core.soap.attachment.MimeConstants;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
/**
* TODO
Modified: trunk/src/test/java/org/jboss/test/ws/common/utils/DOMWriterTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/common/utils/DOMWriterTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/common/utils/DOMWriterTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -29,8 +29,8 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified: trunk/src/test/java/org/jboss/test/ws/common/utils/JavaUtilsTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/common/utils/JavaUtilsTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/common/utils/JavaUtilsTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -23,7 +23,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.tools.jbws_161.custom.HelloObj;
-import org.jboss.ws.utils.JavaUtils;
+import org.jboss.ws.core.utils.JavaUtils;
/**
* Test the JavaUtils
Modified:
trunk/src/test/java/org/jboss/test/ws/common/wsdl11/MicrosoftGeneratedWSDLTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/common/wsdl11/MicrosoftGeneratedWSDLTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/common/wsdl11/MicrosoftGeneratedWSDLTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -25,9 +25,9 @@
import org.jboss.test.ws.JBossWSTest;
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.tools.wsdl.WSDLDefinitionsFactory;
/**
* Tests WSDL11Reader ability to parse WSDL Files
Modified: trunk/src/test/java/org/jboss/test/ws/common/wsdl11/MultiSchemaTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/common/wsdl11/MultiSchemaTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/common/wsdl11/MultiSchemaTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -25,9 +25,9 @@
import org.jboss.test.ws.JBossWSTest;
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.tools.wsdl.WSDLDefinitionsFactory;
/**
* Test the XSModel, and how it handles multiple schemas
Modified:
trunk/src/test/java/org/jboss/test/ws/common/wsdl11/SimpleFileImportTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/common/wsdl11/SimpleFileImportTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/common/wsdl11/SimpleFileImportTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -31,7 +31,7 @@
import org.jboss.net.protocol.URLStreamHandlerFactory;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.metadata.wsdl.WSDL11DefinitionFactory;
+import org.jboss.ws.tools.wsdl.WSDL11DefinitionFactory;
/**
* Test a wsdl import functionality.
Modified: trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDL11TestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDL11TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDL11TestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -27,10 +27,9 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.Constants;
-import org.jboss.ws.eventing.EventingConstants;
+import org.jboss.ws.extensions.eventing.EventingConstants;
import org.jboss.ws.metadata.wsdl.NCName;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
import org.jboss.ws.metadata.wsdl.WSDLInterface;
import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperation;
@@ -40,6 +39,7 @@
import org.jboss.ws.metadata.wsdl.WSDLService;
import org.jboss.ws.metadata.wsdl.WSDLTypes;
import org.jboss.ws.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Test the unmarshalling of wsdl-1.1 into the unified wsdl structure
Modified: trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLTypesTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLTypesTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLTypesTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -26,9 +26,9 @@
import org.apache.xerces.xs.XSTypeDefinition;
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.metadata.wsdl.WSDLUtils;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* The WSDL may contain or import XSD schema definitions.
Modified:
trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLWithAnonTypesTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLWithAnonTypesTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLWithAnonTypesTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -32,10 +32,10 @@
import org.apache.xerces.xs.XSTerm;
import org.apache.xerces.xs.XSTypeDefinition;
import org.jboss.test.ws.tools.WSToolsTest;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLUtils;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
-import org.jboss.ws.utils.DOMUtils;
import org.w3c.dom.Element;
/**
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/encoded/marshalltest/JavaBean.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/encoded/marshalltest/JavaBean.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/encoded/marshalltest/JavaBean.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -10,7 +10,7 @@
import java.util.Arrays;
import java.util.Calendar;
-import org.jboss.ws.utils.JavaUtils;
+import org.jboss.ws.core.utils.JavaUtils;
public class JavaBean
{
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxrpc/encoded/marshalltest/ValueType.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/encoded/marshalltest/ValueType.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/encoded/marshalltest/ValueType.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -10,7 +10,7 @@
import java.util.Arrays;
import java.util.Calendar;
-import org.jboss.ws.utils.JavaUtils;
+import org.jboss.ws.core.utils.JavaUtils;
public class ValueType
{
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1068/JBWS1068TestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1068/JBWS1068TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1068/JBWS1068TestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -25,7 +25,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Cannot handle xsd:import of xml schema
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1093/JBWS1093TestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1093/JBWS1093TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1093/JBWS1093TestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -35,7 +35,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
* Test case to test that when a deployment contains both an endpoint and a
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1107/JBWS1107TestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1107/JBWS1107TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1107/JBWS1107TestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -32,7 +32,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
* Test case to test that an endpoint can be accessed if there is whitespace
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1124/JBWS1124TestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1124/JBWS1124TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1124/JBWS1124TestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -31,7 +31,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
* Scoped class loading domains for WS endpoints
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1179/TestEndpointImpl.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1179/TestEndpointImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1179/TestEndpointImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -25,9 +25,9 @@
import javax.servlet.http.HttpSession;
-import org.jboss.ws.common.CommonMessageContext;
-import org.jboss.ws.jaxrpc.handler.MessageContextJAXRPC;
-import org.jboss.ws.soap.MessageContextAssociation;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.jaxrpc.handler.MessageContextJAXRPC;
+import org.jboss.ws.core.soap.MessageContextAssociation;
/**
*
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1186/JBWS1186TestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1186/JBWS1186TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1186/JBWS1186TestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -37,7 +37,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
* The prefix "xsi" for attribute "xsi:nil" is not bound
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1186/ServerHandler.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1186/ServerHandler.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1186/ServerHandler.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -36,7 +36,7 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.logging.Logger;
-import org.jboss.ws.soap.SOAPContentElement;
+import org.jboss.ws.core.soap.SOAPContentElement;
public class ServerHandler extends GenericHandler
{
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1190/TestEndpointImpl.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1190/TestEndpointImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1190/TestEndpointImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -25,12 +25,12 @@
import java.io.FilenameFilter;
import java.net.MalformedURLException;
+import org.jboss.ws.core.server.ServerConfig;
+import org.jboss.ws.core.server.ServerConfigFactory;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
import org.jboss.ws.metadata.wsdl.WSDLService;
-import org.jboss.ws.server.ServerConfig;
-import org.jboss.ws.server.ServerConfigFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
*
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1205/TestEndpointImpl.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1205/TestEndpointImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1205/TestEndpointImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -28,8 +28,8 @@
import javax.naming.InitialContext;
import javax.xml.rpc.Service;
-import org.jboss.ws.server.ServerConfig;
-import org.jboss.ws.server.ServerConfigFactory;
+import org.jboss.ws.core.server.ServerConfig;
+import org.jboss.ws.core.server.ServerConfigFactory;
/**
* @author darran.lofthouse(a)jboss.com
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws434/JBWS434TestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws434/JBWS434TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws434/JBWS434TestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -34,7 +34,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMUtils;
import org.w3c.dom.Attr;
import org.w3c.dom.NamedNodeMap;
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws775/JBWS775TestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws775/JBWS775TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws775/JBWS775TestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -35,7 +35,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.utils.DOMWriter;
+import org.jboss.ws.core.utils.DOMWriter;
/**
* Web services deployment can fail when deploying multiple EJB JARs
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws812/JBWS812TestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws812/JBWS812TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws812/JBWS812TestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -41,8 +41,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
import org.w3c.dom.Element;
/**
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws812/ServerHandler.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws812/ServerHandler.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws812/ServerHandler.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -30,7 +30,7 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.logging.Logger;
-import org.jboss.ws.utils.DOMWriter;
+import org.jboss.ws.core.utils.DOMWriter;
public class ServerHandler extends GenericHandler
{
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws950/JBWS950TestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws950/JBWS950TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws950/JBWS950TestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -32,7 +32,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
* Attributes of type xsd:QName incorrectly serialized
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws955/JBWS955TestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws955/JBWS955TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws955/JBWS955TestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -32,8 +32,8 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
import org.w3c.dom.Element;
/**
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws956/JBWS956TestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws956/JBWS956TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws956/JBWS956TestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -32,7 +32,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
* Deserialization of complex bean containing an array of complex beans
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws958/JBWS958TestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws958/JBWS958TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws958/JBWS958TestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -26,7 +26,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* XML entity usage in wsdl contained schema
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxrpc/marshall/MarshallRpcLitDIITestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/marshall/MarshallRpcLitDIITestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/marshall/MarshallRpcLitDIITestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -35,7 +35,7 @@
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.test.ws.jaxrpc.marshall.types.JavaBean;
import org.jboss.ws.Constants;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
* Test the Dynamic Invocation Interface (DII) on the Call
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/marshall/MarshallTest.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/marshall/MarshallTest.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/marshall/MarshallTest.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -32,7 +32,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.jaxrpc.marshall.types.JavaBean;
import org.jboss.test.ws.jaxrpc.marshall.types.JavaBean2;
-import org.jboss.ws.utils.JavaUtils;
+import org.jboss.ws.core.utils.JavaUtils;
/**
* Test standard JAX-RPC types.
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/docstyle/bare/TrivialServiceDocBareTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/docstyle/bare/TrivialServiceDocBareTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/docstyle/bare/TrivialServiceDocBareTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -33,7 +33,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
* Test JSE test case for an document/literal/bare style service.
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/docstyle/wrapped/TrivialServiceDocWrappedTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/docstyle/wrapped/TrivialServiceDocWrappedTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/docstyle/wrapped/TrivialServiceDocWrappedTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -33,7 +33,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
* Test JSE test case for an document/literal/wrapped style service.
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/dynamichandler/DynamicHandlerTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/dynamichandler/DynamicHandlerTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/dynamichandler/DynamicHandlerTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -35,9 +35,9 @@
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.utils.ObjectNameFactory;
+import org.jboss.ws.core.jaxrpc.ServiceExt;
+import org.jboss.ws.core.utils.ObjectNameFactory;
+import org.jboss.ws.metadata.umdm.HandlerMetaData;
/**
* Test dynamic handlers
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/exception/ExceptionTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/exception/ExceptionTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/exception/ExceptionTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -48,7 +48,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
* Test user exception propagation.
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderClientTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderClientTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderClientTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -36,8 +36,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.Constants;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.jaxrpc.StubExt;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.StubExt;
/**
* Test bound and unbound headers
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderDIITestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderDIITestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderDIITestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -35,7 +35,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.Constants;
-import org.jboss.ws.jaxrpc.CallImpl;
+import org.jboss.ws.core.jaxrpc.CallImpl;
/**
* Test the Dynamic Invocation Interface (DII) on the Call
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderProxyTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderProxyTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderProxyTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -33,9 +33,9 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.Constants;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.jaxrpc.ServiceImpl;
-import org.jboss.ws.jaxrpc.StubExt;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceImpl;
+import org.jboss.ws.core.jaxrpc.StubExt;
/**
* Test bound and unbound headers
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/holder/HolderTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/holder/HolderTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/holder/HolderTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -56,7 +56,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
* Test Holders
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jmstransport/JMSTransportTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jmstransport/JMSTransportTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jmstransport/JMSTransportTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -26,7 +26,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMUtils;
/**
* A web service client that connects to a MDB endpoint.
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109ejb/RpcDIIConfiguredCallTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109ejb/RpcDIIConfiguredCallTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109ejb/RpcDIIConfiguredCallTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -33,8 +33,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.jaxrpc.ServiceImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceImpl;
/**
* Test the Dynamic Invocation Interface (DII) on a Call that is preconfigured from WSDL
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109ejb/RpcDIIUnconfiguredCallTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109ejb/RpcDIIUnconfiguredCallTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109ejb/RpcDIIUnconfiguredCallTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -34,7 +34,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.Constants;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
* Test the Dynamic Invocation Interface (DII) on the Call
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109ejb/RpcProxyTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109ejb/RpcProxyTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109ejb/RpcProxyTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -30,8 +30,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.jaxrpc.ServiceImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceImpl;
/**
* Test the DynamicProxy Call
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/DocJSETestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/DocJSETestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/DocJSETestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -33,7 +33,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
* Test JSE endpoint for a document style service.
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcDIIConfiguredCallTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcDIIConfiguredCallTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcDIIConfiguredCallTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -33,8 +33,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.jaxrpc.ServiceImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceImpl;
/**
* Test the Dynamic Invocation Interface (DII) on a Call that is preconfigured from WSDL
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcDIIUnconfiguredCallTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcDIIUnconfiguredCallTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcDIIUnconfiguredCallTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -34,7 +34,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.Constants;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
* Test the Dynamic Invocation Interface (DII) on the Call
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcJSETestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcJSETestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcJSETestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -33,7 +33,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
* Test JSE test case for an rpc style service.
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcProxyTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcProxyTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcProxyTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -30,8 +30,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.jaxrpc.ServiceImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceImpl;
/**
* Test the DynamicProxy Call
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/message/MessageTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/message/MessageTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/message/MessageTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -50,8 +50,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.utils.DOMUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/message/MessageTestServiceBean.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/message/MessageTestServiceBean.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/message/MessageTestServiceBean.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -36,7 +36,7 @@
import javax.xml.transform.dom.DOMSource;
import org.jboss.logging.Logger;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/EmployeeRecordsImpl.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/EmployeeRecordsImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/EmployeeRecordsImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -33,7 +33,7 @@
import javax.xml.transform.stream.StreamSource;
import org.jboss.ws.WSException;
-import org.jboss.ws.utils.IOUtils;
+import org.jboss.ws.core.utils.IOUtils;
/**
* EmployeeRecords service endpoint
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/MTOMTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/MTOMTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/MTOMTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -38,8 +38,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.jaxrpc.StubExt;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.StubExt;
/**
* Test SOAP with XOP through the JAXRPC dynamic proxy layer.
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/oneway/OneWayTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/oneway/OneWayTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/oneway/OneWayTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -33,7 +33,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
* Test JSE test case for onway operations.
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/rpcstyle/TrivialServiceRpcTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/rpcstyle/TrivialServiceRpcTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/rpcstyle/TrivialServiceRpcTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -33,7 +33,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
* Test JSE test case for an rpc style service.
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/swa/AttachmentProxyTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/swa/AttachmentProxyTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/swa/AttachmentProxyTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -40,7 +40,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
* Test SOAP with Attachements (SwA) through the JAXRPC dynamic proxy layer.
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/swa/AttachmentSAAJTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/swa/AttachmentSAAJTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/swa/AttachmentSAAJTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -49,7 +49,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.soap.SOAPBodyElementRpc;
+import org.jboss.ws.core.soap.SOAPBodyElementRpc;
/**
* Test SOAP with Attachements (SwA) through the SAAJ layer.
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wseventing/SysmonTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wseventing/SysmonTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wseventing/SysmonTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -42,21 +42,21 @@
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.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.jaxrpc.ServiceImpl;
-import org.jboss.ws.jaxrpc.StubExt;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceImpl;
+import org.jboss.ws.core.jaxrpc.StubExt;
+import org.jboss.ws.extensions.addressing.AddressingClientUtil;
+import org.jboss.ws.extensions.addressing.jaxrpc.WSAddressingClientHandler;
+import org.jboss.ws.extensions.eventing.EventSourceEndpoint;
+import org.jboss.ws.extensions.eventing.EventingConstants;
+import org.jboss.ws.extensions.eventing.SubscriptionManagerEndpoint;
+import org.jboss.ws.extensions.eventing.element.DeliveryType;
+import org.jboss.ws.extensions.eventing.element.EndpointReference;
+import org.jboss.ws.extensions.eventing.element.FilterType;
+import org.jboss.ws.extensions.eventing.element.StatusRequest;
+import org.jboss.ws.extensions.eventing.element.SubscribeRequest;
+import org.jboss.ws.extensions.eventing.element.SubscribeResponse;
+import org.jboss.ws.extensions.eventing.element.UnsubscribeRequest;
/**
* Test the eventing example service.
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wseventing/SysmonUtil.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wseventing/SysmonUtil.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wseventing/SysmonUtil.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -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.extensions.addressing.AddressingClientUtil;
+import org.jboss.ws.extensions.eventing.element.EndpointReference;
+import org.jboss.ws.extensions.eventing.element.SubscribeResponse;
/**
* Util methods that drive the SysmoneTestCase.
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/SimpleEncryptTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/SimpleEncryptTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/SimpleEncryptTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -37,9 +37,9 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.jaxrpc.ServiceImpl;
-import org.jboss.ws.wsse.jaxrpc.WSSecurityHandlerOutbound;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceImpl;
+import org.jboss.ws.extensions.security.jaxrpc.WSSecurityHandlerOutbound;
/**
* Test WS-Security with RPC/Literal
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/SimpleSignTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/SimpleSignTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/SimpleSignTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -37,9 +37,9 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.jaxrpc.ServiceImpl;
-import org.jboss.ws.wsse.jaxrpc.WSSecurityHandlerOutbound;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceImpl;
+import org.jboss.ws.extensions.security.jaxrpc.WSSecurityHandlerOutbound;
/**
* Test WS-Security with RPC/Literal
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/StorePassEncryptTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/StorePassEncryptTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/StorePassEncryptTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -37,9 +37,9 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.jaxrpc.ServiceImpl;
-import org.jboss.ws.wsse.jaxrpc.WSSecurityHandlerOutbound;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceImpl;
+import org.jboss.ws.extensions.security.jaxrpc.WSSecurityHandlerOutbound;
/**
* This test simulates simulates the usage of a jboss-ws-security keystore and truststore
use cases
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefClientTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefClientTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefClientTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -34,9 +34,9 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Test the JAXRPC <service-ref>
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefEJBTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefEJBTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefEJBTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -33,9 +33,9 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Test the JAXRPC <service-ref>
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefServletTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefServletTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefServletTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -34,9 +34,9 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Test the JAXRPC <service-ref>
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/DIIClientTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/DIIClientTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/DIIClientTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -43,22 +43,22 @@
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.jaxrpc.ServiceExt;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.jaxrpc.StubExt;
+import org.jboss.ws.core.jaxrpc.ServiceExt;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.StubExt;
+import org.jboss.ws.extensions.addressing.AddressingClientUtil;
+import org.jboss.ws.extensions.addressing.jaxrpc.WSAddressingClientHandler;
+import org.jboss.ws.extensions.eventing.EventSourceEndpoint;
+import org.jboss.ws.extensions.eventing.EventingConstants;
+import org.jboss.ws.extensions.eventing.SubscriptionManagerEndpoint;
+import org.jboss.ws.extensions.eventing.element.DeliveryType;
+import org.jboss.ws.extensions.eventing.element.EndpointReference;
+import org.jboss.ws.extensions.eventing.element.FilterType;
+import org.jboss.ws.extensions.eventing.element.SubscribeRequest;
+import org.jboss.ws.extensions.eventing.element.SubscribeResponse;
+import org.jboss.ws.extensions.eventing.element.UnsubscribeRequest;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* @author Heiko Braun, <heiko(a)openj.net>
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventSinkServlet.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventSinkServlet.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventSinkServlet.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -29,8 +29,8 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
import org.w3c.dom.Element;
/**
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingSupport.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingSupport.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingSupport.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -35,18 +35,18 @@
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.jaxrpc.StubExt;
+import org.jboss.ws.core.jaxrpc.StubExt;
+import org.jboss.ws.extensions.addressing.AddressingClientUtil;
+import org.jboss.ws.extensions.eventing.EventSourceEndpoint;
+import org.jboss.ws.extensions.eventing.EventingConstants;
+import org.jboss.ws.extensions.eventing.SubscriptionManagerEndpoint;
+import org.jboss.ws.extensions.eventing.element.DeliveryType;
+import org.jboss.ws.extensions.eventing.element.EndpointReference;
+import org.jboss.ws.extensions.eventing.element.FilterType;
+import org.jboss.ws.extensions.eventing.element.SubscribeRequest;
+import org.jboss.ws.extensions.eventing.element.SubscribeResponse;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Eventing test case support.
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -32,17 +32,17 @@
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.jaxrpc.StubExt;
+import org.jboss.ws.core.jaxrpc.StubExt;
+import org.jboss.ws.extensions.addressing.AddressingClientUtil;
+import org.jboss.ws.extensions.eventing.EventingConstants;
+import org.jboss.ws.extensions.eventing.element.DeliveryType;
+import org.jboss.ws.extensions.eventing.element.RenewRequest;
+import org.jboss.ws.extensions.eventing.element.RenewResponse;
+import org.jboss.ws.extensions.eventing.element.StatusRequest;
+import org.jboss.ws.extensions.eventing.element.StatusResponse;
+import org.jboss.ws.extensions.eventing.element.SubscribeRequest;
+import org.jboss.ws.extensions.eventing.element.SubscribeResponse;
+import org.jboss.ws.extensions.eventing.element.UnsubscribeRequest;
/**
* Test the eventing endpoints.
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/NotificationTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/NotificationTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/NotificationTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -28,10 +28,10 @@
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.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.extensions.eventing.EventingConstants;
+import org.jboss.ws.extensions.eventing.element.SubscribeResponse;
+import org.jboss.ws.extensions.eventing.mgmt.EventDispatcher;
import org.w3c.dom.Element;
/**
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/SubscriptionManagerTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/SubscriptionManagerTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/SubscriptionManagerTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -27,13 +27,13 @@
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.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.extensions.eventing.EventingConstants;
+import org.jboss.ws.extensions.eventing.deployment.EventingEndpointDI;
+import org.jboss.ws.extensions.eventing.element.EndpointReference;
+import org.jboss.ws.extensions.eventing.mgmt.Filter;
+import org.jboss.ws.extensions.eventing.mgmt.SubscriptionManager;
+import org.jboss.ws.extensions.eventing.mgmt.SubscriptionTicket;
import org.w3c.dom.Element;
/**
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/MicrosoftInteropTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/MicrosoftInteropTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/MicrosoftInteropTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -32,12 +32,12 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.test.ws.JBossWSTest;
-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.jboss.ws.core.soap.MessageFactoryImpl;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.extensions.security.Constants;
+import org.jboss.ws.extensions.security.SecurityDecoder;
+import org.jboss.ws.extensions.security.SecurityStore;
+import org.jboss.ws.extensions.security.Util;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/RoundTripTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/RoundTripTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/RoundTripTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -34,23 +34,23 @@
import org.jboss.security.SecurityAssociation;
import org.jboss.test.ws.JBossWSTest;
-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.jboss.ws.core.soap.MessageFactoryImpl;
+import org.jboss.ws.core.utils.DOMWriter;
+import org.jboss.ws.extensions.security.Constants;
+import org.jboss.ws.extensions.security.EncryptionOperation;
+import org.jboss.ws.extensions.security.OperationDescription;
+import org.jboss.ws.extensions.security.QNameTarget;
+import org.jboss.ws.extensions.security.RequireEncryptionOperation;
+import org.jboss.ws.extensions.security.RequireSignatureOperation;
+import org.jboss.ws.extensions.security.SecurityDecoder;
+import org.jboss.ws.extensions.security.SecurityEncoder;
+import org.jboss.ws.extensions.security.SecurityStore;
+import org.jboss.ws.extensions.security.SendUsernameOperation;
+import org.jboss.ws.extensions.security.SignatureOperation;
+import org.jboss.ws.extensions.security.Target;
+import org.jboss.ws.extensions.security.TimestampOperation;
+import org.jboss.ws.extensions.security.Util;
+import org.jboss.ws.extensions.security.WsuIdTarget;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/SunInteropTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/SunInteropTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/SunInteropTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -31,12 +31,12 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.test.ws.JBossWSTest;
-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.jboss.ws.core.soap.MessageFactoryImpl;
+import org.jboss.ws.core.utils.DOMWriter;
+import org.jboss.ws.extensions.security.Constants;
+import org.jboss.ws.extensions.security.SecurityDecoder;
+import org.jboss.ws.extensions.security.SecurityStore;
+import org.jboss.ws.extensions.security.Util;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/XOPTypeDefTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/XOPTypeDefTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/XOPTypeDefTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -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.extensions.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: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/InlineHandler.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/InlineHandler.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/InlineHandler.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -22,7 +22,7 @@
package org.jboss.test.ws.jaxrpc.xop.doclit;
import org.jboss.logging.Logger;
-import org.jboss.ws.soap.NameImpl;
+import org.jboss.ws.core.soap.NameImpl;
import javax.xml.rpc.handler.GenericHandler;
import javax.xml.rpc.handler.HandlerInfo;
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPBase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPBase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPBase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -24,8 +24,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.jaxrpc.xop.XOPTestSupport;
import org.jboss.test.ws.jaxrpc.xop.shared.*;
-import org.jboss.ws.jaxrpc.StubExt;
-import org.jboss.ws.utils.IOUtils;
+import org.jboss.ws.core.jaxrpc.StubExt;
+import org.jboss.ws.core.utils.IOUtils;
import javax.activation.DataHandler;
import javax.xml.rpc.Stub;
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/InlineHandler.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/InlineHandler.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/InlineHandler.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,7 +1,7 @@
package org.jboss.test.ws.jaxrpc.xop.rpclit;
import org.jboss.logging.Logger;
-import org.jboss.ws.soap.NameImpl;
+import org.jboss.ws.core.soap.NameImpl;
import javax.xml.namespace.QName;
import javax.xml.rpc.handler.GenericHandler;
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPBase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPBase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPBase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -24,8 +24,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.jaxrpc.xop.XOPTestSupport;
import org.jboss.test.ws.jaxrpc.xop.shared.*;
-import org.jboss.ws.jaxrpc.StubExt;
-import org.jboss.ws.utils.IOUtils;
+import org.jboss.ws.core.jaxrpc.StubExt;
+import org.jboss.ws.core.utils.IOUtils;
import javax.activation.DataHandler;
import javax.xml.rpc.Stub;
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/MTOMServiceBase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/MTOMServiceBase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/MTOMServiceBase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -21,10 +21,10 @@
*/
package org.jboss.test.ws.jaxrpc.xop.shared;
-import org.jboss.ws.common.CommonMessageContext;
-import org.jboss.ws.soap.MessageContextAssociation;
-import org.jboss.ws.jaxrpc.StubExt;
-import org.jboss.ws.xop.XOPContext;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.jaxrpc.StubExt;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.extensions.xop.XOPContext;
import java.util.StringTokenizer;
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxws/asynchronous/AsynchronousDispatchTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/asynchronous/AsynchronousDispatchTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/asynchronous/AsynchronousDispatchTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -41,7 +41,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMUtils;
import org.xml.sax.InputSource;
/**
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxws/asynchronous/AsynchronousProxyTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/asynchronous/AsynchronousProxyTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/asynchronous/AsynchronousProxyTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -37,7 +37,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxws.client.ResponseImpl;
+import org.jboss.ws.core.jaxws.client.ResponseImpl;
/**
* Test JAXWS asynchrous proxy
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/binding/ClientHandler.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/binding/ClientHandler.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/binding/ClientHandler.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -35,7 +35,7 @@
import javax.xml.ws.handler.soap.SOAPMessageContext;
import org.jboss.logging.Logger;
-import org.jboss.ws.jaxws.handler.GenericSOAPHandler;
+import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
/**
* A client side handler for the ws-addressing
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxws/context/WebServiceContextTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/context/WebServiceContextTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/context/WebServiceContextTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -35,7 +35,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Test JAXWS WebServiceContext
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointServlet.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointServlet.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointServlet.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -35,8 +35,8 @@
import javax.xml.ws.Service;
import javax.xml.ws.soap.SOAPBinding;
-import org.jboss.ws.server.HttpContext;
-import org.jboss.ws.server.HttpServer;
+import org.jboss.ws.core.server.HttpContext;
+import org.jboss.ws.core.server.HttpServer;
/**
* Test Endpoint deployment
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -43,7 +43,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Test JAXWS Endpoint deployment
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxws/exception/ExceptionEndpointImpl.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/exception/ExceptionEndpointImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/exception/ExceptionEndpointImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -27,8 +27,8 @@
import javax.xml.soap.SOAPFault;
import javax.xml.ws.soap.SOAPFaultException;
-import org.jboss.ws.soap.NameImpl;
-import org.jboss.ws.soap.SOAPFaultImpl;
+import org.jboss.ws.core.soap.NameImpl;
+import org.jboss.ws.core.soap.SOAPFaultImpl;
@WebService(endpointInterface="org.jboss.test.ws.jaxws.exception.ExceptionEndpoint")
public class ExceptionEndpointImpl implements ExceptionEndpoint
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/handlerscope/ProtocolHandler.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/handlerscope/ProtocolHandler.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/handlerscope/ProtocolHandler.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -28,7 +28,7 @@
import javax.xml.ws.handler.MessageContext;
import javax.xml.ws.handler.soap.SOAPMessageContext;
-import org.jboss.ws.jaxws.handler.GenericSOAPHandler;
+import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
public class ProtocolHandler extends GenericSOAPHandler
{
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -34,7 +34,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.CallImpl;
+import org.jboss.ws.core.jaxrpc.CallImpl;
/**
* [JBWS-1178] Multiple virtual host and soap:address problem
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -27,12 +27,12 @@
import javax.jws.WebService;
+import org.jboss.ws.core.server.ServerConfig;
+import org.jboss.ws.core.server.ServerConfigFactory;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
import org.jboss.ws.metadata.wsdl.WSDLService;
-import org.jboss.ws.server.ServerConfig;
-import org.jboss.ws.server.ServerConfigFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
*
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/jbws860/JBWS860TestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/jbws860/JBWS860TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/jbws860/JBWS860TestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -33,7 +33,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Investigate "Is Not A Servlet" error with multiple servlets in the web.xml
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/jbws944/JBWS944TestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/jbws944/JBWS944TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/jbws944/JBWS944TestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -33,7 +33,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* EJB3 jmx name is incorrectly derrived
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/complex/client/JSR181ComplexTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/complex/client/JSR181ComplexTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/complex/client/JSR181ComplexTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -32,7 +32,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
*
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/handlerchain/AuthorizationHandler.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/handlerchain/AuthorizationHandler.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/handlerchain/AuthorizationHandler.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -35,7 +35,7 @@
import javax.xml.ws.handler.soap.SOAPMessageContext;
import org.jboss.logging.Logger;
-import org.jboss.ws.jaxws.handler.GenericSOAPHandler;
+import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
/**
* A server side handler
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/handlerchain/LogHandler.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/handlerchain/LogHandler.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/handlerchain/LogHandler.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -35,7 +35,7 @@
import javax.xml.ws.handler.soap.SOAPMessageContext;
import org.jboss.logging.Logger;
-import org.jboss.ws.jaxws.handler.GenericSOAPHandler;
+import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
/**
* A server side handler
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/handlerchain/RoutingHandler.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/handlerchain/RoutingHandler.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/handlerchain/RoutingHandler.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -39,7 +39,7 @@
import javax.xml.ws.handler.soap.SOAPMessageContext;
import org.jboss.logging.Logger;
-import org.jboss.ws.jaxws.handler.GenericSOAPHandler;
+import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
/**
* A server side handler
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/oneway/JSR181OneWayTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/oneway/JSR181OneWayTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/oneway/JSR181OneWayTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -34,8 +34,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
import org.w3c.dom.Element;
import org.xml.sax.InputSource;
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/soapbinding/JSR181SOAPBindingTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/soapbinding/JSR181SOAPBindingTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/soapbinding/JSR181SOAPBindingTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -39,7 +39,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.soap.NameImpl;
+import org.jboss.ws.core.soap.NameImpl;
/**
* Test the JSR-181 annotation: javax.jws.SOAPBinding
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webmethod/JSR181WebMethodTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webmethod/JSR181WebMethodTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webmethod/JSR181WebMethodTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -41,8 +41,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.soap.NameImpl;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.soap.NameImpl;
+import org.jboss.ws.core.utils.DOMUtils;
import org.w3c.dom.Element;
import org.xml.sax.InputSource;
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webparam/JSR181WebParamTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webparam/JSR181WebParamTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webparam/JSR181WebParamTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -32,10 +32,10 @@
import org.jboss.test.ws.JBossWSTest;
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.core.jaxrpc.CallImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
/**
* Test the JSR-181 annotation: javax.jws.WebParam
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webresult/JSR181WebResultTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webresult/JSR181WebResultTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webresult/JSR181WebResultTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -37,10 +37,10 @@
import org.jboss.test.ws.JBossWSTest;
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.soap.NameImpl;
+import org.jboss.ws.core.jaxrpc.CallImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.soap.NameImpl;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
/**
* Test the JSR-181 annotation: javax.jws.webresult
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceBase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceBase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceBase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -30,7 +30,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
// $Id$
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxws/logicalhandler/LogicalJAXBHandler.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/logicalhandler/LogicalJAXBHandler.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/logicalhandler/LogicalJAXBHandler.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -28,7 +28,7 @@
import javax.xml.ws.handler.LogicalMessageContext;
import javax.xml.ws.handler.MessageContext;
-import org.jboss.ws.jaxws.handler.GenericLogicalHandler;
+import org.jboss.ws.core.jaxws.handler.GenericLogicalHandler;
public class LogicalJAXBHandler extends GenericLogicalHandler
{
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxws/logicalhandler/LogicalSourceHandler.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/logicalhandler/LogicalSourceHandler.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/logicalhandler/LogicalSourceHandler.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -34,8 +34,8 @@
import javax.xml.ws.handler.LogicalMessageContext;
import javax.xml.ws.handler.MessageContext;
-import org.jboss.ws.jaxws.handler.GenericLogicalHandler;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.jaxws.handler.GenericLogicalHandler;
+import org.jboss.ws.core.utils.DOMUtils;
import org.w3c.dom.Element;
public class LogicalSourceHandler extends GenericLogicalHandler
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/logicalhandler/ProtocolHandler.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/logicalhandler/ProtocolHandler.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/logicalhandler/ProtocolHandler.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -28,7 +28,7 @@
import javax.xml.ws.handler.MessageContext;
import javax.xml.ws.handler.soap.SOAPMessageContext;
-import org.jboss.ws.jaxws.handler.GenericSOAPHandler;
+import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
/**
* A client side handler for the ws-addressing
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderBeanPayload.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderBeanPayload.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderBeanPayload.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -31,8 +31,8 @@
import javax.xml.ws.WebServiceException;
import javax.xml.ws.WebServiceProvider;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
import org.w3c.dom.Element;
/**
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderJAXBTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderJAXBTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderJAXBTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -48,7 +48,7 @@
import org.jboss.test.ws.jaxws.jsr181.soapbinding.SubmitBareRequest;
import org.jboss.test.ws.jaxws.jsr181.soapbinding.SubmitBareResponse;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
import org.w3c.dom.Element;
/**
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderMessageTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderMessageTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderMessageTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -37,7 +37,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Test a Provider<SOAPMessage>
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderPayloadTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderPayloadTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderPayloadTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -37,7 +37,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Test a Provider<SOAPMessage>
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jsr181ejb/JSR181WebServiceEJB3TestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jsr181ejb/JSR181WebServiceEJB3TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jsr181ejb/JSR181WebServiceEJB3TestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -35,7 +35,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Test the JSR-181 annotation: javax.jws.WebService
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jsr181pojo/JSR181WebServiceJSETestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jsr181pojo/JSR181WebServiceJSETestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jsr181pojo/JSR181WebServiceJSETestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -33,9 +33,9 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Test the JSR-181 annotation: javax.jws.WebService
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/RetailSampleTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/RetailSampleTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/RetailSampleTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -25,7 +25,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
import javax.xml.namespace.QName;
import java.net.MalformedURLException;
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/handler/SOAPMessageTrace.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/handler/SOAPMessageTrace.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/handler/SOAPMessageTrace.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -21,12 +21,12 @@
*/
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.soap.MessageContextAssociation;
-import org.jboss.ws.soap.SOAPMessageImpl;
-import org.jboss.ws.soap.SOAPElementWriter;
-import org.jboss.ws.soap.SOAPElementImpl;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.core.soap.SOAPElementImpl;
+import org.jboss.ws.core.soap.SOAPElementWriter;
+import org.jboss.ws.core.soap.SOAPMessageImpl;
import org.jboss.logging.Logger;
import javax.xml.ws.handler.MessageContext;
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxws/samples/wsaddressing/AddressingStatefulTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/samples/wsaddressing/AddressingStatefulTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/samples/wsaddressing/AddressingStatefulTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -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.extensions.addressing.jaxws.WSAddressingClientHandler;
/**
* Test stateful endpoint using ws-addressing
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxws/samples/wsaddressing/ClientHandler.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/samples/wsaddressing/ClientHandler.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/samples/wsaddressing/ClientHandler.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -35,9 +35,9 @@
import javax.xml.ws.handler.MessageContext;
import org.jboss.logging.Logger;
-import org.jboss.ws.jaxws.handler.GenericSOAPHandler;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.UUIDGenerator;
+import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.UUIDGenerator;
/**
* A client side handler for the ws-addressing
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxws/samples/wsaddressing/ServerHandler.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/samples/wsaddressing/ServerHandler.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/samples/wsaddressing/ServerHandler.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -33,8 +33,8 @@
import javax.xml.ws.handler.MessageContext;
import org.jboss.logging.Logger;
-import org.jboss.ws.jaxws.handler.GenericSOAPHandler;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
+import org.jboss.ws.core.utils.DOMUtils;
/**
* A server side handler for the ws-addressing
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefClientTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefClientTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefClientTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -33,7 +33,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Test the JAXWS annotation: javax.xml.ws.WebServiceref
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefEJB3TestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefEJB3TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefEJB3TestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -34,7 +34,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Test the JAXWS annotation: javax.xml.ws.WebServiceref
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefServletTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefServletTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefServletTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -35,7 +35,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Test the JAXWS annotation: javax.xml.ws.WebServiceref
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/EndpointReferenceTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/EndpointReferenceTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/EndpointReferenceTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -24,8 +24,8 @@
//$Id$
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.addressing.EndpointReferenceImpl;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.extensions.addressing.EndpointReferenceImpl;
import org.w3c.dom.Element;
/**
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/ClientHandler.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/ClientHandler.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/ClientHandler.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -33,7 +33,7 @@
import org.jboss.logging.Logger;
import org.jboss.test.ws.jaxws.wsaddressing.AddressingHandler;
-import org.jboss.ws.utils.UUIDGenerator;
+import org.jboss.ws.core.utils.UUIDGenerator;
/**
* A client side handler for the ws-addressing
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/FaultToEndpointImpl.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/FaultToEndpointImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/FaultToEndpointImpl.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -33,8 +33,8 @@
import javax.xml.namespace.QName;
import org.jboss.logging.Logger;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
/**
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/xop/MimeDeclarationTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/MimeDeclarationTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/MimeDeclarationTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -27,7 +27,7 @@
import java.awt.*;
import java.lang.reflect.Method;
-import org.jboss.ws.xop.jaxws.ReflectiveXOPScanner;
+import org.jboss.ws.extensions.xop.jaxws.ReflectiveXOPScanner;
/**
* Test the ReflectiveXOPScanner.
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpointBean.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpointBean.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpointBean.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -21,17 +21,15 @@
*/
package org.jboss.test.ws.jaxws.xop.doclit;
-import org.jboss.ws.annotation.PortComponent;
-import org.jboss.ws.WSException;
+import java.io.IOException;
-import javax.jws.WebMethod;
-import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding;
-import javax.ejb.Stateless;
-import javax.xml.ws.BindingType;
import javax.activation.DataHandler;
-import java.io.IOException;
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+import org.jboss.ws.WSException;
+
+
@Stateless
@WebService(name="MTOMEndpoint", serviceName = "MTOMService",
endpointInterface = "org.jboss.test.ws.jaxws.xop.doclit.MTOMEndpoint")
public class MTOMEndpointBean implements MTOMEndpoint {
Modified: trunk/src/test/java/org/jboss/test/ws/tools/JavaToWSDL11TestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/tools/JavaToWSDL11TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/tools/JavaToWSDL11TestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -34,13 +34,14 @@
import org.jboss.test.ws.tools.sei.ServiceException;
import org.jboss.test.ws.tools.sei.StandardJavaTypes;
import org.jboss.ws.Constants;
-import org.jboss.ws.jaxrpc.Style;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.IOUtils;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLUtils;
import org.jboss.ws.tools.JavaToWSDL;
import org.jboss.ws.tools.WSToolsConstants;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.IOUtils;
+import org.jboss.ws.tools.wsdl.WSDLWriter;
import org.w3c.dom.Element;
/**
@@ -129,7 +130,7 @@
WSDLDefinitions wsdl = jwsdl.generate(seiClass);
Writer fw = IOUtils.getCharsetFileWriter(new File(wsdlPath),
Constants.DEFAULT_XML_CHARSET);
- wsdl.write(fw, Constants.DEFAULT_XML_CHARSET);
+ new WSDLWriter(wsdl).write(fw, Constants.DEFAULT_XML_CHARSET);
fw.close();
//Validate the generated WSDL
Modified: trunk/src/test/java/org/jboss/test/ws/tools/SchemaGeneratorTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/tools/SchemaGeneratorTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/tools/SchemaGeneratorTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -28,7 +28,7 @@
import org.jboss.test.ws.common.jbossxb.complex.Base;
import org.jboss.test.ws.common.jbossxb.complex.Composite;
import org.jboss.test.ws.common.jbossxb.complex.Derived;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMUtils;
import org.w3c.dom.Element;
/** Test the XSD schema generator
Modified: trunk/src/test/java/org/jboss/test/ws/tools/WSDL11ToJavaTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/tools/WSDL11ToJavaTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/tools/WSDL11ToJavaTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -31,11 +31,11 @@
import org.jboss.test.ws.tools.sei.StandardJavaTypes;
import org.jboss.test.ws.tools.validation.WSDL11Validator;
import org.jboss.test.ws.tools.validation.WSDLValidator;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
-import org.jboss.ws.metadata.wsdl.WSDL20Writer;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.tools.WSDLToJava;
import org.jboss.ws.tools.interfaces.WSDLToJavaIntf;
+import org.jboss.ws.tools.wsdl.WSDLWriter;
/**
* Test jbossws WSDL11 -> Java
@@ -86,14 +86,14 @@
File wsdlDir = new File("./tools/wsdl-out");
wsdlDir.mkdirs();
FileWriter writer = new FileWriter(new File(wsdlDir + "/" + fname));
- new WSDL20Writer(wsdl).write(writer);
+ new WSDLWriter(wsdl).write(writer);
writer.close();
}
private String getWSDLAsString(WSDLDefinitions wsdl) throws IOException
{
StringWriter strwr = new StringWriter();
- new WSDL20Writer(wsdl).write(strwr);
+ new WSDLWriter(wsdl).write(strwr);
return strwr.toString();
}
Deleted: trunk/src/test/java/org/jboss/test/ws/tools/WSDL11ToWSDL20TestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/tools/WSDL11ToWSDL20TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/tools/WSDL11ToWSDL20TestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -1,134 +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.test.ws.tools;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.StringWriter;
-
-import org.jboss.test.ws.JBossWSTest;
-import org.jboss.test.ws.tools.sei.PrimitiveTypes;
-import org.jboss.test.ws.tools.sei.StandardJavaTypes;
-import org.jboss.test.ws.tools.validation.WSDL11Validator;
-import org.jboss.test.ws.tools.validation.WSDLValidator;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
-import org.jboss.ws.metadata.wsdl.WSDL20Writer;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
-import org.jboss.ws.tools.WSDLToJava;
-import org.jboss.ws.tools.interfaces.WSDLToJavaIntf;
-
-/**
- * Test jbossws WSDL11 -> Java -> WSDL20
- *
- * @author anil.saldhana(a)jboss.org
- * @since January 26,2005
- */
-public class WSDL11ToWSDL20TestCase extends JBossWSTest
-{
- /** Test a SEI that contains JAXRPC primitive types */
- public void testPrimitiveTypes() throws Exception
- {
- Class seiClass = PrimitiveTypes.class;
- WSDLDefinitions wsdlDefinitions = getWSDLDefinitions(seiClass,
"PrimitiveTypesService_RPC_11.wsdl");
- String wsdlString = getWSDLAsString(wsdlDefinitions);
- //System.out.println(wsdlString);
- writeWSDL(wsdlDefinitions, "PrimitiveTypesService_RPC_20.wsdl");
- }
-
- /** Test a SEI that contains JAXRPC java standard types */
- public void testStandardJavaTypes() throws Exception
- {
- Class seiClass = StandardJavaTypes.class;
- WSDLDefinitions wsdlDefinitions = getWSDLDefinitions(seiClass,
"StandardJavaTypesService_RPC_11.wsdl");
- String wsdlString = getWSDLAsString(wsdlDefinitions);
- //System.out.println(wsdlString);
- writeWSDL(wsdlDefinitions, "StandardJavaTypesService_RPC_20.wsdl");
- }
-
- /** Test a SEI that contains JAXRPC java standard types */
- public void testStandardDocJavaTypes() throws Exception
- {
- Class seiClass = StandardJavaTypes.class;
- WSDLDefinitions wsdlDefinitions = getWSDLDefinitions(seiClass,
"StandardJavaTypesService_DOC_11.wsdl");
- String wsdlString = getWSDLAsString(wsdlDefinitions);
- //System.out.println(wsdlString);
- writeWSDL(wsdlDefinitions, "StandardJavaTypesService_DOC_20.wsdl");
- }
-
- /** Test a SEI that contains JAXRPC java standard types */
- public void testWSDLSpecExample() throws Exception
- {
- WSDLDefinitions wsdl = doWSDLTest("W3CExample_DOC_11.wsdl");
- //System.out.println(wsdlString);
- writeWSDL(wsdl, "W3CExample_DOC_20.wsdl");
- }
-
- private void writeWSDL(WSDLDefinitions wsdl, String fname) throws Exception
- {
- String wsdlWrite = "tools";
-
- FileWriter writer = new FileWriter(wsdlWrite + "/" + fname);
- new WSDL20Writer(wsdl).write(writer);
- writer.close();
- }
-
- private String getWSDLAsString(WSDLDefinitions wsdl) throws IOException
- {
- StringWriter strwr = new StringWriter();
- new WSDL20Writer(wsdl).write(strwr);
- return strwr.toString();
- }
-
- private WSDLDefinitions getWSDLDefinitions(Class seiClass, String wsdlFileName) throws
Exception
- {
- File wsdlFile = new File("resources/tools/wsdlfixture/" + wsdlFileName);
- assertTrue(wsdlFile.exists());
-
- WSDLDefinitionsFactory wsdlFactory = WSDLDefinitionsFactory.newInstance();
- WSDLDefinitions wsdlDefinitions = wsdlFactory.parse(wsdlFile.toURL());
-
- WSDLValidator validator = new WSDL11Validator();
- if (validator.validate(seiClass, wsdlDefinitions) == false)
- System.err.println("FIXME: " + validator.getErrorList().toString());
-
- return wsdlDefinitions;
- }
-
- /**
- * The idea here is that the WSDLReader reads in the <definition> element
- * and looks at the default namespace. If it is wsdl-1.1, it delegates to
- * wsdl4j which parses the same wsdl again and builds the wsdl4j object graph.
- * TODO:Reading the wsdl4j graph and copying to jbossws/wsdl objects
- * @param wsdlFileName
- * @throws Exception
- */
- private WSDLDefinitions doWSDLTest(String wsdlFileName) throws Exception
- {
- File wsdlFile = new File("resources/tools/wsdlfixture/" + wsdlFileName);
- assertTrue(wsdlFile.exists());
- WSDLToJavaIntf wsdljava = new WSDLToJava();
- wsdljava.setTypeMapping(new LiteralTypeMapping());
- return wsdljava.convertWSDL2Java(wsdlFile.toURL());
- }
-}
Modified: trunk/src/test/java/org/jboss/test/ws/tools/WSToolsTest.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/tools/WSToolsTest.java 2006-12-07 10:45:48 UTC
(rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/tools/WSToolsTest.java 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -39,11 +39,13 @@
import org.jboss.test.ws.tools.validation.WSDL11Validator;
import org.jboss.test.ws.tools.validation.WSDLValidator;
import org.jboss.ws.Constants;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
-import org.jboss.ws.jaxrpc.Style;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
+import org.jboss.ws.core.utils.JavaUtils;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
import org.jboss.ws.tools.JavaToWSDL;
import org.jboss.ws.tools.JavaToXSD;
@@ -51,9 +53,7 @@
import org.jboss.ws.tools.client.ServiceCreator;
import org.jboss.ws.tools.exceptions.JBossWSToolsException;
import org.jboss.ws.tools.mapping.MappingFileGenerator;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
-import org.jboss.ws.utils.JavaUtils;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
import org.w3c.dom.Element;
/**
Modified:
trunk/src/test/java/org/jboss/test/ws/tools/clientside/ClientSideArtifactsTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/tools/clientside/ClientSideArtifactsTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/tools/clientside/ClientSideArtifactsTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -28,14 +28,14 @@
import org.jboss.test.ws.tools.WSToolsTest;
import org.jboss.test.ws.tools.fixture.JBossSourceComparator;
import org.jboss.test.ws.tools.validation.JaxrpcMappingValidator;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.tools.WSDLToJava;
import org.jboss.ws.tools.client.ServiceCreator;
import org.jboss.ws.tools.mapping.MappingFileGenerator;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
import org.w3c.dom.Element;
/**
Modified: trunk/src/test/java/org/jboss/test/ws/tools/doclit/ToolsDocLitTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/tools/doclit/ToolsDocLitTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/tools/doclit/ToolsDocLitTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -26,12 +26,13 @@
import org.jboss.test.ws.tools.WSToolsTest;
import org.jboss.ws.Constants;
-import org.jboss.ws.jaxrpc.Style;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.IOUtils;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.tools.JavaToWSDL;
import org.jboss.ws.tools.WSToolsConstants;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.IOUtils;
+import org.jboss.ws.tools.wsdl.WSDLWriter;
import org.w3c.dom.Element;
/**
@@ -57,7 +58,7 @@
WSDLDefinitions wsdl = jwsdl.generate(seiClass);
Writer fw = IOUtils.getCharsetFileWriter(new File(wsdlPath),
Constants.DEFAULT_XML_CHARSET);
- wsdl.write(fw, Constants.DEFAULT_XML_CHARSET);
+ new WSDLWriter(wsdl).write(fw, Constants.DEFAULT_XML_CHARSET);
fw.close();
String fixturefile =
"resources/tools/doc-lit/trivial/wsdl/SampleService.wsdl";
Modified: trunk/src/test/java/org/jboss/test/ws/tools/enums/EnumTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/tools/enums/EnumTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/tools/enums/EnumTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -24,8 +24,8 @@
import java.io.FileInputStream;
import org.jboss.test.ws.JBossWSTest;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.tools.WSTools;
-import org.jboss.ws.utils.DOMUtils;
import org.w3c.dom.Element;
/**
Modified:
trunk/src/test/java/org/jboss/test/ws/tools/holders/StandardHoldersTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/tools/holders/StandardHoldersTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/tools/holders/StandardHoldersTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -30,17 +30,18 @@
import org.jboss.test.ws.tools.validation.WSDL11Validator;
import org.jboss.test.ws.tools.validation.WSDLValidator;
import org.jboss.ws.Constants;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
-import org.jboss.ws.jaxrpc.Style;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.IOUtils;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.tools.JavaToWSDL;
import org.jboss.ws.tools.WSDLToJava;
import org.jboss.ws.tools.WSToolsConstants;
import org.jboss.ws.tools.exceptions.JBossWSToolsException;
import org.jboss.ws.tools.interfaces.WSDLToJavaIntf;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.IOUtils;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLWriter;
import org.w3c.dom.Element;
@@ -85,7 +86,7 @@
String wsdlDir = "tools/";
String wsdlPath = wsdlDir+ "/HolderService.wsdl";
Writer fw = IOUtils.getCharsetFileWriter(new File(wsdlPath),
Constants.DEFAULT_XML_CHARSET);
- wsdl.write(fw, Constants.DEFAULT_XML_CHARSET);
+ new WSDLWriter(wsdl).write(fw, Constants.DEFAULT_XML_CHARSET);
fw.close();
//Now validate the wsdl file
Modified: trunk/src/test/java/org/jboss/test/ws/tools/java2xsd/SchemaModelTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/tools/java2xsd/SchemaModelTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/tools/java2xsd/SchemaModelTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -31,9 +31,9 @@
import org.jboss.test.ws.common.jbossxb.complex.Derived;
import org.jboss.test.ws.common.jbossxb.simple.SimpleUserType;
import org.jboss.ws.Constants;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
import org.jboss.ws.tools.JavaToXSD;
-import org.jboss.ws.utils.DOMUtils;
import org.w3c.dom.Element;
/**
Modified:
trunk/src/test/java/org/jboss/test/ws/tools/java2xsd/SchemaTypesCreatorTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/tools/java2xsd/SchemaTypesCreatorTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/tools/java2xsd/SchemaTypesCreatorTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -29,10 +29,10 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.tools.jbws_161.customexceptions.UserException;
import org.jboss.test.ws.tools.sei.Derived;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSTypeDefinition;
import org.jboss.ws.tools.schema.SchemaTypeCreator;
-import org.jboss.ws.utils.DOMUtils;
import org.w3c.dom.Element;
/**
Modified: trunk/src/test/java/org/jboss/test/ws/tools/jbws1079/JBWS1079TestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/tools/jbws1079/JBWS1079TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/tools/jbws1079/JBWS1079TestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -26,8 +26,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.tools.fixture.JBossSourceComparator;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.tools.WSTools;
-import org.jboss.ws.utils.DOMUtils;
import org.w3c.dom.Element;
/**
Modified: trunk/src/test/java/org/jboss/test/ws/tools/jbws1170/JBWS1170TestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/tools/jbws1170/JBWS1170TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/tools/jbws1170/JBWS1170TestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -26,8 +26,8 @@
import java.io.FileReader;
import org.jboss.test.ws.JBossWSTest;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.tools.WSTools;
-import org.jboss.ws.utils.DOMUtils;
import org.w3c.dom.Element;
/**
Modified: trunk/src/test/java/org/jboss/test/ws/tools/jbws1253/JBWS1253TestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/tools/jbws1253/JBWS1253TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/tools/jbws1253/JBWS1253TestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -26,8 +26,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.tools.fixture.JBossSourceComparator;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.tools.WSTools;
-import org.jboss.ws.utils.DOMUtils;
import org.w3c.dom.Element;
/**
Modified: trunk/src/test/java/org/jboss/test/ws/tools/jbws818/JBWS818TestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/tools/jbws818/JBWS818TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/tools/jbws818/JBWS818TestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -24,8 +24,8 @@
import java.io.FileInputStream;
import org.jboss.test.ws.JBossWSTest;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.tools.WSTools;
-import org.jboss.ws.utils.DOMUtils;
import org.w3c.dom.Element;
/**
Modified: trunk/src/test/java/org/jboss/test/ws/tools/jbws_204/AnonTypesTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/tools/jbws_204/AnonTypesTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/tools/jbws_204/AnonTypesTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -29,8 +29,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.tools.jbws_204.wscompile.anontypes.Items;
import org.jboss.ws.Constants;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.tools.JavaToXSD;
-import org.jboss.ws.utils.DOMUtils;
import org.w3c.dom.Element;
/**
Modified: trunk/src/test/java/org/jboss/test/ws/tools/jbws_204/NillableTypesTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/tools/jbws_204/NillableTypesTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/tools/jbws_204/NillableTypesTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -31,10 +31,10 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.tools.jbws_204.wscompile.nillabletypes.NillableType;
import org.jboss.ws.Constants;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
import org.jboss.ws.metadata.wsdl.xmlschema.WSSchemaUtils;
import org.jboss.ws.tools.JavaToXSD;
-import org.jboss.ws.utils.DOMUtils;
import org.w3c.dom.Element;
Modified:
trunk/src/test/java/org/jboss/test/ws/tools/jbws_204/StandardArraysTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/tools/jbws_204/StandardArraysTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/tools/jbws_204/StandardArraysTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -29,8 +29,8 @@
import org.jboss.test.ws.tools.WSToolsTest;
import org.jboss.ws.Constants;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.tools.JavaToXSD;
-import org.jboss.ws.utils.DOMUtils;
import org.w3c.dom.Element;
/**
Modified:
trunk/src/test/java/org/jboss/test/ws/tools/jbws_204/StandardDoubleArraysTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/tools/jbws_204/StandardDoubleArraysTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/tools/jbws_204/StandardDoubleArraysTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -29,7 +29,7 @@
import org.jboss.test.ws.tools.WSToolsTest;
import org.jboss.ws.Constants;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMUtils;
import org.w3c.dom.Element;
/**
Modified:
trunk/src/test/java/org/jboss/test/ws/tools/metadata/JavaWsdlMappingMetaDataTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/tools/metadata/JavaWsdlMappingMetaDataTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/tools/metadata/JavaWsdlMappingMetaDataTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -27,6 +27,7 @@
import javax.xml.namespace.QName;
import org.jboss.test.ws.JBossWSTest;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
import org.jboss.ws.metadata.jaxrpcmapping.MethodParamPartsMapping;
@@ -37,7 +38,6 @@
import org.jboss.ws.metadata.jaxrpcmapping.ServiceInterfaceMapping;
import org.jboss.ws.metadata.jaxrpcmapping.WsdlMessageMapping;
import org.jboss.ws.metadata.jaxrpcmapping.WsdlReturnValueMapping;
-import org.jboss.ws.utils.DOMUtils;
import org.w3c.dom.Element;
/**
Modified:
trunk/src/test/java/org/jboss/test/ws/tools/metadata/WebServicesMetaDataTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/tools/metadata/WebServicesMetaDataTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/tools/metadata/WebServicesMetaDataTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -28,11 +28,11 @@
import javax.xml.namespace.QName;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.metadata.jsr109.PortComponentMetaData;
-import org.jboss.ws.metadata.jsr109.WebserviceDescriptionMetaData;
-import org.jboss.ws.metadata.jsr109.WebservicesFactory;
-import org.jboss.ws.metadata.jsr109.WebservicesMetaData;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.metadata.webservices.PortComponentMetaData;
+import org.jboss.ws.metadata.webservices.WebserviceDescriptionMetaData;
+import org.jboss.ws.metadata.webservices.WebservicesFactory;
+import org.jboss.ws.metadata.webservices.WebservicesMetaData;
import org.jboss.xb.binding.ObjectModelFactory;
import org.jboss.xb.binding.Unmarshaller;
import org.jboss.xb.binding.UnmarshallerFactory;
Modified:
trunk/src/test/java/org/jboss/test/ws/tools/validation/WSDL11ValidationTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/tools/validation/WSDL11ValidationTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/tools/validation/WSDL11ValidationTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -26,8 +26,8 @@
import junit.framework.TestCase;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.tools.exceptions.JBossWSToolsException;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Testcase to test the WSDL Validator
Modified: trunk/src/test/java/org/jboss/test/ws/tools/xmlschema/WSDLTypesTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/tools/xmlschema/WSDLTypesTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/tools/xmlschema/WSDLTypesTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -27,7 +27,7 @@
import javax.xml.namespace.QName;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLTypes;
import org.jboss.ws.metadata.wsdl.WSDLUtils;
Modified:
trunk/src/test/java/org/jboss/test/ws/tools/xmlschema/XercesSchemaParserTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/tools/xmlschema/XercesSchemaParserTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/tools/xmlschema/XercesSchemaParserTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -47,6 +47,7 @@
import org.apache.xerces.xs.XSTypeDefinition;
import org.apache.xerces.xs.XSWildcard;
import org.jboss.test.ws.JBossWSTest;
+import org.jboss.ws.core.utils.JBossWSEntityResolver;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSComplexTypeDefinition;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSElementDeclaration;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSEntityResolver;
@@ -54,7 +55,6 @@
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSParticle;
import org.jboss.ws.metadata.wsdl.xsd.SchemaUtils;
import org.jboss.ws.tools.JavaToXSD;
-import org.jboss.ws.utils.JBossWSEntityResolver;
import org.jboss.xb.binding.sunday.unmarshalling.LSInputAdaptor;
import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver;
Modified: trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/AnonymousTypesTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/AnonymousTypesTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/AnonymousTypesTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -25,7 +25,7 @@
import org.jboss.test.ws.tools.WSToolsTest;
import org.jboss.test.ws.tools.fixture.JBossSourceComparator;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
import org.jboss.ws.tools.XSDToJava;
import org.jboss.ws.tools.interfaces.XSDToJavaIntf;
Modified: trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/ComplexTypesTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/ComplexTypesTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/ComplexTypesTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -25,7 +25,7 @@
import org.jboss.test.ws.tools.WSToolsTest;
import org.jboss.test.ws.tools.fixture.JBossSourceComparator;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
import org.jboss.ws.tools.XSDToJava;
import org.jboss.ws.tools.interfaces.XSDToJavaIntf;
Modified: trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/NillableTypesTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/NillableTypesTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/NillableTypesTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -25,7 +25,7 @@
import org.jboss.test.ws.tools.WSToolsTest;
import org.jboss.test.ws.tools.fixture.JBossSourceComparator;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
import org.jboss.ws.tools.XSDToJava;
import org.jboss.ws.tools.interfaces.XSDToJavaIntf;
Modified: trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/ReferencesTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/ReferencesTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/ReferencesTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -25,7 +25,7 @@
import org.jboss.test.ws.tools.WSToolsTest;
import org.jboss.test.ws.tools.fixture.JBossSourceComparator;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
import org.jboss.ws.tools.XSDToJava;
import org.jboss.ws.tools.interfaces.XSDToJavaIntf;
Modified: trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/SimpleTypesTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/SimpleTypesTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/SimpleTypesTestCase.java 2006-12-07
10:43:36 UTC (rev 1600)
@@ -25,7 +25,7 @@
import org.jboss.test.ws.tools.WSToolsTest;
import org.jboss.test.ws.tools.fixture.JBossSourceComparator;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
import org.jboss.ws.tools.XSDToJava;
import org.jboss.ws.tools.interfaces.XSDToJavaIntf;
Modified: trunk/src/test/resources/common/config/jaxrpc-endpoint-config.xml
===================================================================
--- trunk/src/test/resources/common/config/jaxrpc-endpoint-config.xml 2006-12-07 10:45:48
UTC (rev 1599)
+++ trunk/src/test/resources/common/config/jaxrpc-endpoint-config.xml 2006-12-07 10:43:36
UTC (rev 1600)
@@ -17,7 +17,7 @@
<handler-chain-name>PreHandlerChain</handler-chain-name>
<handler>
<j2ee:handler-name>WSSecurityHandlerInbound</j2ee:handler-name>
-
<j2ee:handler-class>org.jboss.ws.wsse.jaxrpc.WSSecurityHandlerInbound</j2ee:handler-class>
+
<j2ee:handler-class>org.jboss.ws.extensions.security.jaxrpc.WSSecurityHandlerInbound</j2ee:handler-class>
</handler>
</pre-handler-chain>
</endpoint-config>
Modified: trunk/src/test/resources/common/config/jaxws-endpoint-config.xml
===================================================================
--- trunk/src/test/resources/common/config/jaxws-endpoint-config.xml 2006-12-07 10:45:48
UTC (rev 1599)
+++ trunk/src/test/resources/common/config/jaxws-endpoint-config.xml 2006-12-07 10:43:36
UTC (rev 1600)
@@ -18,7 +18,7 @@
<javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
<javaee:handler>
<javaee:handler-name>WSSecurityHandlerInbound</javaee:handler-name>
-
<javaee:handler-class>org.jboss.ws.wsse.jaxws.WSSecurityHandlerInbound</javaee:handler-class>
+
<javaee:handler-class>org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerInbound</javaee:handler-class>
</javaee:handler>
</javaee:handler-chain>
</pre-handler-chains>
Modified:
trunk/src/test/resources/interop/microsoft/addressing/sep06/wsa10/META-INF/application-client.xml
===================================================================
---
trunk/src/test/resources/interop/microsoft/addressing/sep06/wsa10/META-INF/application-client.xml 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/resources/interop/microsoft/addressing/sep06/wsa10/META-INF/application-client.xml 2006-12-07
10:43:36 UTC (rev 1600)
@@ -26,7 +26,7 @@
<handler>
<handler-name>client.notify.handler</handler-name>
-
<handler-class>org.jboss.ws.addressing.jaxrpc.WSAddressingClientHandler</handler-class>
+
<handler-class>org.jboss.ws.extensions.addressing.jaxrpc.WSAddressingClientHandler</handler-class>
<!--init-param>
<param-name>javax.xml.ws.addressing.to.inbound</param-name>
<
param-value>http://example.org/node/A</param-value>
@@ -37,7 +37,7 @@
<handler>
<handler-name>client.echo.handler</handler-name>
-
<handler-class>org.jboss.ws.addressing.jaxrpc.WSAddressingClientHandler</handler-class>
+
<handler-class>org.jboss.ws.extensions.addressing.jaxrpc.WSAddressingClientHandler</handler-class>
<!--init-param>
<param-name>javax.xml.ws.addressing.to.inbound</param-name>
<
param-value>http://example.org/node/A</param-value>
Modified:
trunk/src/test/resources/interop/microsoft/addressing/sep06/wsa10/WEB-INF/webservices.xml
===================================================================
---
trunk/src/test/resources/interop/microsoft/addressing/sep06/wsa10/WEB-INF/webservices.xml 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/resources/interop/microsoft/addressing/sep06/wsa10/WEB-INF/webservices.xml 2006-12-07
10:43:36 UTC (rev 1600)
@@ -22,7 +22,7 @@
<handler>
<handler-name>addressing handler</handler-name>
-
<handler-class>org.jboss.ws.addressing.jaxrpc.WSAddressingServerHandler</handler-class>
+
<handler-class>org.jboss.ws.extensions.addressing.jaxrpc.WSAddressingServerHandler</handler-class>
<init-param>
<param-name>validate</param-name>
<param-value>false</param-value>
@@ -45,7 +45,7 @@
<handler>
<handler-name>addressing handler</handler-name>
-
<handler-class>org.jboss.ws.addressing.jaxrpc.WSAddressingServerHandler</handler-class>
+
<handler-class>org.jboss.ws.extensions.addressing.jaxrpc.WSAddressingServerHandler</handler-class>
<init-param>
<param-name>validate</param-name>
<param-value>false</param-value>
Modified:
trunk/src/test/resources/interop/microsoft/addressing/wsa10/META-INF/application-client.xml
===================================================================
---
trunk/src/test/resources/interop/microsoft/addressing/wsa10/META-INF/application-client.xml 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/resources/interop/microsoft/addressing/wsa10/META-INF/application-client.xml 2006-12-07
10:43:36 UTC (rev 1600)
@@ -26,7 +26,7 @@
<handler>
<handler-name>client.notify.handler</handler-name>
-
<handler-class>org.jboss.ws.addressing.jaxrpc.WSAddressingClientHandler</handler-class>
+
<handler-class>org.jboss.ws.extensions.addressing.jaxrpc.WSAddressingClientHandler</handler-class>
<!--init-param>
<param-name>javax.xml.ws.addressing.to.inbound</param-name>
<
param-value>http://example.org/node/A</param-value>
@@ -37,7 +37,7 @@
<handler>
<handler-name>client.echo.handler</handler-name>
-
<handler-class>org.jboss.ws.addressing.jaxrpc.WSAddressingClientHandler</handler-class>
+
<handler-class>org.jboss.ws.extensions.addressing.jaxrpc.WSAddressingClientHandler</handler-class>
<!--init-param>
<param-name>javax.xml.ws.addressing.to.inbound</param-name>
<
param-value>http://example.org/node/A</param-value>
Modified:
trunk/src/test/resources/interop/microsoft/addressing/wsaTestService/WEB-INF/webservices.xml
===================================================================
---
trunk/src/test/resources/interop/microsoft/addressing/wsaTestService/WEB-INF/webservices.xml 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/resources/interop/microsoft/addressing/wsaTestService/WEB-INF/webservices.xml 2006-12-07
10:43:36 UTC (rev 1600)
@@ -29,7 +29,7 @@
<handler>
<handler-name>addressing handler</handler-name>
-
<handler-class>org.jboss.ws.addressing.jaxrpc.WSAddressingServerHandler</handler-class>
+
<handler-class>org.jboss.ws.extensions.addressing.jaxrpc.WSAddressingServerHandler</handler-class>
<init-param>
<param-name>validate</param-name>
<param-value>false</param-value>
Modified: trunk/src/test/resources/jaxrpc/marshall-rpclit/WEB-INF/webservices.xml
===================================================================
--- trunk/src/test/resources/jaxrpc/marshall-rpclit/WEB-INF/webservices.xml 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/resources/jaxrpc/marshall-rpclit/WEB-INF/webservices.xml 2006-12-07
10:43:36 UTC (rev 1600)
@@ -19,7 +19,7 @@
</service-impl-bean>
<handler>
<handler-name>MTOM disabled handler</handler-name>
- <handler-class>org.jboss.ws.xop.DisableMTOMHandler</handler-class>
+
<handler-class>org.jboss.ws.extensions.xop.DisableMTOMHandler</handler-class>
</handler>
</port-component>
</webservice-description>
Modified:
trunk/src/test/resources/jaxrpc/samples/wseventing/META-INF/application-client.xml
===================================================================
---
trunk/src/test/resources/jaxrpc/samples/wseventing/META-INF/application-client.xml 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/resources/jaxrpc/samples/wseventing/META-INF/application-client.xml 2006-12-07
10:43:36 UTC (rev 1600)
@@ -8,21 +8,21 @@
<service-ref>
<service-ref-name>service/SysmonService</service-ref-name>
-
<service-interface>org.jboss.ws.eventing.EventingService</service-interface>
+
<service-interface>org.jboss.ws.extensions.eventing.EventingService</service-interface>
<wsdl-file>META-INF/wsdl/sysmon.wsdl</wsdl-file>
<jaxrpc-mapping-file>META-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
<port-component-ref>
-
<service-endpoint-interface>org.jboss.ws.eventing.EventSourceEndpoint</service-endpoint-interface>
+
<service-endpoint-interface>org.jboss.ws.extensions.eventing.EventSourceEndpoint</service-endpoint-interface>
</port-component-ref>
<port-component-ref>
-
<service-endpoint-interface>org.jboss.ws.eventing.SubscriptionManagerEndpoint</service-endpoint-interface>
+
<service-endpoint-interface>org.jboss.ws.extensions.eventing.SubscriptionManagerEndpoint</service-endpoint-interface>
</port-component-ref>
<handler>
<handler-name>WSAddressingHandler</handler-name>
-
<handler-class>org.jboss.ws.addressing.jaxrpc.WSAddressingClientHandler</handler-class>
+
<handler-class>org.jboss.ws.extensions.addressing.jaxrpc.WSAddressingClientHandler</handler-class>
</handler>
</service-ref>
Modified: trunk/src/test/resources/jaxrpc/samples/wseventing/WEB-INF/jaxrpc-mapping.xml
===================================================================
---
trunk/src/test/resources/jaxrpc/samples/wseventing/WEB-INF/jaxrpc-mapping.xml 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/resources/jaxrpc/samples/wseventing/WEB-INF/jaxrpc-mapping.xml 2006-12-07
10:43:36 UTC (rev 1600)
@@ -3,19 +3,19 @@
version="1.1"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd">
<package-mapping>
- <package-type>org.jboss.ws.eventing</package-type>
+ <package-type>org.jboss.ws.extensions.eventing</package-type>
<
namespaceURI>http://schemas.xmlsoap.org/ws/2004/08/eventing</namesp...
</package-mapping>
<java-xml-type-mapping>
-
<java-type>org.jboss.ws.eventing.element.SubscribeRequest</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.SubscribeRequest</java-type>
<root-type-qname
xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing">
typeNS:Subscribe</root-type-qname>
<qname-scope>element</qname-scope>
</java-xml-type-mapping>
<java-xml-type-mapping>
-
<java-type>org.jboss.ws.eventing.element.SubscribeRequest</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.SubscribeRequest</java-type>
<anonymous-type-qname
xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing">
typeNS:>Subscribe</anonymous-type-qname>
<qname-scope>complexType</qname-scope>
@@ -42,7 +42,7 @@
</java-xml-type-mapping>
<java-xml-type-mapping>
- <java-type>org.jboss.ws.eventing.element.FilterType</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.FilterType</java-type>
<root-type-qname
xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing">
typeNS:FilterType</root-type-qname>
<qname-scope>complexType</qname-scope>
@@ -57,7 +57,7 @@
</java-xml-type-mapping>
<java-xml-type-mapping>
- <java-type>org.jboss.ws.eventing.element.DeliveryType</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.DeliveryType</java-type>
<root-type-qname
xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing">
typeNS:DeliveryType</root-type-qname>
<qname-scope>complexType</qname-scope>
@@ -76,14 +76,14 @@
</java-xml-type-mapping>
<java-xml-type-mapping>
-
<java-type>org.jboss.ws.eventing.element.SubscriptionEndRequest</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.SubscriptionEndRequest</java-type>
<root-type-qname
xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing">
typeNS:SubscriptionEnd</root-type-qname>
<qname-scope>element</qname-scope>
</java-xml-type-mapping>
<java-xml-type-mapping>
-
<java-type>org.jboss.ws.eventing.element.SubscriptionEndRequest</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.SubscriptionEndRequest</java-type>
<anonymous-type-qname
xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing">
typeNS:>SubscriptionEnd</anonymous-type-qname>
<qname-scope>complexType</qname-scope>
@@ -102,14 +102,14 @@
</java-xml-type-mapping>
<java-xml-type-mapping>
-
<java-type>org.jboss.ws.eventing.element.SubscribeResponse</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.SubscribeResponse</java-type>
<root-type-qname
xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing">
typeNS:SubscribeResponse</root-type-qname>
<qname-scope>element</qname-scope>
</java-xml-type-mapping>
<java-xml-type-mapping>
-
<java-type>org.jboss.ws.eventing.element.SubscribeResponse</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.SubscribeResponse</java-type>
<anonymous-type-qname
xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing">
typeNS:>SubscribeResponse</anonymous-type-qname>
<qname-scope>complexType</qname-scope>
@@ -124,13 +124,13 @@
</java-xml-type-mapping>
<java-xml-type-mapping>
-
<java-type>org.jboss.ws.eventing.element.EndpointReference</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.EndpointReference</java-type>
<root-type-qname
xmlns:typeNS="http://www.w3.org/2005/08/addressing">typeNS:E...
<qname-scope>element</qname-scope>
</java-xml-type-mapping>
<java-xml-type-mapping>
-
<java-type>org.jboss.ws.eventing.element.EndpointReference</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.EndpointReference</java-type>
<root-type-qname
xmlns:typeNS="http://www.w3.org/2005/08/addressing">
typeNS:EndpointReferenceType</root-type-qname>
<qname-scope>complexType</qname-scope>
@@ -149,13 +149,13 @@
</java-xml-type-mapping>
<java-xml-type-mapping>
- <java-type>org.jboss.ws.eventing.element.MetaData</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.MetaData</java-type>
<root-type-qname
xmlns:typeNS="http://www.w3.org/2005/08/addressing">typeNS:M...
<qname-scope>element</qname-scope>
</java-xml-type-mapping>
<!--java-xml-type-mapping>
- <java-type>org.jboss.ws.eventing.element.MetaData</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.MetaData</java-type>
<root-type-qname
xmlns:typeNS="http://www.w3.org/2005/08/addressing">typeNS:M...
<qname-scope>complexType</qname-scope>
<variable-mapping>
@@ -165,13 +165,13 @@
</java-xml-type-mapping-->
<java-xml-type-mapping>
- <java-type>org.jboss.ws.eventing.element.RenewRequest</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.RenewRequest</java-type>
<root-type-qname
xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"&g...
<qname-scope>element</qname-scope>
</java-xml-type-mapping>
<java-xml-type-mapping>
- <java-type>org.jboss.ws.eventing.element.RenewRequest</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.RenewRequest</java-type>
<anonymous-type-qname
xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing">
typeNS:>Renew</anonymous-type-qname>
<qname-scope>complexType</qname-scope>
@@ -182,14 +182,14 @@
</java-xml-type-mapping>
<java-xml-type-mapping>
- <java-type>org.jboss.ws.eventing.element.RenewResponse</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.RenewResponse</java-type>
<root-type-qname
xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing">
typeNS:RenewResponse</root-type-qname>
<qname-scope>element</qname-scope>
</java-xml-type-mapping>
<java-xml-type-mapping>
- <java-type>org.jboss.ws.eventing.element.RenewResponse</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.RenewResponse</java-type>
<anonymous-type-qname
xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing">
typeNS:>RenewResponse</anonymous-type-qname>
<qname-scope>complexType</qname-scope>
@@ -200,7 +200,7 @@
</java-xml-type-mapping>
<java-xml-type-mapping>
- <java-type>org.jboss.ws.eventing.element.StatusRequest</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.StatusRequest</java-type>
<root-type-qname
xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing">
typeNS:GetStatus</root-type-qname>
<qname-scope>element</qname-scope>
@@ -211,21 +211,21 @@
</java-xml-type-mapping>
<java-xml-type-mapping>
- <java-type>org.jboss.ws.eventing.element.StatusRequest</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.StatusRequest</java-type>
<anonymous-type-qname
xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing">
typeNS:>GetStatus</anonymous-type-qname>
<qname-scope>complexType</qname-scope>
</java-xml-type-mapping>
<java-xml-type-mapping>
- <java-type>org.jboss.ws.eventing.element.StatusResponse</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.StatusResponse</java-type>
<root-type-qname
xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing">
typeNS:GetStatusResponse</root-type-qname>
<qname-scope>element</qname-scope>
</java-xml-type-mapping>
<java-xml-type-mapping>
- <java-type>org.jboss.ws.eventing.element.StatusResponse</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.StatusResponse</java-type>
<anonymous-type-qname
xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing">
typeNS:>GetStatusResponse</anonymous-type-qname>
<qname-scope>complexType</qname-scope>
@@ -236,7 +236,7 @@
</java-xml-type-mapping>
<java-xml-type-mapping>
-
<java-type>org.jboss.ws.eventing.element.UnsubscribeRequest</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.UnsubscribeRequest</java-type>
<root-type-qname
xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing">
typeNS:Unsubscribe</root-type-qname>
<qname-scope>element</qname-scope>
@@ -247,14 +247,14 @@
</java-xml-type-mapping>
<java-xml-type-mapping>
-
<java-type>org.jboss.ws.eventing.element.UnsubscribeRequest</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.UnsubscribeRequest</java-type>
<anonymous-type-qname
xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing">
typeNS:>Unsubscribe</anonymous-type-qname>
<qname-scope>complexType</qname-scope>
</java-xml-type-mapping>
<service-interface-mapping>
-
<service-interface>org.jboss.ws.eventing.EventingService</service-interface>
+
<service-interface>org.jboss.ws.extensions.eventing.EventingService</service-interface>
<wsdl-service-name
xmlns:serviceNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"...
serviceNS:EventingService</wsdl-service-name>
<port-mapping>
@@ -268,7 +268,7 @@
</service-interface-mapping>
<service-endpoint-interface-mapping>
-
<service-endpoint-interface>org.jboss.ws.eventing.EventSourceEndpoint</service-endpoint-interface>
+
<service-endpoint-interface>org.jboss.ws.extensions.eventing.EventSourceEndpoint</service-endpoint-interface>
<wsdl-port-type
xmlns:portTypeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing&quo...
portTypeNS:EventSource</wsdl-port-type>
<wsdl-binding
xmlns:bindingNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"...
@@ -278,7 +278,7 @@
<wsdl-operation>SubscribeOp</wsdl-operation>
<method-param-parts-mapping>
<param-position>0</param-position>
-
<param-type>org.jboss.ws.eventing.element.SubscribeRequest</param-type>
+
<param-type>org.jboss.ws.extensions.eventing.element.SubscribeRequest</param-type>
<wsdl-message-mapping>
<wsdl-message
xmlns:wsdlMsgNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"...
wsdlMsgNS:SubscribeMsg</wsdl-message>
@@ -287,7 +287,7 @@
</wsdl-message-mapping>
</method-param-parts-mapping>
<wsdl-return-value-mapping>
-
<method-return-value>org.jboss.ws.eventing.element.SubscribeResponse</method-return-value>
+
<method-return-value>org.jboss.ws.extensions.eventing.element.SubscribeResponse</method-return-value>
<wsdl-message
xmlns:wsdlMsgNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"...
wsdlMsgNS:SubscribeResponseMsg</wsdl-message>
<wsdl-message-part-name>body</wsdl-message-part-name>
@@ -298,7 +298,7 @@
<java-method-name>subscriptionEnd</java-method-name>
<wsdl-operation>SubscriptionEnd</wsdl-operation>
<wsdl-return-value-mapping>
-
<method-return-value>org.jboss.ws.eventing.element.SubscriptionEndRequest</method-return-value>
+
<method-return-value>org.jboss.ws.extensions.eventing.element.SubscriptionEndRequest</method-return-value>
<wsdl-message
xmlns:wsdlMsgNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"...
wsdlMsgNS:SubscriptionEnd</wsdl-message>
<wsdl-message-part-name>body</wsdl-message-part-name>
@@ -308,7 +308,7 @@
</service-endpoint-interface-mapping>
<service-endpoint-interface-mapping>
-
<service-endpoint-interface>org.jboss.ws.eventing.SubscriptionManagerEndpoint</service-endpoint-interface>
+
<service-endpoint-interface>org.jboss.ws.extensions.eventing.SubscriptionManagerEndpoint</service-endpoint-interface>
<wsdl-port-type
xmlns:portTypeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing&quo...
portTypeNS:SubscriptionManager</wsdl-port-type>
@@ -320,7 +320,7 @@
<wsdl-operation>GetStatusOp</wsdl-operation>
<method-param-parts-mapping>
<param-position>0</param-position>
-
<param-type>org.jboss.ws.eventing.element.StatusRequest</param-type>
+
<param-type>org.jboss.ws.extensions.eventing.element.StatusRequest</param-type>
<wsdl-message-mapping>
<wsdl-message
xmlns:wsdlMsgNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"...
wsdlMsgNS:GetStatusMsg</wsdl-message>
@@ -329,7 +329,7 @@
</wsdl-message-mapping>
</method-param-parts-mapping>
<wsdl-return-value-mapping>
-
<method-return-value>org.jboss.ws.eventing.element.StatusResponse</method-return-value>
+
<method-return-value>org.jboss.ws.extensions.eventing.element.StatusResponse</method-return-value>
<wsdl-message
xmlns:wsdlMsgNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"...
wsdlMsgNS:GetStatusResponseMsg</wsdl-message>
<wsdl-message-part-name>body</wsdl-message-part-name>
@@ -341,7 +341,7 @@
<wsdl-operation>RenewOp</wsdl-operation>
<method-param-parts-mapping>
<param-position>0</param-position>
-
<param-type>org.jboss.ws.eventing.element.RenewRequest</param-type>
+
<param-type>org.jboss.ws.extensions.eventing.element.RenewRequest</param-type>
<wsdl-message-mapping>
<wsdl-message
xmlns:wsdlMsgNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"...
wsdlMsgNS:RenewMsg</wsdl-message>
@@ -350,7 +350,7 @@
</wsdl-message-mapping>
</method-param-parts-mapping>
<wsdl-return-value-mapping>
-
<method-return-value>org.jboss.ws.eventing.element.RenewResponse</method-return-value>
+
<method-return-value>org.jboss.ws.extensions.eventing.element.RenewResponse</method-return-value>
<wsdl-message
xmlns:wsdlMsgNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"...
wsdlMsgNS:RenewResponseMsg</wsdl-message>
<wsdl-message-part-name>body</wsdl-message-part-name>
@@ -362,7 +362,7 @@
<wsdl-operation>UnsubscribeOp</wsdl-operation>
<method-param-parts-mapping>
<param-position>0</param-position>
-
<param-type>org.jboss.ws.eventing.element.UnsubscribeRequest</param-type>
+
<param-type>org.jboss.ws.extensions.eventing.element.UnsubscribeRequest</param-type>
<wsdl-message-mapping>
<wsdl-message
xmlns:wsdlMsgNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"...
wsdlMsgNS:UnsubscribeMsg</wsdl-message>
Modified: trunk/src/test/resources/jaxrpc/samples/wseventing/WEB-INF/web.xml
===================================================================
--- trunk/src/test/resources/jaxrpc/samples/wseventing/WEB-INF/web.xml 2006-12-07 10:45:48
UTC (rev 1599)
+++ trunk/src/test/resources/jaxrpc/samples/wseventing/WEB-INF/web.xml 2006-12-07 10:43:36
UTC (rev 1600)
@@ -6,11 +6,11 @@
<servlet>
<servlet-name>EventSourceServlet</servlet-name>
-
<servlet-class>org.jboss.ws.eventing.EventSourceEndpointImpl</servlet-class>
+
<servlet-class>org.jboss.ws.extensions.eventing.EventSourceEndpointImpl</servlet-class>
</servlet>
<servlet>
<servlet-name>SubscriptionManagerServlet</servlet-name>
-
<servlet-class>org.jboss.ws.eventing.SubscriptionManagerEndpointImpl</servlet-class>
+
<servlet-class>org.jboss.ws.extensions.eventing.SubscriptionManagerEndpointImpl</servlet-class>
</servlet>
<servlet-mapping>
Modified: trunk/src/test/resources/jaxrpc/samples/wseventing/WEB-INF/webservices.xml
===================================================================
--- trunk/src/test/resources/jaxrpc/samples/wseventing/WEB-INF/webservices.xml 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/resources/jaxrpc/samples/wseventing/WEB-INF/webservices.xml 2006-12-07
10:43:36 UTC (rev 1600)
@@ -15,14 +15,14 @@
<port-component>
<port-component-name>SubscriptionManagerPort</port-component-name>
<wsdl-port>wsdl:SubscriptionManagerPort</wsdl-port>
-
<service-endpoint-interface>org.jboss.ws.eventing.SubscriptionManagerEndpoint</service-endpoint-interface>
+
<service-endpoint-interface>org.jboss.ws.extensions.eventing.SubscriptionManagerEndpoint</service-endpoint-interface>
<service-impl-bean>
<servlet-link>SubscriptionManagerServlet</servlet-link>
</service-impl-bean>
<handler>
<handler-name>WSAddressingHandler</handler-name>
-
<handler-class>org.jboss.ws.addressing.jaxrpc.WSAddressingServerHandler</handler-class>
+
<handler-class>org.jboss.ws.extensions.addressing.jaxrpc.WSAddressingServerHandler</handler-class>
</handler>
</port-component>
@@ -30,14 +30,14 @@
<port-component>
<port-component-name>EventSourcePort</port-component-name>
<wsdl-port>wsdl:EventSourcePort</wsdl-port>
-
<service-endpoint-interface>org.jboss.ws.eventing.EventSourceEndpoint</service-endpoint-interface>
+
<service-endpoint-interface>org.jboss.ws.extensions.eventing.EventSourceEndpoint</service-endpoint-interface>
<service-impl-bean>
<servlet-link>EventSourceServlet</servlet-link>
</service-impl-bean>
<handler>
<handler-name>WSAddressingHandler</handler-name>
-
<handler-class>org.jboss.ws.addressing.jaxrpc.WSAddressingServerHandler</handler-class>
+
<handler-class>org.jboss.ws.extensions.addressing.jaxrpc.WSAddressingServerHandler</handler-class>
</handler>
</port-component>
Modified: trunk/src/test/resources/jaxrpc/wseventing/META-INF/application-client.xml
===================================================================
--- trunk/src/test/resources/jaxrpc/wseventing/META-INF/application-client.xml 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/resources/jaxrpc/wseventing/META-INF/application-client.xml 2006-12-07
10:43:36 UTC (rev 1600)
@@ -8,21 +8,21 @@
<service-ref>
<service-ref-name>service/EventingService</service-ref-name>
-
<service-interface>org.jboss.ws.eventing.EventingService</service-interface>
+
<service-interface>org.jboss.ws.extensions.eventing.EventingService</service-interface>
<wsdl-file>META-INF/wsdl/wind.wsdl</wsdl-file>
<jaxrpc-mapping-file>META-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
<port-component-ref>
-
<service-endpoint-interface>org.jboss.ws.eventing.EventSourceEndpoint</service-endpoint-interface>
+
<service-endpoint-interface>org.jboss.ws.extensions.eventing.EventSourceEndpoint</service-endpoint-interface>
</port-component-ref>
<port-component-ref>
-
<service-endpoint-interface>org.jboss.ws.eventing.SubscriptionManagerEndpoint</service-endpoint-interface>
+
<service-endpoint-interface>org.jboss.ws.extensions.eventing.SubscriptionManagerEndpoint</service-endpoint-interface>
</port-component-ref>
<handler>
<handler-name>SOAPOutboundHandler</handler-name>
-
<handler-class>org.jboss.ws.addressing.jaxrpc.WSAddressingClientHandler</handler-class>
+
<handler-class>org.jboss.ws.extensions.addressing.jaxrpc.WSAddressingClientHandler</handler-class>
</handler>
</service-ref>
Modified: trunk/src/test/resources/jaxrpc/wseventing/WEB-INF/jaxrpc-mapping.xml
===================================================================
--- trunk/src/test/resources/jaxrpc/wseventing/WEB-INF/jaxrpc-mapping.xml 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/resources/jaxrpc/wseventing/WEB-INF/jaxrpc-mapping.xml 2006-12-07
10:43:36 UTC (rev 1600)
@@ -3,19 +3,19 @@
version="1.1"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd">
<package-mapping>
- <package-type>org.jboss.ws.eventing</package-type>
+ <package-type>org.jboss.ws.extensions.eventing</package-type>
<
namespaceURI>http://schemas.xmlsoap.org/ws/2004/08/eventing</namesp...
</package-mapping>
<java-xml-type-mapping>
- <java-type>org.jboss.ws.eventing.element.SubscribeRequest</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.SubscribeRequest</java-type>
<root-type-qname
xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing">
typeNS:Subscribe</root-type-qname>
<qname-scope>element</qname-scope>
</java-xml-type-mapping>
<java-xml-type-mapping>
- <java-type>org.jboss.ws.eventing.element.SubscribeRequest</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.SubscribeRequest</java-type>
<anonymous-type-qname
xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing">
typeNS:>Subscribe</anonymous-type-qname>
<qname-scope>complexType</qname-scope>
@@ -42,7 +42,7 @@
</java-xml-type-mapping>
<java-xml-type-mapping>
- <java-type>org.jboss.ws.eventing.element.FilterType</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.FilterType</java-type>
<root-type-qname
xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing">
typeNS:FilterType</root-type-qname>
<qname-scope>complexType</qname-scope>
@@ -57,7 +57,7 @@
</java-xml-type-mapping>
<java-xml-type-mapping>
- <java-type>org.jboss.ws.eventing.element.DeliveryType</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.DeliveryType</java-type>
<root-type-qname
xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing">
typeNS:DeliveryType</root-type-qname>
<qname-scope>complexType</qname-scope>
@@ -76,14 +76,14 @@
</java-xml-type-mapping>
<java-xml-type-mapping>
-
<java-type>org.jboss.ws.eventing.element.SubscriptionEndRequest</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.SubscriptionEndRequest</java-type>
<root-type-qname
xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing">
typeNS:SubscriptionEnd</root-type-qname>
<qname-scope>element</qname-scope>
</java-xml-type-mapping>
<java-xml-type-mapping>
-
<java-type>org.jboss.ws.eventing.element.SubscriptionEndRequest</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.SubscriptionEndRequest</java-type>
<anonymous-type-qname
xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing">
typeNS:>SubscriptionEnd</anonymous-type-qname>
<qname-scope>complexType</qname-scope>
@@ -102,14 +102,14 @@
</java-xml-type-mapping>
<java-xml-type-mapping>
- <java-type>org.jboss.ws.eventing.element.SubscribeResponse</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.SubscribeResponse</java-type>
<root-type-qname
xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing">
typeNS:SubscribeResponse</root-type-qname>
<qname-scope>element</qname-scope>
</java-xml-type-mapping>
<java-xml-type-mapping>
- <java-type>org.jboss.ws.eventing.element.SubscribeResponse</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.SubscribeResponse</java-type>
<anonymous-type-qname
xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing">
typeNS:>SubscribeResponse</anonymous-type-qname>
<qname-scope>complexType</qname-scope>
@@ -124,13 +124,13 @@
</java-xml-type-mapping>
<java-xml-type-mapping>
- <java-type>org.jboss.ws.eventing.element.EndpointReference</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.EndpointReference</java-type>
<root-type-qname
xmlns:typeNS="http://www.w3.org/2005/08/addressing">typeNS:E...
<qname-scope>element</qname-scope>
</java-xml-type-mapping>
<java-xml-type-mapping>
- <java-type>org.jboss.ws.eventing.element.EndpointReference</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.EndpointReference</java-type>
<root-type-qname
xmlns:typeNS="http://www.w3.org/2005/08/addressing">
typeNS:EndpointReferenceType</root-type-qname>
<qname-scope>complexType</qname-scope>
@@ -149,13 +149,13 @@
</java-xml-type-mapping>
<java-xml-type-mapping>
- <java-type>org.jboss.ws.eventing.element.MetaData</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.MetaData</java-type>
<root-type-qname
xmlns:typeNS="http://www.w3.org/2005/08/addressing">typeNS:M...
<qname-scope>element</qname-scope>
</java-xml-type-mapping>
<!--java-xml-type-mapping>
- <java-type>org.jboss.ws.eventing.element.MetaData</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.MetaData</java-type>
<root-type-qname
xmlns:typeNS="http://www.w3.org/2005/08/addressing">typeNS:M...
<qname-scope>complexType</qname-scope>
<variable-mapping>
@@ -165,13 +165,13 @@
</java-xml-type-mapping-->
<java-xml-type-mapping>
- <java-type>org.jboss.ws.eventing.element.RenewRequest</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.RenewRequest</java-type>
<root-type-qname
xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"&g...
<qname-scope>element</qname-scope>
</java-xml-type-mapping>
<java-xml-type-mapping>
- <java-type>org.jboss.ws.eventing.element.RenewRequest</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.RenewRequest</java-type>
<anonymous-type-qname
xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing">
typeNS:>Renew</anonymous-type-qname>
<qname-scope>complexType</qname-scope>
@@ -182,14 +182,14 @@
</java-xml-type-mapping>
<java-xml-type-mapping>
- <java-type>org.jboss.ws.eventing.element.RenewResponse</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.RenewResponse</java-type>
<root-type-qname
xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing">
typeNS:RenewResponse</root-type-qname>
<qname-scope>element</qname-scope>
</java-xml-type-mapping>
<java-xml-type-mapping>
- <java-type>org.jboss.ws.eventing.element.RenewResponse</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.RenewResponse</java-type>
<anonymous-type-qname
xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing">
typeNS:>RenewResponse</anonymous-type-qname>
<qname-scope>complexType</qname-scope>
@@ -200,7 +200,7 @@
</java-xml-type-mapping>
<java-xml-type-mapping>
- <java-type>org.jboss.ws.eventing.element.StatusRequest</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.StatusRequest</java-type>
<root-type-qname
xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing">
typeNS:GetStatus</root-type-qname>
<qname-scope>element</qname-scope>
@@ -211,21 +211,21 @@
</java-xml-type-mapping>
<java-xml-type-mapping>
- <java-type>org.jboss.ws.eventing.element.StatusRequest</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.StatusRequest</java-type>
<anonymous-type-qname
xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing">
typeNS:>GetStatus</anonymous-type-qname>
<qname-scope>complexType</qname-scope>
</java-xml-type-mapping>
<java-xml-type-mapping>
- <java-type>org.jboss.ws.eventing.element.StatusResponse</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.StatusResponse</java-type>
<root-type-qname
xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing">
typeNS:GetStatusResponse</root-type-qname>
<qname-scope>element</qname-scope>
</java-xml-type-mapping>
<java-xml-type-mapping>
- <java-type>org.jboss.ws.eventing.element.StatusResponse</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.StatusResponse</java-type>
<anonymous-type-qname
xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing">
typeNS:>GetStatusResponse</anonymous-type-qname>
<qname-scope>complexType</qname-scope>
@@ -236,7 +236,7 @@
</java-xml-type-mapping>
<java-xml-type-mapping>
-
<java-type>org.jboss.ws.eventing.element.UnsubscribeRequest</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.UnsubscribeRequest</java-type>
<root-type-qname
xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing">
typeNS:Unsubscribe</root-type-qname>
<qname-scope>element</qname-scope>
@@ -247,14 +247,14 @@
</java-xml-type-mapping>
<java-xml-type-mapping>
-
<java-type>org.jboss.ws.eventing.element.UnsubscribeRequest</java-type>
+
<java-type>org.jboss.ws.extensions.eventing.element.UnsubscribeRequest</java-type>
<anonymous-type-qname
xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing">
typeNS:>Unsubscribe</anonymous-type-qname>
<qname-scope>complexType</qname-scope>
</java-xml-type-mapping>
<service-interface-mapping>
-
<service-interface>org.jboss.ws.eventing.EventingService</service-interface>
+
<service-interface>org.jboss.ws.extensions.eventing.EventingService</service-interface>
<wsdl-service-name
xmlns:serviceNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"...
serviceNS:EventingService</wsdl-service-name>
<port-mapping>
@@ -268,7 +268,7 @@
</service-interface-mapping>
<service-endpoint-interface-mapping>
-
<service-endpoint-interface>org.jboss.ws.eventing.EventSourceEndpoint</service-endpoint-interface>
+
<service-endpoint-interface>org.jboss.ws.extensions.eventing.EventSourceEndpoint</service-endpoint-interface>
<wsdl-port-type
xmlns:portTypeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing&quo...
portTypeNS:EventSource</wsdl-port-type>
<wsdl-binding
xmlns:bindingNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"...
@@ -278,7 +278,7 @@
<wsdl-operation>SubscribeOp</wsdl-operation>
<method-param-parts-mapping>
<param-position>0</param-position>
-
<param-type>org.jboss.ws.eventing.element.SubscribeRequest</param-type>
+
<param-type>org.jboss.ws.extensions.eventing.element.SubscribeRequest</param-type>
<wsdl-message-mapping>
<wsdl-message
xmlns:wsdlMsgNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"...
wsdlMsgNS:SubscribeMsg</wsdl-message>
@@ -287,7 +287,7 @@
</wsdl-message-mapping>
</method-param-parts-mapping>
<wsdl-return-value-mapping>
-
<method-return-value>org.jboss.ws.eventing.element.SubscribeResponse</method-return-value>
+
<method-return-value>org.jboss.ws.extensions.eventing.element.SubscribeResponse</method-return-value>
<wsdl-message
xmlns:wsdlMsgNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"...
wsdlMsgNS:SubscribeResponseMsg</wsdl-message>
<wsdl-message-part-name>body</wsdl-message-part-name>
@@ -298,7 +298,7 @@
<java-method-name>subscriptionEnd</java-method-name>
<wsdl-operation>SubscriptionEnd</wsdl-operation>
<wsdl-return-value-mapping>
-
<method-return-value>org.jboss.ws.eventing.element.SubscriptionEndRequest</method-return-value>
+
<method-return-value>org.jboss.ws.extensions.eventing.element.SubscriptionEndRequest</method-return-value>
<wsdl-message
xmlns:wsdlMsgNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"...
wsdlMsgNS:SubscriptionEnd</wsdl-message>
<wsdl-message-part-name>body</wsdl-message-part-name>
@@ -308,7 +308,7 @@
</service-endpoint-interface-mapping>
<service-endpoint-interface-mapping>
-
<service-endpoint-interface>org.jboss.ws.eventing.SubscriptionManagerEndpoint</service-endpoint-interface>
+
<service-endpoint-interface>org.jboss.ws.extensions.eventing.SubscriptionManagerEndpoint</service-endpoint-interface>
<wsdl-port-type
xmlns:portTypeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing&quo...
portTypeNS:SubscriptionManager</wsdl-port-type>
@@ -320,7 +320,7 @@
<wsdl-operation>GetStatusOp</wsdl-operation>
<method-param-parts-mapping>
<param-position>0</param-position>
-
<param-type>org.jboss.ws.eventing.element.StatusRequest</param-type>
+
<param-type>org.jboss.ws.extensions.eventing.element.StatusRequest</param-type>
<wsdl-message-mapping>
<wsdl-message
xmlns:wsdlMsgNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"...
wsdlMsgNS:GetStatusMsg</wsdl-message>
@@ -329,7 +329,7 @@
</wsdl-message-mapping>
</method-param-parts-mapping>
<wsdl-return-value-mapping>
-
<method-return-value>org.jboss.ws.eventing.element.StatusResponse</method-return-value>
+
<method-return-value>org.jboss.ws.extensions.eventing.element.StatusResponse</method-return-value>
<wsdl-message
xmlns:wsdlMsgNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"...
wsdlMsgNS:GetStatusResponseMsg</wsdl-message>
<wsdl-message-part-name>body</wsdl-message-part-name>
@@ -341,7 +341,7 @@
<wsdl-operation>RenewOp</wsdl-operation>
<method-param-parts-mapping>
<param-position>0</param-position>
-
<param-type>org.jboss.ws.eventing.element.RenewRequest</param-type>
+
<param-type>org.jboss.ws.extensions.eventing.element.RenewRequest</param-type>
<wsdl-message-mapping>
<wsdl-message
xmlns:wsdlMsgNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"...
wsdlMsgNS:RenewMsg</wsdl-message>
@@ -350,7 +350,7 @@
</wsdl-message-mapping>
</method-param-parts-mapping>
<wsdl-return-value-mapping>
-
<method-return-value>org.jboss.ws.eventing.element.RenewResponse</method-return-value>
+
<method-return-value>org.jboss.ws.extensions.eventing.element.RenewResponse</method-return-value>
<wsdl-message
xmlns:wsdlMsgNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"...
wsdlMsgNS:RenewResponseMsg</wsdl-message>
<wsdl-message-part-name>body</wsdl-message-part-name>
@@ -362,7 +362,7 @@
<wsdl-operation>UnsubscribeOp</wsdl-operation>
<method-param-parts-mapping>
<param-position>0</param-position>
-
<param-type>org.jboss.ws.eventing.element.UnsubscribeRequest</param-type>
+
<param-type>org.jboss.ws.extensions.eventing.element.UnsubscribeRequest</param-type>
<wsdl-message-mapping>
<wsdl-message
xmlns:wsdlMsgNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"...
wsdlMsgNS:UnsubscribeMsg</wsdl-message>
Modified: trunk/src/test/resources/jaxrpc/wseventing/WEB-INF/web.xml
===================================================================
--- trunk/src/test/resources/jaxrpc/wseventing/WEB-INF/web.xml 2006-12-07 10:45:48 UTC
(rev 1599)
+++ trunk/src/test/resources/jaxrpc/wseventing/WEB-INF/web.xml 2006-12-07 10:43:36 UTC
(rev 1600)
@@ -6,7 +6,7 @@
<display-name>Eventing Service App</display-name>
<servlet>
<servlet-name>EventSourceServlet</servlet-name>
-
<servlet-class>org.jboss.ws.eventing.EventSourceEndpointImpl</servlet-class>
+
<servlet-class>org.jboss.ws.extensions.eventing.EventSourceEndpointImpl</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
@@ -16,7 +16,7 @@
<servlet>
<servlet-name>SubscriptionManagerServlet</servlet-name>
-
<servlet-class>org.jboss.ws.eventing.SubscriptionManagerEndpointImpl</servlet-class>
+
<servlet-class>org.jboss.ws.extensions.eventing.SubscriptionManagerEndpointImpl</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
Modified: trunk/src/test/resources/jaxrpc/wseventing/WEB-INF/webservices.xml
===================================================================
--- trunk/src/test/resources/jaxrpc/wseventing/WEB-INF/webservices.xml 2006-12-07 10:45:48
UTC (rev 1599)
+++ trunk/src/test/resources/jaxrpc/wseventing/WEB-INF/webservices.xml 2006-12-07 10:43:36
UTC (rev 1600)
@@ -15,14 +15,14 @@
<port-component>
<port-component-name>SubscriptionManagerPort</port-component-name>
<wsdl-port>wsdl:SubscriptionManagerPort</wsdl-port>
-
<service-endpoint-interface>org.jboss.ws.eventing.SubscriptionManagerEndpoint</service-endpoint-interface>
+
<service-endpoint-interface>org.jboss.ws.extensions.eventing.SubscriptionManagerEndpoint</service-endpoint-interface>
<service-impl-bean>
<servlet-link>SubscriptionManagerServlet</servlet-link>
</service-impl-bean>
<handler>
-
<handler-name>org.jboss.ws.addressing.jaxrpc.WSAddressingServerHandler</handler-name>
-
<handler-class>org.jboss.ws.addressing.jaxrpc.WSAddressingServerHandler</handler-class>
+ <handler-name>WSAddressingServerHandler</handler-name>
+
<handler-class>org.jboss.ws.extensions.addressing.jaxrpc.WSAddressingServerHandler</handler-class>
</handler>
</port-component>
@@ -30,13 +30,13 @@
<port-component>
<port-component-name>EventSourcePort</port-component-name>
<wsdl-port>wsdl:EventSourcePort</wsdl-port>
-
<service-endpoint-interface>org.jboss.ws.eventing.EventSourceEndpoint</service-endpoint-interface>
+
<service-endpoint-interface>org.jboss.ws.extensions.eventing.EventSourceEndpoint</service-endpoint-interface>
<service-impl-bean>
<servlet-link>EventSourceServlet</servlet-link>
</service-impl-bean>
<handler>
-
<handler-name>org.jboss.ws.addressing.jaxrpc.WSAddressingServerHandler</handler-name>
-
<handler-class>org.jboss.ws.addressing.jaxrpc.WSAddressingServerHandler</handler-class>
+ <handler-name>WSAddressingServerHandler</handler-name>
+
<handler-class>org.jboss.ws.extensions.addressing.jaxrpc.WSAddressingServerHandler</handler-class>
</handler>
</port-component>
Modified: trunk/src/test/resources/jaxws/samples/jsr181ejb/config/ServerHandlers.xml
===================================================================
--- trunk/src/test/resources/jaxws/samples/jsr181ejb/config/ServerHandlers.xml 2006-12-07
10:45:48 UTC (rev 1599)
+++ trunk/src/test/resources/jaxws/samples/jsr181ejb/config/ServerHandlers.xml 2006-12-07
10:43:36 UTC (rev 1600)
@@ -5,7 +5,7 @@
<handler-chain-name>SecureHandlerChain</handler-chain-name>
<handler>
<handler-name>WSSecurityHandlerInbound</handler-name>
-
<handler-class>org.jboss.ws.wsse.WSSecurityHandlerInbound</handler-class>
+
<handler-class>org.jboss.ws.extensions.security.WSSecurityHandlerInbound</handler-class>
</handler>
</handler-chain>
</handler-config>
Modified:
trunk/src/test/resources/jaxws/wsaddressing/action/META-INF/jbossws-client-config.xml
===================================================================
---
trunk/src/test/resources/jaxws/wsaddressing/action/META-INF/jbossws-client-config.xml 2006-12-07
10:45:48 UTC (rev 1599)
+++
trunk/src/test/resources/jaxws/wsaddressing/action/META-INF/jbossws-client-config.xml 2006-12-07
10:43:36 UTC (rev 1600)
@@ -13,7 +13,7 @@
<handler-chain-name>PostHandlerChain</handler-chain-name>
<handler>
<j2ee:handler-name>SOAPClientHandler</j2ee:handler-name>
-
<j2ee:handler-class>org.jboss.ws.addressing.jaxrpc.WSAddressingClientHandler</j2ee:handler-class>
+
<j2ee:handler-class>org.jboss.ws.extensions.addressing.jaxrpc.WSAddressingClientHandler</j2ee:handler-class>
</handler>
</post-handler-chain>
</client-config>