Package ball.lang.reflect
Class InterceptingInvocationHandler<T>
- java.lang.Object
-
- ball.lang.reflect.DefaultInvocationHandler
-
- ball.lang.reflect.InterceptingInvocationHandler<T>
-
- Type Parameters:
T- The type of the "wrapped" target.Bean Property Summary
Name Mode Type isHidden isBound isConstrained target R Tfalse false false
- All Implemented Interfaces:
DefaultInterfaceMethodInvocationHandler,InvocationHandler
public class InterceptingInvocationHandler<T> extends DefaultInvocationHandler
"Intercepting"InvocationHandlerimplementation.- Author:
- Allen D. Ball
-
-
Constructor Summary
Constructors Constructor Description InterceptingInvocationHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectinvoke(Object proxy, Method method, Object[] argv)Subclasses may declare methods with the same signature of a proxied interface method which will be invoked (as a sort of listener) before invoking the target method.-
Methods inherited from class ball.lang.reflect.DefaultInvocationHandler
getImplementedInterfacesOf, getProxyClass, newProxyInstance
-
-
-
-
Constructor Detail
-
InterceptingInvocationHandler
public InterceptingInvocationHandler()
-
-
Method Detail
-
invoke
public Object invoke(Object proxy, Method method, Object[] argv) throws Throwable
Subclasses may declare methods with the same signature of a proxied interface method which will be invoked (as a sort of listener) before invoking the target method. If the invokedMethod's declaring class is assignable from the target's class, theMethodis invoked on the target.- Specified by:
invokein interfaceDefaultInterfaceMethodInvocationHandler- Specified by:
invokein interfaceInvocationHandler- Overrides:
invokein classDefaultInvocationHandler- Parameters:
proxy- The proxy instance.method- TheMethod.argv- The argument array.- Returns:
- The value to return from the
Methodinvocation. - Throws:
Exception- If theMethodcannot be invoked.Throwable
-
-