Updating stubs and skeletons for the second benchmark and drivers; tested the second...
[iot2.git] / benchmarks / drivers / Java / WeatherPhoneGateway / WeatherGatewaySmartCallback_Stub.java
1 package iotcode.WeatherPhoneGateway;
2
3 import java.io.IOException;
4 import java.util.List;
5 import java.util.ArrayList;
6 import java.util.Arrays;
7 import java.util.Map;
8 import java.util.HashMap;
9 import java.util.concurrent.atomic.AtomicBoolean;
10 import iotrmi.Java.IoTRMIComm;
11 import iotrmi.Java.IoTRMICommClient;
12 import iotrmi.Java.IoTRMICommServer;
13 import iotrmi.Java.IoTRMIUtil;
14
15 import iotcode.interfaces.*;
16
17 public class WeatherGatewaySmartCallback_Stub implements WeatherGatewaySmartCallback {
18
19         private int objectId = 4;
20         private IoTRMIComm rmiComm;
21         // Synchronization variables
22         
23
24         public WeatherGatewaySmartCallback_Stub(int _localPortSend, int _localPortRecv, int _portSend, int _portRecv, String _skeletonAddress, int _rev) throws Exception {
25                 if (_localPortSend != 0 && _localPortRecv != 0) {
26                         rmiComm = new IoTRMICommClient(_localPortSend, _localPortRecv, _portSend, _portRecv, _skeletonAddress, _rev);
27                 } else
28                 {
29                         rmiComm = new IoTRMICommClient(_portSend, _portRecv, _skeletonAddress, _rev);
30                 }
31                 IoTRMIUtil.mapStub.put(objectId, this);
32         }
33
34         public WeatherGatewaySmartCallback_Stub(IoTRMIComm _rmiComm, int _objectId) throws Exception {
35                 rmiComm = _rmiComm;
36                 objectId = _objectId;
37         }
38
39         public void informationRetrieved(double _inchesPerWeek, int _weatherZipCode, int _daysToWaterOn, double _inchesPerMinute) {
40                 int methodId = 0;
41                 Class<?> retType = void.class;
42                 Class<?>[] paramCls = new Class<?>[] { double.class, int.class, int.class, double.class };
43                 Object[] paramObj = new Object[] { _inchesPerWeek, _weatherZipCode, _daysToWaterOn, _inchesPerMinute };
44                 rmiComm.remoteCall(objectId, methodId, paramCls, paramObj);
45         }
46
47 }