Class IterableThreadLocal<T>
- java.lang.Object
-
- java.lang.ThreadLocal<T>
-
- fish.payara.nucleus.requesttracing.store.IterableThreadLocal<T>
-
- Type Parameters:
T
- Type of the thread local value
public class IterableThreadLocal<T> extends ThreadLocal<T> implements Iterable<Map.Entry<Thread,T>>
AThreadLocal
that allows to iterate over all availableThread
-value pairs. Note that this is not strongly consistent and may differ from actual current state in moment of change.- Author:
- Jan Bernitt
-
-
Constructor Summary
Constructors Constructor Description IterableThreadLocal(Supplier<? extends T> initialValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected T
initialValue()
Iterator<Map.Entry<Thread,T>>
iterator()
void
remove()
void
set(T value)
-
Methods inherited from class java.lang.ThreadLocal
get, withInitial
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
initialValue
protected T initialValue()
- Overrides:
initialValue
in classThreadLocal<T>
-
set
public void set(T value)
- Overrides:
set
in classThreadLocal<T>
-
remove
public void remove()
- Overrides:
remove
in classThreadLocal<T>
-
-