org.easetech.easytest.interceptor
Class DefaultMethodIntercepter

java.lang.Object
  extended by org.easetech.easytest.interceptor.DefaultMethodIntercepter
All Implemented Interfaces:
MethodIntercepter

public class DefaultMethodIntercepter
extends Object
implements MethodIntercepter

A default implementation of MethodIntercepter to log the time taken by a method

Author:
Anuj Kumar

Field Summary
protected static org.slf4j.Logger LOG
          Logger implementation
 
Constructor Summary
DefaultMethodIntercepter()
           
 
Method Summary
 Object intercept(Method methodToIntercept, Object targetInstance, Object[] methodArgs)
          Intercept the method invocation for logging the time taken by the method.
 
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.slf4j.Logger LOG
Logger implementation

Constructor Detail

DefaultMethodIntercepter

public DefaultMethodIntercepter()
Method Detail

intercept

public Object intercept(Method methodToIntercept,
                        Object targetInstance,
                        Object[] methodArgs)
                 throws Throwable
Intercept the method invocation for logging the time taken by the method.

Specified by:
intercept in interface MethodIntercepter
Parameters:
methodToIntercept - the method to intercept the call for
targetInstance - the target class on which the method will be called
methodArgs - the arguments to the method
Returns:
the object that is returned after method invocation
Throws:
Throwable - if any exception occurs


Copyright © 2013. All Rights Reserved.