summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java
diff options
context:
space:
mode:
authorbdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68>2010-09-14 06:37:31 +0000
committerbdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68>2010-09-14 06:37:31 +0000
commit9f5ca9e3b289e71b95c331aeeb544c479f8b239d (patch)
tree48dd6e43f0512f5074ebb765a0d6c424c4449ff0 /sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java
parent2d4653d7d72dd37d322b6e0c6db95f44a60c8948 (diff)
Use JMS ReplyTo as callback desitnation when scaCallbackDestination property is not set
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@996765 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java')
-rw-r--r--sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wire/CallbackDestinationInterceptor.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wire/CallbackDestinationInterceptor.java b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wire/CallbackDestinationInterceptor.java
index 541f47636f..08411dfdfe 100644
--- a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wire/CallbackDestinationInterceptor.java
+++ b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wire/CallbackDestinationInterceptor.java
@@ -20,7 +20,10 @@ package org.apache.tuscany.sca.binding.jms.wire;
import java.util.List;
+import javax.jms.Destination;
import javax.jms.JMSException;
+import javax.jms.Queue;
+import javax.jms.Topic;
import org.apache.tuscany.sca.assembly.EndpointReference;
import org.apache.tuscany.sca.binding.jms.JMSBinding;
@@ -62,10 +65,17 @@ public class CallbackDestinationInterceptor implements Interceptor {
JMSBindingContext context = msg.getBindingContext();
javax.jms.Message jmsMsg = context.getJmsMsg();
+
if (service.getInterfaceContract().getCallbackInterface() != null) {
String callbackdestName = jmsMsg.getStringProperty(JMSBindingConstants.CALLBACK_Q_PROPERTY);
-
+ if (( callbackdestName == null) && ( jmsMsg.getJMSReplyTo() != null ) ) {
+ Destination replyTo = jmsMsg.getJMSReplyTo();
+ if (replyTo != null) {
+ callbackdestName = (replyTo instanceof Queue) ? ((Queue) replyTo).getQueueName() : ((Topic) replyTo).getTopicName();
+ }
+ }
+
if (callbackdestName != null) {
List<EndpointReference> refs = endpoint.getCallbackEndpointReferences();
for (EndpointReference ref : refs ) {
@@ -74,7 +84,7 @@ public class CallbackDestinationInterceptor implements Interceptor {
callbackBinding.setDestinationName(callbackdestName);
}
}
- }
+ }
String callbackID = jmsMsg.getStringProperty(JMSBindingConstants.CALLBACK_ID_PROPERTY);
if (callbackID != null) {