1 package iotrmi.Java.sample;
3 import java.io.IOException;
4 import iotrmi.Java.IoTRMICall;
6 public class CallBack_CBStub implements CallBackInterface {
11 private IoTRMICall rmiCall;
13 private int objectId = 0; // Default value is 0
18 public CallBack_CBStub(IoTRMICall _rmiCall, int _objectId) throws IOException {
25 public int printInt() {
28 Class<?> retType = int.class;
29 Class<?>[] paramCls = new Class<?>[] { };
30 Object[] paramObj = new Object[] { };
31 Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
36 public void setInt(int _i) {
39 Class<?> retType = void.class;
40 Class<?>[] paramCls = new Class<?>[] { int.class };
41 Object[] paramObj = new Object[] { _i };
42 rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
46 public static void main(String[] args) throws Exception {
49 String address = "localhost";
52 CallBack_Stub cbstub = new CallBack_Stub(port, address, rev);