/**
* wakeUpThreadOnMethodCall() wakes up the correct thread when receiving method call
*/
- public void wakeUpThreadOnMethodCall() {
+ private void wakeUpThreadOnMethodCall() {
Thread thread = new Thread() {
public void run() {
/**
* wakeUpThreadOnReturnValue() wakes up the correct thread when receiving return value
*/
- public void wakeUpThreadOnReturnValue() {
+ private void wakeUpThreadOnReturnValue() {
Thread thread = new Thread() {
public void run() {
/**
* registerSkeleton() registers the skeleton to be woken up
-
*/
public synchronized void registerSkeleton(int objectId, AtomicBoolean methodReceived) {
*/
private IoTSocketClient rmiClientSend;
private IoTSocketClient rmiClientRecv;
- private int objectIdCounter = Integer.MAX_VALUE;
/**
System.out.println("Return value packet: " + Arrays.toString(packetBytes));
returnQueue.offer(packetBytes);
} else
- throw new Error("IoTRMIComm: Packet type is unknown: " + packetType);
+ throw new Error("IoTRMICommClient: Packet type is unknown: " + packetType);
} //else
// Thread.sleep(100);
packetBytes = null;
} catch (Exception ex) {
ex.printStackTrace();
- throw new Error("IoTRMIComm: Error receiving return value bytes on client!");
+ throw new Error("IoTRMICommClient: Error receiving return value bytes on client!");
}
}
}
didServerRecvConnect.set(true);
} catch (Exception ex) {
ex.printStackTrace();
- throw new Error("IoTRMIComm: Error receiving return value bytes on client!");
+ throw new Error("IoTRMICommServer: Error starting receiver server!");
}
}
};
didServerSendConnect.set(true);
} catch (Exception ex) {
ex.printStackTrace();
- throw new Error("IoTRMIComm: Error receiving return value bytes on client!");
+ throw new Error("IoTRMICommServer: Error starting sender server!");
}
}
};
System.out.println("Return value packet: " + Arrays.toString(packetBytes));
returnQueue.offer(packetBytes);
} else
- throw new Error("IoTRMIComm: Packet type is unknown: " + packetType);
+ throw new Error("IoTRMICommServer: Packet type is unknown: " + packetType);
} //else
// Thread.sleep(100);
packetBytes = null;
} catch (Exception ex) {
ex.printStackTrace();
- throw new Error("IoTRMIComm: Error receiving return value bytes on client!");
+ throw new Error("IoTRMICommServer: Error receiving return value bytes on server!");
}
}
}
/**
* Public static data structure to keep track of multiple skeletons and stubs
*/
- //public static IoTRMIObject rmiObj;
- //public static IoTRMICall rmiCall;
- //public static int objIdCounter = Integer.MAX_VALUE;
- public static Integer objIdCounter = new Integer(Integer.MAX_VALUE);
public static Map<Integer,Object> mapStub = new HashMap<Integer,Object>(); // Map object to its stub ID
public static Map<Object,Object> mapSkel = new HashMap<Object,Object>(); // Map object to its skeleton
public static Map<Object,Integer> mapSkelId = new HashMap<Object,Integer>(); // Map object to its skeleton ID