Adding object ID tracking for simultaneous generation of stubs/skeletons (e.g. for...
[iot2.git] / benchmarks / Java / SmartLightsController / CameraCallback_Skeleton.java
index 74103684ee37dbf06fca49e33f43a5510207ab06..0ee1c4fbc06dae5622acf8c68fae2b7ddee3f359 100644 (file)
@@ -17,22 +17,21 @@ import iotcode.interfaces.*;
 public class CameraCallback_Skeleton implements CameraCallback {
 
        private CameraCallback mainObj;
-       private int objectId = 0;
+       private int objectId = 3;
        // Communications and synchronizations
        private IoTRMIComm rmiComm;
        private AtomicBoolean didAlreadyInitWaitInvoke;
        private AtomicBoolean methodReceived;
        private byte[] methodBytes = null;
        // Permissions
-       private final static int object0Id = 0; //CameraSmartCallback
-       private static Integer[] object0Permission = { 0 };
-       private static List<Integer> set0Allowed;
+       private static Integer[] object3Permission = { 0 };
+       private static List<Integer> set3Allowed;
        
 
        public CameraCallback_Skeleton(CameraCallback _mainObj, int _portSend, int _portRecv) throws Exception {
                mainObj = _mainObj;
                rmiComm = new IoTRMICommServer(_portSend, _portRecv);
-               set0Allowed = new ArrayList<Integer>(Arrays.asList(object0Permission));
+               set3Allowed = new ArrayList<Integer>(Arrays.asList(object3Permission));
                IoTRMIUtil.mapSkel.put(_mainObj, this);
                IoTRMIUtil.mapSkelId.put(_mainObj, objectId);
                didAlreadyInitWaitInvoke = new AtomicBoolean(false);
@@ -56,7 +55,7 @@ public class CameraCallback_Skeleton implements CameraCallback {
                mainObj = _mainObj;
                rmiComm = _rmiComm;
                objectId = _objectId;
-               set0Allowed = new ArrayList<Integer>(Arrays.asList(object0Permission));
+               set3Allowed = new ArrayList<Integer>(Arrays.asList(object3Permission));
                didAlreadyInitWaitInvoke = new AtomicBoolean(false);
                methodReceived = new AtomicBoolean(false);
                rmiComm.registerSkeleton(objectId, methodReceived);
@@ -88,7 +87,7 @@ public class CameraCallback_Skeleton implements CameraCallback {
                        int _objectId = IoTRMIComm.getObjectId(methodBytes);
                        int methodId = IoTRMIComm.getMethodId(methodBytes);
                        if (_objectId == objectId) {
-                               if (!set0Allowed.contains(methodId)) {
+                               if (!set3Allowed.contains(methodId)) {
                                        throw new Error("Object with object Id: " + _objectId + "  is not allowed to access method: " + methodId);
                                }
                        }