cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r906074 - in /cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms: JCATransactionalMessageListenerContainer.java JMSDestination.java
Date Wed, 03 Feb 2010 14:47:50 GMT
Author: dkulp
Date: Wed Feb  3 14:47:49 2010
New Revision: 906074

URL: http://svn.apache.org/viewvc?rev=906074&view=rev
Log:
Remove direct dependency on jca classes from JMSDestination

Modified:
    cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JCATransactionalMessageListenerContainer.java
    cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java

Modified: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JCATransactionalMessageListenerContainer.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JCATransactionalMessageListenerContainer.java?rev=906074&r1=906073&r2=906074&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JCATransactionalMessageListenerContainer.java
(original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JCATransactionalMessageListenerContainer.java
Wed Feb  3 14:47:49 2010
@@ -20,6 +20,8 @@
 package org.apache.cxf.transport.jms;
 
 import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Map;
 
 import javax.jms.JMSException;
 import javax.jms.MessageConsumer;
@@ -34,7 +36,7 @@
 import org.springframework.jms.support.JmsUtils;
 
 public class JCATransactionalMessageListenerContainer extends DefaultMessageListenerContainer
{
-    static final ThreadLocal<MessageEndpoint> ENDPOINT_LOCAL = new ThreadLocal<MessageEndpoint>();
+    static final ThreadLocal<Map<Class<?>, ?>> ENDPOINT_LOCAL = new ThreadLocal<Map<Class<?>,
?>>();
     static final String MESSAGE_ENDPOINT_FACTORY = "MessageEndpointFactory";
     static final String MDB_TRANSACTED_METHOD = "MDBTransactedMethod";
     private MessageEndpointFactory factory;
@@ -61,7 +63,11 @@
             s = xa.getSession();
             mc = s.createConsumer(getDestination());            
             ep = factory.createEndpoint(xar);
-            ENDPOINT_LOCAL.set(ep);
+            
+            Map<Class<?>, Object> mp = new HashMap<Class<?>, Object>();
+            mp.put(MessageEndpoint.class, ep);
+            
+            ENDPOINT_LOCAL.set(mp);
             ep.beforeDelivery(method);                
             messageReceived = doReceiveAndExecute(invoker, s, mc, null);
             ep.afterDelivery();

Modified: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java?rev=906074&r1=906073&r2=906074&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
(original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
Wed Feb  3 14:47:49 2010
@@ -25,6 +25,7 @@
 import java.util.Calendar;
 import java.util.Collection;
 import java.util.GregorianCalendar;
+import java.util.Map;
 import java.util.SimpleTimeZone;
 import java.util.TimeZone;
 import java.util.concurrent.ConcurrentLinkedQueue;
@@ -37,7 +38,6 @@
 import javax.jms.MessageListener;
 import javax.jms.Session;
 import javax.jms.TextMessage;
-import javax.resource.spi.endpoint.MessageEndpoint;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
@@ -199,9 +199,12 @@
             
             BusFactory.setThreadDefaultBus(bus);
 
-            MessageEndpoint ep = JCATransactionalMessageListenerContainer.ENDPOINT_LOCAL.get();
-            if (ep != null) {
-                inMessage.setContent(MessageEndpoint.class, ep);
+            
+            Map<Class<?>, ?> mp = JCATransactionalMessageListenerContainer.ENDPOINT_LOCAL.get();
+            if (mp != null) {
+                for (Map.Entry<Class<?>, ?> ent : mp.entrySet()) {
+                    inMessage.setContent(ent.getKey(), ent.getValue());
+                }
                 JCATransactionalMessageListenerContainer.ENDPOINT_LOCAL.remove();
             }
 



Mime
View raw message