Using methodId directly without method signature; placing sendReturnObj in individual...
[iot2.git] / iotjava / iotrmi / Java / IoTRMIObject.java
index 043c28a8cb1b0359e6ebcf8d3a117c047650e345..317ed1f5804837c300a26643a33185b74ada7747 100644 (file)
@@ -37,12 +37,11 @@ public class IoTRMIObject {
        /**
         * Constructors
         */
-       public IoTRMIObject(int _port, String[] _methodSign) throws  
+       public IoTRMIObject(int _port) throws  
                ClassNotFoundException, InstantiationException, 
                        IllegalAccessException, IOException {
 
                rmiUtil = new IoTRMIUtil();
-               listMethodId2Sign = Arrays.asList(_methodSign); // Initialize the method ID list
                methodBytes = null;
                rmiServer = new IoTSocketServer(_port);
                rmiServer.connect();
@@ -56,6 +55,7 @@ public class IoTRMIObject {
 
                // Receive method info
                methodBytes = rmiServer.receiveBytes(methodBytes);
+               System.out.println("Method: " + Arrays.toString(methodBytes));
                return methodBytes;
        }
 
@@ -99,9 +99,9 @@ public class IoTRMIObject {
 
 
        /**
-        * getSignature() gets method signature from bytes
+        * getMethodId() gets method Id from bytes
         */
-       public String getSignature() {
+       public int getMethodId() {
 
                // Get method Id bytes
                byte[] methodIdBytes = new byte[IoTRMIUtil.METHOD_ID_LEN];
@@ -109,8 +109,8 @@ public class IoTRMIObject {
                System.arraycopy(methodBytes, IoTRMIUtil.OBJECT_ID_LEN, methodIdBytes, 0, IoTRMIUtil.METHOD_ID_LEN);
                // Get method Id
                int methodId = IoTRMIUtil.byteArrayToInt(methodIdBytes);
-               // Get method signature from the list
-               return listMethodId2Sign.get(methodId);
+               // Get method Id
+               return methodId;
        }