summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2011-09-12 12:56:21 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2011-09-12 12:56:21 +0000
commit87a10062349ab91797f9cf3876b2e05885082cd7 (patch)
tree74c06fb6a38e92f688404f2c76fbf05650690fd4 /sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java
parent77e9e62a8753f29bbb0e4d048789060cc502a4c0 (diff)
Fix the setting of the JMS callback destination from request properties for the JMS binding
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1169722 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.java32
1 files changed, 21 insertions, 11 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 9e14ad0b1a..f7573b182b 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
@@ -18,25 +18,23 @@
*/
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;
import org.apache.tuscany.sca.binding.jms.JMSBindingConstants;
import org.apache.tuscany.sca.binding.jms.JMSBindingException;
import org.apache.tuscany.sca.binding.jms.context.JMSBindingContext;
import org.apache.tuscany.sca.core.invocation.InterceptorAsyncImpl;
-import org.apache.tuscany.sca.invocation.Interceptor;
import org.apache.tuscany.sca.invocation.Invoker;
import org.apache.tuscany.sca.invocation.Message;
import org.apache.tuscany.sca.runtime.RuntimeComponentService;
import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
+import org.apache.tuscany.sca.assembly.Binding;
+
/**
* JMS Binding Interceptor class that deals with a callback destination address on the service side
*
@@ -99,13 +97,25 @@ public class CallbackDestinationInterceptor extends InterceptorAsyncImpl {
// Place the Callback destination name into the Callback EPRs for the service endpoint
if (callbackdestName != null) {
- List<EndpointReference> refs = endpoint.getCallbackEndpointReferences();
- for (EndpointReference ref : refs ) {
- if (ref.getBinding() instanceof JMSBinding ) {
- JMSBinding callbackBinding = (JMSBinding) ref.getBinding();
- callbackBinding.setDestinationName(callbackdestName);
- } // end if
- } // end for
+ for (Binding b : service.getCallback().getBindings()) {
+ if (b instanceof JMSBinding) {
+ JMSBinding callbackBinding;
+ try {
+ callbackBinding = (JMSBinding)((JMSBinding)b).clone();
+ } catch (CloneNotSupportedException e) {
+ throw new RuntimeException(e);
+ }
+ callbackBinding.setDestinationName(callbackdestName);
+ msg.getHeaders().put("CALLBACK_BINDING", callbackBinding);
+ }
+ }
+// List<EndpointReference> refs = endpoint.getCallbackEndpointReferences();
+// for (EndpointReference ref : refs ) {
+// if (ref.getBinding() instanceof JMSBinding ) {
+// JMSBinding callbackBinding = (JMSBinding) ref.getBinding();
+// callbackBinding.setDestinationName(callbackdestName);
+// } // end if
+// } // end for
} // end if
// Callback ID not used at present