ADF’s Active Data Service and multiple push windows

As mentioned here, the ADS feature of ADF Faces supports “push channel sharing” since a very long time…

The first window that hits a page which contains an active component, e.g. a <af:table> that is referencing to an ActiveDataModel implementation, becames the “master” window. This window maintains a persistent connection to the ADS subsystem. In the screenshot you can see that the first window has a HTTP GET request to a wls.ads resource (this URL is representing our implementation of the AbstractAsyncServlet of Weblogic – yes on other containers this is not invoked…😉 ).

Notice that the second window does NOT have a connection to that servlet… In fact, when the second page renders, it registers itself with the master window. Once the ADS subsystem receives a new (server-side) event, in streams the data ONLY to the master window. That window simply dispatches the payload to the components (on the right page/window).  Some more on how to talk to a different window, you can read here.

Now you may wonder what happens if you close the master window (or do a refresh/F5 there) ? You are not (totally) loosing the persistent connection. The client side engine of ADS (called Active Data Manager) notices that the master window is going away and migrates the channel to one of the slave windows. That ensures you never loose active data…

This is a pretty cool feature! To play with ADS / ADF just get a copy of JDeveloper.

Howdy!

Posted in adf, ajax, comet, fun, java, javascript, jdeveloper, jsf, oracle, Oracle ADF Faces, web²
4 comments on “ADF’s Active Data Service and multiple push windows
  1. […] 7, 2010 · Leave a Comment I mentioned earlier that ADS is pretty much model driven and requires no extra sit-ups in the declarative view. It […]

  2. […] Faces has great and flexible support for Comet with its ADS facility. This post quickly describes you to push data from a backend to your client. In order to avoid […]

  3. Hyangelo Hao says:

    How does ADF handle when the “master” window is closed? I implemented something similar before with respect to having “master” and “slave” windows and sharing/pooling the comet connection. My implementation involved having the master window send out “heartbeats” every X seconds. When the master window dies and stops sending heartbeats, the slave windows “elect” a new master by writing to a common cookie(pretty hacky but I guess that is already a given with comet).

  4. Prashanth says:

    Hi,
    I am using ADS with bean and an activeoutputText with bean.value

    The bean extends BaseActiveDataModel and checks the Model Layer/ VO for any database Notification.

    On receieving the update it creates a payload and calls fireActivedataUpdate(Event)

    All is working fine in the page and it works as expected. On receiving the database update it does refresh the text in the ActiveOutputText component.
    But if a refresh/F5 is done on the page the window loses the persistent connection.

    Also if any other requests are sent from the browser and a standard /partial page refresh is done then also the connection is broken (because there is an adf table with a partial trigger from a button)
    but you told in your blog that the main window does not lose the connection. Am I doing something wrong?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: