org.omnifaces.cdi.viewscope
Class ViewScopeContext

java.lang.Object
  extended by org.omnifaces.cdi.viewscope.ViewScopeContext
All Implemented Interfaces:
javax.enterprise.context.spi.Context

public class ViewScopeContext
extends java.lang.Object
implements javax.enterprise.context.spi.Context

Provide a context for the ViewScoped annotation wherein beans are managed by ViewScopeManager.

Since:
1.6
Author:
Radu Creanga , Bauke Scholtz
See Also:
ViewScoped, ViewScopeManager

Constructor Summary
ViewScopeContext(javax.enterprise.inject.spi.BeanManager manager, javax.enterprise.inject.spi.Bean<ViewScopeManager> bean)
          Construct a new view scope context.
 
Method Summary
<T> T
get(javax.enterprise.context.spi.Contextual<T> type)
           
<T> T
get(javax.enterprise.context.spi.Contextual<T> type, javax.enterprise.context.spi.CreationalContext<T> context)
           
 java.lang.Class<? extends java.lang.annotation.Annotation> getScope()
          Returns ViewScoped class.
 boolean isActive()
          Returns true if there is a FacesContext, and it has a UIViewRoot, and isInitialized() has returned true.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewScopeContext

public ViewScopeContext(javax.enterprise.inject.spi.BeanManager manager,
                        javax.enterprise.inject.spi.Bean<ViewScopeManager> bean)
Construct a new view scope context.

Parameters:
manager - The bean manager.
bean - The view scope manager bean.
Method Detail

getScope

public java.lang.Class<? extends java.lang.annotation.Annotation> getScope()
Returns ViewScoped class.

Specified by:
getScope in interface javax.enterprise.context.spi.Context

isActive

public boolean isActive()
Returns true if there is a FacesContext, and it has a UIViewRoot, and isInitialized() has returned true.

Specified by:
isActive in interface javax.enterprise.context.spi.Context

get

public <T> T get(javax.enterprise.context.spi.Contextual<T> type)
Specified by:
get in interface javax.enterprise.context.spi.Context

get

public <T> T get(javax.enterprise.context.spi.Contextual<T> type,
                 javax.enterprise.context.spi.CreationalContext<T> context)
Specified by:
get in interface javax.enterprise.context.spi.Context