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
14 private final static String[] methodSignatures = {
23 public CallBack_Stub(int _port, String _address, int _rev) throws IOException {
25 rmiCall = new IoTRMICall(_port, _address, _rev, methodSignatures);
29 // Return method signatures
30 public static String[] getMethodSignatures() {
32 return methodSignatures;
36 public int printInt() {
38 String sign = "intprintInt()";
39 Class<?> retType = int.class;
40 Class<?>[] paramCls = new Class<?>[] { };
41 Object[] paramObj = new Object[] { };
42 Object retObj = rmiCall.remoteCall(objectId, sign, retType, null, null, paramCls, paramObj);
47 public void setInt(int _i) {
49 String sign = "voidsetInt(int)";
50 Class<?> retType = void.class;
51 Class<?>[] paramCls = new Class<?>[] { int.class };
52 Object[] paramObj = new Object[] { _i };
53 rmiCall.remoteCall(objectId, sign, retType, null, null, paramCls, paramObj);
57 public static void main(String[] args) throws Exception {
60 String address = "localhost";
63 CallBack_Stub cbstub = new CallBack_Stub(port, address, rev);