public class ViewScopeEventListener extends Object implements ViewMapListener
ViewScopeManager
Constructor and Description |
---|
ViewScopeEventListener() |
Modifier and Type | Method and Description |
---|---|
boolean |
isListenerForSource(Object source)
Returns
true if given source is an instance of UIViewRoot . |
void |
processEvent(SystemEvent event)
If the event is an instance of
PreDestroyViewMapEvent , which means that the JSF view scope is about to
be destroyed, then find the current instance of ViewScopeManager and invoke its
ViewScopeManager.preDestroyView() method. |
public boolean isListenerForSource(Object source)
true
if given source is an instance of UIViewRoot
.isListenerForSource
in interface SystemEventListener
public void processEvent(SystemEvent event) throws AbortProcessingException
PreDestroyViewMapEvent
, which means that the JSF view scope is about to
be destroyed, then find the current instance of ViewScopeManager
and invoke its
ViewScopeManager.preDestroyView()
method.
Or, if the event is an instance of PostRestoreStateEvent
, which means that the JSF view scope has
recently restored, then check if the current request is an unload request and if so, then destroy the JSF view
scope the same way as described above.
processEvent
in interface SystemEventListener
AbortProcessingException
Copyright © 2012–2015 OmniFaces. All rights reserved.