Package io.micronaut.jms.pool
Class JMSConnectionPool
java.lang.Object
io.micronaut.jms.pool.AbstractPool<PooledObject<javax.jms.Connection>>
io.micronaut.jms.pool.JMSConnectionPool
- All Implemented Interfaces:
javax.jms.ConnectionFactory
public class JMSConnectionPool
extends AbstractPool<PooledObject<javax.jms.Connection>>
implements javax.jms.ConnectionFactory
Decorator of the provided
ConnectionFactory to ensure maximum reuse
of Connection instances.- Since:
- 1.0.0
- Author:
- Elliott Pope
-
Field Summary
Fields inherited from class io.micronaut.jms.pool.AbstractPool
initialSize, maxSize, pool -
Constructor Summary
ConstructorsConstructorDescriptionJMSConnectionPool(javax.jms.ConnectionFactory connectionFactory, int initialPoolSize, int maxPoolSize) -
Method Summary
Modifier and TypeMethodDescriptionprotected PooledConnectionCreate an object for the pool.javax.jms.Connectionjavax.jms.ConnectioncreateConnection(String userName, String password) javax.jms.JMSContextjavax.jms.JMSContextcreateContext(int sessionMode) javax.jms.JMSContextcreateContext(String userName, String password) javax.jms.JMSContextcreateContext(String userName, String password, int sessionMode) javax.jms.ConnectionFactoryProvides access to the underlyingConnectionFactory.protected voidreset(PooledObject<javax.jms.Connection> pooledObject) Reset the provided object so it can be returned to the pool for reuse.toString()Methods inherited from class io.micronaut.jms.pool.AbstractPool
release, request
-
Constructor Details
-
JMSConnectionPool
public JMSConnectionPool(javax.jms.ConnectionFactory connectionFactory, int initialPoolSize, int maxPoolSize)
-
-
Method Details
-
create
Description copied from class:AbstractPoolCreate an object for the pool.- Specified by:
createin classAbstractPool<PooledObject<javax.jms.Connection>>- Parameters:
args- the arguments to be provided to the create method.- Returns:
- a new object of type
<T>for the pool.
-
reset
Description copied from class:AbstractPoolReset the provided object so it can be returned to the pool for reuse.- Specified by:
resetin classAbstractPool<PooledObject<javax.jms.Connection>>- Parameters:
pooledObject- the object
-
createConnection
public javax.jms.Connection createConnection() throws javax.jms.JMSException- Specified by:
createConnectionin interfacejavax.jms.ConnectionFactory- Throws:
javax.jms.JMSException
-
createConnection
public javax.jms.Connection createConnection(String userName, String password) throws javax.jms.JMSException - Specified by:
createConnectionin interfacejavax.jms.ConnectionFactory- Throws:
javax.jms.JMSException
-
createContext
public javax.jms.JMSContext createContext()- Specified by:
createContextin interfacejavax.jms.ConnectionFactory
-
createContext
- Specified by:
createContextin interfacejavax.jms.ConnectionFactory
-
createContext
- Specified by:
createContextin interfacejavax.jms.ConnectionFactory
-
createContext
public javax.jms.JMSContext createContext(int sessionMode) - Specified by:
createContextin interfacejavax.jms.ConnectionFactory
-
getConnectionFactory
public javax.jms.ConnectionFactory getConnectionFactory()Provides access to the underlyingConnectionFactory.- Returns:
- the connection factory
-
toString
-