public class JDKThreadLocal<T> extends ContextLocalBase<T> implements ContextLocal<T>
ContextLocal using
JDK ThreadLocalContextLocal.Factory, ContextLocal.InitialValueProvider<T>CONF_CONTEXT_LOCAL_FACTORY| Constructor and Description |
|---|
JDKThreadLocal() |
JDKThreadLocal(ContextLocal.InitialValueProvider<T> ivp) |
| Modifier and Type | Method and Description |
|---|---|
T |
get()
Returns the value in the current context's copy of 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.
|
initialValueapplybreakOutclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitialValuepublic JDKThreadLocal()
public JDKThreadLocal(ContextLocal.InitialValueProvider<T> ivp)
public T get()
ContextLocalContextLocal.initialValue() method.get in interface ContextLocal<T>public void set(T value)
ContextLocalContextLocal.initialValue()
method to set the values of context-locals.set in interface ContextLocal<T>value - the value to be stored in the current context's copy of
this context-local.public void remove()
ContextLocalContextLocal.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.remove in interface ContextLocal<T>Copyright © 2017. All Rights Reserved.