1 23 24 package protoactive.core.body.metaobject; 25 26 import protoactive.core.body.future.LocalFuture; 27 28 import java.lang.reflect.Method ; 29 30 public class Request { 31 32 public Object target; 33 34 public Method m; 35 36 public Object [] args; 37 38 public LocalFuture future; 39 40 public String toString () { 41 String s = m.getName() + "("; 42 for (int i = 0; i < args.length; ++i) { 43 s = s + args[i]; 44 if (i < args.length - 1) { 45 s = s + ","; 46 } 47 } 48 return s + ")"; 49 } 50 51 public Object invoke () { 52 try { 53 return m.invoke(target, args); 54 } catch (Exception e) { 55 throw new Error ("Invocation exception: " + e); 56 } 57 } 58 } 59 | Popular Tags |