public class JMSConnectionPool extends AbstractPool<PooledObject<javax.jms.Connection>> implements javax.jms.ConnectionFactory
ConnectionFactory
to ensure maximum reuse
of Connection
instances.initialSize, maxSize, pool
Constructor and Description |
---|
JMSConnectionPool(javax.jms.ConnectionFactory connectionFactory,
int initialPoolSize,
int maxPoolSize) |
Modifier and Type | Method and Description |
---|---|
protected PooledConnection |
create(java.lang.Object... args)
Create an object for the pool.
|
javax.jms.Connection |
createConnection() |
javax.jms.Connection |
createConnection(java.lang.String userName,
java.lang.String password) |
javax.jms.JMSContext |
createContext() |
javax.jms.JMSContext |
createContext(int sessionMode) |
javax.jms.JMSContext |
createContext(java.lang.String userName,
java.lang.String password) |
javax.jms.JMSContext |
createContext(java.lang.String userName,
java.lang.String password,
int sessionMode) |
javax.jms.ConnectionFactory |
getConnectionFactory()
Provides access to the underlying
ConnectionFactory . |
protected void |
reset(PooledObject<javax.jms.Connection> pooledObject)
Reset the provided object so it can be returned to the pool for reuse.
|
java.lang.String |
toString() |
release, request
public JMSConnectionPool(javax.jms.ConnectionFactory connectionFactory, int initialPoolSize, int maxPoolSize)
protected PooledConnection create(java.lang.Object... args)
AbstractPool
create
in class AbstractPool<PooledObject<javax.jms.Connection>>
args
- the arguments to be provided to the create method.<T>
for the pool.protected void reset(PooledObject<javax.jms.Connection> pooledObject)
AbstractPool
reset
in class AbstractPool<PooledObject<javax.jms.Connection>>
pooledObject
- the objectpublic javax.jms.Connection createConnection() throws javax.jms.JMSException
createConnection
in interface javax.jms.ConnectionFactory
javax.jms.JMSException
public javax.jms.Connection createConnection(java.lang.String userName, java.lang.String password) throws javax.jms.JMSException
createConnection
in interface javax.jms.ConnectionFactory
javax.jms.JMSException
public javax.jms.JMSContext createContext()
createContext
in interface javax.jms.ConnectionFactory
public javax.jms.JMSContext createContext(java.lang.String userName, java.lang.String password)
createContext
in interface javax.jms.ConnectionFactory
public javax.jms.JMSContext createContext(java.lang.String userName, java.lang.String password, int sessionMode)
createContext
in interface javax.jms.ConnectionFactory
public javax.jms.JMSContext createContext(int sessionMode)
createContext
in interface javax.jms.ConnectionFactory
public javax.jms.ConnectionFactory getConnectionFactory()
ConnectionFactory
.public java.lang.String toString()
toString
in class java.lang.Object