1 22 package org.jboss.aop.joinpoint; 23 24 import org.jboss.aop.Advisor; 25 import org.jboss.aop.advice.Interceptor; 26 import org.jboss.aop.metadata.MetaDataResolver; 27 import org.jboss.aop.metadata.SimpleMetaData; 28 29 import java.lang.reflect.Field ; 30 import java.util.Map ; 31 32 39 public class FieldReadInvocationWrapper extends FieldReadInvocation 40 { 41 static final long serialVersionUID = 7595351292713886213L; 42 43 FieldReadInvocation wrapped; 44 45 public FieldReadInvocationWrapper(FieldReadInvocation wrapped, Interceptor[] interceptors) 46 { 47 super(interceptors); 48 this.wrapped = wrapped; 49 } 50 51 public Object getMetaData(Object group, Object attr) 52 { 53 return wrapped.getMetaData(group, attr); 54 } 55 56 public Object invokeNext() throws Throwable 57 { 58 if (interceptors != null && currentInterceptor < interceptors.length) 59 { 60 try 61 { 62 return interceptors[currentInterceptor++].invoke(this); 63 } 64 finally 65 { 66 currentInterceptor--; 68 } 69 } 70 try 71 { 72 return wrapped.invokeNext(); 73 } 74 finally 75 { 76 responseContextInfo = wrapped.getResponseContextInfo(); 77 } 78 } 79 80 public MetaDataResolver getInstanceResolver() 81 { 82 return wrapped.getInstanceResolver(); 83 } 84 85 public Invocation copy() 86 { 87 FieldReadInvocationWrapper invocation = new FieldReadInvocationWrapper((FieldReadInvocation)wrapped.copy(), interceptors); 88 invocation.currentInterceptor = this.currentInterceptor; 89 return invocation; 90 } 91 92 public Field getField() 93 { 94 return wrapped.getField(); 95 } 96 97 public int getIndex() 98 { 99 return wrapped.getIndex(); 100 } 101 102 public Map getResponseContextInfo() 103 { 104 return wrapped.getResponseContextInfo(); 105 } 106 107 public void setResponseContextInfo(Map responseContextInfo) 108 { 109 wrapped.setResponseContextInfo(responseContextInfo); 110 } 111 112 public void addResponseAttachment(Object key, Object val) 113 { 114 wrapped.addResponseAttachment(key, val); 115 } 116 117 public Object getResponseAttachment(Object key) 118 { 119 return wrapped.getResponseAttachment(key); 120 } 121 122 public SimpleMetaData getMetaData() 123 { 124 return wrapped.getMetaData(); 125 } 126 127 public void setMetaData(SimpleMetaData data) 128 { 129 wrapped.setMetaData(data); 130 } 131 132 public Advisor getAdvisor() 133 { 134 return wrapped.getAdvisor(); 135 } 136 137 public Object getTargetObject() 138 { 139 return wrapped.getTargetObject(); 140 } 141 142 public void setTargetObject(Object targetObject) 143 { 144 wrapped.setTargetObject(targetObject); 145 } 146 } 147 | Popular Tags |