public interface ContextLocal<T>
Modifier and Type | Interface and Description |
---|---|
static interface |
ContextLocal.Factory |
static class |
ContextLocal.InitialValueProvider<T> |
Modifier and Type | Field and Description |
---|---|
static String |
CONF_CONTEXT_LOCAL_FACTORY |
Modifier and Type | Method and Description |
---|---|
T |
get()
Returns the value in the current context's copy of this
context-local variable.
|
T |
initialValue()
Returns the current context's "initial value" for this
context-local variable.
|
void |
remove()
Removes the current context's value for this context-local
variable.
|
void |
set(T value)
Sets the current context's copy of this context-local variable
to the specified value.
|
static final String CONF_CONTEXT_LOCAL_FACTORY
T get()
initialValue()
method.void set(T value)
initialValue()
method to set the values of context-locals.value
- the value to be stored in the current context's copy of
this context-local.void remove()
initialValue()
method,
unless its value is set by the current context
in the interim. This may result in multiple invocations of the
initialValue method in the current context.T initialValue()
get()
method, unless the context previously invoked the set(T)
method, in which case the initialValue method will not
be invoked for the context. Normally, this method is invoked at
most once per context, but it may be invoked again in case of
subsequent invocations of remove()
followed by get()
.Copyright © 2016. All Rights Reserved.