1 package iotrmi.Java.sample;
3 import java.io.IOException;
4 import iotrmi.Java.IoTRMICall;
6 public class CallBack_Stub implements CallBackInterface {
11 private IoTRMICall rmiCall;
13 private int objectId = 0; // Default value is 0
18 public CallBack_Stub(int _port, String _address, int _rev) throws IOException {
20 rmiCall = new IoTRMICall(_port, _address, _rev);
24 public int printInt() {
27 Class<?> retType = int.class;
28 Class<?>[] paramCls = new Class<?>[] { };
29 Object[] paramObj = new Object[] { };
30 Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
35 public void setInt(int _i) {
38 Class<?> retType = void.class;
39 Class<?>[] paramCls = new Class<?>[] { int.class };
40 Object[] paramObj = new Object[] { _i };
41 rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
45 public static void main(String[] args) throws Exception {
48 String address = "localhost";
51 CallBack_Stub cbstub = new CallBack_Stub(port, address, rev);