]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db/src/org/simantics/db/DevelopmentKeys.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.db / src / org / simantics / db / DevelopmentKeys.java
diff --git a/bundles/org.simantics.db/src/org/simantics/db/DevelopmentKeys.java b/bundles/org.simantics.db/src/org/simantics/db/DevelopmentKeys.java
new file mode 100644 (file)
index 0000000..1a1763d
--- /dev/null
@@ -0,0 +1,69 @@
+package org.simantics.db;\r
+\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.utils.Development;\r
+\r
+public class DevelopmentKeys {\r
+\r
+       final public static String PRINT = "Development.print";\r
+\r
+       final public static String LOGGER_ECHO = trickToInitialize();\r
+       \r
+       final public static String WRITEGRAPH_DEBUG = "WriteGraph.debug";\r
+       final public static String WRITEGRAPH_DEBUG_NAMES = "WriteGraph.debugNames";\r
+       final public static String WRITEGRAPH_DEBUG_STACK = "WriteGraph.debugStack";\r
+\r
+       final public static String WRITEGRAPH_EXCEPTION_STACKTRACES = "WriteGraph.exceptionStacktraces";\r
+       \r
+       final public static String WRITELOGGER_LOG = "WriteLogger.log";\r
+\r
+       final public static String QUERYPROCESSOR_UPDATE = "QueryProcessor.update";\r
+\r
+       final public static String QUERYPROCESSOR_PUT = "QueryProcessor.put";\r
+\r
+       final public static String SESSION_LOG_WRITES = "Session.logWrites";\r
+\r
+       final public static String READGRAPH_COUNT = "ReadGraph.count";\r
+\r
+       final public static String CLUSTERTABLE_VALIDATE_ON_LOAD = "ClusterTable.validateOnLoad";\r
+\r
+       public static void initialize() {\r
+\r
+               if(Development.DEVELOPMENT) {\r
+\r
+                       Development.setProperty(DevelopmentKeys.PRINT, true, Bindings.BOOLEAN);\r
+\r
+                       Development.setProperty(DevelopmentKeys.LOGGER_ECHO, false, Bindings.BOOLEAN);\r
+\r
+                       Development.setProperty(DevelopmentKeys.WRITEGRAPH_DEBUG, false, Bindings.BOOLEAN);\r
+                       Development.setProperty(DevelopmentKeys.WRITEGRAPH_DEBUG_NAMES, false, Bindings.BOOLEAN);\r
+                       Development.setProperty(DevelopmentKeys.WRITEGRAPH_DEBUG_STACK, false, Bindings.BOOLEAN);\r
+\r
+                       Development.setProperty(DevelopmentKeys.WRITEGRAPH_EXCEPTION_STACKTRACES, false, Bindings.BOOLEAN);\r
+\r
+                       Development.setProperty(DevelopmentKeys.READGRAPH_COUNT, false, Bindings.BOOLEAN);\r
+\r
+                       Development.setProperty(DevelopmentKeys.WRITELOGGER_LOG, false, Bindings.BOOLEAN);\r
+\r
+                       Development.setProperty(DevelopmentKeys.QUERYPROCESSOR_UPDATE, false, Bindings.BOOLEAN);\r
+\r
+                       Development.setProperty(DevelopmentKeys.QUERYPROCESSOR_PUT, false, Bindings.BOOLEAN);\r
+\r
+                       Development.setProperty(DevelopmentKeys.SESSION_LOG_WRITES, false, Bindings.BOOLEAN);\r
+                       \r
+                       Development.setProperty(DevelopmentKeys.CLUSTERTABLE_VALIDATE_ON_LOAD, false, Bindings.BOOLEAN);\r
+                       \r
+                       \r
+\r
+               }\r
+\r
+       }\r
+       // This enables to call initialize even if bundle activator is not yet called.\r
+       // This happens when calling from headless junit4 plugin driver and ProCoreServer process does not start.  \r
+       private static String trickToInitialize() {\r
+        return "Logger.echo"; \r
+       }\r
+       static {\r
+        initialize();\r
+       }\r
+}\r