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

public Class ViewScopeManager

extends Object
implements HttpSessionListener, ViewMapListener
Class Inheritance
All Implemented Interfaces
javax.faces.event.ViewMapListener, javax.faces.event.SystemEventListener, javax.faces.event.FacesListener, java.util.EventListener, javax.servlet.http.HttpSessionListener
Imports
com.sun.faces.application.ApplicationAssociate, com.sun.faces.config.WebConfiguration, com.sun.faces.mgbean.BeanManager, com.sun.faces.util.LRUMap, java.util.Collections, .Iterator, .Map, .UUID, java.util.logging.Level, .Logger, javax.faces.application.FacesMessage, .ProjectStage, javax.faces.component.UIViewRoot, javax.faces.context.FacesContext, javax.faces.event.AbortProcessingException, .PostConstructViewMapEvent, .PreDestroyViewMapEvent, .SystemEvent, .ViewMapListener, javax.servlet.http.HttpSession, .HttpSessionEvent, .HttpSessionListener

The manager that deals with non-CDI and CDI ViewScoped beans.

Field Summary

Modifier and TypeField and Description
public static final String
ACTIVE_VIEW_MAPS

Stores the constants to keep track of the active view maps.

public static final String
ACTIVE_VIEW_MAPS_SIZE

Stores the constant for the maximum active view map size.

private ViewScopeContextManager
contextManager

Stores the CDI context manager.

private boolean
private static final Logger
LOGGER

Stores the logger.

public static final String
VIEW_MAP

Stores the view map.

public static final String
VIEW_MAP_ID

Stores the view map id.

public static final String
VIEW_SCOPE_MANAGER

Stores the constant to keep track of the ViewScopeManager.

Constructor Summary

AccessConstructor and Description
public
ViewScopeManager()

Constructor.

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 view map.
viewMap
)

Clear the given view map.

private void
destroyBeans(ApplicationAssociate
the application associate.
applicationAssociate
,
Map<String, Object>
the view map.
viewMap
)

Destroy the managed beans from the given view map.

public void
destroyBeans(FacesContext
the Faces Context.
facesContext
,
Map<String, Object>
the view map.
viewMap
)

Destroy the managed beans from the given view map.

pack-priv ViewScopeContextManager

Returns:

the CDI context manager.
getContextManager
()

Get the CDI context manager.

public static ViewScopeManager
getInstance(FacesContext
the FacesContext.
facesContext
)

Get our instance.

public boolean

Returns:

true if UIViewRoot, false otherwise.
isListenerForSource
(Object
the source.
source
)

Implements javax.faces.event.SystemEventListener.isListenerForSource.

Is a listener for the given source.
public void
processEvent(SystemEvent
the system event.
se
)

Implements javax.faces.event.SystemEventListener.processEvent.

Process the system event.
private void
processPostConstructViewMap(SystemEvent
the system event.
se
)

Process the PostConstructViewMap system event.

private void
processPreDestroyViewMap(SystemEvent
the system event.
se
)

Process the PreDestroyViewMap system event.

private void
removeEldestViewMap(FacesContext facesContext, Map<String, Object>
the eldest view map.
eldestViewMap
)

Remove the eldest view map from the active view maps.

public void
sessionCreated(HttpSessionEvent
the HTTP session event.
se
)

Overrides default javax.servlet.http.HttpSessionListener.sessionCreated.

Create the associated data in the session (if any).
public void
sessionDestroyed(HttpSessionEvent
the HTTP session event.
hse
)

Overrides default javax.servlet.http.HttpSessionListener.sessionDestroyed.

Destroy the associated data in the session.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ACTIVE_VIEW_MAPSback to summary
public static final String ACTIVE_VIEW_MAPS

Stores the constants to keep track of the active view maps.

ACTIVE_VIEW_MAPS_SIZEback to summary
public static final String ACTIVE_VIEW_MAPS_SIZE

Stores the constant for the maximum active view map size.

contextManagerback to summary
private ViewScopeContextManager contextManager

Stores the CDI context manager.

distributableback to summary
private boolean distributable
LOGGERback to summary
private static final Logger LOGGER

Stores the logger.

VIEW_MAPback to summary
public static final String VIEW_MAP

Stores the view map.

VIEW_MAP_IDback to summary
public static final String VIEW_MAP_ID

Stores the view map id.

VIEW_SCOPE_MANAGERback to summary
public static final String VIEW_SCOPE_MANAGER

Stores the constant to keep track of the ViewScopeManager.

Constructor Detail

ViewScopeManagerback to summary
public ViewScopeManager()

Constructor.

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)

Clear the given view map.

Parameters
facesContext:FacesContext

the Faces context.

viewMap:Map<String, Object>

the view map.

destroyBeansback to summary
private void destroyBeans(ApplicationAssociate applicationAssociate, Map<String, Object> viewMap)

Destroy the managed beans from the given view map.

Parameters
applicationAssociate:ApplicationAssociate

the application associate.

viewMap:Map<String, Object>

the view map.

destroyBeansback to summary
public void destroyBeans(FacesContext facesContext, Map<String, Object> viewMap)

Destroy the managed beans from the given view map.

Parameters
facesContext:FacesContext

the Faces Context.

viewMap:Map<String, Object>

the view map.

getContextManagerback to summary
pack-priv ViewScopeContextManager getContextManager()

Get the CDI context manager.

Returns:ViewScopeContextManager

the CDI context manager.

getInstanceback to summary
public static ViewScopeManager getInstance(FacesContext facesContext)

Get our instance.

Parameters
facesContext:FacesContext

the FacesContext.

isListenerForSourceback to summary
public boolean isListenerForSource(Object source)

Implements javax.faces.event.SystemEventListener.isListenerForSource.

Is a listener for the given source.

Parameters
source:Object

the source.

Returns:boolean

true if UIViewRoot, false otherwise.

Annotations
@Override
processEventback to summary
public void processEvent(SystemEvent se) throws AbortProcessingException

Implements javax.faces.event.SystemEventListener.processEvent.

Process the system event.

Parameters
se:SystemEvent

the system event.

Annotations
@Override
Exceptions
AbortProcessingException:
when processing needs to be aborter.
processPostConstructViewMapback to summary
private void processPostConstructViewMap(SystemEvent se)

Process the PostConstructViewMap system event.

Parameters
se:SystemEvent

the system event.

processPreDestroyViewMapback to summary
private void processPreDestroyViewMap(SystemEvent se)

Process the PreDestroyViewMap system event.

Parameters
se:SystemEvent

the system event.

removeEldestViewMapback to summary
private void removeEldestViewMap(FacesContext facesContext, Map<String, Object> eldestViewMap)

Remove the eldest view map from the active view maps.

Parameters
eldestViewMap:Map<String, Object>

the eldest view map.

sessionCreatedback to summary
public void sessionCreated(HttpSessionEvent se)

Overrides default javax.servlet.http.HttpSessionListener.sessionCreated.

Create the associated data in the session (if any).

Parameters
se:HttpSessionEvent

the HTTP session event.

Annotations
@Override
sessionDestroyedback to summary
public void sessionDestroyed(HttpSessionEvent hse)

Overrides default javax.servlet.http.HttpSessionListener.sessionDestroyed.

Destroy the associated data in the session.

Parameters
hse:HttpSessionEvent

the HTTP session event.

Annotations
@Override