Modifier and Type | Class and Description |
---|---|
static class |
DetachedThreadLocal.Cleaner
Determines the cleaning format.
|
Constructor and Description |
---|
DetachedThreadLocal(DetachedThreadLocal.Cleaner cleaner) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
void |
clearAll()
Clears all thread local references for all threads.
|
void |
define(Thread thread,
T value) |
T |
fetchFrom(Thread thread) |
T |
get() |
T |
get(Thread thread) |
WeakConcurrentMap<Thread,T> |
getBackingMap() |
protected T |
inheritValue(T value) |
protected T |
initialValue(Thread thread) |
T |
pushTo(Thread thread) |
void |
run() |
void |
set(T value) |
public DetachedThreadLocal(DetachedThreadLocal.Cleaner cleaner)
public T get()
public void set(T value)
public void clear()
public void clearAll()
public T pushTo(Thread thread)
thread
- The thread to which this thread's thread local value should be pushed.public T fetchFrom(Thread thread)
thread
- The thread from which the thread thread local value should be fetched.public T get(Thread thread)
thread
- The thread for which to set a thread-local value.public void define(Thread thread, T value)
thread
- The thread for which to set a thread-local value.value
- The value to set.protected T initialValue(Thread thread)
thread
- The thread for which an initial value is created.null
.protected T inheritValue(T value)
value
- The value that is inherited.public WeakConcurrentMap<Thread,T> getBackingMap()
Copyright © 2019. All rights reserved.