public abstract class AbstractSynchronizationListener extends Object
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 TopLink 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 AbstractSession |
session
The parent of the uow.
|
protected Object |
transaction
The global transaction object.
|
protected 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(UnitOfWorkImpl unitOfWork,
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 AbstractSession |
getSession() |
protected Object |
getTransaction() |
protected AbstractTransactionController |
getTransactionController() |
protected UnitOfWorkImpl |
getUnitOfWork() |
void |
handleException(RuntimeException exception)
INTERNAL:
Do the appropriate thing for when an exception occurs during SQL issuance.
|
protected void |
setSession(AbstractSession session) |
protected void |
setTransaction(Object transaction) |
protected void |
setTransactionController(AbstractTransactionController newController) |
protected void |
setUnitOfWork(UnitOfWorkImpl unitOfWork) |
protected AbstractTransactionController controller
protected AbstractSession session
protected UnitOfWorkImpl unitOfWork
protected Object transaction
public AbstractSynchronizationListener()
protected AbstractSynchronizationListener(UnitOfWorkImpl unitOfWork, AbstractSession session, Object transaction, AbstractTransactionController controller)
public void beforeCompletion()
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 AbstractSession getSession()
protected void setSession(AbstractSession session)
protected UnitOfWorkImpl getUnitOfWork()
protected void setUnitOfWork(UnitOfWorkImpl unitOfWork)
Copyright © 2022. All rights reserved.