org.jboss.jca.core.connectionmanager.pool.mcp

## Interface ManagedConnectionPool

- All Superinterfaces:
    IdleConnectionRemovalSupport
  All Known Implementing Classes:
    LeakDumperManagedConnectionPool, SemaphoreArrayListManagedConnectionPool, SemaphoreConcurrentLinkedDequeManagedConnectionPool

      public interface ManagedConnectionPool
      extends IdleConnectionRemovalSupport

  Represents a managed connection pool, which manages all connection listeners
  Author:
    Jesper Pedersen

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addConnectionListener(ConnectionListener cl)` Add a connection to the pool
    `void` | `connectionListenerDestroyed(ConnectionListener cl)` Notify that a connection listener belonging to this pool was destroyed.
    `void` | `fillTo(int size)` Fill to
    `ConnectionListener` | `findConnectionListener(javax.resource.spi.ManagedConnection mc)` Find a connection listener
    `ConnectionListener` | `findConnectionListener(javax.resource.spi.ManagedConnection mc, java.lang.Object connection)` Find a connection listener
    `void` | `flush(org.jboss.jca.core.api.connectionmanager.pool.FlushMode mode, java.util.Collection<ConnectionListener> toDestroy)` Flush
    `int` | `getActive()` Get number of active connections
    `ConnectionListener` | `getConnection(javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo cri)` Returns a connection listener that wraps managed connection.
    `long` | `getLastUsed()` Get the last used timestamp
    `void` | `increaseCapacity(javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo cri)` Increase capacity
    `void` | `initialize(javax.resource.spi.ManagedConnectionFactory mcf, ConnectionManager cm, javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo cri, org.jboss.jca.core.api.connectionmanager.pool.PoolConfiguration pc, Pool p)` Initialize the managed connection pool
    `boolean` | `isEmpty()` Checks if the pool is empty or not
    `boolean` | `isIdle()` Is the pool idle ?
    `boolean` | `isRunning()` Checks if the pool is running or not
    `void` | `prefill()` Prefill
    `ConnectionListener` | `removeConnectionListener()` Remove an idle connection from the pool
    `void` | `returnConnection(ConnectionListener cl, boolean kill)` Return connection to the pool.
    `void` | `shutdown()` Shutdown
    `void` | `validateConnections()` Validate connecitons.

    - ### Methods inherited from interface org.jboss.jca.core.connectionmanager.pool.idle.IdleConnectionRemovalSupport

      `removeIdleConnections`

- - ### Method Detail

    - #### getLastUsed

          long getLastUsed()

      Get the last used timestamp
      Returns:
        The value

    - #### initialize

          void initialize(javax.resource.spi.ManagedConnectionFactory mcf,
                          ConnectionManager cm,
                          javax.security.auth.Subject subject,
                          javax.resource.spi.ConnectionRequestInfo cri,
                          org.jboss.jca.core.api.connectionmanager.pool.PoolConfiguration pc,
                          Pool p)

      Initialize the managed connection pool
      Parameters:
        `mcf` - The managed connection factory
        `cm` - The connection manager
        `subject` - The subject
        `cri` - The connection request info
        `pc` - The pool configuration
        `p` - The pool

    - #### getConnection

          ConnectionListener getConnection(javax.security.auth.Subject subject,
                                           javax.resource.spi.ConnectionRequestInfo cri)
                                    throws javax.resource.ResourceException

      Returns a connection listener that wraps managed connection.
      Parameters:
        `subject` - subject
        `cri` - connection request info
      Returns:
        connection listener wrapped managed connection
      Throws:
        `javax.resource.ResourceException` - exception

    - #### findConnectionListener

          ConnectionListener findConnectionListener(javax.resource.spi.ManagedConnection mc)

      Find a connection listener
      Parameters:
        `mc` - The managed connection
      Returns:
        The connection listener; `null` if the connection listener doesn't belong

    - #### findConnectionListener

          ConnectionListener findConnectionListener(javax.resource.spi.ManagedConnection mc,
                                                    java.lang.Object connection)

      Find a connection listener
      Parameters:
        `mc` - The managed connection
        `connection` - The connection
      Returns:
        The connection listener; `null` if the connection listener doesn't belong

    - #### returnConnection

          void returnConnection(ConnectionListener cl,
                                boolean kill)

      Return connection to the pool.
      Parameters:
        `cl` - connection listener
        `kill` - kill connection

    - #### isEmpty

          boolean isEmpty()

      Checks if the pool is empty or not
      Returns:
        True if is emtpy; otherwise false

    - #### isIdle

          boolean isIdle()

      Is the pool idle ?
      Returns:
        True if idle, otherwise false

    - #### isRunning

          boolean isRunning()

      Checks if the pool is running or not
      Returns:
        True if is running; otherwise false

    - #### getActive

          int getActive()

      Get number of active connections
      Returns:
        The value

    - #### prefill

          void prefill()

      Prefill

    - #### flush

          void flush(org.jboss.jca.core.api.connectionmanager.pool.FlushMode mode,
                     java.util.Collection<ConnectionListener> toDestroy)

      Flush
      Parameters:
        `mode` - The flush mode
        `toDestroy` - list of connection listeners to be destroyed

    - #### shutdown

          void shutdown()

      Shutdown

    - #### fillTo

          void fillTo(int size)

      Fill to
      Parameters:
        `size` - The size

    - #### validateConnections

          void validateConnections()
                            throws java.lang.Exception

      Validate connecitons.
      Throws:
        `java.lang.Exception` - for exception

    - #### increaseCapacity

          void increaseCapacity(javax.security.auth.Subject subject,
                                javax.resource.spi.ConnectionRequestInfo cri)

      Increase capacity
      Parameters:
        `subject` - The subject
        `cri` - The connection request information object

    - #### addConnectionListener

          void addConnectionListener(ConnectionListener cl)

      Add a connection to the pool
      Parameters:
        `cl` - The connection listener

    - #### removeConnectionListener

          ConnectionListener removeConnectionListener()

      Remove an idle connection from the pool
      Returns:
        A connection listener; `null` if no connection listener was available

    - #### connectionListenerDestroyed

          void connectionListenerDestroyed(ConnectionListener cl)

      Notify that a connection listener belonging to this pool was destroyed.

Copyright © 2014 IronJacamar (http://www.ironjacamar.org)