java动态代理原理

Proxy.newProxyInstance(t.getClass().getClassLoader(),t.getClass().getInterfaces(),p);

传入了被代理类的加载器~被代理类的接口集合,要代理的对象(实现InvocationHandler)
newProxyInstance方法先通过
Proxy.getProxyClass(classLoader,interfaces)

获取到有默认InvocationHandler构造函数的代理对象最后在通过反射根据p构造出来新的对象实例..
详情
http://www.blogjava.net/AndersLin/archive/2006/06/11/51997.html

你可能感兴趣的:(java,html,.net)