Package org.eclipse.debug.core
Interface IRequest
- All Known Subinterfaces:
IDebugCommandRequest
,IEnabledStateRequest
public interface IRequest
Common base interface for an asynchronously processed request. A request may succeed,
fail or be canceled as indicated by the request's status. When a request is complete
the client fulfilling the request must call
done()
on the request whether
the operation succeeds, fails, or is canceled.
Specific requests (sub types of this interface) often include data pertaining to the request and usually contain results of the request.
Clients are expected to poll a request (using isCanceled
)
periodically and abort at their earliest convenience calling done()
.
A request can be canceled by the originator of the request or a client
fulfilling a request.
Clients that invoke request handlers may implement this interface.
- Since:
- 3.3
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel()
Cancels this request.void
done()
Indicates this request is complete.Returns the status of this request, ornull
.boolean
Returns whether this request has been canceled.void
Sets the status for this request indicating whether this request succeeded, failed, or was canceled.
-
Method Details
-
setStatus
Sets the status for this request indicating whether this request succeeded, failed, or was canceled. When a request fails, the status indicates why the request failed. Anull
status is considered to be successful. Only clients fulfilling a request should call this method. Clients making a request are not intended to call this method.- Parameters:
status
- request status ornull
-
getStatus
IStatus getStatus()Returns the status of this request, ornull
.- Returns:
- request status -
null
is equivalent to an OK status
-
done
void done()Indicates this request is complete. Clients must call this method whether the request succeeds, fails, or is cancelled to indicate that processing is complete. Only clients fulfilling a request should call this method. Clients making a request are not intended to call this method. -
cancel
void cancel()Cancels this request. A request may be canceled by the originator of request or a client fulfilling a request. Optionally a canceled status may be set on this request with more details. A client fulfilling a request must still calldone()
to indicate the request is complete. -
isCanceled
boolean isCanceled()Returns whether this request has been canceled.Clients fulfilling a request are expected to poll a request (using
isCanceled
) periodically and abort at their earliest convenience callingdone()
. A request can be canceled by the originator of the request or a processor fulfilling a request.- Returns:
- whether this request has been canceled
-