org.jboss.resource.connectionmanager
Class JBossManagedConnectionPool.BasePool

java.lang.Object
  extended byorg.jboss.resource.connectionmanager.JBossManagedConnectionPool.BasePool
All Implemented Interfaces:
ManagedConnectionPool (src)
Direct Known Subclasses:
JBossManagedConnectionPool.OnePool (src) , JBossManagedConnectionPool.PoolByCri (src) , JBossManagedConnectionPool.PoolBySubject (src) , JBossManagedConnectionPool.PoolBySubjectAndCri (src)
Enclosing class:
JBossManagedConnectionPool (src)

public abstract static class JBossManagedConnectionPool.BasePool
extends java.lang.Object
implements ManagedConnectionPool (src)

The base pool implementation


Constructor Summary
JBossManagedConnectionPool.BasePool(ManagedConnectionFactory (src)  mcf, InternalManagedConnectionPool.PoolParams (src)  poolParams, boolean noTxSeparatePools, Logger (src)  log)
          Create a new base pool
 
Method Summary
 void flush()
          flush the pool
 long getAvailableConnectionCount()
           
 ConnectionListener (src) getConnection(Transaction (src)  transaction, javax.security.auth.Subject subject, ConnectionRequestInfo (src)  cri)
          Get a connection
 int getConnectionCount()
           
 int getConnectionCreatedCount()
           
 int getConnectionDestroyedCount()
           
 int getInUseConnectionCount()
          Return the inuse count
protected abstract  java.lang.Object getKey(javax.security.auth.Subject subject, ConnectionRequestInfo (src)  cri, boolean separateNoTx)
          Retrieve the key for this request
 ManagedConnectionFactory (src) getManagedConnectionFactory()
          Retrieve the managed connection factory for this pool
 int getMaxConnectionsInUseCount()
           
protected  TransactionManager (src) getTransactionManager()
          Get any transaction manager associated with the pool
 void returnConnection(ConnectionListener (src)  cl, boolean kill)
          Return a connection
 void setConnectionListenerFactory(ConnectionListenerFactory (src)  clf)
          Set the connection listener factory
 void shutdown()
          shutdown the pool
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JBossManagedConnectionPool.BasePool

public JBossManagedConnectionPool.BasePool(ManagedConnectionFactory (src)  mcf,
                                           InternalManagedConnectionPool.PoolParams (src)  poolParams,
                                           boolean noTxSeparatePools,
                                           Logger (src)  log)
Create a new base pool

Parameters:
mcf - the managed connection factory
poolParams - the pooling parameters
log - the log
Method Detail

getKey

protected abstract java.lang.Object getKey(javax.security.auth.Subject subject,
                                           ConnectionRequestInfo (src)  cri,
                                           boolean separateNoTx)
                                    throws ResourceException (src) 
Retrieve the key for this request

Parameters:
subject - the subject
cri - the connection request information
Returns:
the key
Throws:
ResourceException (src) - for any error

getManagedConnectionFactory

public ManagedConnectionFactory (src)  getManagedConnectionFactory()
Description copied from interface: ManagedConnectionPool (src)
Retrieve the managed connection factory for this pool

Specified by:
getManagedConnectionFactory in interface ManagedConnectionPool (src)
Returns:
the managed connection factory

setConnectionListenerFactory

public void setConnectionListenerFactory(ConnectionListenerFactory (src)  clf)
Description copied from interface: ManagedConnectionPool (src)
Set the connection listener factory

Specified by:
setConnectionListenerFactory in interface ManagedConnectionPool (src)
Parameters:
clf - the connection event listener factory

getInUseConnectionCount

public int getInUseConnectionCount()
Return the inuse count

Specified by:
getInUseConnectionCount in interface ManagedConnectionPool (src)
Returns:
the count

getConnection

public ConnectionListener (src)  getConnection(Transaction (src)  transaction,
                                        javax.security.auth.Subject subject,
                                        ConnectionRequestInfo (src)  cri)
                                 throws ResourceException (src) 
Description copied from interface: ManagedConnectionPool (src)
Get a connection

Specified by:
getConnection in interface ManagedConnectionPool (src)
Parameters:
subject - the subject for connection
cri - the connection request information
Returns:
a connection event listener wrapping the connection
Throws:
ResourceException (src) - for any error

returnConnection

public void returnConnection(ConnectionListener (src)  cl,
                             boolean kill)
                      throws ResourceException (src) 
Description copied from interface: ManagedConnectionPool (src)
Return a connection

Specified by:
returnConnection in interface ManagedConnectionPool (src)
Parameters:
cl - the connection event listener wrapping the connection
kill - whether to destroy the managed connection
Throws:
ResourceException (src) - for any error

getConnectionCount

public int getConnectionCount()
Specified by:
getConnectionCount in interface ManagedConnectionPool (src)
Returns:
the connection count

getConnectionCreatedCount

public int getConnectionCreatedCount()
Specified by:
getConnectionCreatedCount in interface ManagedConnectionPool (src)
Returns:
the connections created count

getConnectionDestroyedCount

public int getConnectionDestroyedCount()
Specified by:
getConnectionDestroyedCount in interface ManagedConnectionPool (src)
Returns:
the connections destroyed count

getAvailableConnectionCount

public long getAvailableConnectionCount()
Specified by:
getAvailableConnectionCount in interface ManagedConnectionPool (src)
Returns:
the available connections

getMaxConnectionsInUseCount

public int getMaxConnectionsInUseCount()
Specified by:
getMaxConnectionsInUseCount in interface ManagedConnectionPool (src)
Returns:
the available connections

shutdown

public void shutdown()
Description copied from interface: ManagedConnectionPool (src)
shutdown the pool

Specified by:
shutdown in interface ManagedConnectionPool (src)

flush

public void flush()
Description copied from interface: ManagedConnectionPool (src)
flush the pool

Specified by:
flush in interface ManagedConnectionPool (src)

getTransactionManager

protected TransactionManager (src)  getTransactionManager()
Get any transaction manager associated with the pool

Returns:
the transaction manager