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