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 40 public class MethodCalledByConstructorInvocationWrapper extends MethodCalledByConstructorInvocation 41 { 42 private static final long serialVersionUID = 4578273471486761147L; 43 MethodCalledByConstructorInvocation wrapped; 44 45 public MethodCalledByConstructorInvocationWrapper(MethodCalledByConstructorInvocation 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 Object [] getArguments() 86 { 87 return wrapped.getArguments(); 88 } 89 90 public void setArguments(Object [] arguments) 91 { 92 wrapped.setArguments(arguments); 93 } 94 95 public Constructor getCalling() 96 { 97 return wrapped.getCalling(); 98 } 99 100 public Method getCalledMethod() 101 { 102 return wrapped.getCalledMethod(); 103 } 104 105 public Map getResponseContextInfo() 106 { 107 return wrapped.getResponseContextInfo(); 108 } 109 110 public void addResponseAttachment(Object key, Object val) 111 { 112 wrapped.addResponseAttachment(key, val); 113 } 114 115 public void setResponseContextInfo(Map responseContextInfo) 116 { 117 wrapped.setResponseContextInfo(responseContextInfo); 118 } 119 120 public Object getResponseAttachment(Object key) 121 { 122 return wrapped.getResponseAttachment(key); 123 } 124 125 public void setMetaData(SimpleMetaData data) 126 { 127 wrapped.setMetaData(data); 128 } 129 130 public Advisor getAdvisor() 131 { 132 return wrapped.getAdvisor(); 133 } 134 135 public Object getTargetObject() 136 { 137 return wrapped.getTargetObject(); 138 } 139 140 public void setTargetObject(Object targetObject) 141 { 142 wrapped.setTargetObject(targetObject); 143 } 144 145 public Invocation copy() 146 { 147 MethodCalledByConstructorInvocationWrapper invocation = new MethodCalledByConstructorInvocationWrapper((MethodCalledByConstructorInvocation)wrapped.copy(), interceptors); 148 invocation.currentInterceptor = this.currentInterceptor; 149 return invocation; 150 } 151 152 } 153 | Popular Tags |