public final class ThreadLocalUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ThreadLocalUtils.ThreadLocalLifecycle
Integration interface implemented by an object that cleans up the
ThreadLocals in a ThreadLocalManager with the specified lifetime.
|
static class |
ThreadLocalUtils.ThreadLocalManager
Integration interface implemented by object holding onto ThreadLocals
with a specified lifetime
|
Modifier and Type | Method and Description |
---|---|
static <T> ThreadLocal<T> |
newRequestThreadLocal()
Creates and returns a new ThreadLocal that will be automatically removed from
the each request thread when the request finishes.
|
static <T> ThreadLocal<T> |
registerRequestThreadLocal(ThreadLocal<T> threadLocal)
Registers and returns the ThreadLocal to be automatically removed from
the each request thread when the request finishes.
|
public static <T> ThreadLocal<T> newRequestThreadLocal()
registerRequestThreadLocal(java.lang.ThreadLocal<T>)
public static <T> ThreadLocal<T> registerRequestThreadLocal(ThreadLocal<T> threadLocal)
threadLocal
- ThreadLocal to register for automatic removalnewRequestThreadLocal()
Copyright © 2001-2016 The Apache Software Foundation. All Rights Reserved.