mirror of https://github.com/apache/activemq.git
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@646258 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5660ebc8f2
commit
5c7374bfae
|
@ -52,6 +52,7 @@ public class PooledConnectionFactory implements ConnectionFactory, Service {
|
||||||
private int maximumActive = 500;
|
private int maximumActive = 500;
|
||||||
private int maxConnections = 1;
|
private int maxConnections = 1;
|
||||||
private TransactionManager transactionManager;
|
private TransactionManager transactionManager;
|
||||||
|
private int idleTimeout = 30 * 1000;
|
||||||
|
|
||||||
public PooledConnectionFactory() {
|
public PooledConnectionFactory() {
|
||||||
this(new ActiveMQConnectionFactory());
|
this(new ActiveMQConnectionFactory());
|
||||||
|
@ -114,7 +115,9 @@ public class PooledConnectionFactory implements ConnectionFactory, Service {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ConnectionPool createConnectionPool(ActiveMQConnection connection) {
|
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 {
|
protected ActiveMQConnection createConnection(ConnectionKey key) throws JMSException {
|
||||||
|
@ -191,4 +194,12 @@ public class PooledConnectionFactory implements ConnectionFactory, Service {
|
||||||
protected ObjectPoolFactory createPoolFactory() {
|
protected ObjectPoolFactory createPoolFactory() {
|
||||||
return new GenericObjectPoolFactory(null, maximumActive);
|
return new GenericObjectPoolFactory(null, maximumActive);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getIdleTimeout() {
|
||||||
|
return idleTimeout;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIdleTimeout(int idleTimeout) {
|
||||||
|
this.idleTimeout = idleTimeout;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue