proxy = (GrapheneProxyInstance) ((GrapheneProxyInstance) target).copy(); } else { proxy = (GrapheneProxyInstance) GrapheneProxy.getProxyForTarget(context, target);
proxy = (GrapheneProxyInstance) ((GrapheneProxyInstance) target).copy(); } else { proxy = (GrapheneProxyInstance) GrapheneProxy.getProxyForTarget(context, target);
clone = (GrapheneProxyInstance) GrapheneProxy.getProxyForTarget(context, getTarget()); for (Interceptor interceptor : getSortedInterceptorsByPrecedence()) { clone.registerInterceptor(interceptor);
clone = (GrapheneProxyInstance) GrapheneProxy.getProxyForTarget(context, getTarget()); for (Interceptor interceptor : getSortedInterceptorsByPrecedence()) { clone.registerInterceptor(interceptor);
@Test public void testInterceptorCalling() { // having MyObject target = new MyObject(); MyObject proxy = GrapheneProxy.getProxyForTarget(null, target); // when ((GrapheneProxyInstance) proxy).registerInterceptor(new Interceptor() { @Override public Object intercept(InvocationContext context) throws Throwable { return context.invoke(); } @Override public int getPrecedence() { return 1; } }); proxy.someMethod(); }