use of org.apache.wicket.protocol.ws.api.WebSocketPushBroadcaster in project wicket by apache.
the class WebSocketTester method broadcast.
/**
* Broadcasts/pushes a message to specific web socket connection
*
* @param application
* The application where the web socket connection is registered
* @param sessionId
* The id of the http session with which the web socket connection is registered
* @param key
* The key with which the web socket connection is registered
* @param message
* The message to broadcast/push
*/
public void broadcast(Application application, String sessionId, IKey key, IWebSocketPushMessage message) {
WebSocketSettings webSocketSettings = WebSocketSettings.Holder.get(application);
WebSocketPushBroadcaster broadcaster = new WebSocketPushBroadcaster(webSocketSettings.getConnectionRegistry());
ConnectedMessage wsMessage = new ConnectedMessage(application, sessionId, key);
broadcaster.broadcast(wsMessage, message);
}
use of org.apache.wicket.protocol.ws.api.WebSocketPushBroadcaster in project wicket by apache.
the class WebSocketTester method broadcastAll.
/**
* Broadcasts/pushes a message to all active web socket connections
*
* @param application
* The application where the web socket connection is registered
* @param message
* The message to broadcast/push
*/
public void broadcastAll(Application application, IWebSocketPushMessage message) {
WebSocketSettings webSocketSettings = WebSocketSettings.Holder.get(application);
WebSocketPushBroadcaster broadcaster = new WebSocketPushBroadcaster(webSocketSettings.getConnectionRegistry());
broadcaster.broadcastAll(application, message);
}
Aggregations