ca.grimoire.logging.annotations
Class MethodLoggingAdvice

java.lang.Object
  extended by ca.grimoire.logging.annotations.MethodLoggingAdvice

public class MethodLoggingAdvice
extends Object

Intercepts method calls and logs the approprate messages for each of the logging annotations in this package.

See Also:
LogBefore, LogReturn, LogException

Constructor Summary
MethodLoggingAdvice()
           
 
Method Summary
 void logBefore(JoinPoint call, LogBefore logAnnotation)
          Emits the log message from a LogBefore annotation, using the method call's parameter list as the formatting parameters.
 void logException(JoinPoint call, LogException logAnnotation, Throwable exception)
          Emits the log message from a LogException annotation, including the method call's thrown exception.
 void logReturn(JoinPoint call, LogReturn logAnnotation, Object returnValue)
          Emits the log message from a LogReturn annotation, using the method's return value as the (sole) formatting parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodLoggingAdvice

public MethodLoggingAdvice()
Method Detail

logBefore

public void logBefore(JoinPoint call,
                      LogBefore logAnnotation)
Emits the log message from a LogBefore annotation, using the method call's parameter list as the formatting parameters.

Parameters:
call - the method call being intercepted.
logAnnotation - the log annotation.

logReturn

public void logReturn(JoinPoint call,
                      LogReturn logAnnotation,
                      Object returnValue)
Emits the log message from a LogReturn annotation, using the method's return value as the (sole) formatting parameter.

Parameters:
call - the method call being intercepted.
logAnnotation - the log annotation.

logException

public void logException(JoinPoint call,
                         LogException logAnnotation,
                         Throwable exception)
Emits the log message from a LogException annotation, including the method call's thrown exception.

Parameters:
call - the method call being intercepted.
logAnnotation - the log annotation.


Copyright © 2010 Grimoire Alchymia. All Rights Reserved.