com.sun.jsfcl.app
Class AbstractPageBean

java.lang.Object
  extended by com.sun.jsfcl.app.FacesBean
      extended by com.sun.jsfcl.app.AbstractPageBean
All Implemented Interfaces:
java.io.Serializable, java.util.EventListener, javax.faces.event.PhaseListener

public abstract class AbstractPageBean
extends FacesBean

AbstractPageBean is the abstract base class for every page bean associated with a JSP page containing JavaServer Faces components. It extends FacesBean, so it inherits all of the default behavior found there.

In addition to event handler methods that you create while building your application, the runtime environment will also call the following lifecycle related methods at appropriate points during the execution of your application:

See Also:
Serialized Form

Constructor Summary
AbstractPageBean()
          Register this bean as a PhaseListener so that it can participate in the request processing lifecycle of each request.
 
Method Summary
 void afterPhase(javax.faces.event.PhaseEvent event)
          If this event is for the request associated with this page bean, call through to the appropriate "after" lifecycle method for this page bean, and notify interested session bean and application bean instances as well.
 void beforePhase(javax.faces.event.PhaseEvent event)
          If this event is for the request associated with this page bean, call through to the appropriate "before" lifecycle method for this page bean, and notify interested session bean and application bean instances as well.
protected  void destroy()
          Callback method that is called after rendering is completed for this request, if init() was called, regardless of whether or not this was the page that was actually rendered.
protected  void init()
          Callback method that is called whenever a page is navigated to, either directly via a URL, or indirectly via page navigation.
protected  void preprocess()
          Callback method that is called after the component tree has been restored, but before any event processing takes place.
protected  void prerender()
          Callback method that is called just before rendering takes place.
 
Methods inherited from class com.sun.jsfcl.app.FacesBean
afterApplyRequestValues, afterInvokeApplication, afterProcessValidations, afterRenderResponse, afterRestoreView, afterUpdateModelValues, beforeApplyRequestValues, beforeInvokeApplication, beforeProcessValidations, beforeRenderResponse, beforeRestoreView, beforeUpdateModelValues, erase, error, error, fatal, fatal, getApplication, getApplicationMap, getBean, getContext, getExternalContext, getFacesContext, getLifecycle, getPhaseId, getRequestMap, getSessionMap, getValue, info, info, isPostBack, log, log, renderResponse, setBean, setValue, warn, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractPageBean

public AbstractPageBean()

Register this bean as a PhaseListener so that it can participate in the request processing lifecycle of each request.

Method Detail

beforePhase

public void beforePhase(javax.faces.event.PhaseEvent event)

If this event is for the request associated with this page bean, call through to the appropriate "before" lifecycle method for this page bean, and notify interested session bean and application bean instances as well.

Specified by:
beforePhase in interface javax.faces.event.PhaseListener
Overrides:
beforePhase in class FacesBean
Parameters:
event - PhaseEvent to be processed

afterPhase

public void afterPhase(javax.faces.event.PhaseEvent event)

If this event is for the request associated with this page bean, call through to the appropriate "after" lifecycle method for this page bean, and notify interested session bean and application bean instances as well. Then, if this is Render Response phase, deregister ourselves as a listener.

Specified by:
afterPhase in interface javax.faces.event.PhaseListener
Overrides:
afterPhase in class FacesBean
Parameters:
event - PhaseEvent to be processed

init

protected void init()

Callback method that is called whenever a page is navigated to, either directly via a URL, or indirectly via page navigation. Override this method to acquire resources that will be needed for event handlers and lifecycle methods, whether or not this page is performing post back processing. Note that this method is called before the component tree has been restored, so you do not have access to any information from the JavaServer Faces components on this page.

The default implementation does nothing.


preprocess

protected void preprocess()

Callback method that is called after the component tree has been restored, but before any event processing takes place. This method will only be called on a "post back" request that is processing a form submit. Override this method to allocate resources that will be required in your event handlers.

The default implementation does nothing.


prerender

protected void prerender()

Callback method that is called just before rendering takes place. This method will only be called for the page that will actually be rendered (and not, for example, on a page that handled a post back and then navigated to a different page). Override this method to allocate resources that will be required for rendering this page.

The default implementation does nothing.


destroy

protected void destroy()

Callback method that is called after rendering is completed for this request, if init() was called, regardless of whether or not this was the page that was actually rendered. Override this method to release resources acquired in the init(), preprocess(), or prerender() methods (or acquired during execution of an event handler).

The default implementation does nothing.