Class UnSharedContext<K>
java.lang.Object
org.exoplatform.container.context.AbstractContext<K>
org.exoplatform.container.context.UnSharedContext<K>
- All Implemented Interfaces:
javax.enterprise.context.spi.Context,ThreadContextHolder,AdvancedContext<K>
- Direct Known Subclasses:
RequestContext
This is the root class of all the unshared contexts, it relies on a thread local
-
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 -
Method Summary
Modifier and TypeMethodDescriptionvoiddeactivate(K key) Deactivates the current context using the given key from the context of the threadprotected final LockIn case the context is sharable, we will need a lock to synchronize the accessesprotected final booleanIndicates whether the objects of the context that can shared or not.voidunregister(K key) Unregisters a given key from the contextMethods inherited from class org.exoplatform.container.context.AbstractContext
activate, createStorage, destroy, destroy, destroy, get, get, getFromCache, getId, getInstance, getStorage, getThreadContext, isActive, putInCache, register, setStorageMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.enterprise.context.spi.Context
getScope
-
Constructor Details
-
UnSharedContext
public UnSharedContext()
-
-
Method Details
-
unregister
Unregisters a given key from the context- Specified by:
unregisterin interfaceAdvancedContext<K>- Overrides:
unregisterin classAbstractContext<K>- Parameters:
key- the key to unregister
-
deactivate
Deactivates the current context using the given key from the context of the thread- Specified by:
deactivatein interfaceAdvancedContext<K>- Overrides:
deactivatein classAbstractContext<K>- Parameters:
key- the key to use to deactivate the context
-
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
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
-