public interface ConnectionListener extends ConnectionListener
Modifier and Type | Method and Description |
---|---|
boolean |
controls(javax.resource.spi.ManagedConnection mc,
java.lang.Object connection)
Controls the managed connection / connection pair
|
boolean |
delist()
Delist the managed connection
|
void |
dissociate()
Dissociate the connection listener
|
void |
enlist()
Enlist the managed connection
|
java.lang.Exception |
getException()
Get exception
|
long |
getLastCheckedOutTime()
Retrieve the last time this connection was obtained from the pool
|
long |
getLastReturnedTime()
Retrieve the last time this connection was returned to the pool
|
long |
getLastValidatedTime()
Retrieve the last time this connection was validated.
|
ManagedConnectionPool |
getManagedConnectionPool()
Get the managed connection pool
|
int |
getNumberOfConnections()
Get number of connection handles
|
Pool |
getPool()
Retrieve the pool for this listener.
|
ConnectionState |
getState()
Retrieve the state of this connection.
|
boolean |
isEnlisted()
Is enlisted
|
boolean |
isManagedConnectionFree()
Is the managed connection free?
|
boolean |
isTimedOut(long timeout)
Has the connection timed out?
|
boolean |
isTrackByTx()
Get whether the listener is track by transaction
|
void |
registerConnection(java.lang.Object handle)
Register a new connection
|
void |
setLastCheckedOutTime(long v)
Set the last time this connection was obtained from the pool
|
void |
setLastValidatedTime(long lastValidated)
Set the last time, in milliseconds, that this connection was validated.
|
void |
setState(ConnectionState newState)
Set the state of this connection.
|
void |
setTrackByTx(boolean trackByTx)
Set whether the listener is track by transaction
|
boolean |
supportsLazyAssociation()
Supports lazy association
|
boolean |
supportsLazyEnlistment()
Supports lazy enlistment
|
void |
tidyup()
Tidyup
|
void |
toPool()
Mark the connection as in pool
|
void |
unregisterConnection(java.lang.Object handle)
Unregister a connection
|
void |
unregisterConnections()
Unregister all connections
|
getManagedConnection
int getNumberOfConnections()
Pool getPool()
void tidyup() throws javax.resource.ResourceException
Invoked just before returning the connection to the pool when the connection is not being destroyed.
javax.resource.ResourceException
- for any errorManagedConnectionPool getManagedConnectionPool()
ConnectionState getState()
void setState(ConnectionState newState)
newState
- new stateboolean isTimedOut(long timeout)
timeout
- the timeoutvoid toPool()
void registerConnection(java.lang.Object handle)
handle
- the connection handlevoid unregisterConnection(java.lang.Object handle)
handle
- the connection handlevoid unregisterConnections()
boolean isManagedConnectionFree()
boolean isEnlisted()
void enlist() throws javax.transaction.SystemException
javax.transaction.SystemException
- for errorsboolean delist() throws javax.resource.ResourceException
True
if the listener was delisted succesfully, otherwise false
javax.resource.ResourceException
- if exception occursboolean isTrackByTx()
void setTrackByTx(boolean trackByTx)
trackByTx
- true for track by transaction, false otherwiselong getLastValidatedTime()
void setLastValidatedTime(long lastValidated)
lastValidated
- the last time the connection was validated in
milliseconds.long getLastReturnedTime()
long getLastCheckedOutTime()
void setLastCheckedOutTime(long v)
v
- The valuejava.lang.Exception getException()
null
boolean controls(javax.resource.spi.ManagedConnection mc, java.lang.Object connection)
mc
- The managed connectionconnection
- The connection; optionalvoid dissociate() throws javax.resource.ResourceException
javax.resource.ResourceException
- if exception occursboolean supportsLazyAssociation()
True
if supported, otherwise false
boolean supportsLazyEnlistment()
True
if supported, otherwise false
Copyright © 2014 IronJacamar (http://www.ironjacamar.org)