f3696e40ef1404e3575afe73149d1234048cd077
[iot2.git] / benchmarks / IrrigationController / WeatherGatewayCallback_CallbackSkeleton.java
1 package IrrigationController;
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 WeatherGatewayCallback_CallbackSkeleton implements WeatherGatewayCallback {
13
14         private WeatherGatewayCallback mainObj;
15         private int objectId = 0;
16         private String callbackAddress;
17         
18
19         public WeatherGatewayCallback_CallbackSkeleton(WeatherGatewayCallback _mainObj, String _callbackAddress, int _objectId) throws Exception {
20                 callbackAddress = _callbackAddress;
21                 mainObj = _mainObj;
22                 objectId = _objectId;
23         }
24
25         public void informationRetrieved(double _inchesPerWeek, int _weatherZipCode, int _daysToWaterOn, double _inchesPerMinute) {
26                 mainObj.informationRetrieved(_inchesPerWeek, _weatherZipCode, _daysToWaterOn, _inchesPerMinute);
27         }
28
29         public void ___informationRetrieved(IoTRMIObject rmiObj) {
30                 Object[] paramObj = rmiObj.getMethodParams(new Class<?>[] { double.class, int.class, int.class, double.class }, 
31                 new Class<?>[] { null, null, null, null });
32                 informationRetrieved((double) paramObj[0], (int) paramObj[1], (int) paramObj[2], (double) paramObj[3]);
33         }
34
35         public void invokeMethod(IoTRMIObject rmiObj) throws IOException {
36                 int methodId = rmiObj.getMethodId();
37                 switch (methodId) {
38                         case 0: ___informationRetrieved(rmiObj); break;
39                         default: 
40                         throw new Error("Method Id " + methodId + " not recognized!");
41                 }
42         }
43
44 }