1 package SmartLightsController;
3 import java.io.IOException;
5 import java.util.ArrayList;
6 import java.util.Arrays;
7 import iotrmi.Java.IoTRMICall;
8 import iotrmi.Java.IoTRMIObject;
10 import iotcode.interfaces.*;
12 public class CameraCallback_CallbackSkeleton implements CameraCallback {
14 private CameraCallback mainObj;
15 private int objectId = 0;
16 private String callbackAddress;
17 private static int objIdCnt = 0;
18 private IoTRMICall rmiCall;
23 public CameraCallback_CallbackSkeleton(CameraCallback _mainObj, String _callbackAddress, int _objectId) throws Exception {
24 callbackAddress = _callbackAddress;
29 public void newCameraFrameAvailable(CameraSmart _camera) {
30 mainObj.newCameraFrameAvailable(_camera);
33 public void ___regCB(IoTRMIObject rmiObj) throws IOException {
34 Object[] paramObj = rmiObj.getMethodParams(new Class<?>[] { int[].class, String.class, int.class },new Class<?>[] { null, null, null });
35 ports = (int[]) paramObj[0];
36 rmiCall = new IoTRMICall((int) paramObj[0], (String) paramObj[1], ports[1]);
39 public void ___newCameraFrameAvailable(IoTRMIObject rmiObj) {
40 Object[] paramObj = rmiObj.getMethodParams(new Class<?>[] { int.class },
41 new Class<?>[] { null });
43 CameraSmart stub0 = new CameraSmart_CallbackStub(rmiCall, callbackAddress, objIdCnt, ports);
45 newCameraFrameAvailable(stub0);
46 } catch(Exception ex) {
48 throw new Error("Exception from callback object instantiation!");
52 public void invokeMethod(IoTRMIObject rmiObj) throws IOException {
53 int methodId = rmiObj.getMethodId();
55 case 0: ___newCameraFrameAvailable(rmiObj); break;
56 case -9999: ___regCB(rmiObj); break;
58 throw new Error("Method Id " + methodId + " not recognized!");