1 /*******************************************************************************
2 * Copyright (c) 2009, 2013 Ericsson
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Francois Chouinard - Initial API and implementation
11 * Alexandre Montplaisir - Merge with ITmfDataRequest
12 *******************************************************************************/
14 package org
.eclipse
.tracecompass
.tmf
.core
.request
;
16 import org
.eclipse
.jdt
.annotation
.NonNull
;
17 import org
.eclipse
.tracecompass
.tmf
.core
.event
.ITmfEvent
;
18 import org
.eclipse
.tracecompass
.tmf
.core
.timestamp
.TmfTimeRange
;
21 * The TMF event request
23 * @author Francois Chouinard
25 public interface ITmfEventRequest
{
27 // ------------------------------------------------------------------------
29 // ------------------------------------------------------------------------
31 /** The request count for all the events
33 static final int ALL_DATA
= Integer
.MAX_VALUE
;
35 /** The request execution type/priority
39 * Backgroung, long-running, lower priority request
43 * Foreground, short-running, high priority request
48 // ------------------------------------------------------------------------
50 // ------------------------------------------------------------------------
53 * @return request data type (T)
55 Class
<?
extends ITmfEvent
> getDataType();
66 ExecutionType
getExecType();
69 * @return the index of the first event requested
74 * @return the number of requested events
79 * @return the number of events read so far
84 * @return the requested time range
86 TmfTimeRange
getRange();
88 // ------------------------------------------------------------------------
89 // Request state predicates
90 // ------------------------------------------------------------------------
93 * @return true if the request is still active
98 * @return true if the request is completed
100 boolean isCompleted();
103 * @return true if the request has failed
108 * @return true if the request was cancelled
110 boolean isCancelled();
112 // ------------------------------------------------------------------------
114 // ------------------------------------------------------------------------
117 * Process the piece of data
120 * The trace event to process
122 void handleData(@NonNull ITmfEvent event
);
124 // ------------------------------------------------------------------------
125 // Request notifications
126 // ------------------------------------------------------------------------
129 * Request processing start notification
131 void handleStarted();
134 * Request processing completion notification
136 void handleCompleted();
139 * Request successful completion notification
141 void handleSuccess();
144 * Request failure notification
146 void handleFailure();
149 * Request cancellation notification
154 * To suspend the client thread until the request completes (or is
157 * @throws InterruptedException
158 * thrown if the request was cancelled
160 void waitForCompletion() throws InterruptedException
;
162 // ------------------------------------------------------------------------
163 // Request state modifiers
164 // ------------------------------------------------------------------------
167 * Put the request in the running state
172 * Put the request in the completed state
177 * Put the request in the failed completed state
182 * Put the request in the cancelled completed state
186 // ------------------------------------------------------------------------
188 // ------------------------------------------------------------------------
191 * This method is called by the event provider to set the index
192 * corresponding to the time range start time
195 * The start time index
197 void setStartIndex(int index
);
This page took 0.097532 seconds and 5 git commands to generate.