org.openejb.resource.jdbc
Class JdbcManagedConnection

java.lang.Object
  extended by org.openejb.resource.jdbc.JdbcManagedConnection
All Implemented Interfaces:
javax.resource.spi.ManagedConnection

public class JdbcManagedConnection
extends java.lang.Object
implements javax.resource.spi.ManagedConnection


Constructor Summary
JdbcManagedConnection(javax.resource.spi.ManagedConnectionFactory managedFactory, java.sql.Connection sqlConn, JdbcConnectionRequestInfo rxInfo)
           
 
Method Summary
 void addConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)
           
 void associateConnection(java.lang.Object connection)
           
 void cleanup()
          This method will invalidate any JdbcConnection handles that have not already been invalidated (they self invalidate when they are explicitly closed).
protected  void connectionClose(JdbcConnection jdbcConn)
          Invoked by the JdbcConneciton when its close() method is called.
protected  void connectionErrorOccurred(JdbcConnection jdbcConn, java.sql.SQLException sqlE)
           
 void destroy()
           
 java.lang.Object getConnection(javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo cxRequestInfo)
           
 javax.resource.spi.LocalTransaction getLocalTransaction()
           
 java.io.PrintWriter getLogWriter()
           
 javax.resource.spi.ManagedConnectionMetaData getMetaData()
           
protected  JdbcConnectionRequestInfo getRequestInfo()
           
protected  java.sql.Connection getSQLConnection()
           
 javax.transaction.xa.XAResource getXAResource()
           
protected  void localTransactionCommitted()
           
protected  void localTransactionRolledback()
           
protected  void localTransactionStarted()
           
 void removeConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)
           
 void setLogWriter(java.io.PrintWriter out)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JdbcManagedConnection

public JdbcManagedConnection(javax.resource.spi.ManagedConnectionFactory managedFactory,
                             java.sql.Connection sqlConn,
                             JdbcConnectionRequestInfo rxInfo)
                      throws javax.resource.spi.ResourceAdapterInternalException
Throws:
javax.resource.spi.ResourceAdapterInternalException
Method Detail

getSQLConnection

protected java.sql.Connection getSQLConnection()

getRequestInfo

protected JdbcConnectionRequestInfo getRequestInfo()

addConnectionEventListener

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

associateConnection

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

cleanup

public void cleanup()
             throws javax.resource.ResourceException
This method will invalidate any JdbcConnection handles that have not already been invalidated (they self invalidate when they are explicitly closed).

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

getConnection

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

getLocalTransaction

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

getLogWriter

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

getMetaData

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

getXAResource

public javax.transaction.xa.XAResource getXAResource()
                                              throws javax.resource.ResourceException
Specified by:
getXAResource in interface javax.resource.spi.ManagedConnection
Throws:
javax.resource.ResourceException

removeConnectionEventListener

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

setLogWriter

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

localTransactionCommitted

protected void localTransactionCommitted()

localTransactionRolledback

protected void localTransactionRolledback()

localTransactionStarted

protected void localTransactionStarted()

connectionErrorOccurred

protected void connectionErrorOccurred(JdbcConnection jdbcConn,
                                       java.sql.SQLException sqlE)

connectionClose

protected void connectionClose(JdbcConnection jdbcConn)
Invoked by the JdbcConneciton when its close() method is called. This method invalidates the JdbcConnection handle, removes it from the list of active handles and notifies all the ConnectionEventListeners.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 1999-2011 OpenEJB. All Rights Reserved.