Class WebSocketPushBroadcaster
- java.lang.Object
-
- org.apache.wicket.protocol.ws.api.WebSocketPushBroadcaster
-
public class WebSocketPushBroadcaster extends java.lang.ObjectAllows pushing events for processing to Pages that have active web sockets.- Since:
- 6.4
- Author:
- Mikko Tiihonen
-
-
Constructor Summary
Constructors Constructor Description WebSocketPushBroadcaster(IWebSocketConnectionRegistry registry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbroadcast(ConnectedMessage connection, IWebSocketPushMessage message)Processes the given message in the page and session identified by the given Web Socket connection.voidbroadcastAll(org.apache.wicket.Application application, IWebSocketPushMessage message)Processes the given message in all pages that have active Web Socket connections.
-
-
-
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. UseWebSocketSettings.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 sessionmessage- The push message event
-
broadcastAll
public void broadcastAll(org.apache.wicket.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. UseWebSocketSettings.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 applicationmessage- The push message event
-
-