org.tranql.connector
Class AbstractManagedConnection

java.lang.Object
  extended byorg.tranql.connector.AbstractManagedConnection
All Implemented Interfaces:
javax.resource.spi.DissociatableManagedConnection, javax.resource.spi.ManagedConnection, ManagedConnectionHandle
Direct Known Subclasses:
ManagedXAConnection

public abstract class AbstractManagedConnection
extends java.lang.Object
implements javax.resource.spi.ManagedConnection, ManagedConnectionHandle, javax.resource.spi.DissociatableManagedConnection

Version:
$Revision: 251 $ $Date: 2005-09-08 02:15:48 +0200 (Thu, 08 Sep 2005) $

Nested Class Summary
protected  class AbstractManagedConnection.LocalTransactionImpl
           
 
Field Summary
protected  javax.resource.spi.ConnectionRequestInfo cri
           
protected  java.util.LinkedList handles
           
protected  java.util.ArrayList listeners
           
protected  java.io.PrintWriter log
           
protected  javax.resource.spi.ManagedConnectionFactory mcf
           
protected  java.lang.Object physicalConnection
           
protected  javax.security.auth.Subject subject
           
 
Constructor Summary
AbstractManagedConnection(javax.resource.spi.ManagedConnectionFactory mcf, java.lang.Object physicalConnection, ExceptionSorter exceptionSorter)
           
 
Method Summary
 void addConnectionEventListener(javax.resource.spi.ConnectionEventListener connectionEventListener)
           
 void associateConnection(java.lang.Object o)
           
 void cleanup()
          Default implementation dissociates the connection handles.
protected abstract  void closePhysicalConnection()
           
 void connectionClosed(java.lang.Object handle)
           
 void connectionError(java.lang.Exception e)
           
 void destroy()
           
 void dissociateConnections()
           
 java.lang.Object getConnection(javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo connectionRequestInfo)
           
 java.io.PrintWriter getLogWriter()
           
 java.lang.Object getPhysicalConnection()
           
protected  void localTransactionCommit(boolean isSPI)
           
protected  void localTransactionRollback(boolean isSPI)
           
protected  void localTransactionStart(boolean isSPI)
           
 void removeConnectionEventListener(javax.resource.spi.ConnectionEventListener connectionEventListener)
           
 void setLogWriter(java.io.PrintWriter printWriter)
           
protected  void unfilteredConnectionError(java.lang.Exception e)
           
 
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.ManagedConnection
getLocalTransaction, getMetaData, getXAResource
 
Methods inherited from interface org.tranql.connector.ManagedConnectionHandle
getClientLocalTransaction, matches
 

Field Detail

mcf

protected final javax.resource.spi.ManagedConnectionFactory mcf

physicalConnection

protected final java.lang.Object physicalConnection

handles

protected final java.util.LinkedList handles

listeners

protected final java.util.ArrayList listeners

log

protected java.io.PrintWriter log

subject

protected javax.security.auth.Subject subject

cri

protected javax.resource.spi.ConnectionRequestInfo cri
Constructor Detail

AbstractManagedConnection

public AbstractManagedConnection(javax.resource.spi.ManagedConnectionFactory mcf,
                                 java.lang.Object physicalConnection,
                                 ExceptionSorter exceptionSorter)
Method Detail

getPhysicalConnection

public java.lang.Object getPhysicalConnection()
Specified by:
getPhysicalConnection in interface ManagedConnectionHandle

cleanup

public void cleanup()
             throws javax.resource.ResourceException
Default implementation dissociates the connection handles. Sub-classes should override to perform any cleanup needed on the physical connection.

Specified by:
cleanup in interface javax.resource.spi.ManagedConnection
Throws:
javax.resource.ResourceException

destroy

public void destroy()
             throws javax.resource.ResourceException
Specified by:
destroy in interface javax.resource.spi.ManagedConnection
Throws:
javax.resource.ResourceException

closePhysicalConnection

protected abstract void closePhysicalConnection()
                                         throws javax.resource.ResourceException
Throws:
javax.resource.ResourceException

associateConnection

public void associateConnection(java.lang.Object o)
                         throws javax.resource.ResourceException
Specified by:
associateConnection in interface javax.resource.spi.ManagedConnection
Throws:
javax.resource.ResourceException

dissociateConnections

public void dissociateConnections()
                           throws javax.resource.ResourceException
Specified by:
dissociateConnections in interface javax.resource.spi.DissociatableManagedConnection
Throws:
javax.resource.ResourceException

connectionClosed

public void connectionClosed(java.lang.Object handle)
Specified by:
connectionClosed in interface ManagedConnectionHandle

connectionError

public void connectionError(java.lang.Exception e)
Specified by:
connectionError in interface ManagedConnectionHandle

unfilteredConnectionError

protected void unfilteredConnectionError(java.lang.Exception e)

addConnectionEventListener

public void addConnectionEventListener(javax.resource.spi.ConnectionEventListener connectionEventListener)
Specified by:
addConnectionEventListener in interface javax.resource.spi.ManagedConnection

removeConnectionEventListener

public void removeConnectionEventListener(javax.resource.spi.ConnectionEventListener connectionEventListener)
Specified by:
removeConnectionEventListener in interface javax.resource.spi.ManagedConnection

getLogWriter

public java.io.PrintWriter getLogWriter()
                                 throws javax.resource.ResourceException
Specified by:
getLogWriter in interface javax.resource.spi.ManagedConnection
Throws:
javax.resource.ResourceException

setLogWriter

public void setLogWriter(java.io.PrintWriter printWriter)
                  throws javax.resource.ResourceException
Specified by:
setLogWriter in interface javax.resource.spi.ManagedConnection
Throws:
javax.resource.ResourceException

localTransactionStart

protected void localTransactionStart(boolean isSPI)
                              throws javax.resource.ResourceException
Throws:
javax.resource.ResourceException

localTransactionCommit

protected void localTransactionCommit(boolean isSPI)
                               throws javax.resource.ResourceException
Throws:
javax.resource.ResourceException

localTransactionRollback

protected void localTransactionRollback(boolean isSPI)
                                 throws javax.resource.ResourceException
Throws:
javax.resource.ResourceException

getConnection

public java.lang.Object getConnection(javax.security.auth.Subject subject,
                                      javax.resource.spi.ConnectionRequestInfo connectionRequestInfo)
                               throws javax.resource.ResourceException
Specified by:
getConnection in interface javax.resource.spi.ManagedConnection
Throws:
javax.resource.ResourceException


Copyright © -2006 The Codehaus. All Rights Reserved.