public abstract class WebSocketBehavior extends BaseWebSocketBehavior
Constructor and Description |
---|
WebSocketBehavior() |
Modifier and Type | Method and Description |
---|---|
protected void |
onAbort(AbortedMessage message)
A callback method called when the server has aborted the connection
|
protected void |
onClose(ClosedMessage message)
A callback method called when a WebSocket client has closed the connection
to the endpoint handled by this WebSocketBehavior
|
protected void |
onConnect(ConnectedMessage message)
A callback method called when a WebSocket client has connected to the endpoint
handled by this WebSocketBehavior
|
protected void |
onError(WebSocketRequestHandler handler,
ErrorMessage message)
A callback method called when there is a communication error
|
void |
onEvent(Component component,
IEvent<?> event)
Called to notify the behavior about any events sent to the component
|
protected void |
onMessage(WebSocketRequestHandler handler,
BinaryMessage binaryMessage)
A callback method called when there is a binary message sent by the client
|
protected void |
onMessage(WebSocketRequestHandler handler,
TextMessage message)
A callback method called when there is a text message sent by the client
|
protected void |
onPush(WebSocketRequestHandler handler,
IWebSocketPushMessage message)
A callback method called when there is a message pushed/broadcasted by the
server, e.g.
|
getBaseUrl, getContextPath, getFilterPrefix, getPort, getSecurePort, getSessionId, getStatelessHint, getWebSocketSetupScript, renderHead
afterRender, beforeRender, bind, canCallListener, detach, isEnabled, isTemporary, onAttribute, onComponentTag, onConfigure, onException, onRemove, onTag, unbind
public void onEvent(Component component, IEvent<?> event)
Behavior
onEvent
in interface IComponentAwareEventSink
onEvent
in class Behavior
component
- component that owns this sink. For example, if the implementation of this
interface is a Behavior
then component parameter will contain the
component to which the behavior is attached.IComponentAwareEventSink.onEvent(org.apache.wicket.Component,
org.apache.wicket.event.IEvent)
protected void onPush(WebSocketRequestHandler handler, IWebSocketPushMessage message)
handler
- The request handler that can be used to send messages to the clientmessage
- The message pushed/broadcasted by the serverprotected void onConnect(ConnectedMessage message)
message
- the connect message with the info about the clientprotected void onClose(ClosedMessage message)
message
- the close message with the info about the clientprotected void onError(WebSocketRequestHandler handler, ErrorMessage message)
handler
- The request handler that can be used to send messages to the clientmessage
- The error message that that brings information about the communication errorprotected void onAbort(AbortedMessage message)
message
- the aborted message with the info about the clientprotected void onMessage(WebSocketRequestHandler handler, TextMessage message)
handler
- The request handler that can be used to send messages back to the clientmessage
- The text message sent by the clientprotected void onMessage(WebSocketRequestHandler handler, BinaryMessage binaryMessage)
handler
- The request handler that can be used to send messages back to the clientbinaryMessage
- The binary message sent by the clientCopyright © 2006–2022 Apache Software Foundation. All rights reserved.