JDK动态代理之InvocationHandler接口源码分析
InvacationHandler类是JDK动态代理中需要实现的接口,接口中只有一个方法:invoke。
代码
package java.lang.reflect;
/**
* {@code InvocationHandler} is the interface implemented by
* the <i>invocation handler</i> of a proxy instance.
*
* 译文:
* InvocationHandler是代理类实现的接口
*
* <p>Each proxy instance has an associated invocation handler.
* When a method is invoked on a proxy instance, the method
* invocation is encoded and dispatched to the {@code invoke}
* method of its invocation handler.
*
* 译文:
* 每个代理对象都有一个与之关联的handler,代理对象上方法调用会被编码,并发送到
* 与之对应的handler上
*/
pub