From 5670f96c39fb938bfc6951dcb87d623a2d03bf8d Mon Sep 17 00:00:00 2001 From: bdaniel Date: Sun, 14 Nov 2010 22:31:42 +0000 Subject: TUSCANY-3664 Add support for multiple operation output types git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1035089 13f79535-47bb-0310-9956-ffa450edef68 --- .../interfacedef/java/jaxws/JAXWSAsyncInterfaceProcessor.java | 10 +++++----- .../interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca') diff --git a/sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSAsyncInterfaceProcessor.java b/sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSAsyncInterfaceProcessor.java index a866c5b8e1..a57a0b4678 100644 --- a/sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSAsyncInterfaceProcessor.java +++ b/sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSAsyncInterfaceProcessor.java @@ -82,7 +82,7 @@ public class JAXWSAsyncInterfaceProcessor implements JavaInterfaceVisitor { */ private static boolean isJAXWSAsyncPoolingOperation(Operation operation, Operation asyncOperation) { - if (asyncOperation.getOutputType() == null || Response.class != asyncOperation.getOutputType().getPhysical()) { + if (asyncOperation.getOutputType().getLogical().get(0) == null || Response.class != asyncOperation.getOutputType().getLogical().get(0).getPhysical()) { // The return type is not Response return false; } @@ -101,8 +101,8 @@ public class JAXWSAsyncInterfaceProcessor implements JavaInterfaceVisitor { } //a return type of Response where R is the return type of M - DataType operationOutputType = operation.getOutputType(); - DataType asyncOperationOutputType = asyncOperation.getOutputType(); + DataType operationOutputType = operation.getOutputType().getLogical().get(0); + DataType asyncOperationOutputType = asyncOperation.getOutputType().getLogical().get(0); if (operationOutputType != null && asyncOperationOutputType != null) { Class asyncReturnTypeClass = (Class)asyncOperationOutputType.getPhysical(); @@ -149,7 +149,7 @@ public class JAXWSAsyncInterfaceProcessor implements JavaInterfaceVisitor { */ private static boolean isJAXWSAsyncCallbackOperation(Operation operation, Operation asyncOperation) { - if (asyncOperation.getOutputType() == null || Future.class != asyncOperation.getOutputType().getPhysical()) { + if (asyncOperation.getOutputType().getLogical().get(0) == null || Future.class != asyncOperation.getOutputType().getLogical().get(0).getPhysical()) { // The return type is not Future return false; } @@ -173,7 +173,7 @@ public class JAXWSAsyncInterfaceProcessor implements JavaInterfaceVisitor { Class asyncLastParameterTypeClass = asyncOperationInputType.get(size).getPhysical(); if (asyncLastParameterTypeClass == AsyncHandler.class) { //now check the actual type of the AsyncHandler with R - Class returnType = operation.getOutputType().getPhysical(); + Class returnType = operation.getOutputType().getLogical().get(0).getPhysical(); Class asyncActualLastParameterTypeClass = Object.class; if (genericParamType instanceof ParameterizedType) { ParameterizedType asyncLastParameterType = (ParameterizedType)genericParamType; diff --git a/sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java b/sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java index 735f8cf269..74b2b53543 100644 --- a/sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java +++ b/sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java @@ -306,8 +306,8 @@ public class JAXWSJavaInterfaceProcessor implements JavaInterfaceVisitor { name = getValue(name, "return"); QName element = new QName(ns, name); - if (operation.getOutputType() != null) { - Object logical = operation.getOutputType().getLogical(); + if ((operation.getOutputType() != null) && ( operation.getOutputType().getLogical().get(0) != null)) { + Object logical = operation.getOutputType().getLogical().get(0).getLogical(); QName type = null; if (logical instanceof XMLType) { ((XMLType)logical).setElementName(element); -- cgit v1.2.3