* 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 {
* 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 */
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