org.apache.wicket.protocol.ws.api
Class WebSocketPushBroadcaster

java.lang.Object
  extended by org.apache.wicket.protocol.ws.api.WebSocketPushBroadcaster

public class WebSocketPushBroadcaster
extends Object

Allows pushing events for processing to Pages that have active web sockets.

Since:
6.4
Author:
Mikko Tiihonen

Constructor Summary
WebSocketPushBroadcaster(IWebSocketConnectionRegistry registry)
           
 
Method Summary
 void broadcast(ConnectedMessage connection, IWebSocketPushMessage message)
          Processes the given message in the page and session identified by the given Web Socket connection.
 void broadcastAll(Application application, IWebSocketPushMessage message)
          Processes the given message in all pages that have active Web Socket connections.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebSocketPushBroadcaster

public WebSocketPushBroadcaster(IWebSocketConnectionRegistry registry)
Method Detail

broadcast

public void broadcast(ConnectedMessage connection,
                      IWebSocketPushMessage message)
Processes the given message in the page and session identified by the given Web Socket connection. The message is sent as an event to the Page and components of the session allowing the components to be updated. This method can be invoked from any thread, even a non-wicket thread. By default all processing is done in the caller thread. Use IWebSocketSettings.setWebSocketPushMessageExecutor(org.apache.wicket.protocol.ws.concurrent.Executor) to move processing to background threads. If the given connection is no longer open then the broadcast is silently ignored.

Parameters:
connection - The Web Socket connection that identifies the page and session
message - The push message event

broadcastAll

public void broadcastAll(Application application,
                         IWebSocketPushMessage message)
Processes the given message in all pages that have active Web Socket connections. The message is sent as an event to the Page and components of the session allowing the components to be updated. This method can be invoked from any thread, even a non-wicket thread. By default all processing is done in the caller thread. Use IWebSocketSettings.setWebSocketPushMessageExecutor(org.apache.wicket.protocol.ws.concurrent.Executor) to move processing to background threads. If some connections are not in valid state they are silently ignored.

Parameters:
application - The wicket application
message - The push message event


Copyright © 2006–2013 Apache Software Foundation. All rights reserved.