tmf : add waitForInitialization() to ITmfAnalysisModuleWithStateSystem
authorJean-Christian Kouame <jean-christian.kouame@ericsson.com>
Mon, 1 Feb 2016 22:15:41 +0000 (17:15 -0500)
committerMatthew Khouzam <matthew.khouzam@ericsson.com>
Wed, 2 Mar 2016 21:51:27 +0000 (16:51 -0500)
Change-Id: Id6fc4792446dbec8e9cabe43ff743a596d23f1c0
Signed-off-by: Jean-Christian Kouame <jean-christian.kouame@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/65749
Reviewed-by: Genevieve Bastien <gbastien+lttng@versatic.net>
Tested-by: Genevieve Bastien <gbastien+lttng@versatic.net>
Reviewed-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/statesystem/ITmfAnalysisModuleWithStateSystems.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/statesystem/TmfStateSystemAnalysisModule.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/statistics/TmfStatisticsModule.java
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/statesystem/TmfStateSystemViewer.java

index f6c0168b8ac5f065d5bbe8d599ea42667bc896d1..e831f5cf4cd988c69d3627b61e47e555551ecc8e 100644 (file)
@@ -41,4 +41,12 @@ public interface ITmfAnalysisModuleWithStateSystems extends IAnalysisModule {
      */
     Iterable<ITmfStateSystem> getStateSystems();
 
+    /**
+     * Block the calling thread until the analysis module has been initialized.
+     * After this method returns, {@link #getStateSystem()} should not contain
+     * any null elements
+     *
+     * @since 2.0
+     */
+    void waitForInitialization();
 }
index 83ab1ceecf8b459a14620ba7e62fb31cb0ae8414..da07ddf71b90f7d806e8064b6ffa5d39f66401db 100644 (file)
@@ -162,11 +162,7 @@ public abstract class TmfStateSystemAnalysisModule extends TmfAbstractAnalysisMo
         return fStateSystem;
     }
 
-    /**
-     * Block the calling thread until the analysis module has been initialized.
-     * After this method returns, {@link #getStateSystem()} should not return
-     * null anymore.
-     */
+    @Override
     public void waitForInitialization() {
         try {
             fInitialized.await();
index 1996a05abf86c84631c3978f00cbac187aae35b1..d1281311c63254517038eb8df67510a086a8dada 100644 (file)
@@ -66,6 +66,7 @@ public class TmfStatisticsModule extends TmfAbstractAnalysisModule
     /**
      * Wait until the analyses/state systems underneath are ready to be queried.
      */
+    @Override
     public void waitForInitialization() {
         try {
             fInitialized.await();
index cb29e26020b1698752f5c70cb2f179202fdfc367..e822c93959b750c27b1e22c4126d21e212207fa5 100644 (file)
@@ -37,7 +37,6 @@ import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
 import org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler;
 import org.eclipse.tracecompass.tmf.core.signal.TmfTimestampFormatUpdateSignal;
 import org.eclipse.tracecompass.tmf.core.statesystem.ITmfAnalysisModuleWithStateSystems;
-import org.eclipse.tracecompass.tmf.core.statesystem.TmfStateSystemAnalysisModule;
 import org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp;
 import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimestamp;
 import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
@@ -212,10 +211,7 @@ public class TmfStateSystemViewer extends AbstractTmfTreeViewer {
         for (ITmfAnalysisModuleWithStateSystems module : modules) {
             /* Just schedule the module, the data will be filled when available */
             module.schedule();
-            if (module instanceof TmfStateSystemAnalysisModule) {
-                // TODO: add this method to ITmfAnalysisModuleWithStateSystems
-                ((TmfStateSystemAnalysisModule) module).waitForInitialization();
-            }
+            module.waitForInitialization();
             for (ITmfStateSystem ss : module.getStateSystems()) {
                 traceEntry.addChild(new StateSystemEntry(ss));
             }
This page took 0.027287 seconds and 5 git commands to generate.