1 7 package org.jboss.remoting.interceptor; 8 9 import org.jboss.aop.advice.Interceptor; 10 import org.jboss.aop.joinpoint.Invocation; 11 import org.jboss.aop.joinpoint.InvocationBase; 12 13 import java.io.Serializable ; 14 15 22 public class TestInvocation extends InvocationBase implements Serializable 23 { 24 private Object arg; 25 26 public TestInvocation(Interceptor[] interceptorStack) 27 { 28 super(interceptorStack); 29 } 30 31 40 public Invocation getWrapper(Interceptor[] newchain) 41 { 42 int size = interceptors.length + newchain.length; 43 Interceptor[] newInterceptors = new Interceptor[size]; 44 size = 0; 45 for(int i = 0; i < interceptors.length; i++, size++) 46 { 47 newInterceptors[i] = interceptors[i]; 48 } 49 for(int x = 0; x < newchain.length; x++, size++) 50 { 51 newInterceptors[x] = newchain[x]; 52 } 53 TestInvocation newInvocation = new TestInvocation(newInterceptors); 54 newInvocation.setMetaData(getMetaData()); 55 newInvocation.setArgument(getArgument()); 56 return newInvocation; 57 } 58 59 65 public Invocation copy() 66 { 67 return getWrapper(new Interceptor[0]); 68 } 69 70 public void setArgument(Object testTarget) 71 { 72 this.arg = testTarget; 73 } 74 75 public Object getArgument() 76 { 77 return arg; 78 } 79 } 80 | Popular Tags |