Class PentahoRequestContextHolder
- java.lang.Object
-
- org.pentaho.platform.engine.core.system.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.strategyorsetStrategyName(String). Valid values are:MODE_INHERITABLETHREADLOCALandMODE_GLOBAL.Partially inspired by
org.springframework.security.context.SecurityContextHolder.- Author:
- Ramaiz Mansoor
-
-
Field Summary
Fields Modifier and Type Field Description static StringMODE_GLOBALstatic StringMODE_INHERITABLETHREADLOCALstatic StringSYSTEM_PROPERTY
-
Constructor Summary
Constructors Constructor Description PentahoRequestContextHolder()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.pentaho.platform.api.engine.IPentahoRequestContextgetRequestContext()Returns the IPentahoRequestContext for the current threadstatic voidremoveRequestContext()Removes the IPentahoRequestContext for the current thread.static voidsetRequestContext(org.pentaho.platform.api.engine.IPentahoRequestContext requestContext)Sets an IPentahoRequestContext for the current threadstatic voidsetStrategyName(String strategyName)
-
-
-
Field Detail
-
MODE_INHERITABLETHREADLOCAL
public static final String MODE_INHERITABLETHREADLOCAL
- See Also:
- Constant Field Values
-
MODE_GLOBAL
public static final String MODE_GLOBAL
- See Also:
- Constant Field Values
-
SYSTEM_PROPERTY
public static final String SYSTEM_PROPERTY
- See Also:
- Constant Field Values
-
-
Method Detail
-
setRequestContext
public static void setRequestContext(org.pentaho.platform.api.engine.IPentahoRequestContext requestContext)
Sets an IPentahoRequestContext for the current thread- Parameters:
requestContext-
-
getRequestContext
public static org.pentaho.platform.api.engine.IPentahoRequestContext getRequestContext()
Returns the IPentahoRequestContext for the current thread- Returns:
- 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)
-
-