Class Proxy implements InvocationHandler{
Object tar =null;
public Object bid(Object tar){
this.tar=tar;
return Proxy.newProxyInstance(tar.getClass().getClassLoader(),tar.getClass.getInterfaces,this);
}
//重写Invoke 方法
public Object invoke(Object proxy,Method method,Object[] args) throws throwable{
Object result=null;
result=method.invoke(tar,args);
return result;
}
}
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/1812/viewspace-2817709/ ,如需转载,请注明出处,否则将追究法律责任。