|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.axonframework.auditing.AuditingUnitOfWorkListener
public class AuditingUnitOfWorkListener
Listener implementation that adds auditing information to events being tracked by the unit of work this listener is registered to.
| Constructor Summary | |
|---|---|
AuditingUnitOfWorkListener(Object command,
AuditDataProvider auditDataProvider,
AuditLogger auditLogger)
Initialize a listener for the given command. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AuditingUnitOfWorkListener(Object command,
AuditDataProvider auditDataProvider,
AuditLogger auditLogger)
command. The auditDataProvider is called before the
Unit Of Work is committed to provide the auditing information. The auditLogger is invoked after the
Unit Of Work is successfully committed.
command - The command being auditedauditDataProvider - The instance providing the information to attach to the eventsauditLogger - The logger writing the audit| Method Detail |
|---|
public void afterCommit()
UnitOfWorkListenerUnitOfWorkListener.onRollback(Throwable) consecutively.
afterCommit in interface UnitOfWorkListenerUnitOfWork.commit()public void onRollback(Throwable failureCause)
UnitOfWorkListener
onRollback in interface UnitOfWorkListenerfailureCause - The exception (or error) causing the roll backUnitOfWork.rollback(Throwable)
public void onPrepareCommit(Set<AggregateRoot> aggregateRoots,
List<Event> events)
UnitOfWorkListenerevents 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 UnitOfWorkListeneraggregateRoots - the aggregate roots being committedevents - Events that have been registered for dispatching with the UnitOfWorkpublic void onCleanup()
UnitOfWorkListener
onCleanup in interface UnitOfWorkListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||