Package io.micronaut.jms.pool
Class JMSConnectionPool
java.lang.Object
io.micronaut.jms.pool.AbstractPool<PooledObject<jakarta.jms.Connection>>
io.micronaut.jms.pool.JMSConnectionPool
- All Implemented Interfaces:
jakarta.jms.ConnectionFactory
public class JMSConnectionPool
extends AbstractPool<PooledObject<jakarta.jms.Connection>>
implements jakarta.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
(jakarta.jms.ConnectionFactory connectionFactory, int initialPoolSize, int maxPoolSize) -
Method Summary
Modifier and TypeMethodDescriptionprotected PooledConnection
Create an object for the pool.jakarta.jms.Connection
jakarta.jms.Connection
createConnection
(String userName, String password) jakarta.jms.JMSContext
jakarta.jms.JMSContext
createContext
(int sessionMode) jakarta.jms.JMSContext
createContext
(String userName, String password) jakarta.jms.JMSContext
createContext
(String userName, String password, int sessionMode) jakarta.jms.ConnectionFactory
Provides access to the underlyingConnectionFactory
.protected void
reset
(PooledObject<jakarta.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(jakarta.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<jakarta.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<jakarta.jms.Connection>>
- Parameters:
pooledObject
- the object
-
createConnection
public jakarta.jms.Connection createConnection() throws jakarta.jms.JMSException- Specified by:
createConnection
in interfacejakarta.jms.ConnectionFactory
- Throws:
jakarta.jms.JMSException
-
createConnection
public jakarta.jms.Connection createConnection(String userName, String password) throws jakarta.jms.JMSException - Specified by:
createConnection
in interfacejakarta.jms.ConnectionFactory
- Throws:
jakarta.jms.JMSException
-
createContext
public jakarta.jms.JMSContext createContext()- Specified by:
createContext
in interfacejakarta.jms.ConnectionFactory
-
createContext
- Specified by:
createContext
in interfacejakarta.jms.ConnectionFactory
-
createContext
- Specified by:
createContext
in interfacejakarta.jms.ConnectionFactory
-
createContext
public jakarta.jms.JMSContext createContext(int sessionMode) - Specified by:
createContext
in interfacejakarta.jms.ConnectionFactory
-
getConnectionFactory
public jakarta.jms.ConnectionFactory getConnectionFactory()Provides access to the underlyingConnectionFactory
.- Returns:
- the connection factory
-
toString
-