|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.wicketstuff.push.cometd.CometdService
public class CometdService
Cometd based implementation of IChannelService.
This service is based on cometd client implemented by the dojo toolkit, which must be embedded in your application.
This implementation relies on cometd for updating the page, but actually uses
regular cometd events, which, if a channel listener is properly installed on
a component of the page using
addChannelListener(Component, String, IChannelListener), will
trigger a wicket ajax call to get the page actually refreshed using regular
wicket ajax mechanisms.
This mean that each time an event is published, a new connection is made to
the server to get the actual page update required by the
IChannelListener.
IChannelService| Field Summary | |
|---|---|
static java.lang.String |
BAYEUX_CLIENT_PREFIX
|
| Constructor Summary | |
|---|---|
CometdService(org.apache.wicket.protocol.http.WebApplication application)
|
|
| Method Summary | |
|---|---|
void |
addChannelListener(org.apache.wicket.Component component,
java.lang.String channel,
IChannelListener listener)
Adds a behavior to the given component so that it will be notified of ChannelEvents. |
void |
addChannelRemoveListener(java.lang.String chnl,
org.cometd.RemoveListener listener)
|
void |
addChannelRemoveListener(java.lang.String chnl,
org.cometd.RemoveListener listener,
org.apache.wicket.Session sess)
Cometd Specific method to Listen for client removals |
org.apache.wicket.Application |
getApplication()
|
void |
publish(ChannelEvent event)
Implementation of IChannelService.publish(ChannelEvent), which
actually sends a cometd event to the client with a "proxy" attribute set to
"true", which in turn triggers a wicket ajax call to get the listener
notified and update the page. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String BAYEUX_CLIENT_PREFIX
| Constructor Detail |
|---|
public CometdService(org.apache.wicket.protocol.http.WebApplication application)
| Method Detail |
|---|
public void addChannelListener(org.apache.wicket.Component component,
java.lang.String channel,
IChannelListener listener)
IChannelServiceChannelEvents.
Usually the component if a Page, even if it's not mandatory.
Indeed the components reacting to the event are defined in the IChannelListener,
by calling IChannelTarget methods. Hence any component on the page
can serve as the host of the behavior, as soon as it is visible.
addChannelListener in interface IChannelServicecomponent - the component to which the behavior should be addedchannel - the channel for which the listener should be notifiedlistener - the IChannelListener which should be notified of ChannelEvents
public void addChannelRemoveListener(java.lang.String chnl,
org.cometd.RemoveListener listener,
org.apache.wicket.Session sess)
channel - listener - sess - Wicket Session you wish to associate with the listener.
public void addChannelRemoveListener(java.lang.String chnl,
org.cometd.RemoveListener listener)
addChannelRemoveListener(String, RemoveListener, Session)public void publish(ChannelEvent event)
IChannelService.publish(ChannelEvent), which
actually sends a cometd event to the client with a "proxy" attribute set to
"true", which in turn triggers a wicket ajax call to get the listener
notified and update the page.
publish in interface IChannelServiceevent - the event to publish to the listenerspublic org.apache.wicket.Application getApplication()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||