diff options
author | bdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68> | 2010-11-14 22:31:42 +0000 |
---|---|---|
committer | bdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68> | 2010-11-14 22:31:42 +0000 |
commit | 5670f96c39fb938bfc6951dcb87d623a2d03bf8d (patch) | |
tree | 3c8a65b905e4ccf77d32c75c541d22d06cbf73f6 /sca-java-2.x/trunk/modules/implementation-java-runtime/src/main/java/org/apache | |
parent | eec2e27511654d899e2fcc81172dd97d490f6699 (diff) |
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
Diffstat (limited to 'sca-java-2.x/trunk/modules/implementation-java-runtime/src/main/java/org/apache')
-rw-r--r-- | sca-java-2.x/trunk/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationInvoker.java | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/sca-java-2.x/trunk/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationInvoker.java b/sca-java-2.x/trunk/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationInvoker.java index 9eade3ba5c..69da9019a8 100644 --- a/sca-java-2.x/trunk/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationInvoker.java +++ b/sca-java-2.x/trunk/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationInvoker.java @@ -162,23 +162,24 @@ public class JavaImplementationInvoker implements Invoker { if (argumentHolderCount > 0) { - // Holder pattern. Any payload Holder<T> types are returned as the message body. - List<Object> returnArgs = new ArrayList<Object>(); - returnArgs.add(ret); + + // Holder pattern. Any payload Holder<T> types are returned as part of the message body. + Object[] payloadArray = (Object[])payload; + ArrayList<Object> result = new ArrayList<Object>(); if (imethod != null) { - Object[] payloadArray = (Object[])payload; - for (int i = 0, size = op.getParameterModes().size(); i < size; i++) { - // System.out.println( "JavaImplementationInvoker.invoke return parameter " + i + " type=" + parameter.getClass().getName() ); + + result.add(ret); + for (int i = 0, size = op.getParameterModes().size(); i < size; i++) { if (ParameterMode.IN != op.getParameterModes().get(i)) { - // Demote array params from Holder<T> to <T>. - Holder<Object> item = (Holder<Object>)payloadArray[i]; - payloadArray[i] = item.value; - returnArgs.add(payloadArray[i]); + // Demote array params from Holder<T> to <T>. + Holder<Object> item = (Holder<Object>)payloadArray[i]; + payloadArray[i] = item.value; + result.add(payloadArray[i]); } } } - msg.setBody(returnArgs.toArray()); + msg.setBody(result.toArray()); } else { msg.setBody(ret); |