org.objectweb.jonas.resource
Class MySynchro

java.lang.Object
  extended byorg.objectweb.jonas.resource.MySynchro
All Implemented Interfaces:
javax.transaction.Synchronization

public class MySynchro
extends java.lang.Object
implements javax.transaction.Synchronization

This class is an implementation of the Synchronization interface, used by a ConnectionManagerImpl instance. The aim of this class is to close a ManagedConnection when a transaction finishes. This class is necessary when the commit or the rollback action is after a connection close.

Author:
sebastien.chassande@inrialpes.fr, Eric.Hardesty@bull.com

Constructor Summary
MySynchro(ConnectionManagerImpl pCm, MCInfo pMci)
          Constructor for the MySynchro object
 
Method Summary
 void afterCompletion(int status)
          This method is called by the transaction manager after the transaction is committed or rolled back.
 void beforeCompletion()
          This method is called by the transaction manager prior to the start of the transaction completion process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MySynchro

public MySynchro(ConnectionManagerImpl pCm,
                 MCInfo pMci)
Constructor for the MySynchro object

Parameters:
pCm - ConnectionManager object
pMci - ManagedConnection information object
Method Detail

afterCompletion

public void afterCompletion(int status)
This method is called by the transaction manager after the transaction is committed or rolled back. Release the mci from the pool

Specified by:
afterCompletion in interface javax.transaction.Synchronization
Parameters:
status - The transaction flag

beforeCompletion

public void beforeCompletion()
This method is called by the transaction manager prior to the start of the transaction completion process.

Specified by:
beforeCompletion in interface javax.transaction.Synchronization