tmf: Consolidate all state systems in ITmfTrace
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.kernel.core / src / org / eclipse / linuxtools / lttng2 / kernel / core / trace / CtfKernelTrace.java
index 7f412fe775df15457fab931847b83a85f82a0946..3ce5be1d82674db22584da77fde68d14309b2415 100644 (file)
@@ -24,6 +24,7 @@ import org.eclipse.linuxtools.tmf.core.TmfCommonConstants;
 import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace;
 import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
 import org.eclipse.linuxtools.tmf.core.statesystem.IStateChangeInput;
+import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateSystem;
 import org.eclipse.linuxtools.tmf.core.statesystem.StateSystemManager;
 
 /**
@@ -76,6 +77,8 @@ public class CtfKernelTrace extends CtfTmfTrace {
 
     @Override
     protected void buildStateSystem() throws TmfTraceException {
+        super.buildStateSystem();
+
         /* Set up the path to the history tree file we'll use */
         IResource resource = this.getResource();
         String supplDirectory = null;
@@ -90,17 +93,8 @@ public class CtfKernelTrace extends CtfTmfTrace {
         final File htFile = new File(supplDirectory + File.separator + HISTORY_TREE_FILE_NAME);
         final IStateChangeInput htInput = new CtfKernelStateInput(this);
 
-        this.ss = StateSystemManager.loadStateHistory(htFile, htInput, STATE_ID, false);
-    }
-
-    @Override
-    public synchronized void dispose() {
-        /* Clean up the state system */
-        if (ss != null) {
-            ss.dispose();
-        }
-        super.dispose();
+        ITmfStateSystem ss = StateSystemManager.loadStateHistory(htFile, htInput, STATE_ID, false);
+        fStateSystems.put(STATE_ID, ss);
     }
 
-
 }
This page took 0.024699 seconds and 5 git commands to generate.