org.wicketstuff.push.cometd
Class CometdPushService

java.lang.Object
  extended by org.wicketstuff.push.AbstractPushService
      extended by org.wicketstuff.push.cometd.CometdPushService
All Implemented Interfaces:
org.wicketstuff.push.IPushService

public class CometdPushService
extends org.wicketstuff.push.AbstractPushService

Cometd based implementation of 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.

Author:
Xavier Hanin, Rodolfo Hansen, Sebastian Thomschke

Field Summary
 
Fields inherited from class org.wicketstuff.push.AbstractPushService
disconnectListeners, nodesByChannels
 
Method Summary
static CometdPushService get()
           
static CometdPushService get(WebApplication application)
           
static org.wicketstuff.push.IPushServiceRef<CometdPushService> getRef()
           
<EventType>
CometdPushNode<EventType>
installNode(Component component, org.wicketstuff.push.IPushEventHandler<EventType> handler)
          
 boolean isConnected(org.wicketstuff.push.IPushNode<?> node)
          
<EventType>
void
publish(org.wicketstuff.push.IPushChannel<EventType> channel, EventType event)
          
<EventType>
void
publish(org.wicketstuff.push.IPushNode<EventType> node, EventType event)
          
<EventType>
void
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>
void
publishJavascript(org.wicketstuff.push.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(Component component, org.wicketstuff.push.IPushNode<?> node)
          
 
Methods inherited from class org.wicketstuff.push.AbstractPushService
addNodeDisconnectedListener, connectToChannel, createChannel, disconnectFromAllChannels, disconnectFromChannel, removeChannel, removeNodeDisconnectedListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

get

public static CometdPushService get()

get

public static CometdPushService get(WebApplication application)

getRef

public static org.wicketstuff.push.IPushServiceRef<CometdPushService> getRef()
Returns:
a serializable service reference

installNode

public <EventType> CometdPushNode<EventType> installNode(Component component,
                                                         org.wicketstuff.push.IPushEventHandler<EventType> handler)


isConnected

public boolean isConnected(org.wicketstuff.push.IPushNode<?> node)


publish

public <EventType> void publish(org.wicketstuff.push.IPushChannel<EventType> channel,
                                EventType event)


publish

public <EventType> void publish(org.wicketstuff.push.IPushNode<EventType> node,
                                EventType event)


publishJavascript

public <EventType> void publishJavascript(CometdPushNode<EventType> node,
                                          String javascript)
Directly sends JavaScript code to the node via a cometd channel without an additional Wicket AJAX request roundtrip.


publishJavascript

public <EventType> void publishJavascript(org.wicketstuff.push.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.


uninstallNode

public void uninstallNode(Component component,
                          org.wicketstuff.push.IPushNode<?> node)



Copyright © 2012. All Rights Reserved.