public static enum ListenableFuture.ListenerOptimizationStrategy extends java.lang.Enum<ListenableFuture.ListenerOptimizationStrategy>
Enum Constant and Description |
---|
None
The default strategy, no optimization is assumed.
|
SingleThreadIfExecutorMatch
This will optimize away the executor if the executor provided is the same one that the task
WILL complete on.
|
SingleThreadIfExecutorMatchOrDone
Similar to
SingleThreadIfExecutorMatch this will optimize away the executor if
it will complete on the same executor provided. |
Modifier and Type | Method and Description |
---|---|
static ListenableFuture.ListenerOptimizationStrategy |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static ListenableFuture.ListenerOptimizationStrategy[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ListenableFuture.ListenerOptimizationStrategy None
public static final ListenableFuture.ListenerOptimizationStrategy SingleThreadIfExecutorMatch
SingleThreadIfExecutorMatchOrDone
.public static final ListenableFuture.ListenerOptimizationStrategy SingleThreadIfExecutorMatchOrDone
SingleThreadIfExecutorMatch
this will optimize away the executor if
it will complete on the same executor provided. But this also adds the optimization that if
the future is complete, it is assumed that it can now execute in the calling thread. This
is typically useful if you are adding a callback on a thread that is also executing on the
executor you are providing.public static ListenableFuture.ListenerOptimizationStrategy[] values()
for (ListenableFuture.ListenerOptimizationStrategy c : ListenableFuture.ListenerOptimizationStrategy.values()) System.out.println(c);
public static ListenableFuture.ListenerOptimizationStrategy valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null