X-Git-Url: http://plrg.eecs.uci.edu/git/?p=iot2.git;a=blobdiff_plain;f=iotjava%2Fiotrmi%2FJava%2FIoTRMIObject.java;h=06a56ce5638a6e653411cffd373a00a6066da01e;hp=3f0c19c32b253f75185d6603b851f02cc8082d59;hb=d227810e27d0c63637497c4adaabc19dc67b186a;hpb=f59c5789201487e4fc1101ee5f9c6c75d7918607 diff --git a/iotjava/iotrmi/Java/IoTRMIObject.java b/iotjava/iotrmi/Java/IoTRMIObject.java index 3f0c19c..06a56ce 100644 --- a/iotjava/iotrmi/Java/IoTRMIObject.java +++ b/iotjava/iotrmi/Java/IoTRMIObject.java @@ -10,6 +10,9 @@ import java.util.Map; import java.util.Set; import java.lang.reflect.*; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; + /** Class IoTRMIObject is a class that stores info of an object. *

@@ -23,7 +26,7 @@ import java.lang.reflect.*; * @version 1.0 * @since 2016-10-03 */ -public class IoTRMIObject { +public final class IoTRMIObject { /** * Class Properties @@ -32,6 +35,7 @@ public class IoTRMIObject { private IoTRMIUtil rmiUtil; private IoTSocketServer rmiServer; private byte[] methodBytes; + private Lock lock = new ReentrantLock(); /** @@ -54,7 +58,9 @@ public class IoTRMIObject { public byte[] getMethodBytes() throws IOException { // Receive method info + //System.out.println("Method RMIObj before: " + Arrays.toString(methodBytes)); methodBytes = rmiServer.receiveBytes(methodBytes); + //System.out.println("Method RMIObj after: " + Arrays.toString(methodBytes)); return methodBytes; }