public void setTargetObject(Object targetObject) { wrapped.setTargetObject(targetObject); }
public void setTargetObject(Object targetObject) { delegate.setTargetObject(targetObject); }
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { // Get the invocation the handler set Invocation inv = activeInvocation.get(); if(inv instanceof MethodInvocation) { // Need to set the target since this is not a true aop proxy MethodInvocation mi = (MethodInvocation) inv; mi.setTargetObject(target); // Override the method to the poji proxy method to return the invocation method inv = new PojiMethodInvocation(mi, method); } // run through the interceptors for(Interceptor i : interceptors) { i.invoke(inv); } // Perform the invocation on the target try { return method.invoke(target, args); } catch(InvocationTargetException ite) { throw ite.getTargetException(); } }
/** * Copies complete state of Invocation object. * * @return a copy of this instance */ public Invocation copy() { MethodInvocation wrapper = new MethodInvocation(interceptors, methodHash, advisedMethod, unadvisedMethod, advisor); wrapper.metadata = this.metadata; wrapper.currentInterceptor = this.currentInterceptor; wrapper.instanceResolver = this.instanceResolver; wrapper.setTargetObject(this.getTargetObject()); wrapper.setArguments(this.getArguments()); return wrapper; }
public Object invokeMethod(InstanceAdvisor instanceAdvisor, Object target, long methodHash, Object[] arguments, MethodInfo info) throws Throwable { Interceptor[] aspects = info.getInterceptors(); if (instanceAdvisor != null && (instanceAdvisor.hasInterceptors())) { aspects = instanceAdvisor.getInterceptors(aspects); } MethodInvocation invocation = new MethodInvocation(info, aspects); invocation.setArguments(arguments); invocation.setTargetObject(target); return invocation.invokeNext(); }
nextInvocation.setTargetObject(target); nextInvocation.setArguments(methodInvocation.getArguments()); nextInvocation.setAdvisor(this);