ITmfTrace trace = getTrace();
if (trace == null) {
/* This analysis was cancelled in the meantime */
- fInitializationSucceeded = false;
- fInitialized.countDown();
+ analysisReady(false);
return false;
}
IStatus status2 = eventTypesModule.schedule();
if (!(status1.isOK() && status2.isOK())) {
cancelSubAnalyses();
- fInitializationSucceeded = false;
- fInitialized.countDown();
+ analysisReady(false);
return false;
}
/* Wait until the two modules are initialized */
if (!totalsModule.waitForInitialization() || !eventTypesModule.waitForInitialization()) {
- fInitializationSucceeded = false;
- fInitialized.countDown();
+ analysisReady(false);
return false;
}
if (totalsSS == null || eventTypesSS == null) {
/* This analysis was cancelled in the meantime */
- fInitializationSucceeded = false;
- fInitialized.countDown();
+ analysisReady(false);
throw new IllegalStateException("TmfStatisticsModule : Sub-modules initialization succeeded but there is a null state system."); //$NON-NLS-1$
}
fStatistics = new TmfStateStatistics(totalsSS, eventTypesSS);
/* fStatistics is now set, consider this module initialized */
- fInitializationSucceeded = true;
- fInitialized.countDown();
+ analysisReady(true);
/*
* The rest of this "execute" will encompass the "execute" of the two
return true;
}
+ /**
+ * Make the module available and set whether the initialization went well or
+ * not. If not, no state system is available and
+ * {@link #waitForInitialization()} should return false.
+ *
+ * @param success
+ * True if the initialization went well, false otherwise
+ */
+ private void analysisReady(boolean succeeded) {
+ fInitializationSucceeded = succeeded;
+ fInitialized.countDown();
+ }
+
@Override
protected void canceling() {
/*