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
  • Constructor Details

    • JMSConnectionPool

      public JMSConnectionPool(jakarta.jms.ConnectionFactory connectionFactory, int initialPoolSize, int maxPoolSize)
  • Method Details

    • create

      protected PooledConnection create(Object... args)
      Description copied from class: AbstractPool
      Create an object for the pool.
      Specified by:
      create in class AbstractPool<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

      protected void reset(PooledObject<jakarta.jms.Connection> pooledObject)
      Description copied from class: AbstractPool
      Reset the provided object so it can be returned to the pool for reuse.
      Specified by:
      reset in class AbstractPool<PooledObject<jakarta.jms.Connection>>
      Parameters:
      pooledObject - the object
    • createConnection

      public jakarta.jms.Connection createConnection() throws jakarta.jms.JMSException
      Specified by:
      createConnection in interface jakarta.jms.ConnectionFactory
      Throws:
      jakarta.jms.JMSException
    • createConnection

      public jakarta.jms.Connection createConnection(String userName, String password) throws jakarta.jms.JMSException
      Specified by:
      createConnection in interface jakarta.jms.ConnectionFactory
      Throws:
      jakarta.jms.JMSException
    • createContext

      public jakarta.jms.JMSContext createContext()
      Specified by:
      createContext in interface jakarta.jms.ConnectionFactory
    • createContext

      public jakarta.jms.JMSContext createContext(String userName, String password)
      Specified by:
      createContext in interface jakarta.jms.ConnectionFactory
    • createContext

      public jakarta.jms.JMSContext createContext(String userName, String password, int sessionMode)
      Specified by:
      createContext in interface jakarta.jms.ConnectionFactory
    • createContext

      public jakarta.jms.JMSContext createContext(int sessionMode)
      Specified by:
      createContext in interface jakarta.jms.ConnectionFactory
    • getConnectionFactory

      public jakarta.jms.ConnectionFactory getConnectionFactory()
      Provides access to the underlying ConnectionFactory.
      Returns:
      the connection factory
    • toString

      public String toString()
      Overrides:
      toString in class Object