Preparing files, stubs, and skeletons for 2nd benchmark
[iot2.git] / benchmarks / IrrigationController / WeatherGatewayCallback_CallbackSkeleton.java
diff --git a/benchmarks/IrrigationController/WeatherGatewayCallback_CallbackSkeleton.java b/benchmarks/IrrigationController/WeatherGatewayCallback_CallbackSkeleton.java
new file mode 100644 (file)
index 0000000..f3696e4
--- /dev/null
@@ -0,0 +1,44 @@
+package IrrigationController;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Arrays;
+import iotrmi.Java.IoTRMICall;
+import iotrmi.Java.IoTRMIObject;
+
+import iotcode.interfaces.*;
+
+public class WeatherGatewayCallback_CallbackSkeleton implements WeatherGatewayCallback {
+
+       private WeatherGatewayCallback mainObj;
+       private int objectId = 0;
+       private String callbackAddress;
+       
+
+       public WeatherGatewayCallback_CallbackSkeleton(WeatherGatewayCallback _mainObj, String _callbackAddress, int _objectId) throws Exception {
+               callbackAddress = _callbackAddress;
+               mainObj = _mainObj;
+               objectId = _objectId;
+       }
+
+       public void informationRetrieved(double _inchesPerWeek, int _weatherZipCode, int _daysToWaterOn, double _inchesPerMinute) {
+               mainObj.informationRetrieved(_inchesPerWeek, _weatherZipCode, _daysToWaterOn, _inchesPerMinute);
+       }
+
+       public void ___informationRetrieved(IoTRMIObject rmiObj) {
+               Object[] paramObj = rmiObj.getMethodParams(new Class<?>[] { double.class, int.class, int.class, double.class }, 
+               new Class<?>[] { null, null, null, null });
+               informationRetrieved((double) paramObj[0], (int) paramObj[1], (int) paramObj[2], (double) paramObj[3]);
+       }
+
+       public void invokeMethod(IoTRMIObject rmiObj) throws IOException {
+               int methodId = rmiObj.getMethodId();
+               switch (methodId) {
+                       case 0: ___informationRetrieved(rmiObj); break;
+                       default: 
+                       throw new Error("Method Id " + methodId + " not recognized!");
+               }
+       }
+
+}