1 17 18 package org.apache.geronimo.proxy; 19 20 import java.io.IOException ; 21 import java.io.ObjectInput ; 22 import java.io.ObjectOutput ; 23 import java.lang.reflect.Method ; 24 25 import org.apache.geronimo.core.service.Invocation; 26 import org.apache.geronimo.core.service.SimpleInvocation; 27 28 31 final public class ProxyInvocation extends SimpleInvocation { 32 33 Method method; 34 Object args[]; 35 Object proxy; 36 37 40 public void writeExternal(ObjectOutput out) throws IOException { 41 super.writeExternal(out); 42 out.writeObject(args); 43 out.writeObject(new MarshalledMethod(method)); 44 } 45 46 49 public void readExternal(ObjectInput in) throws IOException , ClassNotFoundException { 50 super.readExternal(in); 51 args = (Object []) in.readObject(); 52 method = ((MarshalledMethod) in.readObject()).getMethod(); 53 } 54 55 public static Method getMethod(Invocation invocation) { 56 return (Method ) ((ProxyInvocation) invocation).method; 57 } 58 public static void putMethod(Invocation invocation, Method method) { 59 ((ProxyInvocation) invocation).method = method; 60 } 61 62 public static Object getProxy(Invocation invocation) { 63 return ((ProxyInvocation) invocation).proxy; 64 } 65 public static void putProxy(Invocation invocation, Object proxy) { 66 ((ProxyInvocation) invocation).proxy = proxy; 67 } 68 69 public static Object [] getArguments(Invocation invocation) { 70 return ((ProxyInvocation) invocation).args; 71 } 72 73 public static void putArguments(Invocation invocation, Object [] arguments) { 74 ((ProxyInvocation) invocation).args = arguments; 75 } 76 77 } 78 | Popular Tags |