
public abstract class AbstractConnectionListener extends Object implements ConnectionListener
ConnectionListener interface
contract.| Modifier and Type | Field and Description |
|---|---|
protected CopyOnWriteArraySet<Object> |
connectionHandles
Connection handles
|
protected boolean |
trace
Log trace
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractConnectionListener(ConnectionManager cm,
javax.resource.spi.ManagedConnection managedConnection,
Pool pool,
ManagedConnectionPool mcp,
org.jboss.jca.common.api.metadata.common.FlushStrategy flushStrategy)
Creates a new instance of the listener that is responsible for
tracking the owned connection instance.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Object o)
Compare
|
void |
connectionClosed(javax.resource.spi.ConnectionEvent event) |
void |
connectionErrorOccurred(javax.resource.spi.ConnectionEvent event) |
boolean |
controls(javax.resource.spi.ManagedConnection mc,
Object connection)
Controls the managed connection / connection pair
|
void |
delist()
Delist the managed connection
|
void |
dissociate()
Dissociate the connection listener
|
void |
enlist()
Enlist the managed connection
|
protected org.jboss.jca.core.api.connectionmanager.ccm.CachedConnectionManager |
getCachedConnectionManager()
Gets cached connection manager
|
protected ConnectionManager |
getConnectionManager()
Gets connection manager.
|
long |
getLastUsedTime()
Retrieve the last time this connection was used.
|
long |
getLastValidatedTime()
Retrieve the last time this connection was validated.
|
protected abstract CoreLogger |
getLogger()
Get the logger
|
javax.resource.spi.ManagedConnection |
getManagedConnection()
Retrieve the managed connection for this listener.
|
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 |
localTransactionCommitted(javax.resource.spi.ConnectionEvent event) |
void |
localTransactionRolledback(javax.resource.spi.ConnectionEvent event) |
void |
localTransactionStarted(javax.resource.spi.ConnectionEvent event) |
void |
registerConnection(Object handle)
Register a new connection
|
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
|
String |
toString() |
protected void |
toString(StringBuffer buffer)
Add specific properties.
|
void |
unregisterConnection(Object handle)
Unregister a connection
|
void |
unregisterConnections()
Unregister connections.
|
void |
used()
Mark the connection as used
|
protected boolean trace
protected CopyOnWriteArraySet<Object> connectionHandles
protected AbstractConnectionListener(ConnectionManager cm, javax.resource.spi.ManagedConnection managedConnection, Pool pool, ManagedConnectionPool mcp, org.jboss.jca.common.api.metadata.common.FlushStrategy flushStrategy)
cm - connection managermanagedConnection - managed connectionpool - poolmcp - managed connection poolflushStrategy - flushStrategyprotected org.jboss.jca.core.api.connectionmanager.ccm.CachedConnectionManager getCachedConnectionManager()
protected ConnectionManager getConnectionManager()
protected abstract CoreLogger getLogger()
public int getNumberOfConnections()
public boolean isEnlisted()
public void delist()
throws javax.resource.ResourceException
javax.resource.ResourceException - if exception occurspublic void enlist()
throws SystemException
SystemException - for errorspublic ManagedConnectionPool getManagedConnectionPool()
public long getLastValidatedTime()
public long getLastUsedTime()
public javax.resource.spi.ManagedConnection getManagedConnection()
getManagedConnection in interface org.jboss.jca.core.api.connectionmanager.listener.ConnectionListenerpublic Pool getPool()
public ConnectionState getState()
public boolean isManagedConnectionFree()
public boolean isTimedOut(long timeout)
timeout - the timeoutpublic boolean isTrackByTx()
public void registerConnection(Object handle)
handle - the connection handlepublic void setLastValidatedTime(long lastValidated)
lastValidated - the last time the connection was validated in
milliseconds.public void setState(ConnectionState newState)
newState - new statepublic void setTrackByTx(boolean trackByTx)
trackByTx - true for track by transaction, false otherwisepublic 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 errorpublic void unregisterConnection(Object handle)
handle - the connection handlepublic void unregisterConnections()
public void used()
public void connectionClosed(javax.resource.spi.ConnectionEvent event)
connectionClosed in interface javax.resource.spi.ConnectionEventListenerpublic void connectionErrorOccurred(javax.resource.spi.ConnectionEvent event)
connectionErrorOccurred in interface javax.resource.spi.ConnectionEventListenerpublic boolean controls(javax.resource.spi.ManagedConnection mc,
Object connection)
mc - The managed connectionconnection - The connection; optionalpublic void dissociate()
throws javax.resource.ResourceException
javax.resource.ResourceException - if exception occurspublic boolean supportsLazyAssociation()
True if supported, otherwise falsepublic boolean supportsLazyEnlistment()
True if supported, otherwise falsepublic void localTransactionCommitted(javax.resource.spi.ConnectionEvent event)
localTransactionCommitted in interface javax.resource.spi.ConnectionEventListenerpublic void localTransactionRolledback(javax.resource.spi.ConnectionEvent event)
localTransactionRolledback in interface javax.resource.spi.ConnectionEventListenerpublic void localTransactionStarted(javax.resource.spi.ConnectionEvent event)
localTransactionStarted in interface javax.resource.spi.ConnectionEventListenerpublic int compareTo(Object o)
compareTo in interface Comparableo - The other objectprotected void toString(StringBuffer buffer)
buffer - buffer instanceCopyright © 2013 IronJacamar (http://www.ironjacamar.org)