}
- public int ___printInt() {
- return printInt();
+ public void ___printInt(IoTRMIObject rmiObj) throws IOException {
+ Object retObj = printInt();
+ rmiObj.sendReturnObj(retObj);
}
public void ___setInt(IoTRMIObject rmiObj) {
Object[] paramObj = rmiObj.getMethodParams(new Class<?>[] { int.class },
- new Class<?>[] { null }, new Class<?>[] { null });
+ new Class<?>[] { null });
setInt((int) paramObj[0]);
}
- public Object invokeMethod(IoTRMIObject rmiObj) throws IOException {
+ public void invokeMethod(IoTRMIObject rmiObj) throws IOException {
- String methodSign = rmiObj.getSignature();
- Object[] paramObj = null;
- Object retObj = null;
+ int methodId = rmiObj.getMethodId();
- if (methodSign.equals("intprintInt()")) {
- retObj = ___printInt();
- } else if (methodSign.equals("voidsetInt(int)")) {
- ___setInt(rmiObj);
- } else
- throw new Error("Signature not recognized!");
- System.out.println("Return object: " + retObj);
-
- return retObj;
+ switch (methodId) {
+ case 0: ___printInt(rmiObj); break;
+ case 1: ___setInt(rmiObj); break;
+ default:
+ throw new Error("Method Id not recognized!");
+ }
}