cb = _cb;
objectId = _objectId;
- cout << "Creating CallBack_Skeleton and waiting!" << endl;
}
void CallBack_CBSkeleton::invokeMethod(IoTRMIObject* rmiObj) {
- string methodSign = rmiObj->getSignature();
+ int methodId = rmiObj->getMethodId();
- if (methodSign.compare("intprintInt()") == 0) {
- ___printInt(rmiObj);
- } else if (methodSign.compare("voidsetInt(int)") == 0) {
- ___setInt(rmiObj);
- } else {
- string error = "Signature not recognized: " + string(methodSign);
- throw error;
+ switch (methodId) {
+ case 0 : ___printInt(rmiObj); break;
+ case 1 : ___setInt(rmiObj); break;
+ default:
+ string error = "Method Id not recognized!";
+ throw error;
}
}