Cleaning up code for runtime, installer, RMI, compiler for the Java side
[iot2.git] / iotjava / iotrmi / Java / sample / CallBack_Skeleton.java
diff --git a/iotjava/iotrmi/Java/sample/CallBack_Skeleton.java b/iotjava/iotrmi/Java/sample/CallBack_Skeleton.java
deleted file mode 100644 (file)
index 77a3c81..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-package iotrmi.Java.sample;
-
-import java.io.IOException;
-import java.util.Set;
-import java.util.Arrays;
-import iotrmi.Java.IoTRMIObject;
-
-public class CallBack_Skeleton implements CallBackInterface {
-
-       private int objectId = 0;       // Default value is 0
-       private CallBackInterface cb;
-       private IoTRMIObject rmiObj;
-
-
-       /**
-        * Constructors
-        */
-       public CallBack_Skeleton(CallBackInterface _cb, int _port) throws
-               ClassNotFoundException, InstantiationException,
-                       IllegalAccessException, IOException {
-
-               cb = _cb;
-               System.out.println("Creating CallBack_Skeleton and waiting!");
-               rmiObj = new IoTRMIObject(_port);
-               ___waitRequestInvokeMethod();
-       }
-
-
-       public int printInt() {
-               return cb.printInt();
-       }
-       
-       
-       public void ___printInt() throws IOException {
-               Object retObj = printInt();
-               rmiObj.sendReturnObj(retObj);
-       }
-
-
-       public void setInt(int _i) {
-               cb.setInt(_i);
-       }
-       
-       
-       public void ___setInt() {
-               Object[] paramObj = rmiObj.getMethodParams(new Class<?>[] { int.class }, 
-                       new Class<?>[] { null });
-               setInt((int) paramObj[0]);
-       }
-       
-
-       private void ___waitRequestInvokeMethod() throws IOException {
-
-               // Loop continuously waiting for incoming bytes
-               while (true) {
-
-                       rmiObj.getMethodBytes();
-                       int objId = rmiObj.getObjectId();
-                       if (objId == objectId) {
-                       // Multiplex based on object Id
-                               rmiObj.getMethodBytes();
-                               int methodId = rmiObj.getMethodId();
-
-                               switch (methodId) {
-                                       case 0: ___printInt(); break;
-                                       case 1: ___setInt(); break;
-                                       default:
-                                               throw new Error("Method Id not recognized!");
-                               }
-                       }
-               }
-       }
-
-
-       public static void main(String[] args) throws Exception {
-
-               int port = 5010;
-               CallBack cb = new CallBack(23);
-               CallBack_Skeleton cbSkel = new CallBack_Skeleton(cb, port);
-               //cbSkel.waitRequestInvokeMethod();
-       }
-}