|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.axonframework.unitofwork.UnitOfWorkListenerAdapter
org.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(CommandMessage<?> command,
AuditDataProvider auditDataProvider,
AuditLogger auditLogger)
Initialize a listener for the given command. |
|
| Method Summary | ||
|---|---|---|
void |
afterCommit(UnitOfWork unitOfWork)
Invoked when the UnitOfWork is committed. |
|
|
onEventRegistered(UnitOfWork unitOfWork,
EventMessage<T> event)
Invoked when an Event is registered for publication when the UnitOfWork is committed. |
|
void |
onRollback(UnitOfWork unitOfWork,
Throwable failureCause)
Invoked when the UnitOfWork is rolled back. |
|
| Methods inherited from class org.axonframework.unitofwork.UnitOfWorkListenerAdapter |
|---|
onCleanup, onPrepareCommit, onPrepareTransactionCommit |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AuditingUnitOfWorkListener(CommandMessage<?> 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(UnitOfWork unitOfWork)
UnitOfWorkListenerAdapterUnitOfWorkListener.onRollback(UnitOfWork, Throwable) consecutively.
afterCommit in interface UnitOfWorkListenerafterCommit in class UnitOfWorkListenerAdapterunitOfWork - The Unit of Work being committedUnitOfWork.commit()
public void onRollback(UnitOfWork unitOfWork,
Throwable failureCause)
UnitOfWorkListenerAdapter
onRollback in interface UnitOfWorkListeneronRollback in class UnitOfWorkListenerAdapterunitOfWork - The Unit of Work being rolled backfailureCause - The exception (or error) causing the roll backUnitOfWork.rollback(Throwable)
public <T> EventMessage<T> onEventRegistered(UnitOfWork unitOfWork,
EventMessage<T> event)
UnitOfWorkListenerAdapterevent.
onEventRegistered in interface UnitOfWorkListeneronEventRegistered in class UnitOfWorkListenerAdapterT - 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
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||