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

All Superinterfaces:
IdleConnectionRemovalSupport
All Known Implementing Classes:
ArrayBlockingQueueManagedConnectionPool, SemaphoreArrayListManagedConnectionPool

public interface ManagedConnectionPool
extends IdleConnectionRemovalSupport

Represents a managed connection pool, which manages all connection listeners

Author:
Jesper Pedersen

Method Summary
 void fillToMin()
          Fill to min
 void flush()
          Flush idle connections
 void flush(boolean kill)
          Flush
 int getActive()
          Get number of active connections
 ConnectionListener getConnection(Subject subject, javax.resource.spi.ConnectionRequestInfo cri)
          Returns a connection listener that wraps managed connection.
 ManagedConnectionPoolStatistics getStatistics()
          Get statistics
 void initialize(javax.resource.spi.ManagedConnectionFactory mcf, ConnectionListenerFactory clf, 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 isFull()
          Is the pool full ?
 boolean isIdle()
          Is the pool idle ?
 boolean isRunning()
          Checks if the pool is running or not
 void reenable()
          Reenable a 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

initialize

void initialize(javax.resource.spi.ManagedConnectionFactory mcf,
                ConnectionListenerFactory clf,
                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
clf - The connection listener factory
subject - The subject
cri - The connection request info
pc - The pool configuration
p - The pool

getConnection

ConnectionListener getConnection(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

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

isFull

boolean isFull()
Is the pool full ?

Returns:
True if full, 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

reenable

void reenable()
Reenable a pool


flush

void flush()
Flush idle connections


flush

void flush(boolean kill)
Flush

Parameters:
kill - Kill all connections

shutdown

void shutdown()
Shutdown


fillToMin

void fillToMin()
Fill to min


validateConnections

void validateConnections()
                         throws Exception
Validate connecitons.

Throws:
Exception - for exception

getStatistics

ManagedConnectionPoolStatistics getStatistics()
Get statistics

Returns:
The module


Copyright © 2012 JBoss, by Red Hat (http://www.jboss.org/ironjacamar)