public abstract class ContextLocalBase<T> extends ContextLocal.InitialValueProvider<T> implements ContextLocal<T>
ContextLocal.Factory, ContextLocal.InitialValueProvider<T>
CONF_CONTEXT_LOCAL_FACTORY
Modifier | Constructor and Description |
---|---|
protected |
ContextLocalBase() |
protected |
ContextLocalBase(ContextLocal.InitialValueProvider<T> ivp) |
Modifier and Type | Method and Description |
---|---|
T |
initialValue()
Returns the current context’s “initial value” for this context-local variable.
|
apply
breakOut
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
get, remove, set
protected ContextLocalBase()
protected ContextLocalBase(ContextLocal.InitialValueProvider<T> ivp)
public T initialValue()
ContextLocal
Returns the current context’s “initial value” for this context-local variable. This method will be invoked the first time a context accesses the variable with the ContextLocal.get()
method, unless the context previously invoked the ContextLocal.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 ContextLocal.remove()
followed by ContextLocal.get()
.
initialValue
in interface ContextLocal<T>
initialValue
in class ContextLocal.InitialValueProvider<T>
Copyright © 2014–2018 OSGL (Open Source General Library). All rights reserved.