org.axonframework.auditing
Class NullAuditLogger

java.lang.Object
  extended by org.axonframework.auditing.NullAuditLogger
All Implemented Interfaces:
AuditLogger

public class NullAuditLogger
extends Object
implements AuditLogger

An implementation of AuditLogger that does nothing.

Since:
0.7
Author:
Allard Buijze

Field Summary
static NullAuditLogger INSTANCE
          Returns a singleton instance to this logger.
 
Constructor Summary
NullAuditLogger()
           
 
Method Summary
 void logFailed(CommandMessage<?> command, Throwable failureCause, List<EventMessage> events)
          Writes a failure entry to the audit logs.
 void logSuccessful(CommandMessage<?> command, Object returnValue, List<EventMessage> events)
          Writes a success entry to the audit logs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final NullAuditLogger INSTANCE
Returns a singleton instance to this logger.

Constructor Detail

NullAuditLogger

public NullAuditLogger()
Method Detail

logSuccessful

public void logSuccessful(CommandMessage<?> command,
                          Object returnValue,
                          List<EventMessage> events)
Writes a success entry to the audit logs.

This method may be invoked in the thread dispatching the command. Therefore, considering writing asynchronously when the underlying mechanism is slow.

This implementation does nothing.

Specified by:
logSuccessful in interface AuditLogger
Parameters:
command - The command that has been handled
returnValue - The return value of the command handler
events - The events that were generated during command handling

logFailed

public void logFailed(CommandMessage<?> command,
                      Throwable failureCause,
                      List<EventMessage> events)
Writes a failure entry to the audit logs. The given list of events may contain events. In that case, these event may have been stored in the events store and/or published to the event bus.

This method may be invoked in the thread dispatching the command. Therefore, considering writing asynchronously when the underlying mechanism is slow.

This implementation does nothing.

Specified by:
logFailed in interface AuditLogger
Parameters:
command - The command being executed
failureCause - The cause of the rollback. May be null if the rollback was not caused by an exception
events - any events staged for storage or publishing


Copyright © 2010-2016. All Rights Reserved.