本帖最后由 凝霜的枯藤 于 2014-5-30 10:20 编辑
- public class DynamicProxy implements InvocationHandler {
- private Object target;
- public DynamicProxy(Object target) {
- this.target = target;
- }
- @Override
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
- before();
- Object result = method.invoke(target, args);
- after();
- return result;
- }
- ...
- }
复制代码 听说实现动态代理的话,就要这个类必须得有借口..没有接口怎么实现???
|
|