org.apache.openejb.resource
Class AutoConnectionTracker

java.lang.Object
  extended by org.apache.openejb.resource.AutoConnectionTracker
All Implemented Interfaces:
org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTracker

public class AutoConnectionTracker
extends Object
implements org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTracker


Nested Class Summary
static class AutoConnectionTracker.ConnectionInvocationHandler
           
 
Constructor Summary
AutoConnectionTracker()
           
 
Method Summary
 void handleObtained(org.apache.geronimo.connector.outbound.ConnectionTrackingInterceptor interceptor, org.apache.geronimo.connector.outbound.ConnectionInfo connectionInfo, boolean reassociate)
          Proxies new connection handles so we can detect when they have been garbage collected.
 void handleReleased(org.apache.geronimo.connector.outbound.ConnectionTrackingInterceptor interceptor, org.apache.geronimo.connector.outbound.ConnectionInfo connectionInfo, org.apache.geronimo.connector.outbound.ConnectionReturnAction action)
          Removes the released collection from the garbage collection reference tracker, since this connection is being release via a normal close method.
 void setEnvironment(org.apache.geronimo.connector.outbound.ConnectionInfo connectionInfo, String key)
          Releases any managed connections held by a garbage collected connection proxy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AutoConnectionTracker

public AutoConnectionTracker()
Method Detail

setEnvironment

public void setEnvironment(org.apache.geronimo.connector.outbound.ConnectionInfo connectionInfo,
                           String key)
Releases any managed connections held by a garbage collected connection proxy.

Specified by:
setEnvironment in interface org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTracker
Parameters:
connectionInfo - the connection to be obtained
key - the unique id of the connection manager

handleObtained

public void handleObtained(org.apache.geronimo.connector.outbound.ConnectionTrackingInterceptor interceptor,
                           org.apache.geronimo.connector.outbound.ConnectionInfo connectionInfo,
                           boolean reassociate)
                    throws javax.resource.ResourceException
Proxies new connection handles so we can detect when they have been garbage collected.

Specified by:
handleObtained in interface org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTracker
Parameters:
interceptor - the interceptor used to release the managed connection when the handled is garbage collected.
connectionInfo - the connection that was obtained
reassociate - should always be false
Throws:
javax.resource.ResourceException

handleReleased

public void handleReleased(org.apache.geronimo.connector.outbound.ConnectionTrackingInterceptor interceptor,
                           org.apache.geronimo.connector.outbound.ConnectionInfo connectionInfo,
                           org.apache.geronimo.connector.outbound.ConnectionReturnAction action)
Removes the released collection from the garbage collection reference tracker, since this connection is being release via a normal close method.

Specified by:
handleReleased in interface org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTracker
Parameters:
interceptor - ignored
connectionInfo - the connection that was released
action - ignored


Copyright © 1999-2011 The Apache OpenEJB development community. All Rights Reserved.