Class PentahoRequestContextHolder

  • public class PentahoRequestContextHolder
    extends Object
    Stores the IPentahoRequestContext object for the current thread so that a web service bean can get to it without requiring it to be passed to its methods.

    Configure using system property pentaho.requuestContextHolder.strategy or setStrategyName(String). Valid values are: MODE_INHERITABLETHREADLOCAL and MODE_GLOBAL.

    Partially inspired by

    Ramaiz Mansoor
    • Constructor Detail

      • PentahoRequestContextHolder

        public PentahoRequestContextHolder()
    • Method Detail

      • setRequestContext

        public static void setRequestContext​(org.pentaho.platform.api.engine.IPentahoRequestContext requestContext)
        Sets an IPentahoRequestContext for the current thread
        requestContext -
      • getRequestContext

        public static org.pentaho.platform.api.engine.IPentahoRequestContext getRequestContext()
        Returns the IPentahoRequestContext for the current thread
        thread requestContext
      • removeRequestContext

        public static void removeRequestContext()
        Removes the IPentahoRequestContext for the current thread. It is important that the framework calls this to prevent RequestContext bleed- through between requests as threads are re-used by the server.
      • setStrategyName

        public static void setStrategyName​(String strategyName)