Class ThreadLocalStateCleaner


  • public final class ThreadLocalStateCleaner
    extends java.lang.Object
    Cleans up thread local state for all threads for a given thread local instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T> void cleanupThreadLocal​(java.lang.ThreadLocal<?> threadLocal, java.lang.Thread thread, java.util.function.BiConsumer<java.lang.Thread,​T> cleanedValueListener)  
      <T> void cleanupThreadLocal​(java.lang.ThreadLocal<?> threadLocal, java.util.function.BiConsumer<java.lang.Thread,​T> cleanedValueListener)  
      <T> T getThreadLocalValue​(java.lang.ThreadLocal<?> threadLocal, java.lang.Thread thread)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • cleanupThreadLocal

        public <T> void cleanupThreadLocal​(java.lang.ThreadLocal<?> threadLocal,
                                           java.lang.Thread thread,
                                           java.util.function.BiConsumer<java.lang.Thread,​T> cleanedValueListener)
      • getThreadLocalValue

        public <T> T getThreadLocalValue​(java.lang.ThreadLocal<?> threadLocal,
                                         java.lang.Thread thread)
                                  throws java.lang.reflect.InvocationTargetException,
                                         java.lang.IllegalAccessException
        Throws:
        java.lang.reflect.InvocationTargetException
        java.lang.IllegalAccessException
      • cleanupThreadLocal

        public <T> void cleanupThreadLocal​(java.lang.ThreadLocal<?> threadLocal,
                                           java.util.function.BiConsumer<java.lang.Thread,​T> cleanedValueListener)