public final class QuerydslHttpRequestContextHolder extends Object
QuerydslHttpRequestContext. It delegates to a specific
QuerydslHttpRequestContextHolderStrategy based on runtime
configurations. Default strategy used is
MODE_THREADLOCAL which can be used
by configuring JVM property -
SYSTEM_PROPERTY.
The property can contain either of
MODE_THREADLOCAL or
MODE_INHERITABLETHREADLOCAL but if
it contains any other value, it is assumed to be a cannonical classname for
strategy to be used by this holder.| Modifier and Type | Field and Description |
|---|---|
static String |
MODE_INHERITABLETHREADLOCAL
InheritableThreadLocal based
QuerydslHttpRequestContextHolderStrategy to be used. |
static String |
MODE_THREADLOCAL
ThreadLocal based QuerydslHttpRequestContextHolderStrategy to be
used. |
static String |
SYSTEM_PROPERTY
System property to configure/override the
QuerydslHttpRequestContextHolderStrategy to be used.
|
| Constructor and Description |
|---|
QuerydslHttpRequestContextHolder() |
| Modifier and Type | Method and Description |
|---|---|
static void |
clearContext()
Explicitly clears the context value from the current thread.
|
static QuerydslHttpRequestContext |
getContext()
Obtain the current
QuerydslHttpRequestContext. |
static QuerydslHttpRequestContextHolderStrategy |
getContextHolderStrategy()
Allows retrieval of the context strategy.
|
static void |
setContext(QuerydslHttpRequestContext context)
Associates a new
QuerydslHttpRequestContext with the holder
strategy |
static void |
setStrategyName(String strategyName)
Changes the preferred strategy.
|
public static final String MODE_THREADLOCAL
ThreadLocal based QuerydslHttpRequestContextHolderStrategy to be
used.public static final String MODE_INHERITABLETHREADLOCAL
InheritableThreadLocal based
QuerydslHttpRequestContextHolderStrategy to be used.public static final String SYSTEM_PROPERTY
The property can contain either of
MODE_THREADLOCAL or
MODE_INHERITABLETHREADLOCAL but
if it contains any other value, it is assumed to be a cannonical
classname for strategy to be used by this holder.
public static void clearContext()
public static QuerydslHttpRequestContext getContext()
QuerydslHttpRequestContext.null otherwisepublic static void setContext(QuerydslHttpRequestContext context)
QuerydslHttpRequestContext with the holder
strategycontext - the new QuerydslHttpRequestContext (may not be
null)public static void setStrategyName(String strategyName)
strategyName - the fully qualified class name of the strategy that should be
used.public static QuerydslHttpRequestContextHolderStrategy getContextHolderStrategy()
Copyright © 2018–2019. All rights reserved.