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 T
false false false
- All Implemented Interfaces:
DefaultInterfaceMethodInvocationHandler
,InvocationHandler
public class InterceptingInvocationHandler<T> extends DefaultInvocationHandler
"Intercepting"InvocationHandler
implementation.- Author:
- Allen D. Ball
-
-
Constructor Summary
Constructors Constructor Description InterceptingInvocationHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
invoke(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, theMethod
is invoked on the target.- Specified by:
invoke
in interfaceDefaultInterfaceMethodInvocationHandler
- Specified by:
invoke
in interfaceInvocationHandler
- Overrides:
invoke
in classDefaultInvocationHandler
- Parameters:
proxy
- The proxy instance.method
- TheMethod
.argv
- The argument array.- Returns:
- The value to return from the
Method
invocation. - Throws:
Exception
- If theMethod
cannot be invoked.Throwable
-
-