OF-1147: Thread safety when modifying admin console

When there are multiple plugins loading at the same time, they can
concurrently attempt to add models to the admin console. To prevent
concurrency issues, those methods are made synchronous.
parent 29ef337f
......@@ -87,7 +87,7 @@ public class AdminConsole {
* @param element the Element
* @throws Exception if an error occurs.
*/
public static void addModel(String name, Element element) throws Exception {
public static synchronized void addModel(String name, Element element) throws Exception {
overrideModels.put(name, element);
rebuildModel();
}
......@@ -97,7 +97,7 @@ public class AdminConsole {
*
* @param name the name.
*/
public static void removeModel(String name) {
public static synchronized void removeModel(String name) {
overrideModels.remove(name);
rebuildModel();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment