TOC PREV NEXT INDEX

SessionCounter.java


Since we want everyone to be able to access the application-scoped counter, we're going to keep it simple and just add everyone to a single, global group. The easiest way to do this is to have the group membership logic in the constructor of the session-scoped bean. That way, when our session-scoped bean is created, it's added to a group. Since we only want to do this for our session-scoped counter (and not our application-scoped counter) we'll create another subclass of Counter that does this for us.

Create a new class called SessionCounter by typing or copying the following into your editor:

package org.icefaces.tutorial.easyajaxpush;
 

 
import com.icesoft.faces.async.render.SessionRenderer;
 

 
public class SessionCounter extends Counter {
 

 
    public SessionCounter() {
 
        SessionRenderer.addCurrentSession("all");
 
    }
 
}
 
Note: For ICEfaces v1.7.1 and v1.7.2, the SessionRenderer API was considered experimental so the package for it reflects this (org.icefaces.x.core.push.SessionRenderer). As of ICEfaces v1.8, the API is no longer considered experimental and resides with the rest of the Ajax Push APIs under com.icesoft.faces.async.render.


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