public class ThreadContextUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String |
LOGGER_THREADLOCAL_KEY |
static String |
THREAD_CONTEXT_KEY |
Constructor and Description |
---|
ThreadContextUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
clear()
清除上下文变量
|
static Object |
get(String name) |
static void |
parseCurrentThreadContext(Context mainContext)
从上下文中解出THREAD_CONTEXT_KEY,并设置为线程变量
|
static void |
put(String name,
Object value) |
static void |
putCurrentThreadContextIntoContext(Context mainContext)
将线程变量取出clone一份放入上下文,key为THREAD_CONTEXT_KEY
|
static Object |
remove(String name) |
public static final String THREAD_CONTEXT_KEY
public static final String LOGGER_THREADLOCAL_KEY
public static void clear()
public static void putCurrentThreadContextIntoContext(Context mainContext)
mainContext
- public static void parseCurrentThreadContext(Context mainContext)
mainContext
- Copyright © 2006–2018 TinyGroup. All rights reserved.