/**
* 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();
// Receive method info
methodBytes = rmiServer.receiveBytes(methodBytes);
+ System.out.println("Method: " + Arrays.toString(methodBytes));
return methodBytes;
}
/**
- * 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];
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;
}