org.openmrs.aop
Class LoggingAdvice

java.lang.Object
  extended by org.openmrs.aop.LoggingAdvice
All Implemented Interfaces:
org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor

public class LoggingAdvice
extends java.lang.Object
implements org.aopalliance.intercept.MethodInterceptor

This class provides the log4j aop around advice for our service layer. This advice is placed on all services and daos via the spring application context. See /metadata/api/spring/applicationContext.xml


Field Summary
protected static org.apache.commons.logging.Log log
          Logger for this class.
 
Constructor Summary
LoggingAdvice()
           
 
Method Summary
 java.lang.Object invoke(org.aopalliance.intercept.MethodInvocation invocation)
          This method prints out debug statements for getters and info statements for everything else ("setters").
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.commons.logging.Log log
Logger for this class. Uses the name "org.openmrs.api" so that it seems to fit into the log4j.xml configuration

Constructor Detail

LoggingAdvice

public LoggingAdvice()
Method Detail

invoke

public java.lang.Object invoke(org.aopalliance.intercept.MethodInvocation invocation)
                        throws java.lang.Throwable
This method prints out debug statements for getters and info statements for everything else ("setters"). If debugging is turned on, execution time for each method is printed as well. This method is called for every method in the Class/Service that it is wrapped around. This method should be fairly quick and light.

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

OpenMRS-1.7.x

Generated Apr 27 2012 10:06 PM. NOTE - these libraries are in active development and subject to change