|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectto.etc.webapp.ajax.eventmanager.AjaxEventManager
public class AjaxEventManager
Singleton AJAX event manager. This allows Java code to post an event to browsers waiting for them. This singleton uses JSON to communicate with the browser; it uses a specific CometContext implementation to allow asynchronous IO where the servlet container supports it.
This implementation has support for "lossless" event retrieval. This means that the browser will see all events, even when it's comet connection has been used and returned. When events occur while the browser has abn outstanding Comet call then all is well, and the events can be sent using that call. If however the call has just been returned and a new event occurs then the browser would loose that event because no comet call is present to sent it on.
This gets fixed by assigning all events an unique number that gets incremented for every event. Every time a browser issues a new Comet call it passes in the last event number it has seen. The event manager will queue the events from the last few minutes and will sent all of the events queued thus far to the browser.
Constructor Summary | |
---|---|
AjaxEventManager()
|
Method Summary | |
---|---|
void |
destroy()
Called when the application will die. |
static AjaxEventManager |
getInstance()
|
static void |
initialize()
|
void |
postEvent(java.lang.String channel,
java.lang.Object data)
Sends an event to the specified channels. |
void |
registerEventFilter(java.lang.String channel,
AjaxEventFilterFactory ajaxEventFilterFactory)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AjaxEventManager()
Method Detail |
---|
public static AjaxEventManager getInstance()
public static void initialize()
public void registerEventFilter(java.lang.String channel, AjaxEventFilterFactory ajaxEventFilterFactory)
public void postEvent(java.lang.String channel, java.lang.Object data)
channels
- data
- public void destroy()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |