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 voidstatic voidbooleanget()static Map<CentralizedThreadLocal<?>,Object> static Map<CentralizedThreadLocal<?>,Object> inthashCode()protected Tvoidremove()voidstatic voidsetThreadLocals(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:
getin classThreadLocal<T>
-
hashCode
public int hashCode() -
remove
public void remove()- Overrides:
removein classThreadLocal<T>
-
set
- Overrides:
setin classThreadLocal<T>
-
setWithSafeClosable
Deprecated.As of Cavanaugh (7.4.x), replaced bysetWithSafeCloseable(T) -
setWithSafeCloseable
-
toString
-
initialValue
- Overrides:
initialValuein classThreadLocal<T>
-
setWithSafeCloseable(T)