try { mq.add(new MethodInvocation(obj, m, args) } catch (InvocationTargetException e) { throw e.getTargetException();
public boolean visit(MethodInvocation node){ node = null; } MethodInvocation node = new MethodInvocation(); visit(node); // does it change to null System.out.println(node); // no it doesn't. node is unchanged.
new MethodInvocation(obj, m, args); if( "set".equals(m.getName().substring(0,3)) ){ new MethodInvocation(obj, method_setDirty, args);
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { String methodName = method.getName(); if (methodName.equals("getProducerManager")) { return producer; } else if(methodName.equals("toString")) return toString(); long hash = MethodHashing.calculateHash(method); MethodInvocation sri = new MethodInvocation(interceptors, hash, method, method, null); sri.setArguments(args); return sri.invokeNext(); } }
/** * 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(); }
aspects = advised._getInstanceAdvisor().getInterceptors(aspects); MethodInvocation nextInvocation = new MethodInvocation(info, aspects); nextInvocation.setMetaData(invocation.getMetaData()); nextInvocation.setTargetObject(target);