|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IChannelService
A service providing channel based communication facility in wicket based applications.
Implementation of this interface are the basis of a channel based communication implementation. You usually store one IChannelService implementation in your application instance, and then delegate all your channel related operations to this service, allowing very easy switching between channel communication implementations.
Here is how you usually use an IChannelService implementation:
IChannelService channelService = MyApplication.get().getChannelService();
// I want to send an event when i click a button
[...]
onClick(AjaxRequestTarget target){
channelService.publish(new ChannelEvent("channel"));
}
[...]
// All pages listening this event should add
[...]
channelService.addChannelListener(this, "channel", new IChannelListener() {
public void onEvent(String channel, Map datas, IChannelTarget target){
target.[...]
}
});
[...]
TimerChannelService,
CometdService,
IChannelTarget| 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 |
publish(ChannelEvent event)
Publishes a channel event which will be sent to the channel listeners. |
| Method Detail |
|---|
void addChannelListener(org.apache.wicket.Component component,
java.lang.String channel,
IChannelListener listener)
ChannelEvents.
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.
component - 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 ChannelEventsvoid publish(ChannelEvent event)
event - the event to publish to the listeners
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||