jrun.connector
Class XAConnectionWrapper

jrun.connector.XAConnectionWrapper

public class XAConnectionWrapper

Wrapper class to hold the ManagedConnection, connectionhandle, security info and Transaction information. This wrapper takes care of enlisting and delisting the XAResource associated with this ManagedConnection with the Transaction Manager. It also ensures proper cleanup of the connection after a TX completes.


Constructor Summary
XAConnectionWrapper(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)
          dissociate this from the currently associated tx if any.
 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

XAConnectionWrapper

public XAConnectionWrapper(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
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.