Enum RequestContextStrategy

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<RequestContextStrategy>

    public enum RequestContextStrategy
    extends java.lang.Enum<RequestContextStrategy>
    The enumeration of where the Request Context stores.
    Since:
    1.0.0
    Author:
    Mercy
    See Also:
    RequestAttributes
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      DEFAULT
      Default strategy keeps the original RequestAttributes storage strategy
      INHERITABLE_THREAD_LOCAL
      InheritableThreadLocalstrategy stores the RequestAttributes in InheritableThreadLocal
      THREAD_LOCAL
      ThreadLocal strategy stores the RequestAttributes in ThreadLocal
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static RequestContextStrategy valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static RequestContextStrategy[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • DEFAULT

        public static final RequestContextStrategy DEFAULT
        Default strategy keeps the original RequestAttributes storage strategy
      • THREAD_LOCAL

        public static final RequestContextStrategy THREAD_LOCAL
        ThreadLocal strategy stores the RequestAttributes in ThreadLocal
        See Also:
        ThreadLocal, RequestContextHolder.setRequestAttributes(RequestAttributes)
      • INHERITABLE_THREAD_LOCAL

        public static final RequestContextStrategy INHERITABLE_THREAD_LOCAL
        InheritableThreadLocalstrategy stores the RequestAttributes in InheritableThreadLocal
        See Also:
        InheritableThreadLocal, RequestContextHolder.setRequestAttributes(RequestAttributes, boolean)
    • Method Detail

      • values

        public static RequestContextStrategy[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (RequestContextStrategy c : RequestContextStrategy.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static RequestContextStrategy valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null