public class ContextManagerImpl extends Object implements ContextManager, ThreadContextHolder
ContextManager based on a ConcurrentHashMap that is
filled thanks to a component plugins.MANAGE_THREAD_LOCAL| Constructor and Description |
|---|
ContextManagerImpl() |
| Modifier and Type | Method and Description |
|---|---|
<K> void |
addContext(AdvancedContext<K> ctx)
Registers a context
|
void |
addContexts(ContextPlugin plugin)
Adds all the contexts defined in the given plugin
|
<K> AdvancedContext<K> |
getContext(Class<? extends Annotation> scope)
Gives the context corresponding to the given scope
|
ThreadContext |
getThreadContext()
Gives the value corresponding to the context of the thread
|
boolean |
hasContext(Class<? extends Annotation> scope)
Indicates whether or not a context has a been registered for the given scope
|
public <K> AdvancedContext<K> getContext(Class<? extends Annotation> scope) throws IllegalStateException
getContext in interface ContextManagerscope - the annotation class corresponding to the scopeContext corresponding to the given scopeIllegalStateExceptionpublic boolean hasContext(Class<? extends Annotation> scope)
hasContext in interface ContextManagerscope - the scope of the contexttrue if it exists a context for the given scope, false otherwisepublic <K> void addContext(AdvancedContext<K> ctx)
addContext in interface ContextManagerctx - the Context to registerpublic void addContexts(ContextPlugin plugin)
public ThreadContext getThreadContext()
getThreadContext in interface ThreadContextHolderThreadContext if there are some
valuable ThreadLocal variables to share otherwise null
is expectedCopyright © 2018 eXo Platform SAS. All Rights Reserved.