public class BackgroundContext
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.lang.ThreadLocal<BackgroundContext> |
contextStore
The ThreadLocal instance that will contain the various BackgroundContext objects.
|
private java.lang.String |
processDescriptionKey |
private User |
user |
Modifier | Constructor and Description |
---|---|
private |
BackgroundContext(java.lang.String processDescriptionKey) |
private |
BackgroundContext(User user)
Constructor
|
Modifier and Type | Method and Description |
---|---|
static BackgroundContext |
get()
Used within user code to access the context objects.
|
java.lang.String |
getProcessDescriptionKey() |
User |
getUser() |
static void |
remove()
Removes the BackgroundContext object from this thread once we are done with it.
|
static void |
set(java.lang.String processDescriptionKey) |
static void |
set(User user)
Creates the BackgroundContext instance for this thread and adds it to the store.
|
private static java.lang.ThreadLocal<BackgroundContext> contextStore
private final User user
private final java.lang.String processDescriptionKey
private BackgroundContext(User user)
private BackgroundContext(java.lang.String processDescriptionKey)
public static void set(User user)
public static void set(java.lang.String processDescriptionKey)
public static BackgroundContext get()
public static void remove()
public User getUser()
public java.lang.String getProcessDescriptionKey()