public class CometdPushService extends AbstractPushService
IPushService
.
This implementation relies on cometd for updating the page, but actually uses regular cometd events, that 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 performed by the IPushEventHandler
.
disconnectListeners, nodesByChannels
Modifier and Type | Method and Description |
---|---|
static CometdPushService |
get() |
static CometdPushService |
get(org.apache.wicket.protocol.http.WebApplication application) |
static IPushServiceRef<CometdPushService> |
getRef() |
<EventType> |
installNode(org.apache.wicket.Component component,
IPushEventHandler<EventType> handler) |
boolean |
isConnected(IPushNode<?> node)
Determines if the node (client) is still connected, otherwise clears all queued events.
|
<EventType> |
publish(IPushChannel<EventType> channel,
EventType event) |
<EventType> |
publish(IPushNode<EventType> node,
EventType event)
Queues the given event for later processing by the associated
IPushEventHandler . |
<EventType> |
publishJavascript(CometdPushNode<EventType> node,
String javascript)
Directly sends JavaScript code to the node via a cometd channel without an additional Wicket
AJAX request roundtrip.
|
<EventType> |
publishJavascript(PushChannel<EventType> channel,
String javascript)
Directly sends JavaScript code to all nodes listeing to the given push channel via a cometd
channel without an additional Wicket AJAX request roundtrip.
|
void |
uninstallNode(org.apache.wicket.Component component,
IPushNode<?> node) |
addNodeDisconnectedListener, connectToChannel, createChannel, disconnectFromAllChannels, disconnectFromChannel, removeChannel, removeNodeDisconnectedListener
public static CometdPushService get()
public static CometdPushService get(org.apache.wicket.protocol.http.WebApplication application)
public static IPushServiceRef<CometdPushService> getRef()
public <EventType> CometdPushNode<EventType> installNode(org.apache.wicket.Component component, IPushEventHandler<EventType> handler)
public boolean isConnected(IPushNode<?> node)
public <EventType> void publish(IPushChannel<EventType> channel, EventType event)
public <EventType> void publish(IPushNode<EventType> node, EventType event)
IPushEventHandler
. The
method does nothing in case the node is no longer connected.public <EventType> void publishJavascript(CometdPushNode<EventType> node, String javascript)
public <EventType> void publishJavascript(PushChannel<EventType> channel, String javascript)
public void uninstallNode(org.apache.wicket.Component component, IPushNode<?> node)
Copyright © 2015. All rights reserved.