Class SharedContext<K>
- java.lang.Object
-
- org.exoplatform.container.context.AbstractContext<K>
-
- org.exoplatform.container.context.SharedContext<K>
-
- All Implemented Interfaces:
javax.enterprise.context.spi.Context,ThreadContextHolder,AdvancedContext<K>
- Direct Known Subclasses:
SessionContext
public abstract class SharedContext<K> extends AbstractContext<K>
This is the root class of all the shared contexts, it relies on aConcurrentMap- Version:
- $Id$
- Author:
- Nicolas Filotto
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.exoplatform.container.context.AbstractContext
AbstractContext.ThreadLocalData
-
-
Field Summary
-
Fields inherited from interface org.exoplatform.container.component.ThreadContextHolder
MANAGE_THREAD_LOCAL
-
-
Constructor Summary
Constructors Constructor Description SharedContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected LockgetLock(String id)In case the context is sharable, we will need a lock to synchronize the accessesprotected booleanisSharable()Indicates whether the objects of the context that can shared or not.-
Methods inherited from class org.exoplatform.container.context.AbstractContext
activate, createStorage, deactivate, destroy, destroy, destroy, get, get, getFromCache, getId, getInstance, getStorage, getThreadContext, isActive, putInCache, register, setStorage, unregister
-
-
-
-
Method Detail
-
isSharable
protected final boolean isSharable()
Indicates whether the objects of the context that can shared or not. sharable- Specified by:
isSharablein classAbstractContext<K>- Returns:
trueif the components are sharable,falseotherwise.
-
getLock
protected Lock getLock(String id)
In case the context is sharable, we will need a lock to synchronize the accesses- Specified by:
getLockin classAbstractContext<K>- Parameters:
id- the id of the contextual for which we want a lock- Returns:
- a lock corresponding to the given contextual within the current context
-
-