Top Description Fields Constructors Methods
org.h2.util

public Class DebuggingThreadLocal<T>

extends Object
Class Inheritance
Type Parameters
<T>
the type
Imports
java.util.HashMap, java.util.concurrent.ConcurrentHashMap

Similar to ThreadLocal, except that it allows its data to be read from other threads - useful for debugging info.

Field Summary

Modifier and TypeField and Description
private final ConcurrentHashMap<Long, T>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public T
get()

public HashMap<Long, T>

Returns:

a HashMap containing a mapping from thread-id to value
getSnapshotOfAllThreads
()

Get a snapshot of the data of all threads.

public void
remove()

Remove the value for the current thread.

public void
set(T value)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

mapback to summary
private final ConcurrentHashMap<Long, T> map

Constructor Detail

DebuggingThreadLocalback to summary
public DebuggingThreadLocal()

Method Detail

getback to summary
public T get()
getSnapshotOfAllThreadsback to summary
public HashMap<Long, T> getSnapshotOfAllThreads()

Get a snapshot of the data of all threads.

Returns:HashMap<Long, T>

a HashMap containing a mapping from thread-id to value

removeback to summary
public void remove()

Remove the value for the current thread.

setback to summary
public void set(T value)