Intro :
When a page is submitted and a new page requested, the application invokes both the ADF Faces page lifecycle, which extends the standard JSF request lifecycle, and the ADF page lifecycle.
The extended JSF lifecycle handles submitting the values on the page, validating component values, navigating pages, displaying components on the resulting page, and saving and restoring state.
The FacesServlet servlet manages the request processing lifecycle in JSF applications. It creates an object called FacesContext, which contains the information necessary for request processing, and invokes an object that executes the lifecycle.
The ADF page lifecycle handles preparing and updating the data model, validating the data at the model layer, and executing methods on the business layer. It uses the binding container to make data available for easy referencing by the page during the current page request.
With following example you will get the detailed idea about the ADF Lifecyle.
1.Suppose a web request for some page ex. http://server/yourapp/temp.jsp arrives from the client to the application server.
2.The ADFBindingFilter object looks for the ADF binding context in the HTTP session, and if it is not yet present, initializes it for the first time. It's work is to find the name of the binding context metadata file, and finding and constructing an instance of each data control.
3.The ADFBindingFilter object invokes the beginRequest() method on each data control participating in the request. This method gives the data control a notification at the start of every request so that it can perform any necessary setup.
4.The JSF Lifecycle object, which is responsible for orchestrating the standard processing phases of each request, notifies the ADFPhaseListener class during each phase of the lifecycle, so that it can perform custom processing to coordinate the JSF lifecycle with the ADF Model data binding layer.
5.The ADFPhaseListener object creates an ADF PageLifecycle object to handle each request and delegates appropriate before and after phase methods to corresponding methods in the ADF PageLifecycle class. If the appropriate binding container for the page has never been used before during the user's session, it is created.
6.The first time an application module(AM) data control is referenced during the request, it acquires an instance of the application module from the application module pool.
7.The JSF Lifecycle object forwards control to the page to be rendered.
8.The UI components on the page access value bindings and iterator bindings in the page's binding container and render the formatted output to appear in the browser.
9.The ADFBindingFilter object invokes the endRequest() method on each data control participating in the request. This method gives a data control notification at the end of every request, so that they can perform any necessary resource cleanup.
10.An application module data control uses the endRequest notification to release the instance of the application module back to the application module pool.
11.The user sees the resulting page in the browser.
Comments
Post a Comment