动态代理的步骤

1、创建一个实现接口InvocationHandler的类,它必须实现invoke的方法

2.创建被代理的类以及接口

3、通过Proxy的静态方法newProxyInstance(ClassLoader loder,Class[] interface ,InvocationHandler h)创建一个代理

4、通过代理调用方法

posted @ 2012-08-19 16:24  feifeihu  阅读(176)  评论(0编辑  收藏  举报