From b6effa890ccb61eb4b7a82f0dd7493cac354ef49 Mon Sep 17 00:00:00 2001 From: rtrimana Date: Thu, 27 Oct 2016 12:14:35 -0700 Subject: [PATCH] Completing stub and skeleton sides' APIs; Adding tests for C++ side; Still need to refactor non-primitive data types handling --- iotjava/Makefile | 8 +- iotjava/iotrmi/C++/IoTRMICall.hpp | 12 +- iotjava/iotrmi/C++/IoTRMIObject.hpp | 11 +- iotjava/iotrmi/C++/IoTRMIUtil.hpp | 13 +- iotjava/iotrmi/C++/sample/TestClass.cpp | 23 +++ iotjava/iotrmi/C++/{ => sample}/TestClass.hpp | 11 +- .../iotrmi/C++/sample/TestClassInterface.hpp | 17 +++ .../iotrmi/C++/sample/TestClass_Skeleton.cpp | 18 +++ .../iotrmi/C++/sample/TestClass_Skeleton.hpp | 131 ++++++++++++++++ iotjava/iotrmi/C++/sample/TestClass_Stub.cpp | 28 ++++ iotjava/iotrmi/C++/sample/TestClass_Stub.hpp | 144 ++++++++++++++++++ iotjava/iotrmi/Java/sample/TestClass.java | 2 +- .../Java/sample/TestClassInterface.java | 15 ++ .../iotrmi/Java/sample/TestClass_Stub.java | 4 +- 14 files changed, 416 insertions(+), 21 deletions(-) create mode 100644 iotjava/iotrmi/C++/sample/TestClass.cpp rename iotjava/iotrmi/C++/{ => sample}/TestClass.hpp (85%) create mode 100644 iotjava/iotrmi/C++/sample/TestClassInterface.hpp create mode 100644 iotjava/iotrmi/C++/sample/TestClass_Skeleton.cpp create mode 100644 iotjava/iotrmi/C++/sample/TestClass_Skeleton.hpp create mode 100644 iotjava/iotrmi/C++/sample/TestClass_Stub.cpp create mode 100644 iotjava/iotrmi/C++/sample/TestClass_Stub.hpp create mode 100644 iotjava/iotrmi/Java/sample/TestClassInterface.java diff --git a/iotjava/Makefile b/iotjava/Makefile index 7522db0..4f53798 100644 --- a/iotjava/Makefile +++ b/iotjava/Makefile @@ -37,8 +37,12 @@ rmi: mkdir -p $(BIN_DIR)/iotrmi/C++ #$(G++) iotrmi/C++/IoTSocketServer.cpp -o $(BIN_DIR)/iotrmi/C++/IoTSocketServer.out #$(G++) iotrmi/C++/IoTSocketClient.cpp -o $(BIN_DIR)/iotrmi/C++/IoTSocketClient.out - $(G++) iotrmi/C++/IoTRMICall.cpp -o $(BIN_DIR)/iotrmi/C++/IoTRMICall.out --std=c++11 - $(G++) iotrmi/C++/IoTRMIObject.cpp -o $(BIN_DIR)/iotrmi/C++/IoTRMIObject.out --std=c++11 + #$(G++) iotrmi/C++/IoTRMICall.cpp -o $(BIN_DIR)/iotrmi/C++/IoTRMICall.out --std=c++11 + #$(G++) iotrmi/C++/IoTRMIObject.cpp -o $(BIN_DIR)/iotrmi/C++/IoTRMIObject.out --std=c++11 + mkdir -p $(BIN_DIR)/iotrmi/C++/sample + $(G++) iotrmi/C++/sample/TestClass.cpp -o $(BIN_DIR)/iotrmi/C++/sample/TestClass.out --std=c++11 + $(G++) iotrmi/C++/sample/TestClass_Stub.cpp -o $(BIN_DIR)/iotrmi/C++/sample/TestClass_Stub.out --std=c++11 + $(G++) iotrmi/C++/sample/TestClass_Skeleton.cpp -o $(BIN_DIR)/iotrmi/C++/sample/TestClass_Skeleton.out --std=c++11 PHONY += run-rmiserver run-rmiserver: diff --git a/iotjava/iotrmi/C++/IoTRMICall.hpp b/iotjava/iotrmi/C++/IoTRMICall.hpp index 8503cdf..eb767dd 100644 --- a/iotjava/iotrmi/C++/IoTRMICall.hpp +++ b/iotjava/iotrmi/C++/IoTRMICall.hpp @@ -90,7 +90,7 @@ void* IoTRMICall::remoteCall(string methodSign, string retType, string paramCls[ int retLen = 0; char* retObjBytes = NULL; retObjBytes = rmiClient->receiveBytes(retObjBytes, &retLen); - retObj = IoTRMIUtil::getParamObject(retObj, retType.c_str(), retObjBytes); + retObj = IoTRMIUtil::getParamObject(retObj, retType.c_str(), retObjBytes, retLen); } return retObj; @@ -110,6 +110,11 @@ int IoTRMICall::methodLength(string paramCls[], void* paramObj[], int numParam) if (paramCls[i].compare("string") == 0) { // Get the length of the string through void* casting to string* paramLen = (*(string*)paramObj[i]).length(); + } else if (paramCls[i].compare("string[]") == 0) { + paramLen = IoTRMIUtil::getByteStringLength(*(vector*) paramObj[i]); + } else { + string error = "IoTRMICall: Unrecognizable type: " + paramCls[i]; + throw error; } // Some space for param length, i.e. 32 bits for integer methodLen = methodLen + IoTRMIUtil::PARAM_LEN; @@ -139,6 +144,11 @@ char* IoTRMICall::methodToBytes(string methodSign, string paramCls[], if (paramCls[i].compare("string") == 0) { // Get the length of the string through void* casting to string* paramLen = (*(string*)paramObj[i]).length(); + } else if (paramCls[i].compare("string[]") == 0) { + paramLen = IoTRMIUtil::getByteStringLength(*(vector*) paramObj[i]); + } else { + string error = "IoTRMICall: Unrecognizable type: " + paramCls[i]; + throw error; } // Write the parameter length char prmLenBytes[IoTRMIUtil::METHOD_ID_LEN]; diff --git a/iotjava/iotrmi/C++/IoTRMIObject.hpp b/iotjava/iotrmi/C++/IoTRMIObject.hpp index a6e4cb1..a512dd2 100644 --- a/iotjava/iotrmi/C++/IoTRMIObject.hpp +++ b/iotjava/iotrmi/C++/IoTRMIObject.hpp @@ -92,6 +92,11 @@ void IoTRMIObject::sendReturnObj(void* retObj, string type) { if (type.compare("string") == 0) { // Get the length of the string through void* casting to string* retLen = (*(string*)retObj).length(); + } else if (type.compare("string[]") == 0) { + retLen = IoTRMIUtil::getByteStringLength(*(vector*) retObj); + } else { + string error = "IoTRMICall: Unrecognizable type: " + type; + throw error; } } // Need object bytes variable @@ -107,7 +112,6 @@ void IoTRMIObject::getMethodBytes() { // Get method in bytes and update method length methodBytes = rmiServer->receiveBytes(methodBytes, &methodLen); fflush(NULL); - IoTRMIUtil::printBytes(methodBytes, methodLen, false); } @@ -120,7 +124,6 @@ string IoTRMIObject::getSignature() { // Get method object int methodId = 0; IoTRMIUtil::byteArrayToInt(&methodId, methodIdBytes); - cout << "Method Id: " << methodId << endl; return mapHash2Sign.find(methodId)->second; } @@ -138,7 +141,6 @@ void** IoTRMIObject::getMethodParams(string paramCls[], int numParam, void* para // Byte scanning position int pos = IoTRMIUtil::METHOD_ID_LEN; for (int i = 0; i < numParam; i++) { - int paramLen = rmiUtil->getTypeSize(paramCls[i]); // Get the 32-bit field in the byte array to get the actual // length (this is a param with indefinite length) @@ -152,8 +154,7 @@ void** IoTRMIObject::getMethodParams(string paramCls[], int numParam, void* para char paramBytes[paramLen]; memcpy(paramBytes, methodBytes + pos, paramLen); pos = pos + paramLen; - paramObj[i] = IoTRMIUtil::getParamObject(paramObj[i], paramCls[i].c_str(), paramBytes); - + paramObj[i] = IoTRMIUtil::getParamObject(paramObj[i], paramCls[i].c_str(), paramBytes, paramLen); } // Delete methodBytes delete[] methodBytes; diff --git a/iotjava/iotrmi/C++/IoTRMIUtil.hpp b/iotjava/iotrmi/C++/IoTRMIUtil.hpp index c083a37..50e43bb 100644 --- a/iotjava/iotrmi/C++/IoTRMIUtil.hpp +++ b/iotjava/iotrmi/C++/IoTRMIUtil.hpp @@ -62,7 +62,7 @@ class IoTRMIUtil { static string* byteArrayToString(string* result, char* bytes, int len); // Get parameter object from byte array - static void* getParamObject(void* retObj, const char* type, char* paramBytes); + static void* getParamObject(void* retObj, const char* type, char* paramBytes, int len); static char* getObjectBytes(char* retObjBytes, void* obj, const char* type); // Arrays to bytes @@ -87,7 +87,7 @@ class IoTRMIUtil { // Aggregator functions static char* getArrayObjectBytes(char* retObjBytes, void* obj, const char* type); - static void* getParamObject(void* retObj, const char* type, char* paramBytes, int len); + static void* getArrayParamObject(void* retObj, const char* type, char* paramBytes, int len); // Constants const static int METHOD_ID_LEN = 4; // 4 bytes = 32 bits @@ -204,7 +204,7 @@ int IoTRMIUtil::getByteStringLength(vector arrString) { // **************************** // Getting parameter object based on received byte array -void* IoTRMIUtil::getParamObject(void* retObj, const char* type, char* paramBytes) { +void* IoTRMIUtil::getParamObject(void* retObj, const char* type, char* paramBytes, int len) { if (strcmp(type, "b") == 0 || strcmp(type, "byte") == 0) { @@ -232,7 +232,10 @@ void* IoTRMIUtil::getParamObject(void* retObj, const char* type, char* paramByte retObj = (void*) byteArrayToChar((char*) retObj, paramBytes); } else if ( strcmp(type, "Ss") == 0 || strcmp(type, "string") == 0) { - retObj = (void*) byteArrayToString((string*) retObj, paramBytes); + retObj = (void*) byteArrayToString((string*) retObj, paramBytes, len); + } else if ( string(type).find("[]") != string::npos) { + // This is an array type, i.e. vector + retObj = getArrayParamObject(retObj, type, paramBytes, len); } else { string error = "IoTRMIUtil: Unrecognizable type: " + string(type); throw error; @@ -243,7 +246,7 @@ void* IoTRMIUtil::getParamObject(void* retObj, const char* type, char* paramByte // Get array of objects from byte array - overload getParamObject function -void* IoTRMIUtil::getParamObject(void* retObj, const char* type, char* paramBytes, int len) { +void* IoTRMIUtil::getArrayParamObject(void* retObj, const char* type, char* paramBytes, int len) { if (strcmp(type, "byte[]") == 0) { retObj = (vector*) paramBytes; diff --git a/iotjava/iotrmi/C++/sample/TestClass.cpp b/iotjava/iotrmi/C++/sample/TestClass.cpp new file mode 100644 index 0000000..b70d237 --- /dev/null +++ b/iotjava/iotrmi/C++/sample/TestClass.cpp @@ -0,0 +1,23 @@ +#include +#include +#include "TestClass.hpp" + +using namespace std; + +int main(int argc, char *argv[]) +{ + + TestClassInterface *tc = new TestClass(); + cout << "Return value: " << tc->setAndGetA(123) << endl; + cout << "Return value: " << tc->setACAndGetA("string", 123) << endl; + vector input; + input.push_back("123"); + input.push_back("456"); + input.push_back("987"); + + cout << "Return value: " << tc->sumArray(input) << endl; + + delete tc; + + return 0; +} diff --git a/iotjava/iotrmi/C++/TestClass.hpp b/iotjava/iotrmi/C++/sample/TestClass.hpp similarity index 85% rename from iotjava/iotrmi/C++/TestClass.hpp rename to iotjava/iotrmi/C++/sample/TestClass.hpp index 8d3a3c9..975481a 100644 --- a/iotjava/iotrmi/C++/TestClass.hpp +++ b/iotjava/iotrmi/C++/sample/TestClass.hpp @@ -1,17 +1,18 @@ #include +#include "TestClassInterface.hpp" using namespace std; -class TestClass { +class TestClass : public TestClassInterface { public: TestClass(); TestClass(int _int, float _float, string _string); - ~TestClass(); + //~TestClass(); void setA(int _int); void setB(float _float); void setC(string _string); - string sumArray(const string newA[]); + string sumArray(vector newA); int setAndGetA(int newA); int setACAndGetA(string newC, int newA); //void registerCallback(CallBackInterface _cb); @@ -62,10 +63,10 @@ void TestClass::setC(string _string) { } -string TestClass::sumArray(const string newA[]) { +string TestClass::sumArray(vector newA) { string sum = ""; - int len = sizeof(newA) / sizeof(string); + int len = newA.size(); for(int c = 0; c < len; c++) { sum = sum + newA[c]; } diff --git a/iotjava/iotrmi/C++/sample/TestClassInterface.hpp b/iotjava/iotrmi/C++/sample/TestClassInterface.hpp new file mode 100644 index 0000000..0f05a93 --- /dev/null +++ b/iotjava/iotrmi/C++/sample/TestClassInterface.hpp @@ -0,0 +1,17 @@ +#include +#include + +using namespace std; + +class TestClassInterface { + public: + virtual void setA(int _int) = 0; + virtual void setB(float _float) = 0; + virtual void setC(string _string) = 0; + virtual string sumArray(vector newA) = 0; + virtual int setAndGetA(int newA) = 0; + virtual int setACAndGetA(string newC, int newA) = 0; + //virtual void registerCallback(CallBackInterface _cb); + //virtual int callBack(); +}; + diff --git a/iotjava/iotrmi/C++/sample/TestClass_Skeleton.cpp b/iotjava/iotrmi/C++/sample/TestClass_Skeleton.cpp new file mode 100644 index 0000000..23079c8 --- /dev/null +++ b/iotjava/iotrmi/C++/sample/TestClass_Skeleton.cpp @@ -0,0 +1,18 @@ +#include +#include +#include "TestClass_Skeleton.hpp" + +using namespace std; + +int main(int argc, char *argv[]) +{ + + int port = 5010; + TestClassInterface *tc = new TestClass(3, 5.0, "7911"); + TestClass_Skeleton *tcSkel = new TestClass_Skeleton(tc, port); + tcSkel->waitRequestInvokeMethod(); + + delete tc; + delete tcSkel; + return 0; +} diff --git a/iotjava/iotrmi/C++/sample/TestClass_Skeleton.hpp b/iotjava/iotrmi/C++/sample/TestClass_Skeleton.hpp new file mode 100644 index 0000000..95afe9b --- /dev/null +++ b/iotjava/iotrmi/C++/sample/TestClass_Skeleton.hpp @@ -0,0 +1,131 @@ +#include +#include "../IoTRMIObject.hpp" +#include "TestClass.hpp" + +using namespace std; + +class TestClass_Skeleton { + public: + TestClass_Skeleton(TestClassInterface* _tc, int _port); + ~TestClass_Skeleton(); + + void waitRequestInvokeMethod(); + + private: + TestClassInterface *tc; + IoTRMIObject *rmiObj; + //CallBackInterface cbstub; + + const static int size = 8; + string methodSignatures[size] = { + + "voidsetA(int)", + "voidsetB(float)", + "voidsetC(string)", + "sumArray(string[])", + "intsetAndGetA(int)", + "intsetACAndGetA(string,int)", + "intcallBack()", + "voidregisterCallBack(CallBackInterface)" + }; +}; + + +TestClass_Skeleton::TestClass_Skeleton(TestClassInterface* _tc, int _port) { + + bool _bResult = false; + tc = _tc; + rmiObj = new IoTRMIObject(_port, &_bResult, methodSignatures, size); +} + + +TestClass_Skeleton::~TestClass_Skeleton() { + + if (rmiObj != NULL) { + delete rmiObj; + rmiObj = NULL; + } +} + + +void TestClass_Skeleton::waitRequestInvokeMethod() { + + // Loop continuously waiting for incoming bytes + while (true) { + + rmiObj->getMethodBytes(); + string methodSign = rmiObj->getSignature(); + cout << "Method sign: " << methodSign << endl; + + if (methodSign.compare("voidsetA(int)") == 0) { + string paramCls[] = { "int" }; + int numParam = 1; + int param1 = 0; + void* paramObj[] = { ¶m1 }; + rmiObj->getMethodParams(paramCls, numParam, paramObj); + tc->setA(param1); + } else if (methodSign.compare("voidsetB(float)") == 0) { + string paramCls[] = { "float" }; + int numParam = 1; + float param1 = 0.0; + void* paramObj[] = { ¶m1 }; + rmiObj->getMethodParams(paramCls, numParam, paramObj); + tc->setB(param1); + } else if (methodSign.compare("voidsetC(string)") == 0) { + string paramCls[] = { "string" }; + int numParam = 1; + string param1 = ""; + void* paramObj[] = { ¶m1 }; + rmiObj->getMethodParams(paramCls, numParam, paramObj); + tc->setC(param1); + } else if (methodSign.compare("sumArray(string[])") == 0) { + string paramCls[] = { "string[]" }; + int numParam = 1; + vector param1; + void* paramObj[] = { ¶m1 }; + rmiObj->getMethodParams(paramCls, numParam, paramObj); + string retVal = tc->sumArray(param1); + void* retObj = &retVal; + rmiObj->sendReturnObj(retObj, "string"); + } else if (methodSign.compare("intsetAndGetA(int)") == 0) { + string paramCls[] = { "int" }; + int numParam = 1; + int param1 = 0; + void* paramObj[] = { ¶m1 }; + rmiObj->getMethodParams(paramCls, numParam, paramObj); + int retVal = tc->setAndGetA(param1); + void* retObj = &retVal; + rmiObj->sendReturnObj(retObj, "int"); + } else if (methodSign.compare("intsetACAndGetA(string,int)") == 0) { + string paramCls[] = { "string", "int" }; + int numParam = 2; + string param1 = ""; + int param2 = 0; + void* paramObj[] = { ¶m1, ¶m2 }; + rmiObj->getMethodParams(paramCls, numParam, paramObj); + int retVal = tc->setACAndGetA(param1, param2); + void* retObj = &retVal; + rmiObj->sendReturnObj(retObj, "int"); + /*} else if (methodSign.compare("voidregisterCallBack(CallBackInterface)") == 0) { + // + } else if (methodSign.compare("intcallBack()") == 0) { + //*/ + } else { + string error = "Signature unreqcognized: " + string(methodSign); + throw error; + } + } +} + + +/*void TestClass_Stub::registerCallback(CallBackInterface _cb) { + + cb = _cb; +} + + +int TestClass_Stub::callBack() { + + return cb.printInt(); +}*/ + diff --git a/iotjava/iotrmi/C++/sample/TestClass_Stub.cpp b/iotjava/iotrmi/C++/sample/TestClass_Stub.cpp new file mode 100644 index 0000000..77cea16 --- /dev/null +++ b/iotjava/iotrmi/C++/sample/TestClass_Stub.cpp @@ -0,0 +1,28 @@ +#include +#include +#include "TestClass_Stub.hpp" + +using namespace std; + +int main(int argc, char *argv[]) +{ + + int port = 5010; + const char* address = "localhost"; + int rev = 0; + bool bResult = false; + + TestClassInterface *tcStub = new TestClass_Stub(port, address, rev, &bResult); + cout << "Return value: " << tcStub->setAndGetA(123) << endl; + cout << "Return value: " << tcStub->setACAndGetA("string", 123) << endl; + vector input; + input.push_back("123"); + input.push_back("456"); + input.push_back("987"); + + cout << "Return value: " << tcStub->sumArray(input) << endl; + + delete tcStub; + + return 0; +} diff --git a/iotjava/iotrmi/C++/sample/TestClass_Stub.hpp b/iotjava/iotrmi/C++/sample/TestClass_Stub.hpp new file mode 100644 index 0000000..057643d --- /dev/null +++ b/iotjava/iotrmi/C++/sample/TestClass_Stub.hpp @@ -0,0 +1,144 @@ +#include +#include "../IoTRMICall.hpp" +#include "TestClassInterface.hpp" + +using namespace std; + +class TestClass_Stub : public TestClassInterface { + public: + TestClass_Stub(); + TestClass_Stub(int _port, const char* _address, int _rev, bool* _bResult); + ~TestClass_Stub(); + + void setA(int _int); + void setB(float _float); + void setC(string _string); + string sumArray(vector newA); + int setAndGetA(int newA); + int setACAndGetA(string newC, int newA); + //void registerCallback(CallBackInterface _cb); + //int callBack(); + + private: + int intA; + float floatB; + string stringC; + //CallBackInterface cb; + IoTRMICall *rmiCall; + string address; + //vector ports; +}; + + +TestClass_Stub::TestClass_Stub() { + + address = ""; + rmiCall = NULL; +} + + +TestClass_Stub::TestClass_Stub(int _port, const char* _address, int _rev, bool* _bResult) { + + address = _address; + rmiCall = new IoTRMICall(_port, _address, _rev, _bResult); +} + + +TestClass_Stub::~TestClass_Stub() { + + if (rmiCall != NULL) { + delete rmiCall; + rmiCall = NULL; + } +} + + +void TestClass_Stub::setA(int _int) { + + int numParam = 1; + string sign = "voidsetA(int)"; + string retType = "void"; + string paramCls[] = { "int" }; + void* paramObj[] = { &_int }; + void* retObj = NULL; + rmiCall->remoteCall(sign, retType, paramCls, paramObj, numParam, retObj); +} + + +void TestClass_Stub::setB(float _float) { + + int numParam = 1; + string sign = "voidsetB(float)"; + string retType = "void"; + string paramCls[] = { "float" }; + void* paramObj[] = { &_float }; + void* retObj = NULL; + rmiCall->remoteCall(sign, retType, paramCls, paramObj, numParam, retObj); +} + + +void TestClass_Stub::setC(string _string) { + + int numParam = 1; + string sign = "voidsetC(string)"; + string retType = "void"; + string paramCls[] = { "string" }; + void* paramObj[] = { &_string }; + void* retObj = NULL; + rmiCall->remoteCall(sign, retType, paramCls, paramObj, numParam, retObj); +} + + +string TestClass_Stub::sumArray(vector newA) { + + int numParam = 1; + string sign = "sumArray(string[])"; + string retType = "string"; + string paramCls[] = { "string[]" }; + void* paramObj[] = { &newA }; + string retVal = ""; + void* retObj = &retVal; + rmiCall->remoteCall(sign, retType, paramCls, paramObj, numParam, retObj); + return retVal; +} + + +int TestClass_Stub::setAndGetA(int newA) { + + int numParam = 1; + string sign = "intsetAndGetA(int)"; + string retType = "int"; + string paramCls[] = { "int" }; + void* paramObj[] = { &newA }; + int retVal = 0; + void* retObj = &retVal; + rmiCall->remoteCall(sign, retType, paramCls, paramObj, numParam, retObj); + return retVal; +} + + +int TestClass_Stub::setACAndGetA(string newC, int newA) { + + int numParam = 2; + string sign = "intsetACAndGetA(string,int)"; + string retType = "int"; + string paramCls[] = { "string", "int" }; + void* paramObj[] = { &newC, &newA }; + int retVal = 0; + void* retObj = &retVal; + rmiCall->remoteCall(sign, retType, paramCls, paramObj, numParam, retObj); + return retVal; +} + + +/*void TestClass_Stub::registerCallback(CallBackInterface _cb) { + + cb = _cb; +} + + +int TestClass_Stub::callBack() { + + return cb.printInt(); +}*/ + diff --git a/iotjava/iotrmi/Java/sample/TestClass.java b/iotjava/iotrmi/Java/sample/TestClass.java index 1d519dd..dc6f73e 100644 --- a/iotjava/iotrmi/Java/sample/TestClass.java +++ b/iotjava/iotrmi/Java/sample/TestClass.java @@ -2,7 +2,7 @@ package iotrmi.Java.sample; import java.util.Set; -public class TestClass { +public class TestClass implements TestClassInterface { /** * Class Properties diff --git a/iotjava/iotrmi/Java/sample/TestClassInterface.java b/iotjava/iotrmi/Java/sample/TestClassInterface.java new file mode 100644 index 0000000..d41166d --- /dev/null +++ b/iotjava/iotrmi/Java/sample/TestClassInterface.java @@ -0,0 +1,15 @@ +package iotrmi.Java.sample; + +import java.util.Set; + +public interface TestClassInterface { + + public void setA(int _int); + public void setB(float _float); + public void setC(String _string); + public String sumArray(String[] newA); + public int setAndGetA(int newA); + public int setACAndGetA(String newC, int newA); + public void registerCallback(CallBackInterface _cb); + public int callBack(); +} diff --git a/iotjava/iotrmi/Java/sample/TestClass_Stub.java b/iotjava/iotrmi/Java/sample/TestClass_Stub.java index a57f036..39411a7 100644 --- a/iotjava/iotrmi/Java/sample/TestClass_Stub.java +++ b/iotjava/iotrmi/Java/sample/TestClass_Stub.java @@ -6,7 +6,7 @@ import iotruntime.master.CommunicationHandler; import java.util.Arrays; -public class TestClass_Stub { +public class TestClass_Stub implements TestClassInterface { /** * Class Properties @@ -40,7 +40,7 @@ public class TestClass_Stub { } - private void registerCallback(CallBackInterface _cb) { + public void registerCallback(CallBackInterface _cb) { //int port = 5011; // Send this info to the other end to start the stub //String address = "localhost"; -- 2.34.1