diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-08-18 15:13:26 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-08-18 15:13:26 +0000 |
commit | 368cc6772d62c0ff86e37bb248dd1fa9c7958326 (patch) | |
tree | 111be719d664ce13be39d2631c689a87407fb58b | |
parent | 9ac8fcae71e55605b90aba1306cc51d847b5bb7e (diff) |
Update to better handle messages where the operation can not be determined
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@986730 13f79535-47bb-0310-9956-ffa450edef68
3 files changed, 18 insertions, 16 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsdefault/runtime/OperationSelectorJMSDefaultServiceInterceptor.java b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsdefault/runtime/OperationSelectorJMSDefaultServiceInterceptor.java index e12850c41c..cefba467e0 100644 --- a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsdefault/runtime/OperationSelectorJMSDefaultServiceInterceptor.java +++ b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsdefault/runtime/OperationSelectorJMSDefaultServiceInterceptor.java @@ -175,7 +175,7 @@ public class OperationSelectorJMSDefaultServiceInterceptor implements Intercepto } if (operation == null) { - throw new JMSBindingException("Can't find operation " + (operationName != null ? operationName : ON_MESSAGE_METHOD_NAME)); + throw new JMSBindingException("Cannot determine service operation"); } return operation; diff --git a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/AbstractMessageProcessor.java b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/AbstractMessageProcessor.java index 8b665c91a8..35cc5769fb 100644 --- a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/AbstractMessageProcessor.java +++ b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/AbstractMessageProcessor.java @@ -116,7 +116,7 @@ public abstract class AbstractMessageProcessor implements JMSMessageProcessor { ObjectMessage message = session.createObjectMessage(); String causeMsg; if (o instanceof RuntimeException) { - message.setObject(new RuntimeException(o.getMessage())); + message.setObject(new ServiceRuntimeException(o.getMessage())); } else { // for a checked exception return the checked exception message.setObject(o); diff --git a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportServiceInterceptor.java b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportServiceInterceptor.java index 5ba01f5982..4ba33695e4 100644 --- a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportServiceInterceptor.java +++ b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportServiceInterceptor.java @@ -152,20 +152,22 @@ public class TransportServiceInterceptor implements Interceptor { } return msg; } - - String operationName = msg.getOperation().getName(); - if (jmsBinding.getOperationJMSPriority(operationName) != null) { - responseJMSMsg.setJMSPriority(jmsBinding.getOperationJMSPriority(operationName)); - } - - if (jmsBinding.getOperationJMSType(operationName) != null) { - responseJMSMsg.setJMSType(jmsBinding.getOperationJMSType(operationName)); - } - if (jmsBinding.getOperationJMSDeliveryMode(operationName) != null) { - if (jmsBinding.getOperationJMSDeliveryMode(operationName)) { - responseJMSMsg.setJMSDeliveryMode(DeliveryMode.PERSISTENT); - } else { - responseJMSMsg.setJMSDeliveryMode(DeliveryMode.NON_PERSISTENT); + + if (msg.getOperation() != null) { + String operationName = msg.getOperation().getName(); + if (jmsBinding.getOperationJMSPriority(operationName) != null) { + responseJMSMsg.setJMSPriority(jmsBinding.getOperationJMSPriority(operationName)); + } + + if (jmsBinding.getOperationJMSType(operationName) != null) { + responseJMSMsg.setJMSType(jmsBinding.getOperationJMSType(operationName)); + } + if (jmsBinding.getOperationJMSDeliveryMode(operationName) != null) { + if (jmsBinding.getOperationJMSDeliveryMode(operationName)) { + responseJMSMsg.setJMSDeliveryMode(DeliveryMode.PERSISTENT); + } else { + responseJMSMsg.setJMSDeliveryMode(DeliveryMode.NON_PERSISTENT); + } } } |