public class ViewScopeContextManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
ACTIVE_VIEW_CONTEXTS
Stores the constant to keep track of all the active view scope contexts.
|
private static java.lang.String |
ACTIVE_VIEW_MAPS
Stores the constants to keep track of the active view maps.
|
private javax.enterprise.inject.spi.BeanManager |
beanManager |
private boolean |
isCdiOneOneOrGreater |
private static java.util.logging.Logger |
LOGGER |
private java.lang.Class |
viewScopedCDIEventFireHelperImplClass |
Constructor and Description |
---|
ViewScopeContextManager() |
Modifier and Type | Method and Description |
---|---|
void |
clear(javax.faces.context.FacesContext facesContext)
Clear the current view map using the Faces context.
|
void |
clear(javax.faces.context.FacesContext facesContext,
java.util.Map<java.lang.String,java.lang.Object> viewMap)
Clear the given view map.
|
<T> T |
createBean(javax.faces.context.FacesContext facesContext,
javax.enterprise.context.spi.Contextual<T> contextual,
javax.enterprise.context.spi.CreationalContext<T> creational)
Create the bean.
|
private void |
destroyBeans(java.util.Map<java.lang.String,java.lang.Object> viewMap,
java.util.Map<java.lang.String,ViewScopeContextObject> contextMap)
Destroy the view scoped beans for the given view and context map.
|
void |
fireDestroyedEvent(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIViewRoot root) |
void |
fireInitializedEvent(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIViewRoot root) |
<T> T |
getBean(javax.faces.context.FacesContext facesContext,
javax.enterprise.context.spi.Contextual<T> contextual)
Get the value from the view map (or null if not found).
|
private java.util.Map<java.lang.String,ViewScopeContextObject> |
getContextMap(javax.faces.context.FacesContext facesContext)
Get the context map.
|
private java.util.Map<java.lang.String,ViewScopeContextObject> |
getContextMap(javax.faces.context.FacesContext facesContext,
boolean create)
Get the context map.
|
private java.util.Map<java.lang.String,ViewScopeContextObject> |
getContextMap(javax.faces.context.FacesContext facesContext,
java.util.Map<java.lang.String,java.lang.Object> viewMap)
Get the context map.
|
private java.lang.String |
getName(java.lang.Object instance)
Get the name of the bean for the given object.
|
void |
sessionDestroyed(javax.servlet.http.HttpSessionEvent hse)
Called when a session destroyed.
|
private static final java.util.logging.Logger LOGGER
private boolean isCdiOneOneOrGreater
private java.lang.Class viewScopedCDIEventFireHelperImplClass
private static final java.lang.String ACTIVE_VIEW_CONTEXTS
private static final java.lang.String ACTIVE_VIEW_MAPS
private final javax.enterprise.inject.spi.BeanManager beanManager
public void clear(javax.faces.context.FacesContext facesContext)
facesContext
- the Faces context.public void clear(javax.faces.context.FacesContext facesContext, java.util.Map<java.lang.String,java.lang.Object> viewMap)
facesContext
- the Faces context.viewMap
- the given view map.public <T> T createBean(javax.faces.context.FacesContext facesContext, javax.enterprise.context.spi.Contextual<T> contextual, javax.enterprise.context.spi.CreationalContext<T> creational)
T
- the type.facesContext
- the faces context.contextual
- the contextual.creational
- the creational.private void destroyBeans(java.util.Map<java.lang.String,java.lang.Object> viewMap, java.util.Map<java.lang.String,ViewScopeContextObject> contextMap)
viewMap
- the view map.contextMap
- the context map.public <T> T getBean(javax.faces.context.FacesContext facesContext, javax.enterprise.context.spi.Contextual<T> contextual)
T
- the type.facesContext
- the faces context.contextual
- the contextual.private java.util.Map<java.lang.String,ViewScopeContextObject> getContextMap(javax.faces.context.FacesContext facesContext)
facesContext
- the Faces context.private java.util.Map<java.lang.String,ViewScopeContextObject> getContextMap(javax.faces.context.FacesContext facesContext, boolean create)
facesContext
- the Faces context.create
- flag to indicate if we are creating the context map.private java.util.Map<java.lang.String,ViewScopeContextObject> getContextMap(javax.faces.context.FacesContext facesContext, java.util.Map<java.lang.String,java.lang.Object> viewMap)
facesContext
- the Faces context.create
- flag to indicate if we are creating the context map.private java.lang.String getName(java.lang.Object instance)
instance
- the object.public void sessionDestroyed(javax.servlet.http.HttpSessionEvent hse)
hse
- the HTTP session event.public void fireInitializedEvent(javax.faces.context.FacesContext facesContext, javax.faces.component.UIViewRoot root)
public void fireDestroyedEvent(javax.faces.context.FacesContext facesContext, javax.faces.component.UIViewRoot root)
Copyright © 2002-2013 Oracle America, Inc. All Rights Reserved.