From: rtrimana Date: Sat, 28 Jan 2017 19:48:14 +0000 (-0800) Subject: Cleaning up error messages, etc. in Java RMI part X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=f76403b0da6d67e0d790740ce66f3f75dbab99b3;p=iot2.git Cleaning up error messages, etc. in Java RMI part --- diff --git a/iotjava/iotrmi/Java/IoTRMIComm.java b/iotjava/iotrmi/Java/IoTRMIComm.java index 685bcc5..6840214 100644 --- a/iotjava/iotrmi/Java/IoTRMIComm.java +++ b/iotjava/iotrmi/Java/IoTRMIComm.java @@ -63,7 +63,7 @@ public abstract class IoTRMIComm { /** * wakeUpThreadOnMethodCall() wakes up the correct thread when receiving method call */ - public void wakeUpThreadOnMethodCall() { + private void wakeUpThreadOnMethodCall() { Thread thread = new Thread() { public void run() { @@ -87,7 +87,7 @@ public abstract class IoTRMIComm { /** * wakeUpThreadOnReturnValue() wakes up the correct thread when receiving return value */ - public void wakeUpThreadOnReturnValue() { + private void wakeUpThreadOnReturnValue() { Thread thread = new Thread() { public void run() { @@ -115,7 +115,6 @@ public abstract class IoTRMIComm { /** * registerSkeleton() registers the skeleton to be woken up - */ public synchronized void registerSkeleton(int objectId, AtomicBoolean methodReceived) { diff --git a/iotjava/iotrmi/Java/IoTRMICommClient.java b/iotjava/iotrmi/Java/IoTRMICommClient.java index 7b26445..99d0af9 100644 --- a/iotjava/iotrmi/Java/IoTRMICommClient.java +++ b/iotjava/iotrmi/Java/IoTRMICommClient.java @@ -29,7 +29,6 @@ public class IoTRMICommClient extends IoTRMIComm { */ private IoTSocketClient rmiClientSend; private IoTSocketClient rmiClientRecv; - private int objectIdCounter = Integer.MAX_VALUE; /** @@ -66,13 +65,13 @@ public class IoTRMICommClient extends IoTRMIComm { 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!"); } } } diff --git a/iotjava/iotrmi/Java/IoTRMICommServer.java b/iotjava/iotrmi/Java/IoTRMICommServer.java index bf8d3b5..96032d1 100644 --- a/iotjava/iotrmi/Java/IoTRMICommServer.java +++ b/iotjava/iotrmi/Java/IoTRMICommServer.java @@ -66,7 +66,7 @@ public class IoTRMICommServer extends IoTRMIComm { 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!"); } } }; @@ -86,7 +86,7 @@ public class IoTRMICommServer extends IoTRMIComm { 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!"); } } }; @@ -115,13 +115,13 @@ public class IoTRMICommServer extends IoTRMIComm { 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!"); } } } diff --git a/iotjava/iotrmi/Java/IoTRMIUtil.java b/iotjava/iotrmi/Java/IoTRMIUtil.java index 59b3a49..e2bfb18 100644 --- a/iotjava/iotrmi/Java/IoTRMIUtil.java +++ b/iotjava/iotrmi/Java/IoTRMIUtil.java @@ -57,10 +57,6 @@ public class IoTRMIUtil { /** * 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 mapStub = new HashMap(); // Map object to its stub ID public static Map mapSkel = new HashMap(); // Map object to its skeleton public static Map mapSkelId = new HashMap(); // Map object to its skeleton ID