@CleanupObligation @ParametersAreNonnullByDefault public interface ExecutionContext extends AutoCloseable, JsonWriteable
| Modifier and Type | Interface and Description |
|---|---|
static class |
ExecutionContext.Relation |
static interface |
ExecutionContext.Tag<T> |
| Modifier and Type | Method and Description |
|---|---|
default <T> List<T> |
add(ExecutionContext.Tag<List<T>> tag,
T data) |
void |
add(StackSamples samples) |
void |
add(StackTraceElement[] sample) |
void |
addCloseable(AutoCloseable closeable)
Attach a AutoCloseable to execution context.
|
void |
addLog(Slf4jLogRecord log) |
void |
addLogs(Collection<Slf4jLogRecord> log) |
default <T> List<T> |
addToRootParent(ExecutionContext.Tag<List<T>> tag,
T data) |
void |
attach() |
void |
close() |
default void |
closeAll() |
default void |
closeAllButRoot() |
default <T> void |
combine(ExecutionContext.Tag<T> tag,
T data) |
<V> V |
compute(ExecutionContext.Tag<V> key,
BiFunction<ExecutionContext.Tag<V>,V,V> compute)
Compute context associated data.
|
void |
detach() |
default ExecutionContext |
detachedChild(String operationName) |
default ExecutionContext |
detachedChild(String operationName,
long timeout,
TimeUnit tu) |
<T> T |
get(ExecutionContext.Tag<T> key)
Method to get context associated data.
|
StackSamples |
getAndClearStackSamples() |
default Level |
getBackendMinLogLevel() |
Level |
getBackendMinLogLevel(String loggerName)
The minimum log level overwrite.
|
default Level |
getContextMinLogLevel() |
Level |
getContextMinLogLevel(String loggerName)
The minimum log level accepted by this execution context;
The logs that we will store in this context.
|
long |
getDeadlineNanos() |
default org.spf4j.base.avro.DebugDetail |
getDebugDetail(String origin,
Throwable throwable) |
default org.spf4j.base.avro.DebugDetail |
getDebugDetail(String origin,
Throwable throwable,
boolean addStackSamples) |
CharSequence |
getId() |
default long |
getMillisToDeadline() |
String |
getName() |
default ExecutionContext |
getNotClosedParent() |
ExecutionContext.Relation |
getRelationToSource() |
default ExecutionContext |
getRoot() |
default ExecutionContext |
getRootParent() |
default int |
getSecondsToDeadline() |
ExecutionContext |
getSource() |
StackSamples |
getStackSamples() |
long |
getStartTimeNanos() |
default long |
getTimeRelativeToDeadline(TimeUnit unit) |
default long |
getTimeToDeadline(TimeUnit unit) |
default long |
getUncheckedTimeToDeadline(TimeUnit unit) |
boolean |
isClosed() |
long |
nextChildId() |
<T> T |
put(ExecutionContext.Tag<T> tag,
T data)
Method to put context associated data.
|
default <T> T |
putToRootParent(ExecutionContext.Tag<T> key,
T data)
Method to put context associated data to the root context.
|
default Level |
setBackendMinLogLevel(Level level) |
Level |
setBackendMinLogLevel(String loggerName,
Level level) |
default ExecutionContext |
startChild(String operationName) |
default ExecutionContext |
startChild(String operationName,
long timeout,
TimeUnit tu) |
void |
streamLogs(Consumer<Slf4jLogRecord> to) |
writeJsonTo, writeJsonTo, writeTo@DischargesObligation void close()
close in interface AutoCloseabledefault void closeAll()
default void closeAllButRoot()
CharSequence getId()
long getStartTimeNanos()
long getDeadlineNanos()
@Nullable ExecutionContext getSource()
default ExecutionContext getRoot()
default ExecutionContext getRootParent()
@Nullable default ExecutionContext getNotClosedParent()
@Beta void addLog(Slf4jLogRecord log)
@Beta void addLogs(Collection<Slf4jLogRecord> log)
@Beta void addCloseable(AutoCloseable closeable)
closeable - @Beta Level getContextMinLogLevel(String loggerName)
default Level getContextMinLogLevel()
@Beta @Nullable Level getBackendMinLogLevel(String loggerName)
@Beta void streamLogs(Consumer<Slf4jLogRecord> to)
void detach()
void attach()
@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 <T> T get(ExecutionContext.Tag<T> key)
T - type of data.key - key of data.@Nullable @Beta <T> T put(ExecutionContext.Tag<T> tag, T data)
T - type of data.key - the key of data.data - the data.@Beta default <T> void combine(ExecutionContext.Tag<T> tag, T data)
@Nullable @Beta default <T> T putToRootParent(ExecutionContext.Tag<T> key, T data)
T - type of data.key - the key of data.data - the data.@Beta @Nullable <V> V compute(ExecutionContext.Tag<V> key, BiFunction<ExecutionContext.Tag<V>,V,V> compute)
K - V - key - compute - @Nullable @Beta default <T> List<T> add(ExecutionContext.Tag<List<T>> tag, T data)
@Nullable @Beta default <T> List<T> addToRootParent(ExecutionContext.Tag<List<T>> tag, T data)
default ExecutionContext startChild(String operationName, long timeout, TimeUnit tu)
default ExecutionContext startChild(String operationName)
default ExecutionContext detachedChild(String operationName, long timeout, TimeUnit tu)
default ExecutionContext detachedChild(String operationName)
long nextChildId()
void add(StackTraceElement[] sample)
void add(StackSamples samples)
@Nullable StackSamples getAndClearStackSamples()
@Nullable StackSamples getStackSamples()
boolean isClosed()
ExecutionContext.Relation getRelationToSource()
default org.spf4j.base.avro.DebugDetail getDebugDetail(String origin, @Nullable Throwable throwable)
Copyright © 2019 SPF4J. All rights reserved.