|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.axonframework.unitofwork.UnitOfWorkListenerAdapter
public abstract class UnitOfWorkListenerAdapter
Abstract implementation of the UnitOfWorkListener
that provides empty implementation of all methods declared
in UnitOfWorkListener
. This implementation does nothing.
Constructor Summary | |
---|---|
UnitOfWorkListenerAdapter()
|
Method Summary | ||
---|---|---|
void |
afterCommit(UnitOfWork unitOfWork)
Invoked when the UnitOfWork is committed. |
|
void |
onCleanup(UnitOfWork unitOfWork)
Notifies listeners that the UnitOfWork is being cleaned up. |
|
|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UnitOfWorkListenerAdapter()
Method Detail |
---|
public <T> EventMessage<T> onEventRegistered(UnitOfWork unitOfWork, EventMessage<T> event)
event
.
onEventRegistered
in interface UnitOfWorkListener
T
- The type of payload of the EventMessageunitOfWork
- The Unit of Work on which an event is registeredevent
- The event about to be registered for publication
public 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 UnitOfWorkListener
unitOfWork
- 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)
UnitOfWorkListener
onPrepareTransactionCommit
in interface UnitOfWorkListener
unitOfWork
- 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()
.TransactionManager
public void afterCommit(UnitOfWork unitOfWork)
UnitOfWorkListener.onRollback(UnitOfWork, Throwable)
consecutively.
afterCommit
in interface UnitOfWorkListener
unitOfWork
- The Unit of Work being committedUnitOfWork.commit()
public void onRollback(UnitOfWork unitOfWork, Throwable failureCause)
onRollback
in interface UnitOfWorkListener
failureCause
- unitOfWork
- The Unit of Work being rolled backUnitOfWork.rollback(Throwable)
public void onCleanup(UnitOfWork unitOfWork)
onCleanup
in interface UnitOfWorkListener
unitOfWork
- The Unit of Work being cleaned up
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |