1 8 9 package org.jboss.remoting.invocation; 10 11 import java.lang.reflect.Method ; 12 13 22 public class NameBasedInvocation extends RemoteInvocation 23 { 24 27 static final long serialVersionUID = -6507163932605308471L; 28 29 private final String [] sig; 30 31 public NameBasedInvocation(final Method method, final Object [] params) 32 { 33 super(method.getName(), params); 34 sig = generateSignatureFromMethod(method); 35 } 36 37 private String [] generateSignatureFromMethod(final Method method) 38 { 39 Class [] parameterTypes = method.getParameterTypes(); 40 String [] signature = new String [parameterTypes.length]; 41 for(int i = 0; i < parameterTypes.length; i++) 42 { 43 Class parameterType = parameterTypes[i]; 44 signature[i] = parameterType.getName(); 45 } 46 return signature; 47 } 48 49 public NameBasedInvocation(final String methodName, final Object [] params, final String [] sig) 50 { 51 super(methodName, params); 52 this.sig = sig; 53 } 55 public String [] getSignature() 56 { 57 return sig; 58 } 59 60 public String toString() 61 { 62 return "NameBasedInvocation [" + methodName + "]"; 63 } 64 65 } | Popular Tags |