tmf: Add an ID to each state system that gets built
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / tmf / core / statesystem / StateSystemManager.java
index 41eea8d34975324a72d40261f43e85f18b4765af..f7a62c20434627192d38a7760e3403c484d7e342 100644 (file)
@@ -26,8 +26,8 @@ import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
  * This abstract manager class handles loading or creating state history files
  * for use in TMF's generic state system.
  *
- * @author alexmont
- *
+ * @version 1.0
+ * @author Alexandre Montplaisir
  */
 public abstract class StateSystemManager extends TmfComponent {
 
@@ -48,17 +48,26 @@ public abstract class StateSystemManager extends TmfComponent {
      *            The IStateChangeInput to use for building the history file. It
      *            may be required even if we are opening an already-existing
      *            history (ie, for partial histories).
-     * @param waitForCompletion
-     *            Should we block the calling thread until the construction is
-     *            complete? It has no effect if the file already exists.
+     * @param id
+     *            The ID, or name, to give to the state system we will build.
+     *            The signal that when be sent when the construction is finished
+     *            will carry this ID. It has no effect if the file already
+     *            exists.
+     * @param buildManually
+     *            If false, the construction will wait for a signal before
+     *            starting. If true, it will build everything right now and
+     *            block the caller. It has no effect if the file already exists.
      * @return A IStateSystemQuerier handler to the state system, with which you
      *         can then run queries on the history.
      * @throws TmfTraceException
+     *             If there was a problem reading or writing one of the files.
+     *             See the contents of this exception for more info.
+     * @since 2.0
      */
-    public static IStateSystemQuerier loadStateHistory(File htFile,
-            IStateChangeInput htInput, boolean waitForCompletion)
+    public static ITmfStateSystem loadStateHistory(File htFile,
+            IStateChangeInput htInput, String id, boolean buildManually)
             throws TmfTraceException {
-        IStateSystemQuerier ss;
+        ITmfStateSystem ss;
         IStateHistoryBackend htBackend;
 
         /* If the target file already exists, do not rebuild it uselessly */
@@ -88,7 +97,7 @@ public abstract class StateSystemManager extends TmfComponent {
         try {
             htBackend = new ThreadedHistoryTreeBackend(htFile,
                     htInput.getStartTime(), QUEUE_SIZE);
-            builder = new HistoryBuilder(htInput, htBackend);
+            builder = new HistoryBuilder(htInput, htBackend, id, buildManually);
         } catch (IOException e) {
             /*
              * If it fails here however, it means there was a problem writing to
This page took 0.024647 seconds and 5 git commands to generate.