ContextSnapshotFactory.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| private final Predicate | |
| private final boolean | |
| private final ContextRegistry | |
| private static final DefaultContextSnapshot |
| Access | Constructor and Description |
|---|---|
| public | DefaultContextSnapshotFactory(ContextRegistry contextRegistry, boolean clearMissing, Predicate<Object> captureKeyPredicate)
|
| Modifier and Type | Method and Description |
|---|---|
| public ContextSnapshot | captureAll(Object...
context objects to extract values from contexts)Implements io. ThreadLocal and from other context objects using all
accessors from a ContextRegistry instance.
|
| pack-priv static ContextSnapshot | captureAll(ContextRegistry contextRegistry, Predicate<Object> keyPredicate, boolean clearMissing, Object... contexts)
|
| public ContextSnapshot | captureFrom(Object...
the contexts to read values from contexts)Implements io. ContextSnapshot by reading values from the given context objects.
|
| pack-priv static DefaultContextSnapshot | captureFromContext(Predicate<Object> keyPredicate, boolean clearMissing, ContextRegistry contextRegistry, DefaultContextSnapshot snapshot, Object... contexts)
|
| private static DefaultContextSnapshot | captureFromThreadLocals(Predicate<Object> keyPredicate, boolean clearMissing, ContextRegistry contextRegistry)
|
| private static DefaultContextSnapshot | |
| pack-priv static <C> ContextSnapshot. | |
| public <C> ContextSnapshot. | setThreadLocalsFrom(Object
the source context to read values from sourceContext, String... the keys of the values to read. If none provided, all keys are
considered. keys)Implements io. ThreadLocal values.
|
| pack-priv static <C> ContextSnapshot. | setThreadLocalsFrom(Object sourceContext, ContextRegistry contextRegistry, boolean clearMissing, String... keys)
|
| captureKeyPredicate | back to summary |
|---|---|
| private final Predicate<Object> captureKeyPredicate | |
| clearMissing | back to summary |
|---|---|
| private final boolean clearMissing | |
| contextRegistry | back to summary |
|---|---|
| private final ContextRegistry contextRegistry | |
| emptyContextSnapshot | back to summary |
|---|---|
| private static final DefaultContextSnapshot emptyContextSnapshot | |
| DefaultContextSnapshotFactory | back to summary |
|---|---|
| public DefaultContextSnapshotFactory(ContextRegistry contextRegistry, boolean clearMissing, Predicate<Object> captureKeyPredicate) | |
| captureAll | back to summary |
|---|---|
| public ContextSnapshot captureAll(Object... contexts) Implements io. Doc from io. Capture values from Values captured multiple times are overridden in the snapshot by the order of contexts given as arguments.
| |
| captureAll | back to summary |
|---|---|
| pack-priv static ContextSnapshot captureAll(ContextRegistry contextRegistry, Predicate<Object> keyPredicate, boolean clearMissing, Object... contexts) | |
| captureFrom | back to summary |
|---|---|
| public ContextSnapshot captureFrom(Object... contexts) Implements io. Doc from io. Create a Values captured multiple times are overridden in the snapshot by the order of contexts given as arguments.
| |
| captureFromContext | back to summary |
|---|---|
pack-priv static DefaultContextSnapshot captureFromContext(Predicate<Object> keyPredicate, boolean clearMissing, ContextRegistry contextRegistry, DefaultContextSnapshot snapshot, Object... contexts)
| |
| captureFromThreadLocals | back to summary |
|---|---|
private static DefaultContextSnapshot captureFromThreadLocals(Predicate<Object> keyPredicate, boolean clearMissing, ContextRegistry contextRegistry)
| |
| clearingEmptySnapshot | back to summary |
|---|---|
| private static DefaultContextSnapshot clearingEmptySnapshot(ContextRegistry contextRegistry) | |
| setAllThreadLocalsFrom | back to summary |
|---|---|
pack-priv static <C> ContextSnapshot.
| |
| setThreadLocalsFrom | back to summary |
|---|---|
| public <C> ContextSnapshot. Implements io. Doc from io. Read the values specified by keys from the given source context, and if found, use
them to set
| |
| setThreadLocalsFrom | back to summary |
|---|---|
pack-priv static <C> ContextSnapshot.
| |
| Modifier and Type | Field and Description |
|---|---|
| private Predicate | |
| private boolean | |
| private ContextRegistry |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public ContextSnapshotFactory | build()
Implements io. ContextSnapshotFactory.
|
| public ContextSnapshotFactory. | captureKeyPredicate(Predicate<Object>
predicate used to select matching keys captureKeyPredicate)Implements io. ThreadLocal values
|
| public ContextSnapshotFactory. | clearMissing(boolean
if shouldClear)true, values not present in the context object or
snapshot will be cleared at the start of a scope and later restoredImplements io. ThreadLocal values at the start of
a scope, if there are no corresponding values in the source
ContextSnapshot or context object.
|
| public ContextSnapshotFactory. | contextRegistry(ContextRegistry
the registry to use contextRegistry)Implements io. ContextRegistry to use by the created factory.
|
| captureKeyPredicate | back to summary |
|---|---|
| private Predicate<Object> captureKeyPredicate | |
| clearMissing | back to summary |
|---|---|
| private boolean clearMissing | |
| contextRegistry | back to summary |
|---|---|
| private ContextRegistry contextRegistry | |
| Builder | back to summary |
|---|---|
| public Builder() | |
| build | back to summary |
|---|---|
| public ContextSnapshotFactory build() Implements io. Doc from io. Creates a new instance of
| |
| captureKeyPredicate | back to summary |
|---|---|
| public ContextSnapshotFactory. Implements io. Doc from io. Instructs the factory to use the given predicate to select matching keys when
capturing
| |
| clearMissing | back to summary |
|---|---|
| public ContextSnapshotFactory. Implements io. Doc from io. Determines whether to clear existing
| |
| contextRegistry | back to summary |
|---|---|
| public ContextSnapshotFactory. Implements io. Doc from io. Configures the
| |