public class PentahoSessionHolder extends Object
Configure using system property pentaho.sessionHolder.strategy
or setStrategyName(String)
.
Valid values are: MODE_INHERITABLETHREADLOCAL
and MODE_GLOBAL
.
Partially inspired by org.springframework.security.context.SecurityContextHolder
.
Modifier and Type | Field and Description |
---|---|
static String |
MODE_GLOBAL
Global strategy.
|
static String |
MODE_INHERITABLETHREADLOCAL
Inheritable local strategy.
|
static String |
SYSTEM_PROPERTY
Key for finding session holder strategy.
|
Constructor and Description |
---|
PentahoSessionHolder()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
static org.pentaho.platform.api.engine.IPentahoSession |
getSession()
Returns the IPentahoSession for the current thread.
|
static void |
removeSession()
Removes the IPentahoSession for the current thread.
|
static void |
setSession(org.pentaho.platform.api.engine.IPentahoSession session)
Sets an IPentahoSession for the current thread.
|
static void |
setStrategyName(String strategyName)
Sets the behavior of the session.
|
public static final String MODE_INHERITABLETHREADLOCAL
public static final String MODE_GLOBAL
public static final String SYSTEM_PROPERTY
public static void setSession(org.pentaho.platform.api.engine.IPentahoSession session)
session
- Session to be set.public static org.pentaho.platform.api.engine.IPentahoSession getSession()
public static void removeSession()
public static void setStrategyName(String strategyName)
MODE_INHERITABLETHREADLOCAL
and MODE_GLOBAL
.
The changes to the strategy are applied immediately.strategyName
- Name of the strategy to be used.Copyright © 2019 Hitachi Vantara. All rights reserved.