/** Clears the trace */ @Override public synchronized void dispose() { /* Clean up the index if applicable */ if (getIndexer() != null) { getIndexer().dispose(); } /* Clean up the analysis modules */ synchronized (fAnalysisModules) { for (IAnalysisModule module : fAnalysisModules.values()) { module.dispose(); } fAnalysisModules.clear(); } super.dispose(); }
/** Clears the experiment */ @Override @SuppressWarnings("rawtypes") public synchronized void dispose() { TmfExperimentDisposedSignal<T> signal = new TmfExperimentDisposedSignal<T>(this, this); broadcast(signal); if (fTraces != null) { for (ITmfTrace trace : fTraces) { trace.dispose(); } fTraces = null; } if (fCheckpoints != null) { fCheckpoints.clear(); } super.dispose(); }
/** * Initialize the trace common attributes and the base component. * * @param resource the Eclipse resource (trace) * @param path the trace path * @param type the trace event type * @throws TmfTraceException If something failed during the initialization */ protected void initialize( final IResource resource, final String path, final Class<? extends ITmfEvent> type) throws TmfTraceException { if (path == null) { throw new TmfTraceException("Invalid trace path"); // $NON-NLS-1$ } fPath = path; fResource = resource; String traceName = getName(); if (traceName == null || traceName.isEmpty()) { traceName = (resource != null) ? resource.getName() : new Path(path).lastSegment(); } if (fParser == null) { if (this instanceof ITmfEventParser) { fParser = (ITmfEventParser) this; } else { throw new TmfTraceException("Invalid trace parser"); // $NON-NLS-1$ } } super.init(traceName, type); // register as VIP after super.init() because TmfComponent registers to signal manager there TmfSignalManager.registerVIP(this); fIndexer = createIndexer(fCacheSize); }