activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1452985 - in /activemq/trunk/activemq-spring/src: main/java/org/apache/activemq/pool/PooledConnectionFactoryBean.java test/resources/spring/spring.xml
Date Tue, 05 Mar 2013 20:37:11 GMT
Author: tabish
Date: Tue Mar  5 20:37:10 2013
New Revision: 1452985

URL: http://svn.apache.org/r1452985
Log:
fix for: https://issues.apache.org/jira/browse/AMQ-4360

Update spring pooled bean and config files to use non-deprecated calls.

Modified:
    activemq/trunk/activemq-spring/src/main/java/org/apache/activemq/pool/PooledConnectionFactoryBean.java
    activemq/trunk/activemq-spring/src/test/resources/spring/spring.xml

Modified: activemq/trunk/activemq-spring/src/main/java/org/apache/activemq/pool/PooledConnectionFactoryBean.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-spring/src/main/java/org/apache/activemq/pool/PooledConnectionFactoryBean.java?rev=1452985&r1=1452984&r2=1452985&view=diff
==============================================================================
--- activemq/trunk/activemq-spring/src/main/java/org/apache/activemq/pool/PooledConnectionFactoryBean.java
(original)
+++ activemq/trunk/activemq-spring/src/main/java/org/apache/activemq/pool/PooledConnectionFactoryBean.java
Tue Mar  5 20:37:10 2013
@@ -23,7 +23,6 @@ import javax.transaction.TransactionMana
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.apache.commons.pool.ObjectPoolFactory;
 import org.springframework.beans.factory.FactoryBean;
 
 /**
@@ -55,7 +54,6 @@ public class PooledConnectionFactoryBean
     private int maximumActive = 500;
     private Object transactionManager;
     private String resourceName;
-    private ObjectPoolFactory poolFactory;
 
     public int getMaxConnections() {
         return maxConnections;
@@ -97,14 +95,6 @@ public class PooledConnectionFactoryBean
         this.connectionFactory = connectionFactory;
     }
 
-    public ObjectPoolFactory getPoolFactory() {
-        return poolFactory;
-    }
-
-    public void setPoolFactory(ObjectPoolFactory poolFactory) {
-        this.poolFactory = poolFactory;
-    }
-
     /**
      *
      * @throws Exception
@@ -119,9 +109,8 @@ public class PooledConnectionFactoryBean
                 f.setName(resourceName);
                 f.setTransactionManager((TransactionManager) transactionManager);
                 f.setMaxConnections(maxConnections);
-                f.setMaximumActive(maximumActive);
+                f.setMaximumActiveSessionPerConnection(maximumActive);
                 f.setConnectionFactory(connectionFactory);
-                f.setPoolFactory(poolFactory);
                 this.pooledConnectionFactory = f;
             } catch (Throwable t) {
                 LOGGER.debug("Could not create JCA enabled connection factory: " + t, t);
@@ -133,9 +122,8 @@ public class PooledConnectionFactoryBean
                 XaPooledConnectionFactory f = new XaPooledConnectionFactory();
                 f.setTransactionManager((TransactionManager) transactionManager);
                 f.setMaxConnections(maxConnections);
-                f.setMaximumActive(maximumActive);
+                f.setMaximumActiveSessionPerConnection(maximumActive);
                 f.setConnectionFactory(connectionFactory);
-                f.setPoolFactory(poolFactory);
                 this.pooledConnectionFactory = f;
             } catch (Throwable t) {
                 LOGGER.debug("Could not create XA enabled connection factory: " + t, t);
@@ -146,9 +134,8 @@ public class PooledConnectionFactoryBean
                 LOGGER.debug("Trying to build a PooledConnectionFactory");
                 PooledConnectionFactory f = new PooledConnectionFactory();
                 f.setMaxConnections(maxConnections);
-                f.setMaximumActive(maximumActive);
+                f.setMaximumActiveSessionPerConnection(maximumActive);
                 f.setConnectionFactory(connectionFactory);
-                f.setPoolFactory(poolFactory);
                 this.pooledConnectionFactory = f;
             } catch (Throwable t) {
                 LOGGER.debug("Could not create pooled connection factory: " + t, t);
@@ -173,14 +160,17 @@ public class PooledConnectionFactoryBean
     }
 
     // FactoryBean methods
+    @Override
     public Object getObject() throws Exception {
         return pooledConnectionFactory;
     }
 
+    @Override
     public Class getObjectType() {
         return ConnectionFactory.class;
     }
 
+    @Override
     public boolean isSingleton() {
         return true;
     }

Modified: activemq/trunk/activemq-spring/src/test/resources/spring/spring.xml
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-spring/src/test/resources/spring/spring.xml?rev=1452985&r1=1452984&r2=1452985&view=diff
==============================================================================
--- activemq/trunk/activemq-spring/src/test/resources/spring/spring.xml (original)
+++ activemq/trunk/activemq-spring/src/test/resources/spring/spring.xml Tue Mar  5 20:37:10
2013
@@ -20,10 +20,10 @@
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:amq="http://activemq.apache.org/schema/core"
        xsi:schemaLocation="
-	   http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
-	   http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
-	   http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
-	   http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
+       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
+       http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
+       http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
 
     <amq:broker brokerName="test" useJmx="true" persistent="false">
         <amq:managementContext>
@@ -38,7 +38,7 @@
 
     <bean id="connectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory"
destroy-method="stop">
         <property name="maxConnections" value="100"/>
-        <property name="maximumActive" value="50"/>
+        <property name="maximumActiveSessionPerConnection" value="50"/>
         <property name="connectionFactory">
             <bean class="org.apache.activemq.ActiveMQConnectionFactory">
                 <property name="brokerURL" value="tcp://localhost:61616"/>
@@ -66,4 +66,4 @@
         <property name="transactionManager" ref="transactionManager"/>
     </bean>
 
-</beans>   
\ No newline at end of file
+</beans>
\ No newline at end of file



Mime
View raw message