org.easetech.easytest.interceptor
Class DefaultMethodIntercepter
java.lang.Object
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 |
|
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 |
LOG
protected static final org.slf4j.Logger LOG
- Logger implementation
DefaultMethodIntercepter
public DefaultMethodIntercepter()
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 fortargetInstance - the target class on which the method will be calledmethodArgs - 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.