一、Invocation Handler
.Invocation Handler 是一個(gè)借口下面介紹他的參數(shù)
proxy:代理實(shí)例
method:代理實(shí)例上調(diào)用方法
args:方法需要的參數(shù)
Throwable:如果一個(gè)異常時(shí)檢查型異常并且沒有在動(dòng)態(tài)代理的借口處聲明,那么它將會(huì)被包裝成Undeclared Throwable Exception. Invocation Target Exception是檢查型異常,因此Methon.invoke中所有的異常都會(huì)被客戶端代碼捕獲成UndeclaredThrowableException,
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable;
正確的調(diào)用:

Paste_Image.png