org.springframework.core

Class NamedThreadLocal<T>

  • java.lang.Object
    • java.lang.ThreadLocal<T>
      • org.springframework.core.NamedThreadLocal<T>
  • Type Parameters:
    T - the value type


    public class NamedThreadLocal<T>
    extends java.lang.ThreadLocal<T>
    ThreadLocal subclass that exposes a specified name as toString() result (allowing for introspection).
    Since:
    2.5.2
    Author:
    Juergen Hoeller
    See Also:
    NamedInheritableThreadLocal
    • Constructor Summary

      Constructors 
      Constructor and Description
      NamedThreadLocal(java.lang.String name)
      Create a new NamedThreadLocal with the given name.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String toString() 
      • Methods inherited from class java.lang.ThreadLocal

        get, initialValue, remove, set, withInitial
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • NamedThreadLocal

        public NamedThreadLocal(java.lang.String name)
        Create a new NamedThreadLocal with the given name.
        Parameters:
        name - a descriptive name for this ThreadLocal
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object