ContextAttributes.Impl
public abstract class ContextAttributes extends Object
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 | Description |
---|---|---|
static class |
ContextAttributes.Impl |
Constructor | Description |
---|---|
ContextAttributes() |
Modifier and Type | Method | Description |
---|---|---|
abstract Object |
getAttribute(Object key) |
Accessor for value of specified attribute
|
static ContextAttributes |
getEmpty() |
|
abstract ContextAttributes |
withoutSharedAttribute(Object key) |
|
abstract ContextAttributes |
withPerCallAttribute(Object key,
Object value) |
Mutator used during call (via context) to set value of "non-shared"
part of attribute set.
|
abstract ContextAttributes |
withSharedAttribute(Object key,
Object value) |
|
abstract ContextAttributes |
withSharedAttributes(Map<?,?> attributes) |
public static ContextAttributes getEmpty()
public abstract ContextAttributes withSharedAttribute(Object key, Object value)
public abstract ContextAttributes withSharedAttributes(Map<?,?> attributes)
public abstract ContextAttributes withoutSharedAttribute(Object key)
public abstract Object getAttribute(Object key)
public abstract ContextAttributes withPerCallAttribute(Object key, Object value)
Copyright © 2008–2018. All rights reserved.