- int methodId = rmiObj.getMethodId();
- switch (methodId) {
-
- case 0: ___setA(); break;
- case 1: ___setB(); break;
- case 2: ___setC(); break;
- case 3: ___sumArray(); break;
- case 4: ___setAndGetA(); break;
- case 5: ___setACAndGetA(); break;
- case 6: ___callBack(); break;
- case 7: ___registerCallback(); break;
- case 8: ____registerCallback(); break;
- // Special option to register callback
- case 9: ___regCB(); break;
- // Struct handling (3 is the size of the struct)
- case 10: ___handleStruct(structSize1); break;
- case 11: structSize1 = ___structSize(); break;
- case 12: ___handleEnum(); break;
- default:
- throw new Error("Method Id not recognized!");
- }
+ // Complain if the method is not allowed
+ if (!set0Allowed.contains(methodId))
+ throw new Error("TestClass_Skeleton: This object is not allowed to access method " + methodId);
+ // If we have more than 1 object Id...
+ //else if (_objectId == object1Id) {
+
+ } else
+ throw new Error("TestClass_Skeleton: Unrecognizable object Id: " + _objectId);
+
+ switch (methodId) {
+
+ case 0: ___setA(); break;
+ case 1: ___setB(); break;
+ case 2: ___setC(); break;
+ case 3: ___sumArray(); break;
+ case 4: ___setAndGetA(); break;
+ case 5: ___setACAndGetA(); break;
+ case 6: ___callBack(); break;
+ case 7: ___registerCallback(); break;
+ case 8: ____registerCallback(); break;
+ // Special option to register callback
+ case 9: ___regCB(); break;
+ // Struct handling (3 is the size of the struct)
+ case 10: ___handleStruct(structSize1); break;
+ case 11: structSize1 = ___structSize(); break;
+ case 12: ___handleEnum(); break;
+ default:
+ throw new Error("Method Id " + methodId + " not recognized!");