Note that the way mutability is implemented differs between kinds of attributes, to account for thread-safety: per-call attributes are handled assuming that instances are never shared, whereas changes to per-reader/per-writer attributes are made assuming sharing, by creating new copies instead of modifying state. This allows sharing of default values without per-call copying, but requires two-level lookup on access.
| Modifier and Type | Class and Description |
|---|---|
| public static class |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public abstract Object | |
| public static ContextAttributes | |
| public abstract ContextAttributes | |
| public abstract ContextAttributes | withPerCallAttribute(Object key, Object value)
Mutator used during call (via context) to set value of "non-shared" part of attribute set. |
| public abstract ContextAttributes | |
| public abstract ContextAttributes |
| ContextAttributes | back to summary |
|---|---|
| public ContextAttributes() | |
| getAttribute | back to summary |
|---|---|
| public abstract Object getAttribute(Object key) Accessor for value of specified attribute | |
| getEmpty | back to summary |
|---|---|
| public static ContextAttributes getEmpty() | |
| withoutSharedAttribute | back to summary |
|---|---|
| public abstract ContextAttributes withoutSharedAttribute(Object key) | |
| withPerCallAttribute | back to summary |
|---|---|
| public abstract ContextAttributes withPerCallAttribute(Object key, Object value) Mutator used during call (via context) to set value of "non-shared" part of attribute set. | |
| withSharedAttribute | back to summary |
|---|---|
| public abstract ContextAttributes withSharedAttribute(Object key, Object value) | |
| withSharedAttributes | back to summary |
|---|---|
| public abstract ContextAttributes withSharedAttributes(Map<?, ?> attributes) | |
| Modifier and Type | Field and Description |
|---|---|
| protected transient Map | _nonShared
Per-call attributes that we can directly modify, since they are not shared between threads. |
| protected final Map | _shared
Shared attributes that we cannot modify in-place. |
| protected static final ContextAttributes. | |
| protected static final Object | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected |
| _nonShared | back to summary |
|---|---|
| protected transient Map<Object, Object> _nonShared Per-call attributes that we can directly modify, since they are not shared between threads. Note typed as Object-to-Object, unlike | |
| _shared | back to summary |
|---|---|
| protected final Map<?, ?> _shared Shared attributes that we cannot modify in-place. | |
| EMPTY | back to summary |
|---|---|
| protected static final ContextAttributes. | |
| NULL_SURROGATE | back to summary |
|---|---|
| protected static final Object NULL_SURROGATE | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| Impl | back to summary |
|---|---|
| protected Impl(Map<?, ?> shared) | |
| Impl | back to summary |
|---|---|
| protected Impl(Map<?, ?> shared, Map<Object, Object> nonShared) | |
| _copy | back to summary |
|---|---|
| private Map | |
| getAttribute | back to summary |
|---|---|
| public Object getAttribute(Object key) Implements abstract com. Doc from com. Accessor for value of specified attribute
| |
| getEmpty | back to summary |
|---|---|
| public static ContextAttributes getEmpty() Hides com. | |
| nonSharedInstance | back to summary |
|---|---|
| protected ContextAttributes nonSharedInstance(Object key, Object value) Overridable method that creates initial non-shared instance, with the first explicit set value. | |
| withoutSharedAttribute | back to summary |
|---|---|
| public ContextAttributes withoutSharedAttribute(Object key) Implements abstract com.
| |
| withPerCallAttribute | back to summary |
|---|---|
| public ContextAttributes withPerCallAttribute(Object key, Object value) Implements abstract com. Doc from com. Mutator used during call (via context) to set value of "non-shared" part of attribute set.
| |
| withSharedAttribute | back to summary |
|---|---|
| public ContextAttributes withSharedAttribute(Object key, Object value) Implements abstract com.
| |
| withSharedAttributes | back to summary |
|---|---|
| public ContextAttributes withSharedAttributes(Map<?, ?> shared) Implements abstract com.
| |