org.apache.myfaces.orchestra.viewController.jsf
Class ViewControllerPhaseListener

java.lang.Object
  extended by org.apache.myfaces.orchestra.viewController.jsf.ViewControllerPhaseListener

public class ViewControllerPhaseListener
extends java.lang.Object

Causes lifecycle methods to be invoked on backing beans that are associated with the current view.

For details about when initView callbacks occur, see the documentation for method initView on class ViewController.

See the javadoc for class ViewControllerManager on how to configure the ViewController behaviour.

Note that at the moment this does not support a ViewController bean for subviews (ie f:subView tags), which the Shale ViewController framework does provide. ViewController beans can only be associated with the main viewId, ie the "top level" view template file.

Note that some callbacks might not be invoked if exceptions are thrown by actionlisteners, etc (which again Shale guarantees). This is particularly important for an "endView" callback, where resources allocated on initView (such as database connections) might be released. Hopefully this will be implemented in some later Orchestra release.


Nested Class Summary
static class ViewControllerPhaseListener.ViewControllerPhaseListenerState
           
 
Constructor Summary
ViewControllerPhaseListener()
           
 
Method Summary
 void afterPhase(PhaseEvent event)
           
protected  void assertConversationState(FacesContext facesContext)
          invoked multiple times during the lifecycle to ensure the conversation(s) to the associated viewController are running.
 void beforePhase(PhaseEvent event)
           
protected  void executeInitView(FacesContext facesContext)
          invokes the initView method on your view controller
 PhaseId getPhaseId()
           
protected  ViewControllerPhaseListener.ViewControllerPhaseListenerState getState(FacesContext facesContext)
           
protected  java.lang.String getViewId(FacesContext facesContext)
           
protected  void postRestoreView(FacesContext facesContext)
          Deprecated. overload/use #executeInitView(javax.faces.context.FacesContext) instead
protected  void preInvokeApplication(FacesContext facesContext)
          invokes the preProcess method on your view controller
protected  void preRenderResponse(FacesContext facesContext)
          invokes the preRenderView method on your view controller
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewControllerPhaseListener

public ViewControllerPhaseListener()
Method Detail

beforePhase

public void beforePhase(PhaseEvent event)

afterPhase

public void afterPhase(PhaseEvent event)

getPhaseId

public PhaseId getPhaseId()

getViewId

protected java.lang.String getViewId(FacesContext facesContext)

assertConversationState

protected void assertConversationState(FacesContext facesContext)
invoked multiple times during the lifecycle to ensure the conversation(s) to the associated viewController are running.

Parameters:
facesContext -

preRenderResponse

protected void preRenderResponse(FacesContext facesContext)
invokes the preRenderView method on your view controller


executeInitView

protected void executeInitView(FacesContext facesContext)
invokes the initView method on your view controller

Since:
1.1

postRestoreView

protected void postRestoreView(FacesContext facesContext)
Deprecated. overload/use #executeInitView(javax.faces.context.FacesContext) instead


getState

protected ViewControllerPhaseListener.ViewControllerPhaseListenerState getState(FacesContext facesContext)

preInvokeApplication

protected void preInvokeApplication(FacesContext facesContext)
invokes the preProcess method on your view controller



Copyright © 2009 The Apache Software Foundation. All Rights Reserved.