public class InternalThreadLocal<V> extends Object
| 构造器和说明 |
|---|
InternalThreadLocal() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
destroy() |
V |
get()
Returns the current value for the current thread
|
protected V |
initialValue()
Returns the initial value for this thread-local variable.
|
protected void |
onRemoval(V value)
Invoked when this thread local variable is removed by
remove(). |
void |
remove()
Sets the value to uninitialized; a proceeding call to get() will trigger a call to initialValue().
|
void |
remove(InternalThreadLocalMap threadLocalMap)
Sets the value to uninitialized for the specified thread local map;
a proceeding call to get() will trigger a call to initialValue().
|
static void |
removeAll()
Removes all
InternalThreadLocal variables bound to the current thread. |
void |
set(V value)
Sets the value for the current thread.
|
static int |
size()
Returns the number of thread local variables bound to the current thread.
|
public static void removeAll()
InternalThreadLocal variables bound to the current thread. This operation is useful when you
are in a container environment, and you don't want to leave the thread local variables in the threads you do not
manage.public static int size()
public static void destroy()
public final V get()
public final void set(V value)
public final void remove()
public final void remove(InternalThreadLocalMap threadLocalMap)
protected V initialValue() throws Exception
ExceptionCopyright © 2018. All rights reserved.