Top Description Fields Constructors Methods
com.sun.faces.application.view

public Class ViewScopeContextManager

extends Object
Class Inheritance
Static Imports
com.sun.faces.application.view.ViewScopeManager.VIEW_MAP_ID, com.sun.faces.cdi.CdiUtils.getBeanReference, com.sun.faces.config.WebConfiguration.BooleanWebContextInitParameter.EnableDistributable, com.sun.faces.context.SessionMap.getMutex, com.sun.faces.util.Util.getCdiBeanManager, java.util.logging.Level.FINEST, .Level.WARNING

The manager that deals with CDI ViewScoped beans.

Field Summary

Modifier and TypeField and Description
private static final String
ACTIVE_VIEW_CONTEXTS

Stores the constant to keep track of all the active view scope contexts.

private final BeanManager
private final boolean
private static final Logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
clear(FacesContext
the Faces context.
facesContext
)

Clear the current view map using the Faces context.

public void
clear(FacesContext
the Faces context.
facesContext
,
Map<String, Object>
the given view map.
viewMap
)
Deprecated

Clear the given view map.

public void
clear(FacesContext
the Faces context.
facesContext
,
String
The ID of the view map
viewMapId
,
Map<String, Object>
the given view map.
viewMap
)

Clear the given view map.

public <
the type.
T
>
T

Returns:

the value or null if not found.
createBean
(FacesContext
the faces context.
facesContext
,
Contextual<T>
the contextual.
contextual
,
CreationalContext<T>
the creational.
creational
)

Create the bean.

private void
destroyBeans(Map<String, Object>
the view map.
viewMap
,
Map<String, ViewScopeContextObject>
the context map.
contextMap
)

Destroy the view scoped beans for the given view and context map.

public void
public void
public <
the type.
T
>
T

Returns:

the value or null if not found.
getBean
(FacesContext
the faces context.
facesContext
,
Contextual<T>
the contextual.
contextual
)

Get the value from the view map (or null if not found).

private Map<String, ViewScopeContextObject>

Returns:

the context map.
getContextMap
(FacesContext
the Faces context.
facesContext
)

Get the context map.

private Map<String, ViewScopeContextObject>

Returns:

the context map.
getContextMap
(FacesContext
the Faces context.
facesContext
,
boolean
flag to indicate if we are creating the context map.
create
)

Get the context map.

private Map<String, ViewScopeContextObject>

Returns:

the context map.
getContextMap
(FacesContext
the Faces context.
facesContext
,
String
The viewMapId of the map.
viewMapId
)

Get the context map.

private String

Returns:

the name.
getName
(Object
the object.
instance
)

Get the name of the bean for the given object.

public void
sessionDestroyed(HttpSessionEvent
the HTTP session event.
httpSessionEvent
)

Called when a session destroyed.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ACTIVE_VIEW_CONTEXTSback to summary
private static final String ACTIVE_VIEW_CONTEXTS

Stores the constant to keep track of all the active view scope contexts.

beanManagerback to summary
private final BeanManager beanManager
distributableback to summary
private final boolean distributable
LOGGERback to summary
private static final Logger LOGGER

Constructor Detail

ViewScopeContextManagerback to summary
public ViewScopeContextManager()

Method Detail

clearback to summary
public void clear(FacesContext facesContext)

Clear the current view map using the Faces context.

Parameters
facesContext:FacesContext

the Faces context.

clearback to summary
public void clear(FacesContext facesContext, Map<String, Object> viewMap)

Deprecated

Clear the given view map. Use the version with the viewMapId.

Parameters
facesContext:FacesContext

the Faces context.

viewMap:Map<String, Object>

the given view map.

Annotations
@Deprecated
clearback to summary
public void clear(FacesContext facesContext, String viewMapId, Map<String, Object> viewMap)

Clear the given view map.

Parameters
facesContext:FacesContext

the Faces context.

viewMapId:String

The ID of the view map

viewMap:Map<String, Object>

the given view map.

createBeanback to summary
public <T> T createBean(FacesContext facesContext, Contextual<T> contextual, CreationalContext<T> creational)

Create the bean.

Parameters
<T>
the type.
facesContext:FacesContext

the faces context.

contextual:Contextual<T>

the contextual.

creational:CreationalContext<T>

the creational.

Returns:T

the value or null if not found.

destroyBeansback to summary
private void destroyBeans(Map<String, Object> viewMap, Map<String, ViewScopeContextObject> contextMap)

Destroy the view scoped beans for the given view and context map.

Parameters
viewMap:Map<String, Object>

the view map.

contextMap:Map<String, ViewScopeContextObject>

the context map.

fireDestroyedEventback to summary
public void fireDestroyedEvent(FacesContext facesContext, UIViewRoot root)
fireInitializedEventback to summary
public void fireInitializedEvent(FacesContext facesContext, UIViewRoot root)
getBeanback to summary
public <T> T getBean(FacesContext facesContext, Contextual<T> contextual)

Get the value from the view map (or null if not found).

Parameters
<T>
the type.
facesContext:FacesContext

the faces context.

contextual:Contextual<T>

the contextual.

Returns:T

the value or null if not found.

Annotations
@SuppressWarnings:unchecked
getContextMapback to summary
private Map<String, ViewScopeContextObject> getContextMap(FacesContext facesContext)

Get the context map.

Parameters
facesContext:FacesContext

the Faces context.

Returns:Map<String, ViewScopeContextObject>

the context map.

getContextMapback to summary
private Map<String, ViewScopeContextObject> getContextMap(FacesContext facesContext, boolean create)

Get the context map.

Parameters
facesContext:FacesContext

the Faces context.

create:boolean

flag to indicate if we are creating the context map.

Returns:Map<String, ViewScopeContextObject>

the context map.

Annotations
@SuppressWarnings:unchecked
getContextMapback to summary
private Map<String, ViewScopeContextObject> getContextMap(FacesContext facesContext, String viewMapId)

Get the context map.

Parameters
facesContext:FacesContext

the Faces context.

viewMapId:String

The viewMapId of the map.

Returns:Map<String, ViewScopeContextObject>

the context map.

getNameback to summary
private String getName(Object instance)

Get the name of the bean for the given object.

Parameters
instance:Object

the object.

Returns:String

the name.

sessionDestroyedback to summary
public void sessionDestroyed(HttpSessionEvent httpSessionEvent)

Called when a session destroyed.

Parameters
httpSessionEvent:HttpSessionEvent

the HTTP session event.

Annotations
@SuppressWarnings:unchecked