org.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation
Class WindowContextManagerObserver

java.lang.Object
  extended by org.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.WindowContextManagerObserver

@ApplicationScoped
public class WindowContextManagerObserver
extends Object

Observe some JSF phase events and set the appropriate states in the EditableWindowContextManager. We also use it to cleanup unused or obsolete WindowContexts if needed.

Author:
Gerhard Petracek

Constructor Summary
WindowContextManagerObserver()
           
 
Method Summary
protected  void cleanup(javax.faces.event.PhaseEvent phaseEvent, RequestTypeResolver requestTypeResolver, EditableWindowContextManager windowContextManager, WindowContextConfig windowContextConfig, JsfModuleConfig jsfModuleConfig)
           
protected  void tryToRestoreWindowContext(javax.faces.event.PhaseEvent phaseEvent, EditableWindowContextManager windowContextManager, WindowHandler windowHandler, WindowContextConfig windowContextConfig)
          tries to restore the window-id and the window-context as early as possible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WindowContextManagerObserver

public WindowContextManagerObserver()
Method Detail

tryToRestoreWindowContext

protected void tryToRestoreWindowContext(@Observes@BeforePhase(value=RESTORE_VIEW)
                                         javax.faces.event.PhaseEvent phaseEvent,
                                         EditableWindowContextManager windowContextManager,
                                         WindowHandler windowHandler,
                                         WindowContextConfig windowContextConfig)
tries to restore the window-id and the window-context as early as possible

Parameters:
phaseEvent - the current jsf phase-event
windowContextManager - the current window-context-manager
windowHandler - current window-handler
windowContextConfig - the active window-context-config

cleanup

protected void cleanup(@Observes@AfterPhase(value=RESTORE_VIEW)
                       javax.faces.event.PhaseEvent phaseEvent,
                       RequestTypeResolver requestTypeResolver,
                       EditableWindowContextManager windowContextManager,
                       WindowContextConfig windowContextConfig,
                       JsfModuleConfig jsfModuleConfig)


Copyright © 2010-2011 The Apache Software Foundation. All Rights Reserved.