Class JTASynchronizationListener
- java.lang.Object
-
- org.eclipse.persistence.transaction.AbstractSynchronizationListener
-
- org.eclipse.persistence.transaction.JTASynchronizationListener
-
- All Implemented Interfaces:
javax.transaction.Synchronization
,SynchronizationListenerFactory
public class JTASynchronizationListener extends AbstractSynchronizationListener implements javax.transaction.Synchronization, SynchronizationListenerFactory
Purpose: Synchronization object implementation for JTA 1.0
Description: Instances of this class are registered against JTA 1.0 transactions. This class may be subclassed to provide specialized behavior for specific transaction implementations. Subclasses must implement the newListener() method to return an instances of the listener subclass.
- See Also:
JTATransactionController
-
-
Field Summary
-
Fields inherited from class org.eclipse.persistence.transaction.AbstractSynchronizationListener
controller, sequencingCallback, sequencingCallbackMap, session, transaction, transactionKey, unitOfWork
-
-
Constructor Summary
Constructors Constructor Description JTASynchronizationListener()
PUBLIC: Used to create factory instances only.JTASynchronizationListener(org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, org.eclipse.persistence.internal.sessions.AbstractSession session, java.lang.Object transaction, AbstractTransactionController controller)
INTERNAL: Constructor for creating listener instances (expects all required state info)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterCompletion(int stat)
INTERNAL: Called by the JTA transaction manager after the transaction is committed or rolled back.void
beforeCompletion()
INTERNAL: Called by the JTA transaction manager prior to the start of the transaction completion process.AbstractSynchronizationListener
newSynchronizationListener(org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, org.eclipse.persistence.internal.sessions.AbstractSession session, java.lang.Object transaction, AbstractTransactionController controller)
INTERNAL: Create and return the Synchronization listener object that can be registered to receive JTA transaction notification callbacks.-
Methods inherited from class org.eclipse.persistence.transaction.AbstractSynchronizationListener
afterCompletion, callSequencingCallback, getSequencingCallback, getSession, getTransaction, getTransactionController, getTransactionKey, getUnitOfWork, handleException, setSession, setTransaction, setTransactionController, setTransactionKey, setUnitOfWork
-
-
-
-
Constructor Detail
-
JTASynchronizationListener
public JTASynchronizationListener()
PUBLIC: Used to create factory instances only. Use the "full-bodied" constructor for creating proper listener instances.
-
JTASynchronizationListener
public JTASynchronizationListener(org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, org.eclipse.persistence.internal.sessions.AbstractSession session, java.lang.Object transaction, AbstractTransactionController controller)
INTERNAL: Constructor for creating listener instances (expects all required state info)
-
-
Method Detail
-
newSynchronizationListener
public AbstractSynchronizationListener newSynchronizationListener(org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, org.eclipse.persistence.internal.sessions.AbstractSession session, java.lang.Object transaction, AbstractTransactionController controller)
INTERNAL: Create and return the Synchronization listener object that can be registered to receive JTA transaction notification callbacks.- Specified by:
newSynchronizationListener
in interfaceSynchronizationListenerFactory
-
beforeCompletion
public void beforeCompletion()
INTERNAL: Called by the JTA transaction manager prior to the start of the transaction completion process. This call is executed in the same transaction context of the caller who initiates the TransactionManager.commit, or the call is executed with no transaction context if Transaction.commit is used.- Specified by:
beforeCompletion
in interfacejavax.transaction.Synchronization
- Overrides:
beforeCompletion
in classAbstractSynchronizationListener
-
afterCompletion
public void afterCompletion(int stat)
INTERNAL: Called by the JTA transaction manager after the transaction is committed or rolled back. This method executes without a transaction context.- Specified by:
afterCompletion
in interfacejavax.transaction.Synchronization
- Parameters:
stat
- The status of the transaction completion.
-
-