public interface ThreadContextListener extends Comparable<ThreadContextListener>
ThreadContext
. ThreadContextListener
s are invoked by a
ThreadContextExecutor
.Modifier and Type | Interface and Description |
---|---|
static class |
ThreadContextListener.DefaultPriorities |
Modifier and Type | Method and Description |
---|---|
default void |
afterDestroy(ThreadContext threadContext,
ThreadContext parentThreadContext)
Invoked after the current
ThreadContext is destroyed and reset. |
default void |
afterInitialize(ThreadContext threadContext,
ThreadContext parentThreadContext)
Invoked after the current
ThreadContext is initialized and set. |
default void |
beforeDestroy(ThreadContext threadContext,
ThreadContext parentThreadContext)
Invoked before the current
ThreadContext is destroyed and reset. |
default void |
beforeInitialize(ThreadContext threadContext,
ThreadContext parentThreadContext)
Invoked before the current
ThreadContext is initialized and set. |
default int |
compareTo(ThreadContextListener other) |
int |
getPriority()
Returns the priority that defines the order in which listeners are invoked.
|
int getPriority()
default void beforeInitialize(@Nonnull ThreadContext threadContext, @Nullable ThreadContext parentThreadContext)
ThreadContext
is initialized and set. This method can be used, for example, to
inherit properties from the parent context.threadContext
- The ThreadContext
that is initialized and will be set.parentThreadContext
- The existing parent ThreadContext
, or null
if there is currently no
ThreadContext
.default void afterInitialize(@Nonnull ThreadContext threadContext, @Nullable ThreadContext parentThreadContext)
ThreadContext
is initialized and set.threadContext
- The ThreadContext
that was initialized is now set.parentThreadContext
- The parent ThreadContext
, or null
if there is no parent ThreadContext
.default void beforeDestroy(@Nonnull ThreadContext threadContext, @Nullable ThreadContext parentThreadContext)
ThreadContext
is destroyed and reset.threadContext
- The ThreadContext
that is destroyed and will be removed.parentThreadContext
- The parent ThreadContext
, or null
if there is no parent ThreadContext
.default void afterDestroy(@Nonnull ThreadContext threadContext, @Nullable ThreadContext parentThreadContext)
ThreadContext
is destroyed and reset.threadContext
- The ThreadContext
that was destroyed and removed.parentThreadContext
- The parent ThreadContext
, or null
if there is no parent ThreadContext
.default int compareTo(@Nonnull ThreadContextListener other)
compareTo
in interface Comparable<ThreadContextListener>
Copyright © 2019 SAP SE. All rights reserved.