Package hudson.util
Interface InvocationInterceptor
public interface InvocationInterceptor
Interceptor around
InvocationHandler
.- Since:
- 1.232
- Author:
- Kohsuke Kawaguchi
-
Method Summary
Modifier and TypeMethodDescriptioninvoke
(Object proxy, Method method, Object[] args, InvocationHandler delegate) This method can intercept the invocation ofInvocationHandler
either before or after the invocation happens.
-
Method Details
-
invoke
Object invoke(Object proxy, Method method, Object[] args, InvocationHandler delegate) throws Throwable This method can intercept the invocation ofInvocationHandler
either before or after the invocation happens.The general coding pattern is:
Object invoke(Object proxy, Method method, Object[] args, InvocationHandler delegate) { ... do pre-invocation work ... ret = delegate.invoke(proxy,method,args); ... do post-invocation work ... return ret; }
But the implementation may choose to skip calling the 'delegate' object, alter arguments, and alter the return value.
- Throws:
Throwable
-