Class PlainRequestContextHolder

java.lang.Object
com.sap.cds.framework.plain.servlet.PlainRequestContextHolder
All Implemented Interfaces:
AutoCloseable

public class PlainRequestContextHolder extends Object implements AutoCloseable
A thread-local storage to keep request-dependent data.
  • Method Details

    • initialize

      public static PlainRequestContextHolder initialize()
      Creates a new context instance.
      Returns:
      The context holder instance for the current thread
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • get

      public static <K, V> V get(K key)
      Fetches the value stored for given key.
      Type Parameters:
      K - The key type
      V - The value type
      Parameters:
      key - The key
      Returns:
      The value of null if not existing
    • set

      public <K, V> void set(K key, V value)
      Stores the given value for the given key in the current request context.
      Type Parameters:
      K - The key type
      V - The value type
      Parameters:
      key - The key
      value - The value