public Object process(MethodInvocation invocation) throws Throwable { log.info("process(MethodInvocation), "+invocation); Object value = invocation.invokeNext(); if( value instanceof Collection ) { Collection<DeploymentContext> ctxs = (Collection<DeploymentContext>) value; log.info("ctxs: "+ctxs); } return value; } }
@Override public Object proceed() throws Exception { try { return delegate.invokeNext(); } catch(Exception e) { throw e; } catch(Error e) { throw (Error) e; } catch(Throwable t) { throw new RuntimeException(t); } }
@Override public Object proceed() throws Exception { try { return delegate.invokeNext(); } catch(Exception e) { throw e; } catch(Error e) { throw (Error) e; } catch(Throwable t) { throw new RuntimeException(t); } }
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(); } }
public Object invokeNext() throws Throwable { if (interceptors != null && currentInterceptor < interceptors.length) { try { return interceptors[currentInterceptor++].invoke(this); } finally { // so that interceptors like clustering can reinvoke down the chain currentInterceptor--; } } try { return wrapped.invokeNext(); } finally { responseContextInfo = wrapped.getResponseContextInfo(); } }
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.setArguments(methodInvocation.getArguments()); nextInvocation.setAdvisor(this); InvocationResponse response = new InvocationResponse(nextInvocation.invokeNext()); response.setContextInfo(nextInvocation.getResponseContextInfo()); return response;