public class SemaphoreArrayListManagedConnectionPool extends java.lang.Object implements ManagedConnectionPool
Constructor and Description |
---|
SemaphoreArrayListManagedConnectionPool()
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addConnectionListener(ConnectionListener cl)
Add a connection to the pool
|
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(FlushMode mode)
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
|
ManagedConnectionPoolStatistics |
getStatistics()
Get statistics
|
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,
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 |
prefill()
Prefill
|
void |
reenable()
Reenable a pool
|
ConnectionListener |
removeConnectionListener()
Remove an idle connection from the pool
|
void |
removeIdleConnections()
Pool removes idle connections.
|
void |
returnConnection(ConnectionListener cl,
boolean kill)
Return connection to the pool.
|
void |
returnConnection(ConnectionListener cl,
boolean kill,
boolean cleanup) |
void |
shutdown()
Shutdown
|
java.lang.String |
toString()
String representation
|
void |
validateConnections()
Validate connecitons.
|
public SemaphoreArrayListManagedConnectionPool()
public void initialize(javax.resource.spi.ManagedConnectionFactory mcf, ConnectionManager cm, javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo cri, PoolConfiguration pc, Pool p)
initialize
in interface ManagedConnectionPool
mcf
- The managed connection factorycm
- The connection managersubject
- The subjectcri
- The connection request infopc
- The pool configurationp
- The poolpublic long getLastUsed()
getLastUsed
in interface ManagedConnectionPool
public boolean isRunning()
isRunning
in interface ManagedConnectionPool
public boolean isEmpty()
isEmpty
in interface ManagedConnectionPool
public boolean isFull()
isFull
in interface ManagedConnectionPool
public boolean isIdle()
isIdle
in interface ManagedConnectionPool
public int getActive()
getActive
in interface ManagedConnectionPool
public void reenable()
reenable
in interface ManagedConnectionPool
public void prefill()
prefill
in interface ManagedConnectionPool
public ConnectionListener getConnection(javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo cri) throws javax.resource.ResourceException
getConnection
in interface ManagedConnectionPool
subject
- subjectcri
- connection request infojavax.resource.ResourceException
- exceptionpublic ConnectionListener findConnectionListener(javax.resource.spi.ManagedConnection mc)
findConnectionListener
in interface ManagedConnectionPool
mc
- The managed connectionnull
if the connection listener doesn't belongpublic ConnectionListener findConnectionListener(javax.resource.spi.ManagedConnection mc, java.lang.Object connection)
findConnectionListener
in interface ManagedConnectionPool
mc
- The managed connectionconnection
- The connectionnull
if the connection listener doesn't belongpublic void addConnectionListener(ConnectionListener cl)
addConnectionListener
in interface ManagedConnectionPool
cl
- The connection listenerpublic ConnectionListener removeConnectionListener()
removeConnectionListener
in interface ManagedConnectionPool
null
if no connection listener was availablepublic void returnConnection(ConnectionListener cl, boolean kill)
returnConnection
in interface ManagedConnectionPool
cl
- connection listenerkill
- kill connectionpublic void returnConnection(ConnectionListener cl, boolean kill, boolean cleanup)
public void flush(FlushMode mode)
flush
in interface ManagedConnectionPool
mode
- The flush modepublic void removeIdleConnections()
removeIdleConnections
in interface IdleConnectionRemovalSupport
public void shutdown()
shutdown
in interface ManagedConnectionPool
public void fillTo(int size)
fillTo
in interface ManagedConnectionPool
size
- The sizepublic ManagedConnectionPoolStatistics getStatistics()
getStatistics
in interface ManagedConnectionPool
public void increaseCapacity(javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo cri)
increaseCapacity
in interface ManagedConnectionPool
subject
- The subjectcri
- The connection request information objectpublic void validateConnections() throws java.lang.Exception
validateConnections
in interface ManagedConnectionPool
java.lang.Exception
- for exceptionpublic java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2013 IronJacamar (http://www.ironjacamar.org)