HomeSitemapContact Us

Ajax Push

Ajax Push is a revolutionary capability of the ICEfaces framework that enables asynchronous, web-based push of presentation changes to the client browser based on server-side events. Any web application where users are observing dynamic data can benefit, as Ajax Push brings that data alive with dynamic, instantaneous updates. When multiple users are interacting with the same data, Ajax Push enables real-time collaborative features, because everyone can be instantly aware of each others actions. Ajax Push is a fundamental capability of the ICEfaces framework, available from the very first release. The framework handles all of the low-level intricacies of the push mechanism, providing the developer with a simple, pure Java API for application development. This frees the developer to focus on creative aspects of push-style application development.

Ajax Push In Action

The best way to understand the power of Ajax Push is to see it in action. ICEfaces includes several examples of push-style collaborative applications such asAction Monitor andWebMC .

Nuts and Bolts of Ajax Push

The underlying mechanism for Ajax Push is HTTP protocol inversion (also known as long polling). This technique involves holding a connection open from the browser client to the server with a blocking request, and then fulfilling that request when some state change in the application triggers an update to the presentation. This mechanism is illustrated in the diagram below.

HTTP Protocol Inversion

Based on this basic mechanism ICEfaces offers the following features.

  • Connection Heartbeating and Monitoring: In order to maintain potentially long-lived connections, ICEfaces includes a configurable heart beat mechanism that actively monitors the health of the connection, and provides alerts when connection problems are detected.
  • Browser Connection Sharing: Overcoming the connection limit associated with browsers, ICEfaces facilitates sharing of the push connection between multiple views in the same browser instance. This means that multiple tabs or windows onto the same push-enabled application will work. It also means that multiple push-enabled portlets within a page can coexist and share the connection.
  • Optimized Rendering: ICEfaces utilizes the JSF lifecycle to force rendering of clients requiring an updated. The framework provides the necessary synchronization, and optimizes rendering through request coalescing and a configurable, bounded thread pool.
  • Clustered Rendering: With Ajax Push it is possible for events occurring at one node in a cluster to cause push events to occur to clients being served at other nodes in the cluster. ICEfaces uses JMS to deliver render requests to all nodes in the cluster, making large-scale clustered deployments of push-enabled applications simple to achieve.

The Programming Model

While the underlying mechanism for Ajax Push is intricate, the programming model provided in ICEfaces is simple. The key elements of the ICEfaces Ajax Push mechanism are described and illustrated below.

  • Render Manager: The Render Manager is an application scoped managed bean that coordinates all render requests. It handles JSF lifecycle management, and coalesces render requests to maximize performance. The Render Manager also handles the registration and population of Render Groups.
  • Render Group: A Render Group is an object that is registered with the Render Manager, and is used to organize groups of Renderables (clients) that will receive the same push updates. Different types of render groups such as on-demand, interval, and delay renderers are available.
  • Renderable: Any request or session scoped bean that implements the ICEfaces Renderable interface, can be added to a Render Group, and participate in Ajax Push events.
Push Architecture

To add Ajax Push capabilities to your application you simply need to:

  1. Add the Render Manager to your application's configuration.
  2. Establish and populate Render Groups for different types of push events that you need to support.
  3. Request a render on a Render Group based on some trigger in your application logic.

Scalable Asynchronous Request Processing

As described earlier, the underlying HTTP protocol inversion mechanism used for Ajax Push requires an open connection per client session. Under the standard Java Servlet model, this approach does not scale well, as each connection requires its on thread of execution. In order to overcome this thread per client dependency a number of application servers include an Asynchronous Request Processing (ARP) mechanism, and ICEfaces is integrated with these mechanisms to ensure scalable deployment of push enabled applications. The following ARP mechanisms are supported in ICEfaces.

The ICEfaces AHS can be deployed along side any application server that does not include its own ARP mechanism to ensure scalable deployments in any environment. It can also be used for clustered and portal deployments, so scalable Ajax Push can be accommodated under the full spectrum application deployment scenarios.

Need more Information? Join us for this webinar presentation:Developing Ajax Push Applications .

 

 

© COPYRIGHT 2008 ICESOFT TECHNOLOGIES INC.Privacy Policy |Contact Us POWERED BY  ICEfacesPowered by ICEfaces