动态代理invoke的调用

Each proxy instance has an associated <i>invocation handler</i>
 * object, which implements the interface {@link InvocationHandler}.
 * A method invocation on a proxy instance through one of its proxy
 * interfaces will be dispatched to the {@link InvocationHandler#invoke
 * invoke} method of the instance's invocation handler, passing the proxy
 * instance, a {@code java.lang.reflect.Method} object identifying
 * the method that was invoked, and an array of type {@code Object}
 * containing the arguments.  The invocation handler processes the
 * encoded method invocation as appropriate and the result that it
 * returns will be returned as the result of the method invocation on
 * the proxy instance.
每个代理实例都有一个关联的 <i>invocation handler<i> 对象,该对象实现了接口 {@link InvocationHandler}。
通过代理接口之一对代理实例的方法调用将被分派到实例的调用处理程序的 {@link InvocationHandlerinvoke invoke} 方法,
传递代理实例,{@code java.lang.reflect.Method} 对象标识被调用的方法,以及包含参数的 {@code Object} 类型的数组。
调用处理程序适当地处理编码的方法调用,并且它返回的结果将作为代理实例上的方法调用的结果返回。

 

posted @ 2022-04-02 16:06  每天--自然醒  阅读(128)  评论(0)    收藏  举报