Source:
private synchronized void initializeStreamingMonitor() { if (fInitialized) { return; } fInitialized = true; if (getStreamingInterval() == 0) { final ITmfContext context = seekEvent(0); final ITmfEvent event = getNext(context); context.dispose(); if (event == null) { return; } final TmfTimeRange timeRange = new TmfTimeRange(event.getTimestamp(), TmfTimestamp.BIG_CRUNCH); final TmfTraceRangeUpdatedSignal signal = new TmfTraceRangeUpdatedSignal(this, this, timeRange); new Thread() { @Override public void run() { broadcast(signal); } }.start(); return; } final Thread thread = new Thread("Streaming Monitor for experiment " + getName()) { private ITmfTimestamp fSafeTimestamp = null; private ITmfTimestamp lastSafeTimestamp = null; private TmfTimeRange timeRange = null; @Override public void run() { while (!executorIsShutdown()) { if (!getIndexer().isIndexing()) { ITmfTimestamp startTimestamp = TmfTimestamp.BIG_CRUNCH; ITmfTimestamp endTimestamp = TmfTimestamp.BIG_BANG; for (final ITmfTrace trace : getChildren(ITmfTrace.class)) { if (trace.getStartTime().compareTo(startTimestamp) < 0) { startTimestamp = trace.getStartTime(); } if (trace.getStreamingInterval() != 0 && trace.getEndTime().compareTo(endTimestamp) > 0) { endTimestamp = trace.getEndTime(); } } ITmfTimestamp safeTimestamp = fSafeTimestamp; if (safeTimestamp != null && (lastSafeTimestamp == null || safeTimestamp.compareTo(lastSafeTimestamp) > 0)) { timeRange = new TmfTimeRange(startTimestamp, safeTimestamp); lastSafeTimestamp = safeTimestamp; } else { timeRange = null; } fSafeTimestamp = endTimestamp; if (timeRange != null) { final TmfTraceRangeUpdatedSignal signal = new TmfTraceRangeUpdatedSignal(TmfExperiment.this, TmfExperiment.this, timeRange); broadcast(signal); } } try { Thread.sleep(getStreamingInterval()); } catch (final InterruptedException e) { e.printStackTrace(); } } } }; thread.start(); }

Target:
private synchronized void initializeStreamingMonitor() { if (fInitialized) { return; } fInitialized = true; if (getStreamingInterval() == 0) { final ITmfContext context = seekEvent(0); final ITmfEvent event = getNext(context); context.dispose(); if (event == null) { return; } final TmfTimeRange timeRange = new TmfTimeRange(event.getTimestamp(), TmfTimestamp.BIG_CRUNCH); final TmfTraceRangeUpdatedSignal signal = new TmfTraceRangeUpdatedSignal(this, this, timeRange); new Thread() { @Override public void run() { broadcast(signal); } }.start(); return; } final Thread thread = new Thread("Streaming Monitor for experiment " + getName()) { private ITmfTimestamp safeTimestamp = null; private ITmfTimestamp lastSafeTimestamp = null; private TmfTimeRange timeRange = null; @Override public void run() { while (!executorIsShutdown()) { if (!getIndexer().isIndexing()) { ITmfTimestamp startTimestamp = TmfTimestamp.BIG_CRUNCH; ITmfTimestamp endTimestamp = TmfTimestamp.BIG_BANG; for (final ITmfTrace trace : getChildren(ITmfTrace.class)) { if (trace.getStartTime().compareTo(startTimestamp) < 0) { startTimestamp = trace.getStartTime(); } if (trace.getStreamingInterval() != 0 && trace.getEndTime().compareTo(endTimestamp) > 0) { endTimestamp = trace.getEndTime(); } } ITmfTimestamp safeTs = safeTimestamp; if (safeTs != null && (lastSafeTimestamp == null || safeTs.compareTo(lastSafeTimestamp) > 0)) { timeRange = new TmfTimeRange(startTimestamp, safeTs); lastSafeTimestamp = safeTs; } else { timeRange = null; } safeTimestamp = endTimestamp; if (timeRange != null) { final TmfTraceRangeUpdatedSignal signal = new TmfTraceRangeUpdatedSignal(TmfExperiment.this, TmfExperiment.this, timeRange); broadcast(signal); } } try { Thread.sleep(getStreamingInterval()); } catch (final InterruptedException e) { e.printStackTrace(); } } } }; thread.start(); }