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;
12 private String address;
14 private int objectId = 0; // Default value is 0
15 private final static String[] methodSignatures = {
24 public CallBack_CBStub(IoTRMICall _rmiCall, int _objectId, String _address) throws IOException {
32 // Return method signatures
33 public static String[] getMethodSignatures() {
35 return methodSignatures;
39 public int printInt() {
41 String sign = "intprintInt()";
42 Class<?> retType = int.class;
43 Class<?>[] paramCls = new Class<?>[] { };
44 Object[] paramObj = new Object[] { };
45 Object retObj = rmiCall.remoteCall(objectId, sign, retType, null, null, paramCls, paramObj);
50 public void setInt(int _i) {
52 String sign = "voidsetInt(int)";
53 Class<?> retType = void.class;
54 Class<?>[] paramCls = new Class<?>[] { int.class };
55 Object[] paramObj = new Object[] { _i };
56 rmiCall.remoteCall(objectId, sign, retType, null, null, paramCls, paramObj);
60 public static void main(String[] args) throws Exception {
63 String address = "localhost";
66 CallBack_Stub cbstub = new CallBack_Stub(port, address, rev);