org.apache.activemq.pool
Class PooledConnectionFactory
java.lang.Object
org.apache.activemq.pool.PooledConnectionFactory
- All Implemented Interfaces:
- javax.jms.ConnectionFactory, Service
public class PooledConnectionFactory
- extends Object
- implements javax.jms.ConnectionFactory, Service
A JMS provider which pools Connection, Session and MessageProducer instances
so it can be used with tools like Spring's JmsTemplate.
NOTE this implementation is only intended for use when sending
messages. It does not deal with pooling of consumers; for that look at a
library like Jencks such as in this example
- Version:
- $Revision: 1.1 $
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PooledConnectionFactory
public PooledConnectionFactory()
PooledConnectionFactory
public PooledConnectionFactory(String brokerURL)
PooledConnectionFactory
public PooledConnectionFactory(ActiveMQConnectionFactory connectionFactory)
getConnectionFactory
public ActiveMQConnectionFactory getConnectionFactory()
setConnectionFactory
public void setConnectionFactory(ActiveMQConnectionFactory connectionFactory)
createConnection
public javax.jms.Connection createConnection()
throws javax.jms.JMSException
- Specified by:
createConnection
in interface javax.jms.ConnectionFactory
- Throws:
javax.jms.JMSException
createConnection
public javax.jms.Connection createConnection(String userName,
String password)
throws javax.jms.JMSException
- Specified by:
createConnection
in interface javax.jms.ConnectionFactory
- Throws:
javax.jms.JMSException
createConnection
protected ActiveMQConnection createConnection(ConnectionKey key)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
start
public void start()
- Specified by:
start
in interface Service
- See Also:
org.apache.activemq.service.Service#start()
stop
public void stop()
throws Exception
- Specified by:
stop
in interface Service
- Throws:
Exception
getPoolFactory
public org.apache.commons.pool.ObjectPoolFactory getPoolFactory()
setPoolFactory
public void setPoolFactory(org.apache.commons.pool.ObjectPoolFactory poolFactory)
- Sets the object pool factory used to create individual session pools for
each connection
getMaximumActive
public int getMaximumActive()
setMaximumActive
public void setMaximumActive(int maximumActive)
- Sets the maximum number of active sessions per connection
createPoolFactory
protected org.apache.commons.pool.ObjectPoolFactory createPoolFactory()
Copyright © 2011 Apache Software Foundation. All Rights Reserved.