org.apache.myfaces.cdi.view
Class ViewScopeContextualStorage

java.lang.Object
  extended by org.apache.myfaces.cdi.view.ViewScopeContextualStorage
All Implemented Interfaces:
Serializable

public class ViewScopeContextualStorage
extends Object
implements Serializable

This Storage holds all information needed for storing View Scope instances in a context. This scope requires passivation and is not concurrent.

See Also:
Serialized Form

Constructor Summary
ViewScopeContextualStorage(javax.enterprise.inject.spi.BeanManager beanManager)
           
 
Method Summary
<T> T
createContextualInstance(javax.enterprise.context.spi.Contextual<T> bean, javax.enterprise.context.spi.CreationalContext<T> creationalContext)
           
 javax.enterprise.context.spi.Contextual<?> getBean(Object beanKey)
          Restores the Bean from its beanKey.
<T> Object
getBeanKey(javax.enterprise.context.spi.Contextual<T> bean)
          If the context is a passivating scope then we return the passivationId of the Bean.
 Map<String,Object> getNameBeanKeyMap()
           
 Map<Object,ContextualInstanceInfo<?>> getStorage()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewScopeContextualStorage

public ViewScopeContextualStorage(javax.enterprise.inject.spi.BeanManager beanManager)
Parameters:
beanManager - is needed for serialisation
concurrent - whether the ContextualStorage might get accessed concurrently by different threads
passivationCapable - whether the storage is for passivation capable Scopes
Method Detail

getStorage

public Map<Object,ContextualInstanceInfo<?>> getStorage()
Returns:
the underlying storage map.

getNameBeanKeyMap

public Map<String,Object> getNameBeanKeyMap()

createContextualInstance

public <T> T createContextualInstance(javax.enterprise.context.spi.Contextual<T> bean,
                                      javax.enterprise.context.spi.CreationalContext<T> creationalContext)
Type Parameters:
T -
Parameters:
bean -
creationalContext -
Returns:

getBeanKey

public <T> Object getBeanKey(javax.enterprise.context.spi.Contextual<T> bean)
If the context is a passivating scope then we return the passivationId of the Bean. Otherwise we use the Bean directly.

Returns:
the key to use in the context map

getBean

public javax.enterprise.context.spi.Contextual<?> getBean(Object beanKey)
Restores the Bean from its beanKey.

See Also:
getBeanKey(javax.enterprise.context.spi.Contextual)


Copyright © 2014 The Apache Software Foundation. All rights reserved.