summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-10-23 10:25:33 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-10-23 10:25:33 +0000
commita1f1485ebf771c5bd9cc4bddb6adfbd5fc2eb550 (patch)
tree9f19dea54757437c5eedac8e598e98e7ecc7b6d8
parent4e8a796b4dfba27549f5d91a3e269c84e99a9d14 (diff)
Update JavaInterfaceIntrospectorImpl to not consider teh JAXWS Async API methods in the overloaded ops on remotable interfaces
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@828990 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--java/sca/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceIntrospectorImpl.java23
1 files changed, 22 insertions, 1 deletions
diff --git a/java/sca/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceIntrospectorImpl.java b/java/sca/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceIntrospectorImpl.java
index 6b8ea60517..e903783300 100644
--- a/java/sca/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceIntrospectorImpl.java
+++ b/java/sca/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceIntrospectorImpl.java
@@ -31,8 +31,11 @@ import java.util.HashSet;
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 @@ public class JavaInterfaceIntrospectorImpl {
if (remotable && names.contains(name)) {
throw new OverloadedOperationException(method);
}
- if (remotable) {
+ if (remotable && !jaxwsAsyncMethod(method)) {
names.add(name);
}
@@ -254,4 +257,22 @@ public class JavaInterfaceIntrospectorImpl {
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;
+ }
+
}