public static class ContextAttributes.Impl extends ContextAttributes implements java.io.Serializable
ContextAttributes.Impl
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.Object,java.lang.Object> |
_nonShared
Per-call attributes that we can directly modify, since they are not
shared between threads.
|
protected java.util.Map<?,?> |
_shared
Shared attributes that we can not modify in-place.
|
protected static ContextAttributes.Impl |
EMPTY |
protected static java.lang.Object |
NULL_SURROGATE |
private static long |
serialVersionUID |
Modifier | Constructor and Description |
---|---|
protected |
Impl(java.util.Map<?,?> shared) |
protected |
Impl(java.util.Map<?,?> shared,
java.util.Map<java.lang.Object,java.lang.Object> nonShared) |
Modifier and Type | Method and Description |
---|---|
private java.util.Map<java.lang.Object,java.lang.Object> |
_copy(java.util.Map<?,?> src) |
java.lang.Object |
getAttribute(java.lang.Object key)
Accessor for value of specified attribute
|
static ContextAttributes |
getEmpty() |
protected ContextAttributes |
nonSharedInstance(java.lang.Object key,
java.lang.Object value)
Overridable method that creates initial non-shared instance,
with the first explicit set value.
|
ContextAttributes |
withoutSharedAttribute(java.lang.Object key) |
ContextAttributes |
withPerCallAttribute(java.lang.Object key,
java.lang.Object value)
Mutator used during call (via context) to set value of "non-shared"
part of attribute set.
|
ContextAttributes |
withSharedAttribute(java.lang.Object key,
java.lang.Object value) |
ContextAttributes |
withSharedAttributes(java.util.Map<?,?> shared) |
private static final long serialVersionUID
protected static final ContextAttributes.Impl EMPTY
protected static final java.lang.Object NULL_SURROGATE
protected final java.util.Map<?,?> _shared
protected transient java.util.Map<java.lang.Object,java.lang.Object> _nonShared
NOTE: typed as Object-to-Object, unlike _shared
, because
we need to be able to modify contents, and wildcard type would
complicate that access.
protected Impl(java.util.Map<?,?> shared)
protected Impl(java.util.Map<?,?> shared, java.util.Map<java.lang.Object,java.lang.Object> nonShared)
public static ContextAttributes getEmpty()
public ContextAttributes withSharedAttribute(java.lang.Object key, java.lang.Object value)
withSharedAttribute
in class ContextAttributes
public ContextAttributes withSharedAttributes(java.util.Map<?,?> shared)
withSharedAttributes
in class ContextAttributes
public ContextAttributes withoutSharedAttribute(java.lang.Object key)
withoutSharedAttribute
in class ContextAttributes
public java.lang.Object getAttribute(java.lang.Object key)
ContextAttributes
getAttribute
in class ContextAttributes
public ContextAttributes withPerCallAttribute(java.lang.Object key, java.lang.Object value)
ContextAttributes
withPerCallAttribute
in class ContextAttributes
protected ContextAttributes nonSharedInstance(java.lang.Object key, java.lang.Object value)
private java.util.Map<java.lang.Object,java.lang.Object> _copy(java.util.Map<?,?> src)