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.Constructor ; 30 import java.lang.reflect.Method ; 31 import java.util.Map ; 32 33 39 public class ConstructorCalledByMethodInvocationWrapper extends ConstructorCalledByMethodInvocation 40 { 41 private static final long serialVersionUID = 3704470177577877004L; 42 43 ConstructorCalledByMethodInvocation wrapped; 44 45 public ConstructorCalledByMethodInvocationWrapper(ConstructorCalledByMethodInvocation 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 return wrapped.invokeNext(); 71 } 72 73 public MetaDataResolver getInstanceResolver() 74 { 75 return wrapped.getInstanceResolver(); 76 } 77 78 public Class getCallingClass() 79 { 80 return wrapped.getCallingClass(); 81 } 82 83 public Method getCallingMethod() 84 { 85 return wrapped.getCallingMethod(); 86 } 87 88 public Constructor getCalledConstructor() 89 { 90 return wrapped.getCalledConstructor(); 91 } 92 93 public boolean isWrapped() 94 { 95 return wrapped.isWrapped(); 96 } 97 98 public Method getWrappingMethod() 99 { 100 return wrapped.getWrappingMethod(); 101 } 102 103 public Invocation copy() 104 { 105 ConstructorCalledByMethodInvocationWrapper invocation = new ConstructorCalledByMethodInvocationWrapper((ConstructorCalledByMethodInvocation) wrapped.copy(), interceptors); 106 invocation.currentInterceptor = this.currentInterceptor; 107 return invocation; 108 } 109 110 public Advisor getAdvisor() 111 { 112 return wrapped.getAdvisor(); 113 } 114 115 public Object getTargetObject() 116 { 117 return wrapped.getTargetObject(); 118 } 119 120 public void setTargetObject(Object targetObject) 121 { 122 wrapped.setTargetObject(targetObject); 123 } 124 125 public Map getResponseContextInfo() 126 { 127 return wrapped.getResponseContextInfo(); 128 } 129 130 public void setResponseContextInfo(Map responseContextInfo) 131 { 132 wrapped.setResponseContextInfo(responseContextInfo); 133 } 134 135 public void addResponseAttachment(Object key, Object val) 136 { 137 wrapped.addResponseAttachment(key, val); 138 } 139 140 public Object getResponseAttachment(Object key) 141 { 142 return wrapped.getResponseAttachment(key); 143 } 144 145 public SimpleMetaData getMetaData() 146 { 147 return wrapped.getMetaData(); 148 } 149 150 public void setMetaData(SimpleMetaData data) 151 { 152 wrapped.setMetaData(data); 153 } 154 155 public Object [] getArguments() 156 { 157 return wrapped.getArguments(); 158 } 159 160 public void setArguments(Object [] arguments) 161 { 162 wrapped.setArguments(arguments); 163 } 164 165 public Object getCallingObject() 166 { 167 return wrapped.getCallingObject(); 168 } 169 } 170 | Popular Tags |