@CleanupObligation @ParametersAreNonnullByDefault public interface ExecutionContext extends AutoCloseable
Modifier and Type | Method and Description |
---|---|
void |
close() |
<K,V> V |
compute(K key,
BiFunction<K,V,V> compute)
Compute context associated data.
|
Object |
get(Object key)
Method to get context associated data.
|
default <T> T |
get(Object key,
Class<T> clasz)
Method to get context associated data.
|
long |
getDeadlineNanos() |
default long |
getMillisToDeadline() |
String |
getName() |
ExecutionContext |
getParent() |
default int |
getSecondsToDeadline() |
long |
getStartTimeNanos() |
default long |
getTimeRelativeToDeadline(TimeUnit unit) |
default long |
getTimeToDeadline(TimeUnit unit) |
default long |
getUncheckedTimeToDeadline(TimeUnit unit) |
<T> T |
put(Object key,
T data)
Method to put context associated data.
|
default <T> T |
putToRoot(Object key,
T data)
Method to put context associated data to the root context.
|
@DischargesObligation void close()
close
in interface AutoCloseable
long getStartTimeNanos()
long getDeadlineNanos()
@Nullable ExecutionContext getParent()
@Nonnegative default long getTimeToDeadline(TimeUnit unit) throws TimeoutException
TimeoutException
@Nonnegative default long getUncheckedTimeToDeadline(TimeUnit unit)
@Nonnegative default long getMillisToDeadline() throws TimeoutException
TimeoutException
@Nonnegative default int getSecondsToDeadline() throws TimeoutException
TimeoutException
@Nullable @Beta default <T> T get(Object key, Class<T> clasz)
T
- type of baggage.key
- key of baggage.clasz
- class of baggage value.@Nullable @Beta Object get(Object key)
T
- type of data.key
- key of data.@Nullable @Beta <T> T put(Object key, T data)
T
- type of data.key
- the key of data.data
- the data.@Nullable @Beta default <T> T putToRoot(Object key, T data)
T
- type of data.key
- the key of data.data
- the data.@Beta @Nullable <K,V> V compute(K key, BiFunction<K,V,V> compute)
K
- V
- key
- compute
- Copyright © 2018 SPF4J. All rights reserved.