TOC PREV NEXT INDEX

Synchronous and Asynchronous Updates


Normally, JSF applications update the presentation as part of the standard request/response cycle. From the perspective of the server-resident application, we refer to this as a synchronous update. The update is initiated from the client and is handled synchronously at the server while the presentation is updated in the response. A synchronous update for ICEfaces is illustrated in Figure 6 .

Figure 6 Synchronous Updates



One serious deficiency with synchronous updates is that the application requires a client-generated request before it can affect presentation layer changes. If an application state change occurs during a period of client inactivity, there is no means to present changing information to the user. ICEfaces overcomes this deficiency with an asynchronous update mode that facilitates driving asynchronous presentation changes to the client, based on server-side application state changes. The ICEfaces application developer is not restricted to the standard request/response cycle of a normal JSF application. Again, the Ajax bridge facilitates ongoing asynchronous updates through the use of asynchronous XMLHttpRequests that are fulfilled when DOM updates become available due to a render pass. Because the process leverages incremental Direct-to-DOM updates for asynchronous presentation changes, you can expect these changes to occur in a smooth, flicker-free manner. Figure 7 illustrates this process.

The primary consideration from the developer's perspective is to identify and implement the triggers that cause the presentation updates to happen. Trigger mechanisms are entirely under developer control and can include standard JSF mechanisms like ValueChangeEvents, or any other outside stimulus.

Because it is important to manage the asynchronous rendering process in a scalable and performant manner, ICEfaces provides a Server-initiated Rendering API and implementation. See Server-initiated Rendering (Ajax Push) for additional discussion.

Figure 7 Asynchronous Update with Direct-to-DOM Rendering



Asynchronous mode is the default for ICEfaces, but in cases where asynchronous updates are not required, ICEfaces can be configured to support synchronous mode only. Running in synchronous mode reduces the connection resource requirements for an application deployment. See Asynchronous vs. Synchronous Updates to specify the mode of operation.

When ICEfaces is running in asynchronous mode, it is possible for an outstanding request to remain open for an extended period of time. Depending on the deployment environment, it is possible for a long-lived connection to be lost, resulting in the loss of asynchronous updates. ICEfaces provides connection management facilities that allow the application to react to connection-related errors. See Connection Management for additional information.



Copyright 2005-2009. ICEsoft Technologies, Inc.
TOC PREV NEXT INDEX