Interface ExecutorUtil.InheritableThreadLocalProvider

  • Enclosing class:
    ExecutorUtil

    public static interface ExecutorUtil.InheritableThreadLocalProvider
    Any class which wants to carry forward the thread local values to the threads run by thread pools must implement this interface and the implementation should be registered here
    • Method Detail

      • store

        void store​(AtomicReference<Object> ctx)
        This is invoked in the parent thread which submitted a task. copy the necessary Objects to the ctx. The object that is passed is same across all three methods
      • set

        void set​(AtomicReference<Object> ctx)
        This is invoked in the thread pool thread. set the appropriate values in the thread local of this thread.
      • clean

        void clean​(AtomicReference<Object> ctx)
        This method is invoked in the thread pool thread after the execution clean all the variables set in the set method