servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r388198 - in /incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow: jca/JCAFlow.java jms/JMSFlow.java
Date Thu, 23 Mar 2006 16:16:41 GMT
Author: gnodet
Date: Thu Mar 23 08:16:40 2006
New Revision: 388198

URL: http://svn.apache.org/viewcvs?rev=388198&view=rev
Log:
SM-366: jms and jca flow should not use the same queues
Also improve the jca flow to auto-detect a TransactionContextManager from the spring context
(if any)

Modified:
    incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/jca/JCAFlow.java
    incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/jms/JMSFlow.java

Modified: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/jca/JCAFlow.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/jca/JCAFlow.java?rev=388198&r1=388197&r2=388198&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/jca/JCAFlow.java
(original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/jca/JCAFlow.java
Thu Mar 23 08:16:40 2006
@@ -61,6 +61,7 @@
 import org.apache.geronimo.connector.outbound.connectionmanagerconfig.XATransactions;
 import org.apache.geronimo.connector.work.GeronimoWorkManager;
 import org.apache.geronimo.transaction.context.TransactionContextManager;
+import org.apache.servicemix.jbi.container.SpringJBIContainer;
 import org.apache.servicemix.jbi.event.EndpointAdapter;
 import org.apache.servicemix.jbi.event.EndpointEvent;
 import org.apache.servicemix.jbi.event.EndpointListener;
@@ -72,6 +73,7 @@
 import org.jencks.JCAConnector;
 import org.jencks.SingletonEndpointFactory;
 import org.jencks.factory.ConnectionManagerFactoryBean;
+import org.springframework.context.ApplicationContext;
 
 import edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap;
 import edu.emory.mathcs.backport.java.util.concurrent.CopyOnWriteArraySet;
@@ -85,7 +87,7 @@
 public class JCAFlow extends AbstractFlow implements MessageListener {
     
     private static final Log log = LogFactory.getLog(JCAFlow.class);
-    private static final String INBOUND_PREFIX = "org.apache.servicemix.inbound.";
+    private static final String INBOUND_PREFIX = "org.apache.servicemix.jca.";
     private String jmsURL = "tcp://localhost:61616";
     private String userName;
     private String password;
@@ -573,6 +575,17 @@
 	}
 
 	public TransactionContextManager getTransactionContextManager() {
+        if (transactionContextManager == null) {
+            if (broker != null && broker.getContainer() instanceof SpringJBIContainer)
{
+                ApplicationContext applicationContext = ((SpringJBIContainer) broker.getContainer()).getApplicationContext();
+                if (applicationContext != null) {
+                    Map map = applicationContext.getBeansOfType(TransactionContextManager.class);
+                    if( map.size() == 1) {
+                        transactionContextManager = (TransactionContextManager) map.values().iterator().next();
+                    }
+                }
+            }
+        }
 		return transactionContextManager;
 	}
 

Modified: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/jms/JMSFlow.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/jms/JMSFlow.java?rev=388198&r1=388197&r2=388198&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/jms/JMSFlow.java
(original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/jms/JMSFlow.java
Thu Mar 23 08:16:40 2006
@@ -69,7 +69,7 @@
 
     private static final Log log = LogFactory.getLog(JMSFlow.class);
 
-    private static final String INBOUND_PREFIX = "org.apache.servicemix.inbound.";
+    private static final String INBOUND_PREFIX = "org.apache.servicemix.jms.";
 
     private String jmsURL = "peer://org.apache.servicemix?persistent=false";
 



Mime
View raw message