Search in sources :

Example 16 with ITmfEventRequest

use of org.eclipse.tracecompass.tmf.core.request.ITmfEventRequest in project tracecompass by tracecompass.

the class TmfUml2SDSyncLoader method cancelOngoingRequests.

/**
 * Cancels any ongoing find operation
 */
protected void cancelOngoingRequests() {
    fLock.lock();
    ITmfEventRequest pageRequest = null;
    try {
        // Cancel the search thread
        if (fFindJob != null) {
            fFindJob.cancel();
        }
        fFindResults = null;
        fFindCriteria = null;
        fCurrentFindIndex = 0;
        pageRequest = fPageRequest;
        fPageRequest = null;
    } finally {
        fLock.unlock();
    }
    if (pageRequest != null && !pageRequest.isCompleted()) {
        pageRequest.cancel();
    }
}
Also used : ITmfEventRequest(org.eclipse.tracecompass.tmf.core.request.ITmfEventRequest)

Example 17 with ITmfEventRequest

use of org.eclipse.tracecompass.tmf.core.request.ITmfEventRequest in project tracecompass by tracecompass.

the class TmfUml2SDSyncLoader method dispose.

@Override
public void dispose() {
    super.dispose();
    ITmfEventRequest indexRequest = null;
    fLock.lock();
    try {
        IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
        // During Eclipse shutdown the active workbench window is null
        if (window != null) {
            window.getSelectionService().removePostSelectionListener(this);
        }
        indexRequest = fIndexRequest;
        fIndexRequest = null;
        cancelOngoingRequests();
        fView.setSDFindProvider(null);
        fView.setSDPagingProvider(null);
        fView.setSDFilterProvider(null);
        fView = null;
    } finally {
        fLock.unlock();
    }
    if (indexRequest != null && !indexRequest.isCompleted()) {
        indexRequest.cancel();
    }
}
Also used : IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) ITmfEventRequest(org.eclipse.tracecompass.tmf.core.request.ITmfEventRequest)

Example 18 with ITmfEventRequest

use of org.eclipse.tracecompass.tmf.core.request.ITmfEventRequest in project tracecompass by tracecompass.

the class TmfEventProvider method fireRequest.

private void fireRequest(boolean isTimeout) {
    synchronized (fLock) {
        if (fRequestPendingCounter > 0) {
            return;
        }
        if (!fPendingCoalescedRequests.isEmpty()) {
            Iterator<TmfCoalescedEventRequest> iter = fPendingCoalescedRequests.iterator();
            while (iter.hasNext()) {
                ExecutionType type = (isTimeout ? ExecutionType.BACKGROUND : ExecutionType.FOREGROUND);
                ITmfEventRequest request = iter.next();
                if (type == request.getExecType()) {
                    queueRequest(request);
                    iter.remove();
                }
            }
        }
    }
}
Also used : ExecutionType(org.eclipse.tracecompass.tmf.core.request.ITmfEventRequest.ExecutionType) TmfCoalescedEventRequest(org.eclipse.tracecompass.internal.tmf.core.request.TmfCoalescedEventRequest) ITmfEventRequest(org.eclipse.tracecompass.tmf.core.request.ITmfEventRequest)

Aggregations

ITmfEventRequest (org.eclipse.tracecompass.tmf.core.request.ITmfEventRequest)18 ITmfEvent (org.eclipse.tracecompass.tmf.core.event.ITmfEvent)4 TmfEventRequest (org.eclipse.tracecompass.tmf.core.request.TmfEventRequest)4 TmfTimeRange (org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange)4 ITmfTrace (org.eclipse.tracecompass.tmf.core.trace.ITmfTrace)3 TmfSignalHandler (org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler)2 ITmfTimestamp (org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp)2 ArrayList (java.util.ArrayList)1 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)1 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)1 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)1 Job (org.eclipse.core.runtime.jobs.Job)1 Nullable (org.eclipse.jdt.annotation.Nullable)1 TmfCoalescedEventRequest (org.eclipse.tracecompass.internal.tmf.core.request.TmfCoalescedEventRequest)1 PcapEvent (org.eclipse.tracecompass.internal.tmf.pcap.core.event.PcapEvent)1 ITmfStateSystem (org.eclipse.tracecompass.statesystem.core.ITmfStateSystem)1 TimeRangeException (org.eclipse.tracecompass.statesystem.core.exceptions.TimeRangeException)1 ITmfStateInterval (org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval)1 TmfStateInterval (org.eclipse.tracecompass.statesystem.core.interval.TmfStateInterval)1 ITmfEventProvider (org.eclipse.tracecompass.tmf.core.component.ITmfEventProvider)1