You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by sc...@apache.org on 2007/02/09 04:13:41 UTC
svn commit: r505153 - in /webservices/axis2/trunk/java/modules:
jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/
jaxws/src/org/apache/axis2/jaxws/runtime/description/
jaxws/src/org/apache/axis2/jaxws/runtime/description/impl/
jaxws/src/org/apache/...
Author: scheu
Date: Thu Feb 8 19:13:40 2007
New Revision: 505153
URL: http://svn.apache.org/viewvc?view=rev&rev=505153
Log:
AXIS2-1800
Contributor:Rich Scheuerle
Move package name collecting from metadata module to the jaxws module
Added:
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/injection/
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/injection/ResourceInjectionServiceRuntimeDescription.java
- copied, changed from r505013, webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/ResourceInjectionServiceRuntimeDescription.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/injection/ResourceInjectionServiceRuntimeDescriptionFactory.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/injection/impl/
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/injection/impl/ResourceInjectionServiceRuntimeDescriptionBuilder.java
- copied, changed from r505013, webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/impl/ResourceInjectionServiceRuntimeDescriptionBuilder.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/injection/impl/ResourceInjectionServiceRuntimeDescriptionImpl.java
- copied, changed from r505013, webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/impl/ResourceInjectionServiceRuntimeDescriptionImpl.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/MarshalServiceRuntimeDescription.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/MarshalServiceRuntimeDescriptionFactory.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/MarshalServiceRuntimeDescriptionBuilder.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/MarshalServiceRuntimeDescriptionImpl.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/PackageSetBuilder.java
- copied, changed from r505017, webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/PackageSetBuilder.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/wsdl/
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/wsdl/SchemaReader.java
- copied unchanged from r505017, webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/wsdl/SchemaReader.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/wsdl/SchemaReaderException.java
- copied unchanged from r505017, webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/wsdl/SchemaReaderException.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/wsdl/impl/
- copied from r505017, webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/wsdl/impl/
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/wsdl/impl/SchemaReaderImpl.java
- copied unchanged from r505113, webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/wsdl/impl/SchemaReaderImpl.java
Removed:
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/ResourceInjectionServiceRuntimeDescription.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/ResourceInjectionServiceRuntimeDescriptionFactory.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/impl/ResourceInjectionServiceRuntimeDescriptionBuilder.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/impl/ResourceInjectionServiceRuntimeDescriptionImpl.java
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/PackageSetBuilder.java
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/wsdl/SchemaReader.java
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/wsdl/SchemaReaderException.java
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/wsdl/impl/
Modified:
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMethodMarshaller.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedPlusMethodMarshaller.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/RPCLitMethodMarshaller.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/endpoint/lifecycle/impl/EndpointLifecycleManagerImpl.java
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/EndpointDescription.java
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java?view=diff&rev=505153&r1=505152&r2=505153
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java Thu Feb 8 19:13:40 2007
@@ -33,6 +33,7 @@
import org.apache.axis2.jaxws.message.Protocol;
import org.apache.axis2.jaxws.message.factory.MessageFactory;
import org.apache.axis2.jaxws.registry.FactoryRegistry;
+import org.apache.axis2.jaxws.runtime.description.marshal.MarshalServiceRuntimeDescription;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -68,7 +69,8 @@
// 4) The type of the data block is defined by schema; thus in most cases
// an xsi:type will not be present
ParameterDescription[] pds =operationDesc.getParameterDescriptions();
- TreeSet<String> packages = endpointDesc.getPackages();
+ MarshalServiceRuntimeDescription marshalDesc = MethodMarshallerUtils.getMarshalDesc(endpointDesc);
+ TreeSet<String> packages = marshalDesc.getPackages();
// Get the return value.
Class returnType = operationDesc.getResultActualType();
@@ -116,7 +118,8 @@
// 4) The type of the data block (data:foo) is defined by schema (and probably
// is not present in the message
ParameterDescription[] pds =operationDesc.getParameterDescriptions();
- TreeSet<String> packages = endpointDesc.getPackages();
+ MarshalServiceRuntimeDescription marshalDesc = MethodMarshallerUtils.getMarshalDesc(endpointDesc);
+ TreeSet<String> packages = marshalDesc.getPackages();
// Unmarshal the ParamValues from the message
@@ -165,7 +168,8 @@
// Get the operation information
ParameterDescription[] pds =operationDesc.getParameterDescriptions();
- TreeSet<String> packages = endpointDesc.getPackages();
+ MarshalServiceRuntimeDescription marshalDesc = MethodMarshallerUtils.getMarshalDesc(endpointDesc);
+ TreeSet<String> packages = marshalDesc.getPackages();
// Create the message
MessageFactory mf = (MessageFactory)FactoryRegistry.getFactory(MessageFactory.class);
@@ -221,7 +225,8 @@
// Get the operation information
ParameterDescription[] pds =operationDesc.getParameterDescriptions();
- TreeSet<String> packages = endpointDesc.getPackages();
+ MarshalServiceRuntimeDescription marshalDesc = MethodMarshallerUtils.getMarshalDesc(endpointDesc);
+ TreeSet<String> packages = marshalDesc.getPackages();
// Create the message
MessageFactory mf = (MessageFactory)FactoryRegistry.getFactory(MessageFactory.class);
@@ -249,6 +254,9 @@
EndpointInterfaceDescription ed = operationDesc.getEndpointInterfaceDescription();
EndpointDescription endpointDesc = ed.getEndpointDescription();
+ MarshalServiceRuntimeDescription marshalDesc = MethodMarshallerUtils.getMarshalDesc(endpointDesc);
+ TreeSet<String> packages = marshalDesc.getPackages();
+
// We want to respond with the same protocol as the request,
// It the protocol is null, then use the Protocol defined by the binding
if (protocol == null) {
@@ -264,7 +272,7 @@
// Put the fault onto the message
MethodMarshallerUtils.marshalFaultResponse(throwable,
operationDesc,
- endpointDesc.getPackages(),
+ packages,
m,
false); // don't force xsi:type for doc/lit
return m;
@@ -277,10 +285,12 @@
EndpointInterfaceDescription ed = operationDesc.getEndpointInterfaceDescription();
EndpointDescription endpointDesc = ed.getEndpointDescription();
+ MarshalServiceRuntimeDescription marshalDesc = MethodMarshallerUtils.getMarshalDesc(endpointDesc);
+ TreeSet<String> packages = marshalDesc.getPackages();
// Note all exceptions are caught and rethrown with a WebServiceException
try {
- Throwable t = MethodMarshallerUtils.demarshalFaultResponse(operationDesc, endpointDesc.getPackages(), message, false);
+ Throwable t = MethodMarshallerUtils.demarshalFaultResponse(operationDesc, packages, message, false);
return t;
} catch(Exception e) {
throw ExceptionFactory.makeWebServiceException(e);
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMethodMarshaller.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMethodMarshaller.java?view=diff&rev=505153&r1=505152&r2=505153
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMethodMarshaller.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMethodMarshaller.java Thu Feb 8 19:13:40 2007
@@ -42,6 +42,7 @@
import org.apache.axis2.jaxws.message.factory.JAXBBlockFactory;
import org.apache.axis2.jaxws.message.factory.MessageFactory;
import org.apache.axis2.jaxws.registry.FactoryRegistry;
+import org.apache.axis2.jaxws.runtime.description.marshal.MarshalServiceRuntimeDescription;
import org.apache.axis2.jaxws.util.ConvertUtils;
import org.apache.axis2.jaxws.util.XMLRootElementUtil;
import org.apache.axis2.jaxws.wrapper.JAXBWrapperTool;
@@ -82,7 +83,8 @@
// 4) The type of the data block is defined by schema; thus in most cases
// an xsi:type will not be present
ParameterDescription[] pds =operationDesc.getParameterDescriptions();
- TreeSet<String> packages = endpointDesc.getPackages();
+ MarshalServiceRuntimeDescription marshalDesc = MethodMarshallerUtils.getMarshalDesc(endpointDesc);
+ TreeSet<String> packages = marshalDesc.getPackages();
// Determine if a returnValue is expected.
// The return value may be an child element
@@ -192,8 +194,9 @@
// 4) The type of the data block (data:foo) is defined by schema (and probably
// is not present in the message
ParameterDescription[] pds =operationDesc.getParameterDescriptions();
- TreeSet<String> packages = endpointDesc.getPackages();
-
+ MarshalServiceRuntimeDescription marshalDesc = MethodMarshallerUtils.getMarshalDesc(endpointDesc);
+ TreeSet<String> packages = marshalDesc.getPackages();
+
// In usage=WRAPPED, there will be a single JAXB block inside the body.
// Get this block
JAXBBlockContext blockContext = new JAXBBlockContext(packages);
@@ -257,6 +260,9 @@
EndpointInterfaceDescription ed = operationDesc.getEndpointInterfaceDescription();
EndpointDescription endpointDesc = ed.getEndpointDescription();
+ MarshalServiceRuntimeDescription marshalDesc = MethodMarshallerUtils.getMarshalDesc(endpointDesc);
+ TreeSet<String> packages = marshalDesc.getPackages();
+
// We want to respond with the same protocol as the request,
// It the protocol is null, then use the Protocol defined by the binding
if (protocol == null) {
@@ -344,7 +350,7 @@
(JAXBBlockFactory)FactoryRegistry.getFactory(JAXBBlockFactory.class);
Block block = factory.createFrom(object,
- new JAXBBlockContext(endpointDesc.getPackages()),
+ new JAXBBlockContext(packages),
null); // The factory will get the qname from the value
m.setBodyBlock(block);
@@ -359,6 +365,8 @@
EndpointInterfaceDescription ed = operationDesc.getEndpointInterfaceDescription();
EndpointDescription endpointDesc = ed.getEndpointDescription();
Protocol protocol = Protocol.getProtocolForBinding(endpointDesc.getClientBindingID());
+ MarshalServiceRuntimeDescription marshalDesc = MethodMarshallerUtils.getMarshalDesc(endpointDesc);
+ TreeSet<String> packages = marshalDesc.getPackages();
// Note all exceptions are caught and rethrown with a WebServiceException
@@ -430,7 +438,7 @@
(JAXBBlockFactory)FactoryRegistry.getFactory(JAXBBlockFactory.class);
Block block = factory.createFrom(object,
- new JAXBBlockContext(endpointDesc.getPackages()),
+ new JAXBBlockContext(packages),
null); // The factory will get the qname from the value
m.setBodyBlock(block);
@@ -444,6 +452,9 @@
EndpointInterfaceDescription ed = operationDesc.getEndpointInterfaceDescription();
EndpointDescription endpointDesc = ed.getEndpointDescription();
+ MarshalServiceRuntimeDescription marshalDesc = MethodMarshallerUtils.getMarshalDesc(endpointDesc);
+ TreeSet<String> packages = marshalDesc.getPackages();
+
// We want to respond with the same protocol as the request,
// It the protocol is null, then use the Protocol defined by the binding
if (protocol == null) {
@@ -459,7 +470,7 @@
// Put the fault onto the message
MethodMarshallerUtils.marshalFaultResponse(throwable,
operationDesc,
- endpointDesc.getPackages(),
+ packages,
m,
false); // don't force xsi:type for doc/lit
return m;
@@ -472,11 +483,13 @@
EndpointInterfaceDescription ed = operationDesc.getEndpointInterfaceDescription();
EndpointDescription endpointDesc = ed.getEndpointDescription();
+ MarshalServiceRuntimeDescription marshalDesc = MethodMarshallerUtils.getMarshalDesc(endpointDesc);
+ TreeSet<String> packages = marshalDesc.getPackages();
// Note all exceptions are caught and rethrown with a WebServiceException
try {
Throwable t = MethodMarshallerUtils.demarshalFaultResponse(operationDesc,
- endpointDesc.getPackages(),
+ packages,
message,
false);
return t;
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedPlusMethodMarshaller.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedPlusMethodMarshaller.java?view=diff&rev=505153&r1=505152&r2=505153
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedPlusMethodMarshaller.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedPlusMethodMarshaller.java Thu Feb 8 19:13:40 2007
@@ -49,6 +49,7 @@
import org.apache.axis2.jaxws.message.factory.JAXBBlockFactory;
import org.apache.axis2.jaxws.message.factory.MessageFactory;
import org.apache.axis2.jaxws.registry.FactoryRegistry;
+import org.apache.axis2.jaxws.runtime.description.marshal.MarshalServiceRuntimeDescription;
import org.apache.axis2.jaxws.util.ConvertUtils;
import org.apache.axis2.jaxws.util.XMLRootElementUtil;
import org.apache.axis2.jaxws.wrapper.JAXBWrapperTool;
@@ -130,7 +131,8 @@
// 4) The type of the data block is defined by schema; thus in most cases
// an xsi:type will not be present
ParameterDescription[] pds =operationDesc.getParameterDescriptions();
- TreeSet<String> packages = endpointDesc.getPackages();
+ MarshalServiceRuntimeDescription marshalDesc = MethodMarshallerUtils.getMarshalDesc(endpointDesc);
+ TreeSet<String> packages = marshalDesc.getPackages();
// Determine if a returnValue is expected.
// The return value may be an child element
@@ -270,8 +272,9 @@
// 4) The type of the data block (data:foo) is defined by schema (and probably
// is not present in the message
ParameterDescription[] pds =operationDesc.getParameterDescriptions();
- TreeSet<String> packages = endpointDesc.getPackages();
-
+ MarshalServiceRuntimeDescription marshalDesc = MethodMarshallerUtils.getMarshalDesc(endpointDesc);
+ TreeSet<String> packages = marshalDesc.getPackages();
+
// In usage=WRAPPED, there will be a single JAXB block inside the body.
// Get this block
JAXBBlockContext blockContext = new JAXBBlockContext(packages);
@@ -381,7 +384,8 @@
// Get the operation information
ParameterDescription[] pds =operationDesc.getParameterDescriptions();
- TreeSet<String> packages = endpointDesc.getPackages();
+ MarshalServiceRuntimeDescription marshalDesc = MethodMarshallerUtils.getMarshalDesc(endpointDesc);
+ TreeSet<String> packages = marshalDesc.getPackages();
// Create the message
MessageFactory mf = (MessageFactory)FactoryRegistry.getFactory(MessageFactory.class);
@@ -489,6 +493,8 @@
EndpointInterfaceDescription ed = operationDesc.getEndpointInterfaceDescription();
EndpointDescription endpointDesc = ed.getEndpointDescription();
Protocol protocol = Protocol.getProtocolForBinding(endpointDesc.getClientBindingID());
+ MarshalServiceRuntimeDescription marshalDesc = MethodMarshallerUtils.getMarshalDesc(endpointDesc);
+ TreeSet<String> packages = marshalDesc.getPackages();
// Note all exceptions are caught and rethrown with a WebServiceException
@@ -569,7 +575,6 @@
// Put the object into the message
JAXBBlockFactory factory =
(JAXBBlockFactory)FactoryRegistry.getFactory(JAXBBlockFactory.class);
- TreeSet<String> packages = endpointDesc.getPackages();
Block block = factory.createFrom(object,
new JAXBBlockContext(packages),
null); // The factory will get the qname from the value
@@ -592,6 +597,9 @@
}
EndpointInterfaceDescription ed = operationDesc.getEndpointInterfaceDescription();
EndpointDescription endpointDesc = ed.getEndpointDescription();
+ MarshalServiceRuntimeDescription marshalDesc = MethodMarshallerUtils.getMarshalDesc(endpointDesc);
+ TreeSet<String> packages = marshalDesc.getPackages();
+
// We want to respond with the same protocol as the request,
// It the protocol is null, then use the Protocol defined by the binding
if (protocol == null) {
@@ -607,7 +615,7 @@
// Put the fault onto the message
MethodMarshallerUtils.marshalFaultResponse(throwable,
operationDesc,
- endpointDesc.getPackages(),
+ packages,
m,
false); // don't force xsi:type for doc/lit
return m;
@@ -623,11 +631,13 @@
}
EndpointInterfaceDescription ed = operationDesc.getEndpointInterfaceDescription();
EndpointDescription endpointDesc = ed.getEndpointDescription();
+ MarshalServiceRuntimeDescription marshalDesc = MethodMarshallerUtils.getMarshalDesc(endpointDesc);
+ TreeSet<String> packages = marshalDesc.getPackages();
// Note all exceptions are caught and rethrown with a WebServiceException
try {
Throwable t = MethodMarshallerUtils.demarshalFaultResponse(operationDesc,
- endpointDesc.getPackages(),
+ packages,
message,
false);
return t;
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java?view=diff&rev=505153&r1=505152&r2=505153
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java Thu Feb 8 19:13:40 2007
@@ -44,9 +44,11 @@
import org.apache.axis2.java.security.AccessController;
import org.apache.axis2.jaxws.ExceptionFactory;
+import org.apache.axis2.jaxws.description.EndpointDescription;
import org.apache.axis2.jaxws.description.FaultDescription;
import org.apache.axis2.jaxws.description.OperationDescription;
import org.apache.axis2.jaxws.description.ParameterDescription;
+import org.apache.axis2.jaxws.description.ServiceDescription;
import org.apache.axis2.jaxws.i18n.Messages;
import org.apache.axis2.jaxws.message.Block;
import org.apache.axis2.jaxws.message.Message;
@@ -57,6 +59,8 @@
import org.apache.axis2.jaxws.message.factory.JAXBBlockFactory;
import org.apache.axis2.jaxws.message.util.XMLFaultUtils;
import org.apache.axis2.jaxws.registry.FactoryRegistry;
+import org.apache.axis2.jaxws.runtime.description.marshal.MarshalServiceRuntimeDescription;
+import org.apache.axis2.jaxws.runtime.description.marshal.MarshalServiceRuntimeDescriptionFactory;
import org.apache.axis2.jaxws.util.ClassUtils;
import org.apache.axis2.jaxws.util.ConvertUtils;
import org.apache.axis2.jaxws.util.SAAJFactory;
@@ -964,5 +968,13 @@
return e;
}
+ /**
+ * @param ed
+ * @return
+ */
+ static MarshalServiceRuntimeDescription getMarshalDesc(EndpointDescription ed) {
+ ServiceDescription sd = ed.getServiceDescription();
+ return MarshalServiceRuntimeDescriptionFactory.get(sd);
+ }
}
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/RPCLitMethodMarshaller.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/RPCLitMethodMarshaller.java?view=diff&rev=505153&r1=505152&r2=505153
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/RPCLitMethodMarshaller.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/RPCLitMethodMarshaller.java Thu Feb 8 19:13:40 2007
@@ -36,6 +36,7 @@
import org.apache.axis2.jaxws.message.Protocol;
import org.apache.axis2.jaxws.message.factory.MessageFactory;
import org.apache.axis2.jaxws.registry.FactoryRegistry;
+import org.apache.axis2.jaxws.runtime.description.marshal.MarshalServiceRuntimeDescription;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -85,7 +86,8 @@
// Get the operation information
ParameterDescription[] pds =operationDesc.getParameterDescriptions();
- TreeSet<String> packages = endpointDesc.getPackages();
+ MarshalServiceRuntimeDescription marshalDesc = MethodMarshallerUtils.getMarshalDesc(endpointDesc);
+ TreeSet<String> packages = marshalDesc.getPackages();
// TODO This needs more work. We need to check inside holders of input params. We also
// may want to exclude header params from this check
@@ -161,7 +163,8 @@
// 5) We always send an xsi:type, but other vendor's may not.
// Get the operation information
ParameterDescription[] pds =operationDesc.getParameterDescriptions();
- TreeSet<String> packages = endpointDesc.getPackages();
+ MarshalServiceRuntimeDescription marshalDesc = MethodMarshallerUtils.getMarshalDesc(endpointDesc);
+ TreeSet<String> packages = marshalDesc.getPackages();
// Indicate that the style is RPC. This is important so that the message understands
// that the data blocks are underneath the operation element
@@ -236,7 +239,8 @@
// Get the operation information
ParameterDescription[] pds =operationDesc.getParameterDescriptions();
- TreeSet<String> packages = endpointDesc.getPackages();
+ MarshalServiceRuntimeDescription marshalDesc = MethodMarshallerUtils.getMarshalDesc(endpointDesc);
+ TreeSet<String> packages = marshalDesc.getPackages();
// Create the message
MessageFactory mf = (MessageFactory)FactoryRegistry.getFactory(MessageFactory.class);
@@ -330,7 +334,8 @@
// 5) We always send an xsi:type, but other vendor's may not.
// Get the operation information
ParameterDescription[] pds =operationDesc.getParameterDescriptions();
- TreeSet<String> packages = endpointDesc.getPackages();
+ MarshalServiceRuntimeDescription marshalDesc = MethodMarshallerUtils.getMarshalDesc(endpointDesc);
+ TreeSet<String> packages = marshalDesc.getPackages();
// Indicate that the style is RPC. This is important so that the message understands
// that the data blocks are underneath the operation element
@@ -375,6 +380,9 @@
EndpointInterfaceDescription ed = operationDesc.getEndpointInterfaceDescription();
EndpointDescription endpointDesc = ed.getEndpointDescription();
+ MarshalServiceRuntimeDescription marshalDesc = MethodMarshallerUtils.getMarshalDesc(endpointDesc);
+ TreeSet<String> packages = marshalDesc.getPackages();
+
// We want to respond with the same protocol as the request,
// It the protocol is null, then use the Protocol defined by the binding
if (protocol == null) {
@@ -395,7 +403,7 @@
// Put the fault onto the message
MethodMarshallerUtils.marshalFaultResponse(throwable,
operationDesc,
- endpointDesc.getPackages(),
+ packages,
m,
true); // isRPC=true
return m;
@@ -408,10 +416,12 @@
EndpointInterfaceDescription ed = operationDesc.getEndpointInterfaceDescription();
EndpointDescription endpointDesc = ed.getEndpointDescription();
+ MarshalServiceRuntimeDescription marshalDesc = MethodMarshallerUtils.getMarshalDesc(endpointDesc);
+ TreeSet<String> packages = marshalDesc.getPackages();
// Note all exceptions are caught and rethrown with a WebServiceException
try {
- Throwable t = MethodMarshallerUtils.demarshalFaultResponse(operationDesc, endpointDesc.getPackages(), message, true);
+ Throwable t = MethodMarshallerUtils.demarshalFaultResponse(operationDesc, packages, message, true);
return t;
} catch(Exception e) {
throw ExceptionFactory.makeWebServiceException(e);
Copied: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/injection/ResourceInjectionServiceRuntimeDescription.java (from r505013, webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/ResourceInjectionServiceRuntimeDescription.java)
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/injection/ResourceInjectionServiceRuntimeDescription.java?view=diff&rev=505153&p1=webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/ResourceInjectionServiceRuntimeDescription.java&r1=505013&p2=webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/injection/ResourceInjectionServiceRuntimeDescription.java&r2=505153
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/ResourceInjectionServiceRuntimeDescription.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/injection/ResourceInjectionServiceRuntimeDescription.java Thu Feb 8 19:13:40 2007
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.axis2.jaxws.runtime.description;
+package org.apache.axis2.jaxws.runtime.description.injection;
import org.apache.axis2.jaxws.description.ServiceRuntimeDescription;
Added: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/injection/ResourceInjectionServiceRuntimeDescriptionFactory.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/injection/ResourceInjectionServiceRuntimeDescriptionFactory.java?view=auto&rev=505153
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/injection/ResourceInjectionServiceRuntimeDescriptionFactory.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/injection/ResourceInjectionServiceRuntimeDescriptionFactory.java Thu Feb 8 19:13:40 2007
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ * Copyright 2006 International Business Machines Corp.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.jaxws.runtime.description.injection;
+
+import org.apache.axis2.jaxws.description.OperationDescription;
+import org.apache.axis2.jaxws.description.ServiceDescription;
+import org.apache.axis2.jaxws.runtime.description.impl.OperationRuntimeDescriptionBuilder;
+import org.apache.axis2.jaxws.runtime.description.injection.impl.ResourceInjectionServiceRuntimeDescriptionBuilder;
+
+public class ResourceInjectionServiceRuntimeDescriptionFactory {
+
+ /**
+ * intentionally private
+ */
+ private ResourceInjectionServiceRuntimeDescriptionFactory() {}
+
+ /**
+ * Get or create MarshalServiceRuntimeDescription
+ * @param serviceDesc
+ * @param implClass
+ * @return OperationRuntimeDescription
+ */
+ public static ResourceInjectionServiceRuntimeDescription get(ServiceDescription serviceDesc, Class implClass) {
+ String key = ResourceInjectionServiceRuntimeDescriptionBuilder.getKey(implClass);
+ ResourceInjectionServiceRuntimeDescription risrDesc =
+ (ResourceInjectionServiceRuntimeDescription )
+ serviceDesc.getServiceRuntimeDesc(key);
+
+ if (risrDesc == null) {
+ risrDesc = ResourceInjectionServiceRuntimeDescriptionBuilder.create(serviceDesc, implClass);
+ serviceDesc.setServiceRuntimeDesc(risrDesc);
+ }
+ return risrDesc;
+ }
+}
Copied: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/injection/impl/ResourceInjectionServiceRuntimeDescriptionBuilder.java (from r505013, webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/impl/ResourceInjectionServiceRuntimeDescriptionBuilder.java)
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/injection/impl/ResourceInjectionServiceRuntimeDescriptionBuilder.java?view=diff&rev=505153&p1=webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/impl/ResourceInjectionServiceRuntimeDescriptionBuilder.java&r1=505013&p2=webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/injection/impl/ResourceInjectionServiceRuntimeDescriptionBuilder.java&r2=505153
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/impl/ResourceInjectionServiceRuntimeDescriptionBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/injection/impl/ResourceInjectionServiceRuntimeDescriptionBuilder.java Thu Feb 8 19:13:40 2007
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.axis2.jaxws.runtime.description.impl;
+package org.apache.axis2.jaxws.runtime.description.injection.impl;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
@@ -26,7 +26,7 @@
import org.apache.axis2.java.security.AccessController;
import org.apache.axis2.jaxws.description.ServiceDescription;
-import org.apache.axis2.jaxws.runtime.description.ResourceInjectionServiceRuntimeDescription;
+import org.apache.axis2.jaxws.runtime.description.injection.ResourceInjectionServiceRuntimeDescription;
public class ResourceInjectionServiceRuntimeDescriptionBuilder {
Copied: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/injection/impl/ResourceInjectionServiceRuntimeDescriptionImpl.java (from r505013, webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/impl/ResourceInjectionServiceRuntimeDescriptionImpl.java)
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/injection/impl/ResourceInjectionServiceRuntimeDescriptionImpl.java?view=diff&rev=505153&p1=webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/impl/ResourceInjectionServiceRuntimeDescriptionImpl.java&r1=505013&p2=webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/injection/impl/ResourceInjectionServiceRuntimeDescriptionImpl.java&r2=505153
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/impl/ResourceInjectionServiceRuntimeDescriptionImpl.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/injection/impl/ResourceInjectionServiceRuntimeDescriptionImpl.java Thu Feb 8 19:13:40 2007
@@ -1,7 +1,23 @@
-package org.apache.axis2.jaxws.runtime.description.impl;
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ * Copyright 2006 International Business Machines Corp.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.jaxws.runtime.description.injection.impl;
import org.apache.axis2.jaxws.description.ServiceDescription;
-import org.apache.axis2.jaxws.runtime.description.ResourceInjectionServiceRuntimeDescription;
+import org.apache.axis2.jaxws.runtime.description.injection.ResourceInjectionServiceRuntimeDescription;
public class ResourceInjectionServiceRuntimeDescriptionImpl implements
ResourceInjectionServiceRuntimeDescription {
Added: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/MarshalServiceRuntimeDescription.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/MarshalServiceRuntimeDescription.java?view=auto&rev=505153
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/MarshalServiceRuntimeDescription.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/MarshalServiceRuntimeDescription.java Thu Feb 8 19:13:40 2007
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ * Copyright 2006 International Business Machines Corp.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.jaxws.runtime.description.marshal;
+
+import java.util.TreeSet;
+
+import org.apache.axis2.jaxws.description.ServiceRuntimeDescription;
+
+
+/**
+ * Used to cache marshal information
+ */
+public interface MarshalServiceRuntimeDescription extends ServiceRuntimeDescription {
+ public TreeSet<String> getPackages();
+}
Added: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/MarshalServiceRuntimeDescriptionFactory.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/MarshalServiceRuntimeDescriptionFactory.java?view=auto&rev=505153
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/MarshalServiceRuntimeDescriptionFactory.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/MarshalServiceRuntimeDescriptionFactory.java Thu Feb 8 19:13:40 2007
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ * Copyright 2006 International Business Machines Corp.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.jaxws.runtime.description.marshal;
+
+import org.apache.axis2.jaxws.description.ServiceDescription;
+import org.apache.axis2.jaxws.runtime.description.marshal.impl.MarshalServiceRuntimeDescriptionBuilder;
+
+public class MarshalServiceRuntimeDescriptionFactory {
+
+ /**
+ * intentionally private
+ */
+ private MarshalServiceRuntimeDescriptionFactory() {}
+
+ /**
+ * Get or create MarshalServiceRuntimeDescription
+ * @param serviceDesc
+ * @param implClass
+ * @return MarshalServiceRuntimeDescription
+ */
+ public static MarshalServiceRuntimeDescription get(ServiceDescription serviceDesc) {
+ String key = MarshalServiceRuntimeDescriptionBuilder.getKey();
+ MarshalServiceRuntimeDescription desc =
+ (MarshalServiceRuntimeDescription )
+ serviceDesc.getServiceRuntimeDesc(key);
+
+ if (desc == null) {
+ desc = MarshalServiceRuntimeDescriptionBuilder.create(serviceDesc);
+ serviceDesc.setServiceRuntimeDesc(desc);
+ }
+ return desc;
+ }
+}
Added: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/MarshalServiceRuntimeDescriptionBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/MarshalServiceRuntimeDescriptionBuilder.java?view=auto&rev=505153
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/MarshalServiceRuntimeDescriptionBuilder.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/MarshalServiceRuntimeDescriptionBuilder.java Thu Feb 8 19:13:40 2007
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ * Copyright 2006 International Business Machines Corp.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.jaxws.runtime.description.marshal.impl;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.security.PrivilegedAction;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.TreeSet;
+
+import javax.annotation.Resource;
+
+import org.apache.axis2.java.security.AccessController;
+import org.apache.axis2.jaxws.description.ServiceDescription;
+import org.apache.axis2.jaxws.runtime.description.marshal.MarshalServiceRuntimeDescription;
+
+public class MarshalServiceRuntimeDescriptionBuilder {
+
+ /**
+ * Intentionally Private
+ */
+ private MarshalServiceRuntimeDescriptionBuilder() { }
+
+ /**
+ * create
+ * @param opDesc
+ * @param implClassName
+ * @return
+ */
+ static public MarshalServiceRuntimeDescription create(ServiceDescription serviceDesc) {
+ MarshalServiceRuntimeDescriptionImpl desc =
+ new MarshalServiceRuntimeDescriptionImpl(getKey(), serviceDesc);
+ init(desc, serviceDesc);
+ return desc;
+ }
+
+ static public String getKey() {
+ return "JAXWS-MARSHAL";
+ }
+
+ /**
+ * @param implClass
+ * @return true if Field or Method has a @Resource annotation
+ */
+ static private void init(MarshalServiceRuntimeDescriptionImpl marshalDesc,
+ ServiceDescription serviceDesc) {
+ TreeSet<String> packages = new TreeSet<String>();
+
+ // @TODO There are two ways to get the packages.
+ // Schema Walk (prefered) and Annotation Walk.
+ // The Schema walk requires an existing or generated schema.
+ //
+ // There are some limitations in the current schema walk
+ // And there are problems in the annotation walk.
+ // So for now we will do both.
+ boolean doSchemaWalk = true;
+ boolean doAnnotationWalk = true;
+ packages = new TreeSet<String>();
+ if (doSchemaWalk) {
+ packages.addAll(PackageSetBuilder.getPackagesFromSchema(serviceDesc));
+ }
+ if (doAnnotationWalk) {
+ packages.addAll(PackageSetBuilder.getPackagesFromAnnotations(serviceDesc));
+ }
+ marshalDesc.setPackages(packages);
+ }
+
+}
\ No newline at end of file
Added: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/MarshalServiceRuntimeDescriptionImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/MarshalServiceRuntimeDescriptionImpl.java?view=auto&rev=505153
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/MarshalServiceRuntimeDescriptionImpl.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/MarshalServiceRuntimeDescriptionImpl.java Thu Feb 8 19:13:40 2007
@@ -0,0 +1,38 @@
+package org.apache.axis2.jaxws.runtime.description.marshal.impl;
+
+import java.util.TreeSet;
+
+import org.apache.axis2.jaxws.description.ServiceDescription;
+import org.apache.axis2.jaxws.runtime.description.marshal.MarshalServiceRuntimeDescription;
+
+
+public class MarshalServiceRuntimeDescriptionImpl implements
+ MarshalServiceRuntimeDescription {
+
+ private ServiceDescription serviceDesc;
+ private String key;
+ private TreeSet<String> packages;
+
+ protected MarshalServiceRuntimeDescriptionImpl(String key,
+ ServiceDescription serviceDesc) {
+ this.serviceDesc = serviceDesc;
+ this.key = key;
+ }
+
+
+ public ServiceDescription getServiceDescription() {
+ return serviceDesc;
+ }
+
+ public String getKey() {
+ return key;
+ }
+
+ public TreeSet<String> getPackages() {
+ return packages;
+ }
+
+ void setPackages(TreeSet<String> packages) {
+ this.packages = packages;
+ }
+}
Copied: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/PackageSetBuilder.java (from r505017, webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/PackageSetBuilder.java)
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/PackageSetBuilder.java?view=diff&rev=505153&p1=webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/PackageSetBuilder.java&r1=505017&p2=webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/PackageSetBuilder.java&r2=505153
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/PackageSetBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/PackageSetBuilder.java Thu Feb 8 19:13:40 2007
@@ -14,13 +14,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.axis2.jaxws.description.impl;
+package org.apache.axis2.jaxws.runtime.description.marshal.impl;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URL;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
import java.util.Set;
import java.util.TreeSet;
@@ -28,8 +30,10 @@
import javax.wsdl.WSDLException;
import javax.xml.bind.JAXBElement;
+import org.apache.axis2.java.security.AccessController;
import org.apache.axis2.jaxws.ExceptionFactory;
import org.apache.axis2.jaxws.description.EndpointDescription;
+import org.apache.axis2.jaxws.description.EndpointDescriptionJava;
import org.apache.axis2.jaxws.description.EndpointInterfaceDescription;
import org.apache.axis2.jaxws.description.FaultDescription;
import org.apache.axis2.jaxws.description.OperationDescription;
@@ -96,11 +100,13 @@
EndpointDescription[] endpointDescs = serviceDesc.getEndpointDescriptions();
if (endpointDescs != null) {
for (int i=0; i< endpointDescs.length; i++) {
- EndpointDescriptionImpl ed = (EndpointDescriptionImpl)endpointDescs[i];
+ EndpointDescription ed = (EndpointDescription)endpointDescs[i];
if(wsdlDefinition == null){
//Let see if we can get wsdl definition from endpoint @WebService annotation.
- String wsdlLocation = ed.getAnnoWebServiceWSDLLocation();
- wsdlDefinition = getWSDLDefinition(wsdlLocation);
+ if (ed instanceof EndpointDescriptionJava) {
+ String wsdlLocation = ((EndpointDescriptionJava) ed).getAnnoWebServiceWSDLLocation();
+ wsdlDefinition = getWSDLDefinition(wsdlLocation);
+ }
}
//So at this point either we got wsdl definition from ServiceDescription (which means we are running this code
//on client side) or we got it from the @WebService annotation (which means we are running this code on server side)
@@ -376,8 +382,8 @@
}
try {
- return DescriptionUtils.forName(className, true,
- DescriptionUtils.getContextClassLoader());
+ return forName(className, true,
+ getContextClassLoader());
//Catch Throwable as ClassLoader can throw an NoClassDefFoundError that
//does not extend Exception, so lets catch everything that extends Throwable
//rather than just Exception.
@@ -414,5 +420,54 @@
}
return wsdlDefinition;
+ }
+
+ /**
+ * Return the class for this name
+ * @return Class
+ */
+ static Class forName(final String className, final boolean initialize, final ClassLoader classloader) throws ClassNotFoundException {
+ // NOTE: This method must remain protected because it uses AccessController
+ Class cl = null;
+ try {
+ cl = (Class) AccessController.doPrivileged(
+ new PrivilegedExceptionAction() {
+ public Object run() throws ClassNotFoundException {
+ return Class.forName(className, initialize, classloader);
+ }
+ }
+ );
+ } catch (PrivilegedActionException e) {
+ if (log.isDebugEnabled()) {
+ log.debug("Exception thrown from AccessController: " + e);
+ }
+ throw (ClassNotFoundException) e.getException();
+ }
+
+ return cl;
+ }
+
+ /**
+ * @return ClassLoader
+ */
+ static ClassLoader getContextClassLoader() {
+ // NOTE: This method must remain private because it uses AccessController
+ ClassLoader cl = null;
+ try {
+ cl = (ClassLoader) AccessController.doPrivileged(
+ new PrivilegedExceptionAction() {
+ public Object run() throws ClassNotFoundException {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ }
+ );
+ } catch (PrivilegedActionException e) {
+ if (log.isDebugEnabled()) {
+ log.debug("Exception thrown from AccessController: " + e);
+ }
+ throw (RuntimeException) e.getException();
+ }
+
+ return cl;
}
}
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/endpoint/lifecycle/impl/EndpointLifecycleManagerImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/endpoint/lifecycle/impl/EndpointLifecycleManagerImpl.java?view=diff&rev=505153&r1=505152&r2=505153
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/endpoint/lifecycle/impl/EndpointLifecycleManagerImpl.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/endpoint/lifecycle/impl/EndpointLifecycleManagerImpl.java Thu Feb 8 19:13:40 2007
@@ -35,8 +35,8 @@
import org.apache.axis2.jaxws.description.ServiceDescription;
import org.apache.axis2.jaxws.handler.SoapMessageContext;
import org.apache.axis2.jaxws.i18n.Messages;
-import org.apache.axis2.jaxws.runtime.description.ResourceInjectionServiceRuntimeDescription;
-import org.apache.axis2.jaxws.runtime.description.ResourceInjectionServiceRuntimeDescriptionFactory;
+import org.apache.axis2.jaxws.runtime.description.injection.ResourceInjectionServiceRuntimeDescription;
+import org.apache.axis2.jaxws.runtime.description.injection.ResourceInjectionServiceRuntimeDescriptionFactory;
import org.apache.axis2.jaxws.server.endpoint.injection.ResourceInjector;
import org.apache.axis2.jaxws.server.endpoint.injection.WebServiceContextInjector;
import org.apache.axis2.jaxws.server.endpoint.injection.factory.ResourceInjectionFactory;
Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/EndpointDescription.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/EndpointDescription.java?view=diff&rev=505153&r1=505152&r2=505153
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/EndpointDescription.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/EndpointDescription.java Thu Feb 8 19:13:40 2007
@@ -108,14 +108,5 @@
public abstract List<String> getHandlerList();
public abstract QName getPortQName();
public abstract QName getServiceQName();
- public abstract Service.Mode getServiceMode();
-
- /**
- * Returns the packages that are needed to marshal/unmarshal the
- * data objects. Example: This set of packages is used to construct a
- * JAXBContext.
- * @return Set<Package>
- */
- public TreeSet<String> getPackages();
-
+ public abstract Service.Mode getServiceMode();
}
Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java?view=diff&rev=505153&r1=505152&r2=505153
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java Thu Feb 8 19:13:40 2007
@@ -18,19 +18,15 @@
import java.security.PrivilegedAction;
import java.util.ArrayList;
-import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.Set;
import java.util.TreeSet;
import javax.jws.WebService;
import javax.wsdl.Binding;
import javax.wsdl.Definition;
import javax.wsdl.Port;
-import javax.wsdl.PortType;
-import javax.wsdl.WSDLException;
import javax.wsdl.extensions.ExtensibilityElement;
import javax.wsdl.extensions.http.HTTPBinding;
import javax.wsdl.extensions.soap.SOAPAddress;
@@ -1230,40 +1226,7 @@
public String getTargetNamespace() {
return getAnnoWebServiceTargetNamespace();
}
- /**
- * Returns the packages that are needed to marshal/unmarshal the
- * data objects. Example: this set of packages is used to construct a
- * JAXBContext.
- * @return Set<Package>
- */
- public TreeSet<String> getPackages() {
- // @REVIEW Currently the package set is stored on the
- // EndpointDescription. We may consider moving this to
- // ServiceDescription.
-
- // The set of packages is calcuated once and saved
- if (packages == null) {
- synchronized(this) {
- // @TODO There are two ways to get the packages.
- // Schema Walk (prefered) and Annotation Walk.
- // The Schema walk requires an existing or generated schema.
- //
- // There are some limitations in the current schema walk
- // And there are problems in the annotation walk.
- // So for now we will do both.
- boolean doSchemaWalk = true;
- boolean doAnnotationWalk = true;
- packages = new TreeSet<String>();
- if (doSchemaWalk) {
- packages.addAll(PackageSetBuilder.getPackagesFromSchema(this.getServiceDescription()));
- }
- if (doAnnotationWalk) {
- packages.addAll(PackageSetBuilder.getPackagesFromAnnotations(this));
- }
- }
- }
- return packages;
- }
+
public PortInfo getPortInfo() {
if (portInfo == null) {
portInfo = new PortInfoImpl(getServiceQName(), getPortQName(), getBindingType());
@@ -1520,9 +1483,6 @@
//
string.append(newline);
string.append("Handler List: " + getHandlerList());
- //
- string.append(newline);
- string.append("Packages: " + getPackages());
//
string.append(newline);
string.append("AxisService: " + getAxisService());
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org