All Downloads are FREE. Search and download functionalities are using the official Maven repository.

hudson.util.InvocationInterceptor Maven / Gradle / Ivy

package hudson.util;

import java.lang.reflect.Method;
import java.lang.reflect.InvocationHandler;

/**
 * Interceptor around {@link InvocationHandler}.
 *
 * @author Kohsuke Kawaguchi
 * @since 1.232
 */
public interface InvocationInterceptor {
    /**
     * This method can intercept the invocation of {@link InvocationHandler} 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. */ public Object invoke(Object proxy, Method method, Object[] args, InvocationHandler delegate) throws Throwable; }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy