diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2008-08-05 07:44:31 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2008-08-05 07:44:31 +0000 |
commit | 50a3cc4041e20af40cd69cfe550c6d9e10f7d9be (patch) | |
tree | 619e1a548b0d892acabec42ff56b2d06526fe622 /java/sca/modules/binding-jms-runtime | |
parent | 987e2e95f3456cc9fb417d3f57e6589266d3d3e3 (diff) |
Updates for special 'onMessage' method
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@682615 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/binding-jms-runtime')
2 files changed, 11 insertions, 5 deletions
diff --git a/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingListener.java b/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingListener.java index f60542018a..6a2ba35aa3 100644 --- a/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingListener.java +++ b/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingListener.java @@ -94,13 +94,16 @@ public class JMSBindingListener implements MessageListener { protected Object invokeService(Message requestJMSMsg) throws JMSException, InvocationTargetException { String operationName = requestMessageProcessor.getOperationName(requestJMSMsg); - Object requestPayload = requestMessageProcessor.extractPayloadFromJMSMessage(requestJMSMsg); - Operation operation = getTargetOperation(operationName); MessageImpl tuscanyMsg = new MessageImpl(); - tuscanyMsg.setBody(requestPayload); tuscanyMsg.setOperation(operation); + if ("onMessage".equals(operation.getName())) { + tuscanyMsg.setBody(requestJMSMsg); + } else { + Object requestPayload = requestMessageProcessor.extractPayloadFromJMSMessage(requestJMSMsg); + tuscanyMsg.setBody(requestPayload); + } setHeaderProperties(requestJMSMsg, tuscanyMsg, operation); diff --git a/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingServiceBindingProvider.java b/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingServiceBindingProvider.java index 5881b37b7c..c372d7848e 100644 --- a/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingServiceBindingProvider.java +++ b/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingServiceBindingProvider.java @@ -82,8 +82,11 @@ public class JMSBindingServiceBindingProvider implements ServiceBindingProvider if (service.getInterfaceContract() != null) { try { InterfaceContract ic = (InterfaceContract)service.getInterfaceContract().clone(); - - Interface ii = (Interface)ic.getInterface().clone(); + Interface ii = ic.getInterface(); + if (ii.getOperations().size() == 1 && "onMessage".equals(ii.getOperations().get(0).getName())) { + return; + } + ii = (Interface)ii.clone(); ii.resetDataBinding("org.apache.axiom.om.OMElement"); ic.setInterface(ii); service.setInterfaceContract(ic); |