Adding enum support for method argument; need to emulate the same functionality for...
[iot2.git] / iotjava / iotrmi / Java / sample / CallBack_Stub.java
index 4b9b7866213ad72928ca38f8e047c7e4686e4df1..8eb2acb6b643af2165141bade2bd8338876c3c08 100644 (file)
@@ -11,46 +11,34 @@ public class CallBack_Stub implements CallBackInterface {
        private IoTRMICall rmiCall;
 
        private int objectId = 0;       // Default value is 0
-       private final static String[] methodSignatures = {
-
-               "intprintInt()",
-               "voidsetInt(int)"
-       };
 
        /**
         * Constructors
         */
        public CallBack_Stub(int _port, String _address, int _rev) throws IOException {
 
-               rmiCall = new IoTRMICall(_port, _address, _rev, methodSignatures);
-       }
-
-
-       // Return method signatures
-       public static String[] getMethodSignatures() {
-
-               return methodSignatures;
+               rmiCall = new IoTRMICall(_port, _address, _rev);
        }
 
 
        public int printInt() {
 
-               String sign = "intprintInt()";
+               int methodId = 0;
                Class<?> retType = int.class;
                Class<?>[] paramCls = new Class<?>[] { };
                Object[] paramObj = new Object[] { };
-               Object retObj = rmiCall.remoteCall(objectId, sign, retType, null, null, paramCls, paramObj);
+               Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
                return (int)retObj;
        }
 
 
        public void setInt(int _i) {
 
-               String sign = "voidsetInt(int)";
+               int methodId = 1;
                Class<?> retType = void.class;
                Class<?>[] paramCls = new Class<?>[] { int.class };
                Object[] paramObj = new Object[] { _i };
-               rmiCall.remoteCall(objectId, sign, retType, null, null, paramCls, paramObj);
+               rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
        }