- /**
- * HELPER: writeJavaMethodCallbackPermission() writes permission checks in stub for callbacks
- */
- private void writeJavaMethodCallbackPermission(String intface) {
-
- println("int methodId = IoTRMIObject.getMethodId(method);");
- // Get all the different stubs
- Map<String,Set<String>> mapNewIntMethods = mapInt2NewInts.get(intface);
- for (Map.Entry<String,Set<String>> intMeth : mapNewIntMethods.entrySet()) {
- String newIntface = intMeth.getKey();
- int newObjectId = getNewIntfaceObjectId(newIntface);
- println("if (!set" + newObjectId + "Allowed.contains(methodId)) {");
- println("throw new Error(\"Callback object for " + intface + " is not allowed to access method: \" + methodId);");
- println("}");
- }
- }
-
-
- /**
- * HELPER: writeJavaInitCallbackPermission() writes the permission for callback
- */
- private void writeJavaInitCallbackPermission(String intface, InterfaceDecl intDecl, boolean callbackExist) {
-
- if (callbackExist) {
- String method = "___initCallBack()";
- int methodNumId = intDecl.getHelperMethodNumId(method);
- Map<String,Set<String>> mapNewIntMethods = mapInt2NewInts.get(intface);
- for (Map.Entry<String,Set<String>> intMeth : mapNewIntMethods.entrySet()) {
- String newIntface = intMeth.getKey();
- int newObjectId = getNewIntfaceObjectId(newIntface);
- println("set" + newObjectId + "Allowed.add(" + methodNumId + ");");
- }
- }
- }
-
-