Merge tag 'v2.3.28' into testing
[lgpl/argeo-commons.git] / org.argeo.init / src / org / argeo / internal / init / InternalState.java
diff --git a/org.argeo.init/src/org/argeo/internal/init/InternalState.java b/org.argeo.init/src/org/argeo/internal/init/InternalState.java
new file mode 100644 (file)
index 0000000..03ab750
--- /dev/null
@@ -0,0 +1,21 @@
+package org.argeo.internal.init;
+
+import org.argeo.api.init.RuntimeContext;
+
+/**
+ * Keep track of the internal state mostly with static variables, typically in
+ * order to synchronise shutdown.
+ */
+public class InternalState {
+       private static RuntimeContext mainRuntimeContext;
+
+       /** The root runtime context in this JVM. */
+       public static RuntimeContext getMainRuntimeContext() {
+               return mainRuntimeContext;
+       }
+
+       public static void setMainRuntimeContext(RuntimeContext mainRuntimeContext) {
+               InternalState.mainRuntimeContext = mainRuntimeContext;
+       }
+
+}