类 DetachedThreadLocal<T>

java.lang.Object
com.tlcsdm.core.concurrent.DetachedThreadLocal<T>
所有已实现的接口:
Runnable

public class DetachedThreadLocal<T> extends Object implements Runnable

A detached local that allows for explicit control of setting and removing values from a thread-local context.

Instances of this class are non-blocking and fully thread safe.
作者:
unknowIfGuestInDream
  • 字段详细资料

  • 构造器详细资料

  • 方法详细资料

    • get

      public T get()
    • getIfPresent

      public T getIfPresent()
    • set

      public void set(T value)
    • clear

      public void clear()
    • clearAll

      public void clearAll()
      Clears all thread local references for all threads.
    • pushTo

      public T pushTo(Thread thread)
      参数:
      thread - The thread to which this thread's thread local value should be pushed.
      返回:
      The value being set.
    • fetchFrom

      public T fetchFrom(Thread thread)
      参数:
      thread - The thread from which the thread thread local value should be fetched.
      返回:
      The value being set.
    • get

      public T get(Thread thread)
      参数:
      thread - The thread for which to set a thread-local value.
      返回:
      The value accociated with this thread.
    • define

      public void define(Thread thread, T value)
      参数:
      thread - The thread for which to set a thread-local value.
      value - The value to set.
    • initialValue

      protected T initialValue(Thread thread)
      参数:
      thread - The thread for which an initial value is created.
      返回:
      The initial value for any thread local. If no default is set, the default value is null.
    • inheritValue

      protected T inheritValue(T value)
      参数:
      value - The value that is inherited.
      返回:
      The inherited value.
    • getBackingMap

      public WeakConcurrentMap<Thread,T> getBackingMap()
      返回:
      The weak map that backs this detached thread local.
    • run

      public void run()
      指定者:
      run 在接口中 Runnable