activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r646258 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/pool/PooledConnectionFactory.java
Date Wed, 09 Apr 2008 10:24:03 GMT
Author: rajdavies
Date: Wed Apr  9 03:23:59 2008
New Revision: 646258

URL: http://svn.apache.org/viewvc?rev=646258&view=rev
Log:
Fix for https://issues.apache.org/activemq/browse/AMQ-1578

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/pool/PooledConnectionFactory.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/pool/PooledConnectionFactory.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/pool/PooledConnectionFactory.java?rev=646258&r1=646257&r2=646258&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/pool/PooledConnectionFactory.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/pool/PooledConnectionFactory.java
Wed Apr  9 03:23:59 2008
@@ -52,6 +52,7 @@
     private int maximumActive = 500;
     private int maxConnections = 1;
     private TransactionManager transactionManager;
+    private int idleTimeout = 30 * 1000;
 
     public PooledConnectionFactory() {
         this(new ActiveMQConnectionFactory());
@@ -114,7 +115,9 @@
     }
 
     protected ConnectionPool createConnectionPool(ActiveMQConnection connection) {
-        return new ConnectionPool(connection, getPoolFactory(), transactionManager);
+        ConnectionPool result =  new ConnectionPool(connection, getPoolFactory(), transactionManager);
+        result.setIdleTimeout(getIdleTimeout());
+        return result;
     }
 
     protected ActiveMQConnection createConnection(ConnectionKey key) throws JMSException
{
@@ -190,5 +193,13 @@
 
     protected ObjectPoolFactory createPoolFactory() {
         return new GenericObjectPoolFactory(null, maximumActive);
+    }
+
+    public int getIdleTimeout() {
+        return idleTimeout;
+    }
+
+    public void setIdleTimeout(int idleTimeout) {
+        this.idleTimeout = idleTimeout;
     }
 }



Mime
View raw message