FileDocCategorySizeDatePackage
ConnectionListener.javaAPI DocJBoss 4.2.14625Fri Jul 13 21:01:18 BST 2007org.jboss.resource.connectionmanager

ConnectionListener

public interface ConnectionListener implements javax.resource.spi.ConnectionEventListener
A jboss connection listener
author
Adrian Brock
author
Weston Price
version
$Revision: 57189 $

Fields Summary
public static final int
NORMAL
Normal state
public static final int
DESTROY
Destroy this connection
public static final int
DESTROYED
This connection has been destroyed
Constructors Summary
Methods Summary
public voiddelist()
Delist the managed connection

public voidenlist()
Enlist the managed connection

public java.lang.ObjectgetContext()
Retrieve the context used by the pool

return
the context

public longgetLastValidatedTime()
Retrieve the last time this connection was validated.

return
the last time the connection was validated

public javax.resource.spi.ManagedConnectiongetManagedConnection()
Retrieve the managed connection for this listener

return
the managed connection

public ManagedConnectionPoolgetManagedConnectionPool()
Retrieve the managed connection pool for this listener

return
the managed connection pool

public intgetState()
Retrieve the state of this connection

return
the state

public voidgrantPermit(boolean value)
Tell the connection listener whether it owns the permit.

param
value true for owning the permit, false otherwise

public booleanhasPermit()
Whether the connection has a permit

return
true when it has permit, false otherwise

public booleanisManagedConnectionFree()
Is the managed connection free?

return
true when it is free

public booleanisTimedOut(long timeout)
Has the connection timed out?

param
timeout the timeout
return
true for timed out, false otherwise

public booleanisTrackByTx()
Get whether the listener is track by transaction

return
true for track by transaction, false otherwise

public voidregisterConnection(java.lang.Object handle)
Register a new connection

param
handle the connection handle

public voidsetLastValidatedTime(long interval)
Set the last time, in milliseconds, that this connection was validated.

param
interval the last time the connection was validated in milliseconds.

public voidsetState(int newState)
Set the state of this connection

public voidsetTrackByTx(boolean trackByTx)
Set whether the listener is track by transaction

param
trackByTx true for track by transaction, false otherwise

public voidtidyup()
Tidyup

Invoked just before returning the connection to the pool when the connection is not being destroyed

throws
ResourceException for any error

public voidunregisterConnection(java.lang.Object handle)
Unregister a connection

param
handle the connection handle

public voidused()
Mark the connection as used