-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNEMethod.java~
47 lines (42 loc) · 1.09 KB
/
NEMethod.java~
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import java.io.*;
import java.net.*;
import java.lang.*;
import java.lang.reflect.*;
public class RMIMethod implements Serializable {
private String className;
private String methodName;
private String[] argTypes;
public RMIMethod (Class classType, String methodName, Class[] argTypes) {
className = classType.getName ();
this.methodName = methodName;
this.argTypes = new String[argTypes.length];
for (int i = 0; i < argTypes.length; i++) {
this.argTypes[i] = argTypes[i].getName ();
}
}
public String getName () {
return methodName;
}
public Class getObjectType () {
try {
return Class.forName (className);
}
catch (ClassNotFoundException e) {
e.printStackTrace ();
return null;
}
}
public Class[] getArgTypes () {
try {
Class[] argTypes = new Class[this.argTypes.length];
for (int i = 0; i < argTypes.length; i++) {
argTypes[i] = Class.forName (this.argTypes[i]);
}
return argTypes;
}
catch (ClassNotFoundException e) {
e.printStackTrace ();
return null;
}
}
}