1 package dynaop.example; 2 3 import dynaop.Interceptor; 4 import dynaop.Invocation; 5 import dynaop.Proxy; 6 import dynaop.ProxyFactory; 7 8 13 public class ProxyFactoryInterceptor implements Interceptor { 14 15 public Object intercept(Invocation invocation) throws Throwable { 16 Object result = invocation.proceed(); 17 18 if (result instanceof Proxy) 20 return result; 21 22 return ProxyFactory.getInstance().wrap(result); 23 } 24 25 } 26 | Popular Tags |