import java.util.List;
import java.util.ArrayList;
import java.util.Arrays;
-import iotrmi.Java.IoTRMICall;
-import iotrmi.Java.IoTRMIObject;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.concurrent.atomic.AtomicBoolean;
+import iotrmi.Java.IoTRMIComm;
+import iotrmi.Java.IoTRMICommClient;
+import iotrmi.Java.IoTRMICommServer;
+import iotrmi.Java.IoTRMIUtil;
import iotcode.interfaces.*;
public class LawnSmart_Stub implements LawnSmart {
- private IoTRMICall rmiCall;
- private String callbackAddress;
- private int[] ports;
-
- private final static int objectId = 0;
+ private int objectId = 1;
+ private IoTRMIComm rmiComm;
+ // Synchronization variables
- public LawnSmart_Stub(int _port, String _skeletonAddress, String _callbackAddress, int _rev, int[] _ports) throws Exception {
- callbackAddress = _callbackAddress;
- ports = _ports;
- rmiCall = new IoTRMICall(_port, _skeletonAddress, _rev);
+ public LawnSmart_Stub(int _localPortSend, int _localPortRecv, int _portSend, int _portRecv, String _skeletonAddress, int _rev) throws Exception {
+ if (_localPortSend != 0 && _localPortRecv != 0) {
+ rmiComm = new IoTRMICommClient(_localPortSend, _localPortRecv, _portSend, _portRecv, _skeletonAddress, _rev);
+ } else
+ {
+ rmiComm = new IoTRMICommClient(_portSend, _portRecv, _skeletonAddress, _rev);
+ }
+ IoTRMIUtil.mapStub.put(objectId, this);
+ }
+
+ public LawnSmart_Stub(IoTRMIComm _rmiComm, int _objectId) throws Exception {
+ rmiComm = _rmiComm;
+ objectId = _objectId;
}
}