|
eXo Kernel :: Container 2.5.0-GA | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exoplatform.container.context.AbstractContext<K>
public abstract class AbstractContext<K>
This is the root class of all the implementations of an AdvancedContext
| Field Summary |
|---|
| Fields inherited from interface org.exoplatform.container.component.ThreadContextHolder |
|---|
MANAGE_THREAD_LOCAL |
| Constructor Summary | |
|---|---|
AbstractContext()
|
|
| Method Summary | ||
|---|---|---|
void |
activate(K key)
Activates the current context using the given key within the context of the thread |
|
protected abstract CreationContextStorage |
createStorage(K key)
Creates a CreationContextStorage instance from the given key |
|
void |
deactivate(K key)
Deactivates the current context using the given key from the context of the thread |
|
protected void |
destroy()
Destroys all the CreationContext that has been stored in the current storage |
|
void |
destroy(javax.enterprise.context.spi.Contextual contextual)
Destroy the existing contextual instance. |
|
protected void |
destroy(CreationContextStorage storage)
Destroys all the CreationContext that has been stored in the given storage |
|
|
get(javax.enterprise.context.spi.Contextual<T> contextual)
|
|
|
get(javax.enterprise.context.spi.Contextual<T> contextual,
javax.enterprise.context.spi.CreationalContext<T> creationalContext)
|
|
protected
|
getId(javax.enterprise.context.spi.Contextual<T> contextual)
Gives an id for the given Contextual |
|
protected
|
getInstance(CreationContextStorage storage,
String id)
Gives the instance stored with the given Contextual id. |
|
protected abstract Lock |
getLock(String id)
In case the context is sharable, we will need a lock to synchronize the accesses |
|
protected CreationContextStorage |
getStorage()
Gives the storage to use to store and access to the CreationContext |
|
ThreadContext |
getThreadContext()
Gives the value corresponding to the context of the thread |
|
boolean |
isActive()
|
|
protected abstract boolean |
isSharable()
Indicates whether the objects of the context that can shared or not. |
|
void |
register(K key)
Registers a new key to the context |
|
protected void |
setStorage(CreationContextStorage storage)
Sets the current storage |
|
void |
unregister(K key)
Unregisters a given key from the context |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.enterprise.context.spi.Context |
|---|
getScope |
| Constructor Detail |
|---|
public AbstractContext()
| Method Detail |
|---|
public <T> T get(javax.enterprise.context.spi.Contextual<T> contextual,
javax.enterprise.context.spi.CreationalContext<T> creationalContext)
get in interface javax.enterprise.context.spi.Contextpublic <T> T get(javax.enterprise.context.spi.Contextual<T> contextual)
get in interface javax.enterprise.context.spi.Contextpublic void destroy(javax.enterprise.context.spi.Contextual contextual)
Destroy the existing contextual instance. If there is no existing instance, no action is taken.
destroy in interface AdvancedContext<K>contextual - the contextual typepublic boolean isActive()
isActive in interface javax.enterprise.context.spi.Contextpublic void activate(K key)
activate in interface AdvancedContext<K>key - the key to use to activate the contextpublic void deactivate(K key)
deactivate in interface AdvancedContext<K>key - the key to use to deactivate the contextpublic void register(K key)
register in interface AdvancedContext<K>key - the key to registerpublic void unregister(K key)
unregister in interface AdvancedContext<K>key - the key to unregisterprotected <T> String getId(javax.enterprise.context.spi.Contextual<T> contextual)
Contextual
contextual - the contextual object for which we want an idprotected abstract boolean isSharable()
true if the components are sharable, false otherwise.protected abstract Lock getLock(String id)
id - the id of the contextual for which we want a lock
protected abstract CreationContextStorage createStorage(K key)
CreationContextStorage instance from the given key
key - the key to use to create the CreationContextStorage
CreationContextStorage corresponding to the given keyprotected CreationContextStorage getStorage()
CreationContextStorage corresponding to the current contextprotected void setStorage(CreationContextStorage storage)
storage - the new current storage. Set it to null to remove the current storageprotected void destroy()
CreationContext that has been stored in the current storage
protected void destroy(CreationContextStorage storage)
CreationContext that has been stored in the given storage
storage - the storage that we would like to cleanup
protected <T> T getInstance(CreationContextStorage storage,
String id)
Contextual id.
storage - the storage from which we will get the instanceid - the id of the contextual for which we want the instance
null otherwisepublic ThreadContext getThreadContext()
getThreadContext in interface ThreadContextHolderThreadContext if there are some
valuable ThreadLocal variables to share otherwise null
is expected
|
eXo Kernel :: Container 2.5.0-GA | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||