Package de.hybris.platform.util
Class ThreadLocalUtilities
java.lang.Object
de.hybris.platform.util.ThreadLocalUtilities
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidclearThreadLocalMemoryForCurrentThread(Map<ThreadLocal, Object> threadlocalsBefore) Removes allThreadLocaldata which has been added to the current thread excluding a specified set of previously existing data.static Map<ThreadLocal,Object> Extracts all data currently held byThreadLocalinstances for the current thread.
-
Method Details
-
clearThreadLocalMemoryForCurrentThread
public static void clearThreadLocalMemoryForCurrentThread(Map<ThreadLocal, Object> threadlocalsBefore) Removes allThreadLocaldata which has been added to the current thread excluding a specified set of previously existing data.This is a workaround for PLA-10329 (java bug http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6625723 ) which is removing all ThreadLocals from current thread that belong to ReentrantReadWriteLocks. Please be aware that this relies on some very dirty reflection work and might break in future.
- Parameters:
threadlocalsBefore- the data to preserve. seeextractThreadLocalValuesForCurrentThread()
-
extractThreadLocalValuesForCurrentThread
Extracts all data currently held byThreadLocalinstances for the current thread. Please be aware that this relies on some very dirty reflection work and might break in future.
-