org.apache.geronimo.connector.outbound
Class ConnectionTrackingInterceptor

java.lang.Object
  extended by org.apache.geronimo.connector.outbound.ConnectionTrackingInterceptor
All Implemented Interfaces:
ConnectionInterceptor

public class ConnectionTrackingInterceptor
extends Object
implements ConnectionInterceptor

ConnectionTrackingInterceptor.java handles communication with the CachedConnectionManager. On method call entry, cached handles are checked for the correct Subject. On method call exit, cached handles are disassociated if possible. On getting or releasing a connection the CachedConnectionManager is notified.


Constructor Summary
ConnectionTrackingInterceptor(ConnectionInterceptor next, String key, ConnectionTracker connectionTracker)
           
 
Method Summary
 void destroy()
           
 void enter(Collection<ConnectionInfo> connectionInfos)
           
 void exit(Collection<ConnectionInfo> connectionInfos)
           
 void getConnection(ConnectionInfo connectionInfo)
          called by: GenericConnectionManager.allocateConnection, GenericConnectionManager.associateConnection, and enter.
 void reassociateConnection(ConnectionInfo connectionInfo)
          Called when a proxied connection which has been released need to be reassociated with a real connection.
 void returnConnection(ConnectionInfo connectionInfo, ConnectionReturnAction connectionReturnAction)
          called by: GeronimoConnectionEventListener.connectionClosed, GeronimoConnectionEventListener.connectionErrorOccurred, exit in: handle has already been dissociated from ManagedConnection. connectionInfo not null, has non-null ManagedConnectionInfo, ManagedConnectionInfo has non-null ManagedConnection handle can be null if called from error in ManagedConnection in pool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionTrackingInterceptor

public ConnectionTrackingInterceptor(ConnectionInterceptor next,
                                     String key,
                                     ConnectionTracker connectionTracker)
Method Detail

getConnection

public void getConnection(ConnectionInfo connectionInfo)
                   throws ResourceException
called by: GenericConnectionManager.allocateConnection, GenericConnectionManager.associateConnection, and enter. in: connectionInfo is non-null, and has non-null ManagedConnectionInfo with non-null managedConnectionfactory. connection handle may or may not be null. out: connectionInfo has non-null connection handle, non null ManagedConnectionInfo with non-null ManagedConnection and GeronimoConnectionEventListener. connection tracker has been notified of handle-managed connection association.

Specified by:
getConnection in interface ConnectionInterceptor
Parameters:
connectionInfo -
Throws:
ResourceException

reassociateConnection

public void reassociateConnection(ConnectionInfo connectionInfo)
                           throws ResourceException
Called when a proxied connection which has been released need to be reassociated with a real connection.

Throws:
ResourceException

returnConnection

public void returnConnection(ConnectionInfo connectionInfo,
                             ConnectionReturnAction connectionReturnAction)
called by: GeronimoConnectionEventListener.connectionClosed, GeronimoConnectionEventListener.connectionErrorOccurred, exit in: handle has already been dissociated from ManagedConnection. connectionInfo not null, has non-null ManagedConnectionInfo, ManagedConnectionInfo has non-null ManagedConnection handle can be null if called from error in ManagedConnection in pool. out: connectionTracker has been notified, ManagedConnectionInfo null.

Specified by:
returnConnection in interface ConnectionInterceptor
Parameters:
connectionInfo -
connectionReturnAction -

destroy

public void destroy()
Specified by:
destroy in interface ConnectionInterceptor

enter

public void enter(Collection<ConnectionInfo> connectionInfos)
           throws ResourceException
Throws:
ResourceException

exit

public void exit(Collection<ConnectionInfo> connectionInfos)
          throws ResourceException
Throws:
ResourceException


Copyright © 2003-2010 Apache Software Foundation. All Rights Reserved.