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.Method ; 30 import java.util.Map ; 31 32 38 public class MethodCalledByMethodInvocationWrapper extends MethodCalledByMethodInvocation 39 { 40 private static final long serialVersionUID = 5130026569290691583L; 41 42 MethodCalledByMethodInvocation wrapped; 43 44 public MethodCalledByMethodInvocationWrapper(MethodCalledByMethodInvocation wrapped, Interceptor[] interceptors) 45 { 46 super(interceptors); 47 this.wrapped = wrapped; 48 } 49 50 public Object getMetaData(Object group, Object attr) 51 { 52 return wrapped.getMetaData(group, attr); 53 } 54 55 public Object invokeNext() throws Throwable 56 { 57 if (interceptors != null && currentInterceptor < interceptors.length) 58 { 59 try 60 { 61 return interceptors[currentInterceptor++].invoke(this); 62 } 63 finally 64 { 65 currentInterceptor--; 67 } 68 } 69 try 70 { 71 return wrapped.invokeNext(); 72 } 73 finally 74 { 75 responseContextInfo = wrapped.getResponseContextInfo(); 76 } 77 } 78 79 public MetaDataResolver getInstanceResolver() 80 { 81 return wrapped.getInstanceResolver(); 82 } 83 84 public Invocation copy() 85 { 86 MethodCalledByMethodInvocationWrapper invocation = new MethodCalledByMethodInvocationWrapper((MethodCalledByMethodInvocation) wrapped.copy(), interceptors); 87 invocation.currentInterceptor = this.currentInterceptor; 88 return invocation; 89 } 90 91 public Object [] getArguments() 92 { 93 return wrapped.getArguments(); 94 } 95 96 public void setArguments(Object [] arguments) 97 { 98 wrapped.setArguments(arguments); 99 } 100 101 public Class getCallingClass() 102 { 103 return wrapped.getCallingClass(); 104 } 105 106 public Method getCallingMethod() 107 { 108 return wrapped.getCallingMethod(); 109 } 110 111 public Map getResponseContextInfo() 112 { 113 return wrapped.getResponseContextInfo(); 114 } 115 116 public void setResponseContextInfo(Map responseContextInfo) 117 { 118 wrapped.setResponseContextInfo(responseContextInfo); 119 } 120 121 public void addResponseAttachment(Object key, Object val) 122 { 123 wrapped.addResponseAttachment(key, val); 124 } 125 126 public Object getResponseAttachment(Object key) 127 { 128 return wrapped.getResponseAttachment(key); 129 } 130 131 public void setMetaData(SimpleMetaData data) 132 { 133 wrapped.setMetaData(data); 134 } 135 136 public Advisor getAdvisor() 137 { 138 return wrapped.getAdvisor(); 139 } 140 141 public Object getTargetObject() 142 { 143 return wrapped.getTargetObject(); 144 } 145 146 public void setTargetObject(Object targetObject) 147 { 148 wrapped.setTargetObject(targetObject); 149 } 150 151 154 public Method getCalledMethod() 155 { 156 return wrapped.getCalledMethod(); 157 } 158 159 public Object getCallingObject() 160 { 161 return wrapped.getCallingObject(); 162 } 163 164 } 165 | Popular Tags |