public class ThreadLocalQuerydslHttpRequestContextHolderStrategy extends Object implements QuerydslHttpRequestContextHolderStrategy
ThreadLocal based implementation of
QuerydslHttpRequestContextHolderStrategy. Supports both
ThreadLocal as well as InheritableThreadLocal based on
initializing argument provided to it.| Constructor and Description |
|---|
ThreadLocalQuerydslHttpRequestContextHolderStrategy(boolean inheritable)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearContext()
Clears the current context.
|
QuerydslHttpRequestContext |
getContext()
Obtains the current context.
|
void |
setContext(QuerydslHttpRequestContext context)
Sets the current context.
|
public ThreadLocalQuerydslHttpRequestContextHolderStrategy(boolean inheritable)
inheritable - dictates whether a InheritableThreadLocal will be used
if this argument value is true or else a
ThreadLocal is used in case of false
value.public void clearContext()
QuerydslHttpRequestContextHolderStrategyclearContext in interface QuerydslHttpRequestContextHolderStrategypublic QuerydslHttpRequestContext getContext()
QuerydslHttpRequestContextHolderStrategygetContext in interface QuerydslHttpRequestContextHolderStrategynull otherwise.public void setContext(QuerydslHttpRequestContext context)
QuerydslHttpRequestContextHolderStrategysetContext in interface QuerydslHttpRequestContextHolderStrategycontext - to the new argument (should never be null,
although implementations must check if null has
been passed and throw an IllegalArgumentException
in such cases)Copyright © 2018–2019. All rights reserved.