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 final static String[] methodSignatures = {
16 private CallBackInterface cb;
22 public CallBack_CBSkeleton(CallBackInterface _cb, int _objectId) throws
23 ClassNotFoundException, InstantiationException,
24 IllegalAccessException, IOException {
28 System.out.println("Creating CallBack_Skeleton and waiting!");
32 public int printInt() {
37 public void ___printInt(IoTRMIObject rmiObj) throws IOException {
38 Object retObj = printInt();
39 rmiObj.sendReturnObj(retObj);
43 public void setInt(int _i) {
48 public void ___setInt(IoTRMIObject rmiObj) {
49 Object[] paramObj = rmiObj.getMethodParams(new Class<?>[] { int.class },
50 new Class<?>[] { null }, new Class<?>[] { null });
51 setInt((int) paramObj[0]);
55 public void invokeMethod(IoTRMIObject rmiObj) throws IOException {
57 int methodId = rmiObj.getMethodId();
60 case 0: ___printInt(rmiObj); break;
61 case 1: ___setInt(rmiObj); break;
63 throw new Error("Signature not recognized!");
68 // Return method signatures
69 public static String[] getMethodSignatures() {
71 return methodSignatures;
75 public static void main(String[] args) throws Exception {