Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.jboss.resource.connectionmanager
Class BaseConnectionManager2.BaseConnectionEventListener  view BaseConnectionManager2.BaseConnectionEventListener download BaseConnectionManager2.BaseConnectionEventListener.java

java.lang.Object
  extended byorg.jboss.resource.connectionmanager.BaseConnectionManager2.BaseConnectionEventListener
All Implemented Interfaces:
javax.resource.spi.ConnectionEventListener, ConnectionListener, java.util.EventListener
Direct Known Subclasses:
NoTxConnectionManager.NoTxConnectionEventListener, TxConnectionManager.TxConnectionEventListener
Enclosing class:
BaseConnectionManager2

protected abstract class BaseConnectionManager2.BaseConnectionEventListener
extends java.lang.Object
implements ConnectionListener


Field Summary
private  java.lang.Object context
           
private  java.util.List handles
           
private  long lastUse
           
protected  org.jboss.logging.Logger log
           
private  javax.resource.spi.ManagedConnection mc
           
private  ManagedConnectionPool mcp
           
private  int state
           
protected  boolean trace
           
 
Fields inherited from interface org.jboss.resource.connectionmanager.ConnectionListener
DESTROY, DESTROYED, NORMAL
 
Constructor Summary
protected BaseConnectionManager2.BaseConnectionEventListener(javax.resource.spi.ManagedConnection mc, ManagedConnectionPool mcp, java.lang.Object context, org.jboss.logging.Logger log)
           
 
Method Summary
 void connectionErrorOccurred(javax.resource.spi.ConnectionEvent ce)
          May be overridden to e.g.
 void delist()
          Delist the managed connection
 void enlist()
          Enlist the managed connection
 java.lang.Object getContext()
          Retrieve the context used by the pool
 javax.resource.spi.ManagedConnection getManagedConnection()
          Retrieve the managed connection for this listener
 ManagedConnectionPool getManagedConnectionPool()
          Retrieve the managed connection pool for this listener
 int getState()
          Retrieve the state of this connection
 boolean isManagedConnectionFree()
          Is the managed connection free?
 boolean isTimedOut(long timeout)
          Has the connection timed out?
 void registerConnection(java.lang.Object handle)
          Register a new connection
 void setState(int newState)
          Set the state of this connection
 void unregisterConnection(java.lang.Object handle)
          Unregister a connection
protected  void unregisterConnections()
           
 void used()
          Mark the connection as used
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.resource.spi.ConnectionEventListener
connectionClosed, localTransactionCommitted, localTransactionRolledback, localTransactionStarted
 

Field Detail

mc

private final javax.resource.spi.ManagedConnection mc

mcp

private final ManagedConnectionPool mcp

context

private final java.lang.Object context

state

private int state

handles

private final java.util.List handles

lastUse

private long lastUse

log

protected org.jboss.logging.Logger log

trace

protected boolean trace
Constructor Detail

BaseConnectionManager2.BaseConnectionEventListener

protected BaseConnectionManager2.BaseConnectionEventListener(javax.resource.spi.ManagedConnection mc,
                                                             ManagedConnectionPool mcp,
                                                             java.lang.Object context,
                                                             org.jboss.logging.Logger log)
Method Detail

getManagedConnection

public javax.resource.spi.ManagedConnection getManagedConnection()
Description copied from interface: ConnectionListener
Retrieve the managed connection for this listener

Specified by:
getManagedConnection in interface ConnectionListener

getManagedConnectionPool

public ManagedConnectionPool getManagedConnectionPool()
Description copied from interface: ConnectionListener
Retrieve the managed connection pool for this listener

Specified by:
getManagedConnectionPool in interface ConnectionListener

getContext

public java.lang.Object getContext()
Description copied from interface: ConnectionListener
Retrieve the context used by the pool

Specified by:
getContext in interface ConnectionListener

getState

public int getState()
Description copied from interface: ConnectionListener
Retrieve the state of this connection

Specified by:
getState in interface ConnectionListener

setState

public void setState(int newState)
Description copied from interface: ConnectionListener
Set the state of this connection

Specified by:
setState in interface ConnectionListener

isTimedOut

public boolean isTimedOut(long timeout)
Description copied from interface: ConnectionListener
Has the connection timed out?

Specified by:
isTimedOut in interface ConnectionListener

used

public void used()
Description copied from interface: ConnectionListener
Mark the connection as used

Specified by:
used in interface ConnectionListener

registerConnection

public void registerConnection(java.lang.Object handle)
Description copied from interface: ConnectionListener
Register a new connection

Specified by:
registerConnection in interface ConnectionListener

unregisterConnection

public void unregisterConnection(java.lang.Object handle)
Description copied from interface: ConnectionListener
Unregister a connection

Specified by:
unregisterConnection in interface ConnectionListener

isManagedConnectionFree

public boolean isManagedConnectionFree()
Description copied from interface: ConnectionListener
Is the managed connection free?

Specified by:
isManagedConnectionFree in interface ConnectionListener

unregisterConnections

protected void unregisterConnections()

connectionErrorOccurred

public void connectionErrorOccurred(javax.resource.spi.ConnectionEvent ce)
May be overridden to e.g. remove from tx map.

Specified by:
connectionErrorOccurred in interface javax.resource.spi.ConnectionEventListener

enlist

public void enlist()
            throws javax.transaction.SystemException
Description copied from interface: ConnectionListener
Enlist the managed connection

Specified by:
enlist in interface ConnectionListener

delist

public void delist()
            throws javax.resource.ResourceException
Description copied from interface: ConnectionListener
Delist the managed connection

Specified by:
delist in interface ConnectionListener