org.kuali.rice.kns.util.spring
Class MethodLoggingInterceptor

java.lang.Object
  extended by org.kuali.rice.kns.util.spring.MethodLoggingInterceptor
All Implemented Interfaces:
org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor

public class MethodLoggingInterceptor
extends Object
implements org.aopalliance.intercept.MethodInterceptor

This interceptor generates log message before entering and after leaving the method being intercepted.


Field Summary
private static org.apache.commons.logging.Log LOG
           
 
Constructor Summary
MethodLoggingInterceptor()
           
 
Method Summary
private  String buildExceptionLabel(Exception e)
           
private  String buildInvocationLabel(org.aopalliance.intercept.MethodInvocation invocation)
           
 Object invoke(org.aopalliance.intercept.MethodInvocation invocation)
          Surrounds the method invocation with FATAL-level log messages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final org.apache.commons.logging.Log LOG
Constructor Detail

MethodLoggingInterceptor

public MethodLoggingInterceptor()
Method Detail

invoke

public Object invoke(org.aopalliance.intercept.MethodInvocation invocation)
              throws Throwable
Surrounds the method invocation with FATAL-level log messages. Using FATAL because I want to make sure that the log messages will always show up, since the correct way to deactivate method-level logging is to remove (or comment) the bean name from the KualiTestSpringLogging.xml file.

Specified by:
invoke in interface org.aopalliance.intercept.MethodInterceptor
Throws:
Throwable
See Also:
MethodInterceptor.invoke(org.aopalliance.intercept.MethodInvocation)

buildInvocationLabel

private String buildInvocationLabel(org.aopalliance.intercept.MethodInvocation invocation)
Parameters:
invocation - MethodInvocation being labeled
Returns:
String used to identify this MethodInvocation

buildExceptionLabel

private String buildExceptionLabel(Exception e)
Parameters:
e - Exception being labeled
Returns:
String used to identify this Exception


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.