public interface CancelState
Once an operation has been canceled
, it cannot be "un-canceled". Where multiple
observers have the option to cancel an operation, cancellation by any observer should be considered as
final and binding; implementations should not require consensus among all observers.
Modifier and Type | Method and Description |
---|---|
void |
cancel(KeyedMessage message)
Cancels the operation, providing a message explaining why.
|
boolean |
isCanceled()
Retrieves a flag indicating whether the operation has been canceled.
|
void cancel(@Nonnull KeyedMessage message)
The cancellation message is required, and should be as descriptive and clear as possible to allow end users to correct, if possible, the issue that triggered cancellation.
message
- a descriptive message explaining why the operation has been canceledNullPointerException
- if the provided message
is null
boolean isCanceled()
In situations where multiple observers have the option to cancel an operation, for example when multiple
listeners receive the same CancelableEvent
, this flag
can be useful for determining that another observer has already canceled the operation.
true
if the operation has been canceled
; otherwise, false
Copyright © 2024 Atlassian. All rights reserved.