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
14 private final static String[] methodSignatures = {
23 public CallBack_CBStub(IoTRMICall _rmiCall, int _objectId) throws IOException {
30 // Return method signatures
31 public static String[] getMethodSignatures() {
33 return methodSignatures;
37 public int printInt() {
39 String sign = "intprintInt()";
40 Class<?> retType = int.class;
41 Class<?>[] paramCls = new Class<?>[] { };
42 Object[] paramObj = new Object[] { };
43 Object retObj = rmiCall.remoteCall(objectId, sign, retType, null, null, paramCls, paramObj);
48 public void setInt(int _i) {
50 String sign = "voidsetInt(int)";
51 Class<?> retType = void.class;
52 Class<?>[] paramCls = new Class<?>[] { int.class };
53 Object[] paramObj = new Object[] { _i };
54 rmiCall.remoteCall(objectId, sign, retType, null, null, paramCls, paramObj);
58 public static void main(String[] args) throws Exception {
61 String address = "localhost";
64 CallBack_Stub cbstub = new CallBack_Stub(port, address, rev);