diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-02-05 18:27:01 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-02-05 18:27:01 +0000 |
commit | 84ef34efa534032fbf89a7c1b30258a73c69a71b (patch) | |
tree | c1d2fd1cdb6bc5c576ee45e842a115cb28cc20b1 /branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/runtime/WireFormatJMSBytesReferenceInterceptor.java | |
parent | 8e208f9a7f2fa251e777658bdf6381d1050e4d95 (diff) |
TUSCANY-2799 - don't return responses inside arrays. Generally reorg the code so that the message processors only worry about getting data in and out of JMS message while the interceptors worry about whether the data should be wrapped as an array. In this way the forward path can do array wrapping in order to keep databinding happy while the response path can omit array wrapping
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@741219 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/runtime/WireFormatJMSBytesReferenceInterceptor.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/runtime/WireFormatJMSBytesReferenceInterceptor.java b/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/runtime/WireFormatJMSBytesReferenceInterceptor.java index f0e835e916..c1ed139a84 100644 --- a/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/runtime/WireFormatJMSBytesReferenceInterceptor.java +++ b/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/runtime/WireFormatJMSBytesReferenceInterceptor.java @@ -78,7 +78,13 @@ public class WireFormatJMSBytesReferenceInterceptor implements Interceptor { JMSBindingContext context = msg.getBindingContext(); Session session = context.getJmsSession(); - javax.jms.Message requestMsg = requestMessageProcessor.insertPayloadIntoJMSMessage(session, msg.getBody()); + Object[] requestParams = msg.getBody(); + javax.jms.Message requestMsg = null; + if (requestParams != null && requestParams.length > 0 ){ + requestMsg = requestMessageProcessor.insertPayloadIntoJMSMessage(session, requestParams[0]); + } else { + requestMsg = requestMessageProcessor.insertPayloadIntoJMSMessage(session, null); + } msg.setBody(requestMsg); requestMsg.setJMSReplyTo(context.getReplyToDestination()); @@ -91,9 +97,9 @@ public class WireFormatJMSBytesReferenceInterceptor implements Interceptor { public Message invokeResponse(Message msg) { if (msg.getBody() != null){ - Object[] response = (Object[])responseMessageProcessor.extractPayloadFromJMSMessage((javax.jms.Message)msg.getBody()); - if (response != null && response.length > 0){ - msg.setBody(response[0]); + Object response = responseMessageProcessor.extractPayloadFromJMSMessage((javax.jms.Message)msg.getBody()); + if (response != null){ + msg.setBody(response); } else { msg.setBody(null); } |