1 package iotrmi.Java.sample;
3 import java.io.IOException;
5 import java.util.Arrays;
6 import iotrmi.Java.IoTRMIObject;
8 public class CallBack_CBSkeleton implements CallBackInterface {
10 private int objectId = 0; // Default value is 0
11 private CallBackInterface cb;
17 public CallBack_CBSkeleton(CallBackInterface _cb, int _objectId) throws
18 ClassNotFoundException, InstantiationException,
19 IllegalAccessException, IOException {
23 System.out.println("Creating CallBack_Skeleton and waiting!");
27 public int printInt() {
32 public void ___printInt(IoTRMIObject rmiObj) throws IOException {
33 Object retObj = printInt();
34 rmiObj.sendReturnObj(retObj);
38 public void setInt(int _i) {
43 public void ___setInt(IoTRMIObject rmiObj) {
44 Object[] paramObj = rmiObj.getMethodParams(new Class<?>[] { int.class },
45 new Class<?>[] { null });
46 setInt((int) paramObj[0]);
50 public void invokeMethod(IoTRMIObject rmiObj) throws IOException {
52 int methodId = rmiObj.getMethodId();
55 case 0: ___printInt(rmiObj); break;
56 case 1: ___setInt(rmiObj); break;
58 throw new Error("Method Id not recognized!");
63 public static void main(String[] args) throws Exception {