public Object access(FieldReadInvocation invocation) throws Throwable { // just in case we have a primitive, we can't return null if (threadbased.get() == null) return invocation.invokeNext(); return threadbased.get(); }
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 invokeRead(Object target, int index) throws Throwable { Interceptor[] aspects = fieldReadInfos[index].getInterceptors(); if (aspects == null) aspects = new Interceptor[0]; FieldReadInvocation invocation; if (target != null) { InstanceAdvised advised = (InstanceAdvised) target; InstanceAdvisor advisor = advised._getInstanceAdvisor(); if (advisor != null && advisor.hasInterceptors()) { aspects = advisor.getInterceptors(aspects); } } invocation = new FieldReadInvocation(advisedFields[index], index, aspects); invocation.setAdvisor(this); invocation.setTargetObject(target); return invocation.invokeNext(); }