Package org.eclipse.debug.core
Interface IRequest
-
- All Known Subinterfaces:
IDebugCommandRequest,IEnabledStateRequest
public interface IRequestCommon 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 calldone()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 callingdone(). 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcancel()Cancels this request.voiddone()Indicates this request is complete.IStatusgetStatus()Returns the status of this request, ornull.booleanisCanceled()Returns whether this request has been canceled.voidsetStatus(IStatus status)Sets the status for this request indicating whether this request succeeded, failed, or was canceled.
-
-
-
Method Detail
-
setStatus
void setStatus(IStatus status)
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. Anullstatus 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 -
nullis 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
-
-