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(); } }
/** * Invokes interceptor chain. * This is the beginning */ public Object invokeWrite(Object target, int index, Object value) throws Throwable { Interceptor[] aspects = fieldWriteInfos[index].getInterceptors(); if (aspects == null) aspects = new Interceptor[0]; FieldWriteInvocation invocation; if (target != null) { InstanceAdvised advised = (InstanceAdvised) target; InstanceAdvisor advisor = advised._getInstanceAdvisor(); if (advisor != null && advisor.hasInterceptors()) { aspects = advised._getInstanceAdvisor().getInterceptors(aspects); } } invocation = new FieldWriteInvocation(advisedFields[index], index, value, aspects); invocation.setAdvisor(this); invocation.setTargetObject(target); return invocation.invokeNext(); }