jrun.connector
Class LocalTxConnectionWrapper

jrun.connector.LocalTxConnectionWrapper

public class LocalTxConnectionWrapper

Wrapper class to hold the ManagedConnection, connectionhandle, security info and LocalTransaction information. This wrapper takes care of enlisting and delisting the LocalTxXAResource with the Transaction Manager. Responds to Connection Events from the LocalTx ResourceAdapter. It also ensures proper cleanup of the connection after a TX completes.


Constructor Summary
LocalTxConnectionWrapper(javax.resource.spi.ManagedConnection mc, javax.security.auth.Subject s, javax.resource.spi.ConnectionRequestInfo cxRequestInfo)
           
 
Method Summary
 void afterCompletion(int status)
           
 void associateManagedConnectionWithTM()
          Takes care of enrolling the XAResource associated with ManagedConnection in the current Tx if any Will also handle any
 void beforeCompletion()
           
 void cleanup()
           
 void close(int tmFlag)
          CONN TUNE: Same behavior as XATransaction for now.
 void connectionClosed(javax.resource.spi.ConnectionEvent event)
           
 void connectionErrorOccurred(javax.resource.spi.ConnectionEvent event)
           
 void expire()
           
 void init(ConnectionManagerImpl cm, Logger logger)
          Sets the ConnectionmanagerImpl, Logger and calls associateTransaction
 void localTransactionCommitted(javax.resource.spi.ConnectionEvent event)
           
 void localTransactionRolledback(javax.resource.spi.ConnectionEvent event)
           
 void localTransactionStarted(javax.resource.spi.ConnectionEvent event)
           
 

Constructor Detail

LocalTxConnectionWrapper

public LocalTxConnectionWrapper(javax.resource.spi.ManagedConnection mc,
                                javax.security.auth.Subject s,
                                javax.resource.spi.ConnectionRequestInfo cxRequestInfo)
Method Detail

init

public void init(ConnectionManagerImpl cm,
                 Logger logger)
Sets the ConnectionmanagerImpl, Logger and calls associateTransaction

associateManagedConnectionWithTM

public void associateManagedConnectionWithTM()
                                      throws java.lang.Exception
Takes care of enrolling the XAResource associated with ManagedConnection in the current Tx if any Will also handle any

close

public void close(int tmFlag)
           throws java.lang.Exception
CONN TUNE: Same behavior as XATransaction for now. May need to change this. CONN TUNE: Not sure, Local Transactions should wait for a distributed TX to complete before going back to pool dissociate this from the currently associated tx if any. If the tx is complete, call cleanup. If the tx is not yet complete, register to hear from the tx when it completes and then call cleanup If no tx is associated, call cleanup
Parameters:
flag - - TMSUCCESS if normal, TMFAIL if from connection error event

beforeCompletion

public void beforeCompletion()

afterCompletion

public void afterCompletion(int status)

expire

public void expire()

connectionClosed

public void connectionClosed(javax.resource.spi.ConnectionEvent event)

cleanup

public void cleanup()
             throws java.lang.Exception

connectionErrorOccurred

public void connectionErrorOccurred(javax.resource.spi.ConnectionEvent event)

localTransactionStarted

public void localTransactionStarted(javax.resource.spi.ConnectionEvent event)

localTransactionCommitted

public void localTransactionCommitted(javax.resource.spi.ConnectionEvent event)

localTransactionRolledback

public void localTransactionRolledback(javax.resource.spi.ConnectionEvent event)


Copyright � 2002 Macromedia Corporation. All Rights Reserved.