@ThreadSafe @ParametersAreNonnullByDefault public class BasicExecutionContext extends Object implements ExecutionContext
Constructor and Description |
---|
BasicExecutionContext(String name,
ExecutionContext parent,
long startTimeNanos,
long deadlineNanos,
Runnable onClose) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close might be overridable to close any additional stuff added in the extendsd class.
|
<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.
|
long |
getDeadlineNanos() |
String |
getName() |
ExecutionContext |
getParent() |
long |
getStartTimeNanos() |
<T> T |
put(Object key,
T data)
Method to put context associated data.
|
String |
toString()
Overwrite as needed for debug string.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
get, getMillisToDeadline, getSecondsToDeadline, getTimeRelativeToDeadline, getTimeToDeadline, getUncheckedTimeToDeadline, putToRoot
public BasicExecutionContext(String name, @Nullable ExecutionContext parent, long startTimeNanos, long deadlineNanos, Runnable onClose)
public final String getName()
getName
in interface ExecutionContext
public final long getDeadlineNanos()
getDeadlineNanos
in interface ExecutionContext
public final long getStartTimeNanos()
getStartTimeNanos
in interface ExecutionContext
@Nullable @Beta public final <T> T put(@Nonnull Object key, @Nonnull T data)
ExecutionContext
put
in interface ExecutionContext
T
- type of data.key
- the key of data.data
- the data.@Nullable @Beta public final Object get(@Nonnull Object key)
ExecutionContext
get
in interface ExecutionContext
key
- key of data.@Nullable public final <K,V> V compute(@Nonnull K key, BiFunction<K,V,V> compute)
ExecutionContext
compute
in interface ExecutionContext
public final ExecutionContext getParent()
getParent
in interface ExecutionContext
public void close()
close
in interface AutoCloseable
close
in interface ExecutionContext
Copyright © 2018 SPF4J. All rights reserved.