eXo Kernel :: Container 2.5.0-GA

org.exoplatform.container.context
Class UnSharedContext<K>

java.lang.Object
  extended by org.exoplatform.container.context.AbstractContext<K>
      extended by org.exoplatform.container.context.UnSharedContext<K>
All Implemented Interfaces:
javax.enterprise.context.spi.Context, ThreadContextHolder, AdvancedContext<K>
Direct Known Subclasses:
RequestContext

public abstract class UnSharedContext<K>
extends AbstractContext<K>

This is the root class of all the unshared contexts, it relies on a thread local

Version:
$Id$
Author:
Nicolas Filotto

Field Summary
 
Fields inherited from interface org.exoplatform.container.component.ThreadContextHolder
MANAGE_THREAD_LOCAL
 
Constructor Summary
UnSharedContext()
           
 
Method Summary
 void deactivate(K key)
          Deactivates the current context using the given key from the context of the thread
protected  Lock getLock(String id)
          In case the context is sharable, we will need a lock to synchronize the accesses
protected  boolean isSharable()
          Indicates whether the objects of the context that can shared or not.
 void unregister(K key)
          Unregisters a given key from the context
 
Methods inherited from class org.exoplatform.container.context.AbstractContext
activate, createStorage, destroy, destroy, destroy, get, get, getId, getInstance, getStorage, getThreadContext, isActive, register, setStorage
 
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

UnSharedContext

public UnSharedContext()
Method Detail

unregister

public void unregister(K key)
Unregisters a given key from the context

Specified by:
unregister in interface AdvancedContext<K>
Overrides:
unregister in class AbstractContext<K>
Parameters:
key - the key to unregister

deactivate

public void deactivate(K key)
Deactivates the current context using the given key from the context of the thread

Specified by:
deactivate in interface AdvancedContext<K>
Overrides:
deactivate in class AbstractContext<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:
isSharable in class AbstractContext<K>
Returns:
true if the components are sharable, false otherwise.

getLock

protected final Lock getLock(String id)
In case the context is sharable, we will need a lock to synchronize the accesses

Specified by:
getLock in class AbstractContext<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

eXo Kernel :: Container 2.5.0-GA

Copyright © 2014 eXo Platform SAS. All Rights Reserved.