java.lang.Object
com.sun.faces.application.view.ViewScopeManager
- All Implemented Interfaces:
FacesListener
,SystemEventListener
,ViewMapListener
,HttpSessionListener
,EventListener
The manager that deals with non-CDI and CDI ViewScoped beans.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Stores the constants to keep track of the active view maps.static final String
Stores the constant for the maximum active view map size.static final String
Stores the view map.static final String
Stores the view map id.static final String
Stores the constant to keep track of the ViewScopeManager. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear
(FacesContext facesContext) Clear the current view map using the Faces context.void
Clear the given view map.void
clear
(FacesContext facesContext, Map<String, Object> viewMap) Deprecated.void
destroyBeans
(FacesContext facesContext, Map<String, Object> viewMap) Destroy the managed beans from the given view map.static ViewScopeManager
getInstance
(FacesContext facesContext) Get our instance.boolean
isListenerForSource
(Object source) Is a listener for the given source.protected static String
locateViewMapId
(FacesContext facesContext, Map<String, Object> viewMap) Static method that locates the ID for a view map in the active view maps stored in the session.void
processEvent
(SystemEvent systemEvent) Process the system event.void
Create the associated data in the session (if any).void
sessionDestroyed
(HttpSessionEvent httpSessionEvent) Destroy the associated data in the session.
-
Field Details
-
ACTIVE_VIEW_MAPS
Stores the constants to keep track of the active view maps.- See Also:
-
ACTIVE_VIEW_MAPS_SIZE
Stores the constant for the maximum active view map size.- See Also:
-
VIEW_MAP
-
VIEW_MAP_ID
-
VIEW_SCOPE_MANAGER
Stores the constant to keep track of the ViewScopeManager.- See Also:
-
-
Constructor Details
-
ViewScopeManager
public ViewScopeManager()Constructor.
-
-
Method Details
-
locateViewMapId
Static method that locates the ID for a view map in the active view maps stored in the session. It just performs a == over the view map because it should be the same object.- Parameters:
facesContext
- The faces contextviewMap
- The view to locate- Returns:
- located ID
-
clear
Clear the current view map using the Faces context.- Parameters:
facesContext
- the Faces context.
-
clear
Deprecated.Clear the given view map. Use the version with viewMapId.- Parameters:
facesContext
- the Faces context.viewMap
- the view map.
-
clear
Clear the given view map.- Parameters:
facesContext
- the Faces context.viewMapId
- The ID of the view mapviewMap
- the view map.
-
destroyBeans
Destroy the managed beans from the given view map.- Parameters:
facesContext
- the Faces Context.viewMap
- the view map.
-
getInstance
Get our instance.- Parameters:
facesContext
- the FacesContext.- Returns:
- our instance.
-
isListenerForSource
Is a listener for the given source.- Specified by:
isListenerForSource
in interfaceSystemEventListener
- Parameters:
source
- the source.- Returns:
- true if UIViewRoot, false otherwise.
-
processEvent
Process the system event.- Specified by:
processEvent
in interfaceSystemEventListener
- Parameters:
systemEvent
- the system event.- Throws:
AbortProcessingException
- when processing needs to be aborted.
-
sessionCreated
Create the associated data in the session (if any).- Specified by:
sessionCreated
in interfaceHttpSessionListener
- Parameters:
se
- the HTTP session event.
-
sessionDestroyed
Destroy the associated data in the session.- Specified by:
sessionDestroyed
in interfaceHttpSessionListener
- Parameters:
httpSessionEvent
- the HTTP session event.
-