public abstract class AbstractSynchronizationListener extends Object implements jakarta.transaction.Synchronization
Purpose: Abstract Synchronization Listener class Description: This abstract class is paired with the AbstractTransactionController class. It contains most of the implementation logic to handle callback notifications from an external transaction manager to ensure consistency between the global transaction and the EclipseLink unit of work. It does not assume any particular specification or interface, but can be called by any implementation subclass.
AbstractTransactionController
Modifier and Type | Field and Description |
---|---|
protected AbstractTransactionController |
controller
The external txn controller that is intimate with the transaction manager
and knows how to do things like rolling back transactions, etc.
|
protected org.eclipse.persistence.internal.sequencing.SequencingCallback |
sequencingCallback
sequencingCallback used in case listener has a single callback.
|
protected Map<DatabaseSession,org.eclipse.persistence.internal.sequencing.SequencingCallback> |
sequencingCallbackMap
sequencingCallbackMap used in case listener has more than one callback:
SessionBroker with at least two members requiring callbacks.
|
protected org.eclipse.persistence.internal.sessions.AbstractSession |
session
The parent of the uow.
|
protected Object |
transaction
The global transaction object.
|
protected Object |
transactionKey
The global transaction key.
|
protected org.eclipse.persistence.internal.sessions.UnitOfWorkImpl |
unitOfWork
The unit of work associated with the global txn that this listener is
bound to.
|
Modifier | Constructor and Description |
---|---|
|
AbstractSynchronizationListener()
INTERNAL:
|
protected |
AbstractSynchronizationListener(org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork,
org.eclipse.persistence.internal.sessions.AbstractSession session,
Object transaction,
AbstractTransactionController controller)
INTERNAL:
|
Modifier and Type | Method and Description |
---|---|
void |
afterCompletion(Object status)
INTERNAL:
The method performs the logic that should be executed after the transaction
has been completed.
|
void |
beforeCompletion()
INTERNAL:
This method performs the logic that occurs at transaction
completion time.
|
protected void |
callSequencingCallback() |
org.eclipse.persistence.internal.sequencing.SequencingCallback |
getSequencingCallback(DatabaseSession dbSession,
org.eclipse.persistence.internal.sequencing.SequencingCallbackFactory sequencingCallbackFactory)
Return sequencingCallback corresponding to the passed session.
|
protected org.eclipse.persistence.internal.sessions.AbstractSession |
getSession() |
protected Object |
getTransaction() |
protected AbstractTransactionController |
getTransactionController() |
protected Object |
getTransactionKey() |
protected org.eclipse.persistence.internal.sessions.UnitOfWorkImpl |
getUnitOfWork() |
void |
handleException(RuntimeException exception)
INTERNAL:
Do the appropriate thing for when an exception occurs during SQL issuance.
|
protected void |
setSession(org.eclipse.persistence.internal.sessions.AbstractSession session) |
protected void |
setTransaction(Object transaction) |
protected void |
setTransactionController(AbstractTransactionController newController) |
protected void |
setTransactionKey(Object transactionKey) |
protected void |
setUnitOfWork(org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork) |
protected AbstractTransactionController controller
protected org.eclipse.persistence.internal.sessions.AbstractSession session
protected org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork
protected Object transaction
protected Object transactionKey
protected org.eclipse.persistence.internal.sequencing.SequencingCallback sequencingCallback
protected Map<DatabaseSession,org.eclipse.persistence.internal.sequencing.SequencingCallback> sequencingCallbackMap
public AbstractSynchronizationListener()
protected AbstractSynchronizationListener(org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, org.eclipse.persistence.internal.sessions.AbstractSession session, Object transaction, AbstractTransactionController controller)
public void beforeCompletion()
beforeCompletion
in interface jakarta.transaction.Synchronization
public void afterCompletion(Object status)
status
- The status code of the transaction completion.public void handleException(RuntimeException exception)
protected AbstractTransactionController getTransactionController()
protected void setTransactionController(AbstractTransactionController newController)
protected Object getTransaction()
protected void setTransaction(Object transaction)
protected Object getTransactionKey()
protected void setTransactionKey(Object transactionKey)
protected org.eclipse.persistence.internal.sessions.AbstractSession getSession()
protected void setSession(org.eclipse.persistence.internal.sessions.AbstractSession session)
protected org.eclipse.persistence.internal.sessions.UnitOfWorkImpl getUnitOfWork()
protected void setUnitOfWork(org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)
protected void callSequencingCallback()
public org.eclipse.persistence.internal.sequencing.SequencingCallback getSequencingCallback(DatabaseSession dbSession, org.eclipse.persistence.internal.sequencing.SequencingCallbackFactory sequencingCallbackFactory)
Copyright © 2007–2020 Eclipse.org - EclipseLink Project. All rights reserved.