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()
Invoked when the UnitOfWork is committed.
|
void |
onCleanup()
Notifies listeners that the UnitOfWork is being cleaned up.
|
void |
onPrepareCommit(Set<AggregateRoot> aggregateRoots,
List<Event> events)
Invoked before aggregates are committed, and before any events are published.
|
void |
onRollback(Throwable failureCause)
Invoked when the UnitOfWork is rolled back.
|
public void onPrepareCommit(Set<AggregateRoot> aggregateRoots, List<Event> 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
aggregateRoots
- the aggregate roots being committedevents
- Events that have been registered for dispatching with the UnitOfWorkpublic void afterCommit()
UnitOfWorkListener.onRollback(Throwable)
consecutively.afterCommit
in interface UnitOfWorkListener
UnitOfWork.commit()
public void onRollback(Throwable failureCause)
onRollback
in interface UnitOfWorkListener
failureCause
- UnitOfWork.rollback(Throwable)
public void onCleanup()
onCleanup
in interface UnitOfWorkListener
Copyright © 2012. All Rights Reserved.