servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r596231 - in /servicemix/trunk: core/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/jms/ distributions/apache-servicemix/src/main/release/conf/
Date Mon, 19 Nov 2007 09:31:00 GMT
Author: gertv
Date: Mon Nov 19 01:30:54 2007
New Revision: 596231

URL: http://svn.apache.org/viewvc?rev=596231&view=rev
Log:
SM-1132: Closing the JMS connection pools

Modified:
    servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/jms/JMSFlow.java
    servicemix/trunk/distributions/apache-servicemix/src/main/release/conf/activemq.xml
    servicemix/trunk/distributions/apache-servicemix/src/main/release/conf/jndi.xml

Modified: servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/jms/JMSFlow.java
URL: http://svn.apache.org/viewvc/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/jms/JMSFlow.java?rev=596231&r1=596230&r2=596231&view=diff
==============================================================================
--- servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/jms/JMSFlow.java
(original)
+++ servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/jms/JMSFlow.java
Mon Nov 19 01:30:54 2007
@@ -16,6 +16,7 @@
  */
 package org.apache.servicemix.jbi.nmr.flow.jms;
 
+import javax.jbi.JBIException;
 import javax.jms.ConnectionFactory;
 import javax.jms.JMSException;
 import javax.jms.Message;
@@ -40,8 +41,11 @@
  */
 public class JMSFlow extends AbstractJMSFlow {
 
+    private PooledConnectionFactory factory;
+
     protected ConnectionFactory createConnectionFactoryFromUrl(String jmsURL) {
-        return (jmsURL != null) ? new PooledConnectionFactory(jmsURL) : new PooledConnectionFactory();
+        factory = (jmsURL != null) ? new PooledConnectionFactory(jmsURL) : new PooledConnectionFactory();
+        return factory;
     }
 
     /**
@@ -74,4 +78,13 @@
         });
     }
 
+    @Override
+    public void shutDown() throws JBIException {
+        super.shutDown();
+        try {
+            factory.stop();
+        } catch (Exception e) {
+            log.warn("Unable to stop JMS connection pool: " + e.getMessage(), e);
+        }
+    }
 }

Modified: servicemix/trunk/distributions/apache-servicemix/src/main/release/conf/activemq.xml
URL: http://svn.apache.org/viewvc/servicemix/trunk/distributions/apache-servicemix/src/main/release/conf/activemq.xml?rev=596231&r1=596230&r2=596231&view=diff
==============================================================================
--- servicemix/trunk/distributions/apache-servicemix/src/main/release/conf/activemq.xml (original)
+++ servicemix/trunk/distributions/apache-servicemix/src/main/release/conf/activemq.xml Mon
Nov 19 01:30:54 2007
@@ -20,7 +20,7 @@
 <beans xmlns:amq="http://activemq.org/config/1.0">
   
   <!-- ActiveMQ JMS Broker configuration -->
-  <amq:broker depends-on="jmxServer" useShutdownHook="false">
+  <amq:broker id="broker" depends-on="jmxServer" useShutdownHook="false">
 
     <!-- Disable creation of the jmx connector 
          which is created in the jmx.xml configuration file -->

Modified: servicemix/trunk/distributions/apache-servicemix/src/main/release/conf/jndi.xml
URL: http://svn.apache.org/viewvc/servicemix/trunk/distributions/apache-servicemix/src/main/release/conf/jndi.xml?rev=596231&r1=596230&r2=596231&view=diff
==============================================================================
--- servicemix/trunk/distributions/apache-servicemix/src/main/release/conf/jndi.xml (original)
+++ servicemix/trunk/distributions/apache-servicemix/src/main/release/conf/jndi.xml Mon Nov
19 01:30:54 2007
@@ -24,7 +24,7 @@
        xmlns:amqra="http://activemq.org/ra/1.0"
        xmlns:util="http://www.springframework.org/schema/util">
 
-  <bean id="jndi" 
+  <bean id="jndi" depends-on="broker"
         class="org.apache.xbean.spring.jndi.SpringInitialContextFactory" 
         factory-method="makeInitialContext"
         singleton="true">
@@ -45,7 +45,7 @@
     
     <!-- wsn2005 jms connection factory -->
     <entry key="java:comp/env/jms/wsnotificationCF">
-	  <bean class="org.apache.activemq.pool.PooledConnectionFactory">
+      <bean class="org.apache.activemq.pool.PooledConnectionFactory" destroy-method="stop">
         <constructor-arg value="${activemq.url}" />
       </bean>
     </entry>



Mime
View raw message