org.easetech.easytest.interceptor
Class InternalInvocationhandler
java.lang.Object
org.easetech.easytest.interceptor.InternalInvocationhandler
- All Implemented Interfaces:
- InvocationHandler
public class InternalInvocationhandler
- extends Object
- implements InvocationHandler
implementation of the InvocationHandler interface for internal usage.
This is used when the user has Provided annotation on a field whose type is an Interface.
EasyTest uses JDK dynamic proxies to intercept calls to the method on Interface type fields.
For Concrete classes, EasyTest uses CGLIB.
- Author:
- Anuj Kumar
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
InternalInvocationhandler
public InternalInvocationhandler()
invoke
public Object invoke(Object proxy,
Method method,
Object[] args)
throws Throwable
- Invoke the method on the provided
targetInstance.
userIntercepter's intercept method is invoked with the right arguments.
Note that this implementation does not use the proxy instance passed to this method.
- Specified by:
invoke in interface InvocationHandler
- Parameters:
proxy - NOT USEDmethod - the method to invokeargs - the arguments to the method
- Returns:
- object
- Throws:
Throwable - if any exception occurs
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.