public int getIndex() { return wrapped.getIndex(); }
/** * Copies complete state of Invocation object. * @return */ public Invocation copy() { FieldReadInvocation wrapper = new FieldReadInvocation(field, index, interceptors); wrapper.setAdvisor(this.getAdvisor()); wrapper.setTargetObject(this.getTargetObject()); wrapper.currentInterceptor = this.currentInterceptor; wrapper.metadata = this.metadata; wrapper.instanceResolver = this.instanceResolver; return wrapper; }
public void addResponseAttachment(Object key, Object val) { wrapped.addResponseAttachment(key, val); }
/** * 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(); }
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(); } }
Object target = fieldInvocation.getTargetObject(); Field field = fieldInvocation.getField(); return field.get(target);
return p.matchesGet(mi.getAdvisor(), mi.getField());
public Object getMetaData(Object group, Object attr) { return wrapped.getMetaData(group, attr); }
public Map<Object, Object> getResponseContextInfo() { return wrapped.getResponseContextInfo(); }
public MetaDataResolver getInstanceResolver() { return wrapped.getInstanceResolver(); }
public Advisor getAdvisor() { return wrapped.getAdvisor(); }
public Field getField() { return wrapped.getField(); }
public Object getResponseAttachment(Object key) { return wrapped.getResponseAttachment(key); }
public Invocation copy() { FieldReadInvocationWrapper invocation = new FieldReadInvocationWrapper((FieldReadInvocation)wrapped.copy(), interceptors); invocation.currentInterceptor = this.currentInterceptor; return invocation; }
public SimpleMetaData getMetaData() { return wrapped.getMetaData(); }
public Object fieldRead(org.jboss.aop.joinpoint.Invocation invocation) throws Throwable { acquireReadLock(); try { org.jboss.aop.joinpoint.FieldReadInvocation fieldInvocation = (org.jboss.aop.joinpoint.FieldReadInvocation)invocation; Integer index = new Integer(fieldInvocation.getIndex()); HashMap map = getTxState(); if (map == null) { map = fieldMap; } DistributedFieldUpdate update = (DistributedFieldUpdate)map.get(index); Object val = update.getValue(); return val; } finally { releaseReadLock(); } }