Package com.liferay.petra.lang
Class CentralizedThreadLocal<T>
java.lang.Object
java.lang.ThreadLocal<T>
com.liferay.petra.lang.CentralizedThreadLocal<T>
-
Constructor Summary
ConstructorsConstructorDescriptionCentralizedThreadLocal
(boolean shortLived) CentralizedThreadLocal
(String name) CentralizedThreadLocal
(String name, Supplier<T> supplier) CentralizedThreadLocal
(String name, Supplier<T> supplier, boolean shortLived) CentralizedThreadLocal
(String name, Supplier<T> supplier, Function<T, T> copyFunction, boolean shortLived) -
Method Summary
Modifier and TypeMethodDescriptionstatic void
static void
boolean
get()
static Map<CentralizedThreadLocal<?>,
Object> static Map<CentralizedThreadLocal<?>,
Object> int
hashCode()
protected T
void
remove()
void
static void
setThreadLocals
(Map<CentralizedThreadLocal<?>, Object> longLivedCentralizedThreadLocals, Map<CentralizedThreadLocal<?>, Object> shortLivedCentralizedThreadLocals) setWithSafeClosable
(T value) Deprecated.setWithSafeCloseable
(T value) toString()
Methods inherited from class java.lang.ThreadLocal
withInitial
-
Constructor Details
-
CentralizedThreadLocal
public CentralizedThreadLocal(boolean shortLived) -
CentralizedThreadLocal
-
CentralizedThreadLocal
-
CentralizedThreadLocal
-
CentralizedThreadLocal
-
-
Method Details
-
clearLongLivedCentralizedThreadLocals
public static void clearLongLivedCentralizedThreadLocals() -
clearShortLivedCentralizedThreadLocals
public static void clearShortLivedCentralizedThreadLocals() -
getLongLivedCentralizedThreadLocals
-
getShortLivedCentralizedThreadLocals
-
setThreadLocals
public static void setThreadLocals(Map<CentralizedThreadLocal<?>, Object> longLivedCentralizedThreadLocals, Map<CentralizedThreadLocal<?>, Object> shortLivedCentralizedThreadLocals) -
equals
-
get
- Overrides:
get
in classThreadLocal<T>
-
hashCode
public int hashCode() -
remove
public void remove()- Overrides:
remove
in classThreadLocal<T>
-
set
- Overrides:
set
in classThreadLocal<T>
-
setWithSafeClosable
Deprecated.As of Cavanaugh (7.4.x), replaced bysetWithSafeCloseable(T)
-
setWithSafeCloseable
-
toString
-
initialValue
- Overrides:
initialValue
in classThreadLocal<T>
-
setWithSafeCloseable(T)