1 22 package org.jboss.aop.joinpoint; 23 24 import java.lang.reflect.Constructor ; 25 import java.util.Map ; 26 import org.jboss.aop.Advisor; 27 import org.jboss.aop.advice.Interceptor; 28 import org.jboss.aop.metadata.MetaDataResolver; 29 import org.jboss.aop.metadata.SimpleMetaData; 30 31 38 public class ConstructionInvocationWrapper extends ConstructorInvocation 39 { 40 41 private static final long serialVersionUID = 7005423783330774114L; 42 43 ConstructionInvocation wrapped; 44 45 public ConstructionInvocationWrapper(ConstructionInvocation 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 [] args) 91 { 92 wrapped.setArguments(args); 93 } 94 95 public Invocation copy() 96 { 97 ConstructionInvocationWrapper invocation = new ConstructionInvocationWrapper((ConstructionInvocation)wrapped.copy(), interceptors); 98 invocation.currentInterceptor = this.currentInterceptor; 99 return invocation; 100 } 101 102 public Constructor getConstructor() 103 { 104 return wrapped.getConstructor(); 105 } 106 107 public void setConstructor(Constructor constructor) 108 { 109 wrapped.setConstructor(constructor); 110 } 111 112 public Map getResponseContextInfo() 113 { 114 return wrapped.getResponseContextInfo(); 115 } 116 117 public void setResponseContextInfo(Map responseContextInfo) 118 { 119 wrapped.setResponseContextInfo(responseContextInfo); 120 } 121 122 public void addResponseAttachment(Object key, Object val) 123 { 124 wrapped.addResponseAttachment(key, val); 125 } 126 127 public Object getResponseAttachment(Object key) 128 { 129 return wrapped.getResponseAttachment(key); 130 } 131 132 public SimpleMetaData getMetaData() 133 { 134 return wrapped.getMetaData(); 135 } 136 137 public void setMetaData(SimpleMetaData data) 138 { 139 wrapped.setMetaData(data); 140 } 141 142 public Advisor getAdvisor() 143 { 144 return wrapped.getAdvisor(); 145 } 146 147 public Object getTargetObject() 148 { 149 return wrapped.getTargetObject(); 150 } 151 152 public void setTargetObject(Object targetObject) 153 { 154 wrapped.setTargetObject(targetObject); 155 } 156 157 } 158 | Popular Tags |