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
ConstructorDescriptionJMSConnectionPool
(javax.jms.ConnectionFactory connectionFactory, int initialPoolSize, int maxPoolSize) -
Method Summary
Modifier and TypeMethodDescriptionprotected PooledConnection
Create an object for the pool.javax.jms.Connection
javax.jms.Connection
createConnection
(String userName, String password) javax.jms.JMSContext
javax.jms.JMSContext
createContext
(int sessionMode) javax.jms.JMSContext
createContext
(String userName, String password) javax.jms.JMSContext
createContext
(String userName, String password, int sessionMode) javax.jms.ConnectionFactory
Provides access to the underlyingConnectionFactory
.protected void
reset
(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:AbstractPool
Create an object for the pool.- Specified by:
create
in 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:AbstractPool
Reset the provided object so it can be returned to the pool for reuse.- Specified by:
reset
in classAbstractPool<PooledObject<javax.jms.Connection>>
- Parameters:
pooledObject
- the object
-
createConnection
public javax.jms.Connection createConnection() throws javax.jms.JMSException- Specified by:
createConnection
in interfacejavax.jms.ConnectionFactory
- Throws:
javax.jms.JMSException
-
createConnection
public javax.jms.Connection createConnection(String userName, String password) throws javax.jms.JMSException - Specified by:
createConnection
in interfacejavax.jms.ConnectionFactory
- Throws:
javax.jms.JMSException
-
createContext
public javax.jms.JMSContext createContext()- Specified by:
createContext
in interfacejavax.jms.ConnectionFactory
-
createContext
- Specified by:
createContext
in interfacejavax.jms.ConnectionFactory
-
createContext
- Specified by:
createContext
in interfacejavax.jms.ConnectionFactory
-
createContext
public javax.jms.JMSContext createContext(int sessionMode) - Specified by:
createContext
in interfacejavax.jms.ConnectionFactory
-
getConnectionFactory
public javax.jms.ConnectionFactory getConnectionFactory()Provides access to the underlyingConnectionFactory
.- Returns:
- the connection factory
-
toString
-