TMF: Have IAnalysisModule#setTrace return boolean instead of throw exception
[deliverable/tracecompass.git] / org.eclipse.tracecompass.tmf.core / src / org / eclipse / tracecompass / tmf / core / analysis / TmfAbstractAnalysisModule.java
index f40d68a79852dd5276eac0192c016404142e28f4..7204b0263d803fee6bea520ed5b6f0618cb368f1 100644 (file)
@@ -111,8 +111,11 @@ public abstract class TmfAbstractAnalysisModule extends TmfComponent implements
         fAutomatic = auto;
     }
 
+    /**
+     * @since 1.0
+     */
     @Override
-    public void setTrace(ITmfTrace trace) throws TmfAnalysisException {
+    public boolean setTrace(ITmfTrace trace) throws TmfAnalysisException {
         if (fTrace != null) {
             throw new TmfAnalysisException(NLS.bind(Messages.TmfAbstractAnalysisModule_TraceSetMoreThanOnce, getName()));
         }
@@ -121,7 +124,7 @@ public abstract class TmfAbstractAnalysisModule extends TmfComponent implements
 
         /* Check that analysis can be executed */
         if (!canExecute(trace)) {
-            throw new TmfAnalysisException(NLS.bind(Messages.TmfAbstractAnalysisModule_AnalysisCannotExecute, getName()));
+            return false;
         }
 
         fTrace = trace;
@@ -133,6 +136,7 @@ public abstract class TmfAbstractAnalysisModule extends TmfComponent implements
         }
         resetAnalysis();
         fStarted = false;
+        return true;
     }
 
     /**
This page took 0.028157 seconds and 5 git commands to generate.