View Javadoc

1   /**
2    * 
3    */
4   package org.sourceforge.jemm.comm.shared;
5   
6   /**
7    * The RPCCallMessage details an RPC call, giving information about the calling thread, 
8    * target interface,method arguments and whether the call is synchronous or asynchronous.
9    *  
10   * @author Rory Graves
11   * 
12   */
13  public class RPCCallMessage extends Message {
14  	private static final long serialVersionUID = 1L;
15  
16  	/** Target interface class. */
17      private final Class<?> ifClass;
18  
19      /** Target method name. */
20      private final String methodName;
21  
22      /** method parameter types. */
23      private final Class<?>[] parameterTypes;
24  
25      /** Call parameters. */
26      private final Object[] parameters;
27  
28      /** Whether this is an asynchronous call rather than a synchronous one. */
29      private final boolean asyncCall;
30  
31      /**
32       * @param threadId The threadId of the caller.
33       * @param asyncCall True for asynchronous call, false for synchronous.
34       * @param ifClass The target interface class.
35       * @param methodName The target method name.
36       * @param parameterTypes  The parameter types of the target method.
37       * @param parameters The parameter values (wrapped if base types)
38       */
39      public RPCCallMessage(String threadId, boolean asyncCall, Class<?> ifClass,
40              String methodName, Class<?>[] parameterTypes, Object[] parameters) {
41          super(threadId);
42          this.asyncCall = asyncCall;
43          this.ifClass = ifClass;
44          this.methodName = methodName;
45          this.parameterTypes = parameterTypes.clone();
46          this.parameters = parameters.clone();
47      }
48  
49  	public Class<?> getIfClass() {
50  		return ifClass;
51  	}
52  
53  	public String getMethodName() {
54  		return methodName;
55  	}
56  
57  	public Class<?>[] getParameterTypes() {
58  		return parameterTypes;
59  	}
60  
61  	public Object[] getParameters() {
62  		return parameters;
63  	}
64  
65  	public boolean isAsyncCall() {
66  		return asyncCall;
67  	}
68  
69  }