public enum CancelOption extends Enum<CancelOption>
CancelOption defines whether a Cancellable future that is waited upon shall be cancelled if waiting
times out or is interrupted.VerifiableFuture,
WaitableFuture| Enum Constant and Description |
|---|
CANCEL_ON_INTERRUPT
Indicates that when waiting on a future is interrupted, the future shall be canceled.
|
CANCEL_ON_TIMEOUT
Indicates that when waiting on a future times out, the future shall be canceled.
|
NO_CANCELLATION
Indicates that even if waiting on a future times out or is interrupted, it shall not be canceled.
|
| Modifier and Type | Method and Description |
|---|---|
static CancelOption |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static CancelOption[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CancelOption CANCEL_ON_TIMEOUT
public static final CancelOption CANCEL_ON_INTERRUPT
public static final CancelOption NO_CANCELLATION
CANCEL_ON_TIMEOUT and CANCEL_ON_INTERRUPT take precedence over this flag. The main purpose of
this flag is to be able to call verify(timeout, NO_CANCELLATION) to suppress cancelling a future on
time-outs or interrupts altogether. By default, verify(timeout) will cancel the future on both time-outs
and interrupts.
public static CancelOption[] values()
for (CancelOption c : CancelOption.values()) System.out.println(c);
public static CancelOption valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullCopyright © 2018–2024 The Apache Software Foundation. All rights reserved.