
public abstract class AbstractPool extends Object implements Pool
It can contains sub-pools according to the semantic of
the pool. Concrete implementatins override getKey(Subject, ConnectionRequestInfo, boolean)
method to create map key object.
| Modifier and Type | Field and Description |
|---|---|
protected CoreLogger |
log
The logger
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractPool(javax.resource.spi.ManagedConnectionFactory mcf,
org.jboss.jca.core.api.connectionmanager.pool.PoolConfiguration pc,
boolean noTxSeparatePools,
boolean sharable)
Create a new base pool.
|
| Modifier and Type | Method and Description |
|---|---|
void |
emptyManagedConnectionPool(ManagedConnectionPool pool)
Remove the matching managed connection pool if the pool is empty
|
ConnectionListener |
findConnectionListener(javax.resource.spi.ManagedConnection mc)
Find a connection listener
|
ConnectionListener |
findConnectionListener(javax.resource.spi.ManagedConnection mc,
Object connection)
Find a connection listener
|
void |
flush()
Flush idle connections from the pool
|
void |
flush(boolean kill)
Flush the pool
|
void |
flush(org.jboss.jca.core.api.connectionmanager.pool.FlushMode mode)
Flush the pool
|
Capacity |
getCapacity()
Get the capacity policy
|
ConnectionListener |
getConnection(Transaction trackByTransaction,
Subject subject,
javax.resource.spi.ConnectionRequestInfo cri)
Get a connection
|
protected ConnectionManager |
getConnectionManager()
Get the connection manager
|
protected abstract Object |
getKey(Subject subject,
javax.resource.spi.ConnectionRequestInfo cri,
boolean separateNoTx)
Retrieve the key for this request.
|
abstract CoreLogger |
getLogger()
Get the logger
|
javax.resource.spi.ManagedConnectionFactory |
getManagedConnectionFactory()
Retrieve the managed connection factory for this pool.
|
protected ManagedConnectionPool |
getManagedConnectionPool(Object key,
Subject subject,
javax.resource.spi.ConnectionRequestInfo cri)
Determine the correct pool for this request,
creates a new one when necessary.
|
protected ConcurrentMap<Object,ManagedConnectionPool> |
getManagedConnectionPools()
Get the managed connection pools.
|
String |
getName()
Gets pool name.
|
org.jboss.jca.core.api.connectionmanager.pool.PoolStatistics |
getStatistics()
Get the statistics
|
protected org.jboss.jca.core.spi.transaction.TransactionIntegration |
getTransactionIntegration()
Get any transaction integration associated with the pool.
|
protected TransactionManager |
getTransactionManager()
Get any transaction manager associated with the pool.
|
protected TransactionSynchronizationRegistry |
getTransactionSynchronizationRegistry()
Get any transaction synchronization registry associated with the pool.
|
protected boolean |
internalTestConnection(javax.resource.spi.ConnectionRequestInfo cri,
Subject subject)
Test if a connection can be obtained
|
boolean |
isSharable()
Is sharable
|
boolean |
isShutdown()
Is shutdown
|
void |
returnConnection(ConnectionListener cl,
boolean kill)
Return a connection
|
void |
setCapacity(Capacity c)
Set the capacity policy
|
void |
setConnectionManager(ConnectionManager cm)
Set the connection manager
|
void |
setName(String poolName)
Sets pool name.
|
void |
shutdown()
Shutdown the pool
|
abstract boolean |
testConnection()
Test if a connection can be obtained
|
abstract boolean |
testConnection(javax.resource.spi.ConnectionRequestInfo cri,
Subject subject)
Test if a connection can be obtained
|
protected final CoreLogger log
protected AbstractPool(javax.resource.spi.ManagedConnectionFactory mcf,
org.jboss.jca.core.api.connectionmanager.pool.PoolConfiguration pc,
boolean noTxSeparatePools,
boolean sharable)
mcf - the managed connection factorypc - the pool configurationnoTxSeparatePools - noTxSeparatePoolsharable - Are the connections sharablepublic void setName(String poolName)
poolName - pool namepublic String getName()
getName in interface org.jboss.jca.core.api.connectionmanager.pool.Poolpublic boolean isSharable()
public Capacity getCapacity()
public void setCapacity(Capacity c)
c - The valueprotected abstract Object getKey(Subject subject, javax.resource.spi.ConnectionRequestInfo cri, boolean separateNoTx) throws javax.resource.ResourceException
subject - the subjectcri - the connection request informationseparateNoTx - separateNoTxjavax.resource.ResourceException - for any errorprotected ManagedConnectionPool getManagedConnectionPool(Object key, Subject subject, javax.resource.spi.ConnectionRequestInfo cri) throws javax.resource.ResourceException
key - the key to the poolsubject - the subject of the poolcri - the connection request infojavax.resource.ResourceException - for any errorprotected org.jboss.jca.core.spi.transaction.TransactionIntegration getTransactionIntegration()
protected TransactionManager getTransactionManager()
protected TransactionSynchronizationRegistry getTransactionSynchronizationRegistry()
public void emptyManagedConnectionPool(ManagedConnectionPool pool)
pool - The poolpublic void flush()
flush in interface org.jboss.jca.core.api.connectionmanager.pool.Poolpublic void flush(boolean kill)
flush in interface org.jboss.jca.core.api.connectionmanager.pool.Poolkill - Kill all connectionspublic void flush(org.jboss.jca.core.api.connectionmanager.pool.FlushMode mode)
flush in interface org.jboss.jca.core.api.connectionmanager.pool.Poolmode - The flush modepublic ConnectionListener getConnection(Transaction trackByTransaction, Subject subject, javax.resource.spi.ConnectionRequestInfo cri) throws javax.resource.ResourceException
trackByTransaction - for transaction stickinesssubject - the subject for connectioncri - the connection request informationjavax.resource.ResourceException - for any errorpublic ConnectionListener findConnectionListener(javax.resource.spi.ManagedConnection mc)
mc - The managed connectionpublic ConnectionListener findConnectionListener(javax.resource.spi.ManagedConnection mc, Object connection)
mc - The managed connectionconnection - The connectionpublic javax.resource.spi.ManagedConnectionFactory getManagedConnectionFactory()
public void returnConnection(ConnectionListener cl, boolean kill) throws javax.resource.ResourceException
cl - the connection event listener wrapping the connectionkill - whether to destroy the managed connectionjavax.resource.ResourceException - for any errorprotected ConnectionManager getConnectionManager()
public void setConnectionManager(ConnectionManager cm)
cm - the connection managerpublic boolean isShutdown()
public void shutdown()
public org.jboss.jca.core.api.connectionmanager.pool.PoolStatistics getStatistics()
getStatistics in interface org.jboss.jca.core.api.connectionmanager.pool.Poolpublic abstract boolean testConnection()
testConnection in interface org.jboss.jca.core.api.connectionmanager.pool.Poolpublic abstract boolean testConnection(javax.resource.spi.ConnectionRequestInfo cri,
Subject subject)
testConnection in interface org.jboss.jca.core.api.connectionmanager.pool.Poolcri - Optional connection request info objectsubject - Optional subjectprotected boolean internalTestConnection(javax.resource.spi.ConnectionRequestInfo cri,
Subject subject)
subject - Optional subjectcri - Optional CRIprotected ConcurrentMap<Object,ManagedConnectionPool> getManagedConnectionPools()
public abstract CoreLogger getLogger()
Copyright © 2013 IronJacamar (http://www.ironjacamar.org)