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 ba...@apache.org on 2007/04/12 17:43:45 UTC

svn commit: r527988 - in /webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws: description/builder/MDQConstants.java description/impl/ServiceDescriptionImpl.java i18n/resource.properties

Author: barrettj
Date: Thu Apr 12 08:43:44 2007
New Revision: 527988

URL: http://svn.apache.org/viewvc?view=rev&rev=527988
Log:
AXIS2-2515
Fix contributed by Dustin Amrhein.  Validate that the impl and SEI do not contain JAX-WS client-side only async methods

Modified:
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/MDQConstants.java
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/i18n/resource.properties

Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/MDQConstants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/MDQConstants.java?view=diff&rev=527988&r1=527987&r2=527988
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/MDQConstants.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/MDQConstants.java Thu Apr 12 08:43:44 2007
@@ -43,4 +43,7 @@
 
     // Java string that represents a class constructor
     public static final String CONSTRUCTOR_METHOD = "<init>";
+
+    public static final String RETURN_TYPE_FUTURE = "java.util.concurrent.Future";
+    public static final String RETURN_TYPE_RESPONSE = "javax.xml.ws.Response";
 }

Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java?view=diff&rev=527988&r1=527987&r2=527988
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java Thu Apr 12 08:43:44 2007
@@ -30,6 +30,8 @@
 import org.apache.axis2.jaxws.description.ServiceRuntimeDescription;
 import org.apache.axis2.jaxws.description.builder.DescriptionBuilderComposite;
 import org.apache.axis2.jaxws.description.builder.MDQConstants;
+import static org.apache.axis2.jaxws.description.builder.MDQConstants.RETURN_TYPE_FUTURE;
+import static org.apache.axis2.jaxws.description.builder.MDQConstants.RETURN_TYPE_RESPONSE;
 import org.apache.axis2.jaxws.description.builder.MethodDescriptionComposite;
 import org.apache.axis2.jaxws.description.builder.ParameterDescriptionComposite;
 import org.apache.axis2.jaxws.i18n.Messages;
@@ -1148,7 +1150,7 @@
 
         //This will perform validation for all methods, regardless of WebMethod annotations
         //It is called for the SEI, and an impl. class that does not specify an endpointInterface
-        validateMethods();
+        validateMethods(seic.getMethodDescriptionsList());
     }
 
     /** @return Returns TRUE if we find just one WebMethod Annotation */
@@ -1179,10 +1181,21 @@
     }
 
 
-    /**
-     */
-    private void validateMethods() {
-        //TODO: Fill this out to validate all MethodDescriptionComposite (and their inclusive
+    private void validateMethods(List<MethodDescriptionComposite> mdcList) {
+        if (mdcList != null && !mdcList.isEmpty()) {
+            for (MethodDescriptionComposite mdc : mdcList) {
+                String returnType = mdc.getReturnType();
+                if (returnType != null
+                                && (returnType.equals(RETURN_TYPE_FUTURE) || returnType
+                                                .equals(RETURN_TYPE_RESPONSE))) {
+                    throw ExceptionFactory.makeWebServiceException(Messages
+                                    .getMessage("serverSideAsync", mdc.getDeclaringClass(), mdc
+                                                    .getMethodName()));
+                }
+            }
+        }
+        // TODO: Fill this out to validate all MethodDescriptionComposite (and
+        // their inclusive
         //      annotations on this SEI (SEI is assumed here)
         //check oneway
         //

Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/i18n/resource.properties
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/i18n/resource.properties?view=diff&rev=527988&r1=527987&r2=527988
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/i18n/resource.properties (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/i18n/resource.properties Thu Apr 12 08:43:44 2007
@@ -158,3 +158,4 @@
 ExecutorShutdown=RejectedExcecutionException. The request is rejected because the Executor Service for the service is shutdown.
 handlerChainNS=The @HandlerChain configuration file {0} in the class {1} could not be loaded.
 hcConfigLoadFail=The @HandlerChain configuration file {0} in the class {1} could not be loaded due to the following error: {2}
+serverSideAsync=The server-side SEI {0} contains the asynchronous method {1}. Asynchronous methods are not allowed for server-side artifacts.



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org