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 invokeNew(Object[] args, int idx) throws Throwable { Interceptor[] cInterceptors = constructorInfos[idx].getInterceptors(); if (cInterceptors == null) cInterceptors = new Interceptor[0]; ConstructorInvocation invocation = new ConstructorInvocation(cInterceptors); invocation.setAdvisor(this); invocation.setArguments(args); invocation.setConstructor(constructors[idx]); return invocation.invokeNext(); }