public abstract class UnitOfWorkListenerAdapter extends Object implements UnitOfWorkListener
UnitOfWorkListener that provides empty implementation of all methods declared
in UnitOfWorkListener. This implementation does nothing.| Constructor and Description |
|---|
UnitOfWorkListenerAdapter() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterCommit(UnitOfWork unitOfWork)
Invoked when the UnitOfWork is committed.
|
void |
onCleanup(UnitOfWork unitOfWork)
Notifies listeners that the UnitOfWork is being cleaned up.
|
<T> EventMessage<T> |
onEventRegistered(UnitOfWork unitOfWork,
EventMessage<T> event)
Invoked when an Event is registered for publication when the UnitOfWork is committed.
|
void |
onPrepareCommit(UnitOfWork unitOfWork,
Set<AggregateRoot> aggregateRoots,
List<EventMessage> events)
Invoked before aggregates are committed, and before any events are published.
|
void |
onPrepareTransactionCommit(UnitOfWork unitOfWork,
Object transaction)
Invoked before the transaction bound to this Unit of Work is committed, but after all other commit activities
(publication of events and saving of aggregates) are performed.
|
void |
onRollback(UnitOfWork unitOfWork,
Throwable failureCause)
Invoked when the UnitOfWork is rolled back.
|
public <T> EventMessage<T> onEventRegistered(UnitOfWork unitOfWork, EventMessage<T> event)
event.onEventRegistered in interface UnitOfWorkListenerT - The type of payload of the EventMessageunitOfWork - The Unit of Work on which an event is registeredevent - The event about to be registered for publicationpublic void onPrepareCommit(UnitOfWork unitOfWork, Set<AggregateRoot> aggregateRoots, List<EventMessage> events)
events may not contain the uncommitted domain events of each of the
aggregateRoots. To retrieve all events, collect all uncommitted events from the aggregate roots and
combine them with the list of events.onPrepareCommit in interface UnitOfWorkListenerunitOfWork - The Unit of Work being committedaggregateRoots - the aggregate roots being committedevents - Events that have been registered for dispatching with the UnitOfWorkpublic void onPrepareTransactionCommit(UnitOfWork unitOfWork, Object transaction)
UnitOfWorkListeneronPrepareTransactionCommit in interface UnitOfWorkListenerunitOfWork - The Unit of Work of which the underlying transaction is being committed.transaction - The object representing the (status of) the transaction, as returned by TransactionManager.startTransaction().TransactionManagerpublic void afterCommit(UnitOfWork unitOfWork)
UnitOfWorkListener.onRollback(UnitOfWork, Throwable) consecutively.afterCommit in interface UnitOfWorkListenerunitOfWork - The Unit of Work being committedUnitOfWork.commit()public void onRollback(UnitOfWork unitOfWork, Throwable failureCause)
onRollback in interface UnitOfWorkListenerfailureCause - unitOfWork - The Unit of Work being rolled backUnitOfWork.rollback(Throwable)public void onCleanup(UnitOfWork unitOfWork)
onCleanup in interface UnitOfWorkListenerunitOfWork - The Unit of Work being cleaned upCopyright © 2010-2015. All Rights Reserved.