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

    • JMSConnectionPool

      public JMSConnectionPool(javax.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<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

      protected void reset(PooledObject<javax.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<javax.jms.Connection>>
      Parameters:
      pooledObject - the object
    • createConnection

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

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

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

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

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

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

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

      public String toString()
      Overrides:
      toString in class Object