tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r828990 - /tuscany/java/sca/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceIntrospectorImpl.java
Date Fri, 23 Oct 2009 10:25:33 GMT
Author: antelder
Date: Fri Oct 23 10:25:33 2009
New Revision: 828990

URL: http://svn.apache.org/viewvc?rev=828990&view=rev
Log:
Update JavaInterfaceIntrospectorImpl to not consider teh JAXWS Async API methods in the overloaded
ops on remotable interfaces

Modified:
    tuscany/java/sca/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceIntrospectorImpl.java

Modified: tuscany/java/sca/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceIntrospectorImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceIntrospectorImpl.java?rev=828990&r1=828989&r2=828990&view=diff
==============================================================================
--- tuscany/java/sca/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceIntrospectorImpl.java
(original)
+++ tuscany/java/sca/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceIntrospectorImpl.java
Fri Oct 23 10:25:33 2009
@@ -31,8 +31,11 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.concurrent.Future;
 
 import javax.xml.namespace.QName;
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Response;
 
 import org.apache.tuscany.sca.interfacedef.DataType;
 import org.apache.tuscany.sca.interfacedef.InvalidAnnotationException;
@@ -187,7 +190,7 @@
             if (remotable && names.contains(name)) {
                 throw new OverloadedOperationException(method);
             }
-            if (remotable) {
+            if (remotable && !jaxwsAsyncMethod(method)) {
                 names.add(name);
             }
 
@@ -254,4 +257,22 @@
         return operations;
     }
 
+    private boolean jaxwsAsyncMethod(Method method) {
+        if (method.getName().endsWith("Async")) {
+            if (method.getName().endsWith("Async")) {
+                if (method.getReturnType().isAssignableFrom(Future.class)) {
+                    if (method.getParameterTypes().length > 0) {
+                        if (method.getParameterTypes()[method.getParameterTypes().length-1].isAssignableFrom(AsyncHandler.class))
{
+                            return true;
+                        }
+                    }
+                }
+                if (method.getReturnType().isAssignableFrom(Response.class)) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
 }



Mime
View raw message