Adding Java Checker Framework checker option in the makefiles; basically this is...
[iot2.git] / benchmarks / Java / HomeSecurityController / CameraCallback_CallbackSkeleton.java
1 package HomeSecurityController;
2
3 import java.io.IOException;
4 import java.util.List;
5 import java.util.ArrayList;
6 import java.util.Arrays;
7 import iotrmi.Java.IoTRMICall;
8 import iotrmi.Java.IoTRMIObject;
9
10 import iotcode.interfaces.*;
11
12 public class CameraCallback_CallbackSkeleton implements CameraCallback {
13
14         private CameraCallback mainObj;
15         private int objectId = 0;
16         private String callbackAddress;
17         
18
19         public CameraCallback_CallbackSkeleton(CameraCallback _mainObj, String _callbackAddress, int _objectId) throws Exception {
20                 callbackAddress = _callbackAddress;
21                 mainObj = _mainObj;
22                 objectId = _objectId;
23         }
24
25         public void newCameraFrameAvailable(byte latestFrame[], long timeStamp) {
26                 mainObj.newCameraFrameAvailable(latestFrame, timeStamp);
27         }
28
29         public void ___newCameraFrameAvailable(IoTRMIObject rmiObj) {
30                 Object[] paramObj = rmiObj.getMethodParams(new Class<?>[] { byte[].class, long.class }, 
31                 new Class<?>[] { null, null });
32                 newCameraFrameAvailable((byte[]) paramObj[0], (long) paramObj[1]);
33         }
34
35         public void invokeMethod(IoTRMIObject rmiObj) throws IOException {
36                 int methodId = rmiObj.getMethodId();
37                 switch (methodId) {
38                         case 0: ___newCameraFrameAvailable(rmiObj); break;
39                         default: 
40                         throw new Error("Method Id " + methodId + " not recognized!");
41                 }
42         }
43
44 }