public interface RequestContext
Modifier and Type | Method and Description |
---|---|
void |
addCancelRequestListener(CancelRequestListener listener)
Registers the provided cancellation listener with this request context so
that it can be notified if a cancellation request is received and
processing of the request should be aborted if possible.
|
void |
checkIfCancelled(boolean signalTooLate)
Throws
CancelledResultException if a cancellation request has
been received and processing of the request should be aborted if
possible. |
int |
getMessageID()
Returns the message ID of the request, if available.
|
void |
removeCancelRequestListener(CancelRequestListener listener)
Removes the provided cancellation listener from this request context so
that it will not be notified if a cancellation request has been received.
|
void addCancelRequestListener(CancelRequestListener listener)
Requests may be cancelled as a result of an abandon request or a cancel extended request sent from the client, or by the server itself (e.g. during server shutdown).
This method provides a event notification mechanism which can be used by asynchronous request handler implementations to detect cancellation of requests.
listener
- The listener which wants to be notified if a cancellation
request is received and processing of the request should be
aborted if possible.NullPointerException
- If the listener
was null
.checkIfCancelled(boolean)
void checkIfCancelled(boolean signalTooLate) throws CancelledResultException
CancelledResultException
if a cancellation request has
been received and processing of the request should be aborted if
possible.
Requests may be cancelled as a result of an abandon request or a cancel extended request sent from the client, or by the server itself (e.g. during server shutdown).
This method provides a polling mechanism which can be used by synchronous request handler implementations to detect cancellation of requests.
signalTooLate
- true
to signal that, after this method returns,
processing of the request will have proceeded too far for it
to be aborted by subsequent cancellation requests.CancelledResultException
- If a cancellation request has been received and processing of
the request should be aborted if possible.addCancelRequestListener(org.forgerock.opendj.ldap.CancelRequestListener)
int getMessageID()
-1
if there is no
message ID associated with the request.void removeCancelRequestListener(CancelRequestListener listener)
listener
- The listener which no longer wants to be notified if a
cancellation request has been received.NullPointerException
- If the listener
was null
.Copyright 2010-2017 ForgeRock AS.