org.easetech.easytest.interceptor
Class InternalInterceptor

java.lang.Object
  extended by org.easetech.easytest.interceptor.InternalInterceptor
All Implemented Interfaces:
net.sf.cglib.proxy.Callback, net.sf.cglib.proxy.MethodInterceptor

public class InternalInterceptor
extends Object
implements net.sf.cglib.proxy.MethodInterceptor

An internal intercepter implementation of the CGLIB provided MethodInterceptor interface, that actually calls the MethodIntercepter.intercept(Method, Object, Object[]) method internally. This is done so as to hide the implementation details of intercepting method calls from the user. A user can extend this class to modify the behavior of the default MethodInterceptor.intercept(Object, Method, Object[], MethodProxy) method implementation

Author:
Anuj Kumar

Field Summary
protected static org.slf4j.Logger LOG
          An instance of logger associated with the test framework.
 
Constructor Summary
InternalInterceptor()
           
 
Method Summary
 Object getTargetInstance()
           
 MethodIntercepter getUserIntercepter()
           
 Object intercept(Object object, Method method, Object[] args, net.sf.cglib.proxy.MethodProxy methodProxy)
          Intercept the method with the advice
 void setTargetInstance(Object targetInstance)
           
 void setUserIntercepter(MethodIntercepter userIntercepter)
           
 
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
An instance of logger associated with the test framework.

Constructor Detail

InternalInterceptor

public InternalInterceptor()
Method Detail

intercept

public Object intercept(Object object,
                        Method method,
                        Object[] args,
                        net.sf.cglib.proxy.MethodProxy methodProxy)
                 throws Throwable
Intercept the method with the advice

Specified by:
intercept in interface net.sf.cglib.proxy.MethodInterceptor
Parameters:
object - the object on which to invoke the method
method - the method to invoke
args - arguments to the method
methodProxy - the method proxy
Returns:
returned value
Throws:
Throwable

getUserIntercepter

public MethodIntercepter getUserIntercepter()
Returns:
the userIntercepter

setUserIntercepter

public void setUserIntercepter(MethodIntercepter userIntercepter)
Parameters:
userIntercepter - the userIntercepter to set

getTargetInstance

public Object getTargetInstance()
Returns:
the targetInstance

setTargetInstance

public void setTargetInstance(Object targetInstance)
Parameters:
targetInstance - the targetInstance to set


Copyright © 2013. All Rights Reserved.