1 22 package org.jboss.ejb3; 23 24 import java.lang.reflect.Method ; 25 import java.util.Map ; 26 import org.jboss.aop.Advisor; 27 import org.jboss.aop.advice.Interceptor; 28 import org.jboss.aop.joinpoint.Invocation; 29 import org.jboss.aop.metadata.SimpleMetaData; 30 import org.jboss.logging.Logger; 31 32 38 public class EJBContainerInvocationWrapper extends EJBContainerInvocation 39 { 40 private static final Logger log = Logger.getLogger(EJBContainerInvocationWrapper.class); 41 42 protected EJBContainerInvocation wrapped; 43 44 public EJBContainerInvocationWrapper(EJBContainerInvocation wrapped, Interceptor[] interceptors) 45 { 46 this.wrapped = wrapped; 47 this.interceptors = interceptors; 48 } 49 50 public Object invokeNext() throws Throwable 51 { 52 if (currentInterceptor < interceptors.length) 53 { 54 try 55 { 56 return interceptors[currentInterceptor++].invoke(this); 57 } 58 finally 59 { 60 currentInterceptor--; 62 } 63 } 64 try 65 { 66 return wrapped.invokeNext(); 67 } 68 finally 69 { 70 responseContextInfo = wrapped.getResponseContextInfo(); 71 } 72 } 73 74 public Method getMethod() 75 { 76 return wrapped.getMethod(); 77 } 78 79 public long getMethodHash() 80 { 81 return wrapped.getMethodHash(); 82 } 83 84 public Object getTargetObject() 85 { 86 return wrapped.getTargetObject(); 87 } 88 89 public void setTargetObject(Object targetObject) 90 { 91 wrapped.setTargetObject(targetObject); 92 } 93 94 public Object [] getArguments() 95 { 96 return wrapped.getArguments(); 97 } 98 99 public void setArguments(Object [] args) 100 { 101 wrapped.setArguments(args); 102 } 103 104 public Object resolveClassAnnotation(Class annotation) 105 { 106 return wrapped.resolveClassAnnotation(annotation); 107 } 108 109 public Object resolveAnnotation(Class annotation) 110 { 111 return wrapped.resolveAnnotation(annotation); 112 } 113 114 public Object getMetaData(Object key, Object attr) 115 { 116 return wrapped.getMetaData(key, attr); 117 } 118 119 public Invocation getWrapper(Interceptor[] newchain) 120 { 121 return wrapped.getWrapper(newchain); 122 } 123 124 public Invocation copy() 125 { 126 return wrapped.copy(); 127 } 128 129 public Map getResponseContextInfo() 130 { 131 return wrapped.getResponseContextInfo(); 132 } 133 134 public void setResponseContextInfo(Map responseContextInfo) 135 { 136 wrapped.setResponseContextInfo(responseContextInfo); 137 } 138 139 public void addResponseAttachment(Object key, Object val) 140 { 141 wrapped.addResponseAttachment(key, val); 142 } 143 144 public Object getResponseAttachment(Object key) 145 { 146 return wrapped.getResponseAttachment(key); 147 } 148 149 public SimpleMetaData getMetaData() 150 { 151 return wrapped.getMetaData(); 152 } 153 154 public void setMetaData(SimpleMetaData data) 155 { 156 wrapped.setMetaData(data); 157 } 158 159 public Object resolveClassMetaData(Object key, Object attr) 160 { 161 return wrapped.resolveClassMetaData(key, attr); 162 } 163 164 public Object invokeNext(Interceptor[] newInterceptors) throws Throwable 165 { 166 return wrapped.invokeNext(newInterceptors); 167 } 168 169 public Advisor getAdvisor() 170 { 171 return wrapped.getAdvisor(); 172 } 173 } 174 | Popular Tags |