Java 源码 - InvocationHandler 调用处理器


InvocationHandler 位于 JDK 反射包下,其作用是在实现 JDK 动态代理。

源码

package java.lang.reflect;

/**
 * InvocationHandler is the interface implemented by the invocation handler of a proxy instance.
 */
public interface InvocationHandler {
    /**
     * Processes a method invocation on a proxy instance and returns the result. 
     */
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable;
}