public abstract class WebSocketHandler extends java.lang.Object implements WebSocketProtocol
| Constructor and Description |
|---|
WebSocketHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(AtmosphereConfig config)
Allow an implementation to query the AtmosphereConfig of init-param, etc.
|
void |
onByteMessage(WebSocket webSocket,
byte[] data,
int offset,
int length)
Invoked when a byte message is received.
|
void |
onClose(WebSocket webSocket)
Invoked when a
WebSocket is closed. |
void |
onError(WebSocket webSocket,
WebSocketProcessor.WebSocketException t)
Invoked when a
WebSocket produces an error. |
java.util.List<AtmosphereRequest> |
onMessage(WebSocket webSocket,
byte[] data,
int offset,
int length)
Parse the WebSocket message, and delegate the processing to the
AtmosphereFramework.asyncSupport or
to any existing technology. |
java.util.List<AtmosphereRequest> |
onMessage(WebSocket webSocket,
java.lang.String data)
Parse the WebSocket message, and delegate the processing to the
AtmosphereFramework.asyncSupport or
to any existing technology. |
void |
onOpen(WebSocket webSocket)
Invoked when a
WebSocket is opened. |
void |
onTextMessage(WebSocket webSocket,
java.lang.String data)
Invoked when a String message is received
|
public void onByteMessage(WebSocket webSocket, byte[] data, int offset, int length)
webSocket - a WebSocketdata - offset - length - public void onTextMessage(WebSocket webSocket, java.lang.String data)
webSocket - a WebSocketdata - public final void configure(AtmosphereConfig config)
WebSocketProtocolconfigure in interface WebSocketProtocolconfig - AtmosphereConfigpublic final java.util.List<AtmosphereRequest> onMessage(WebSocket webSocket, java.lang.String data)
WebSocketProtocolAtmosphereFramework.asyncSupport or
to any existing technology. Invoking AtmosphereFramework.asyncSupport will delegate the request processing
to the AtmosphereHandler implementation. Returning null means this implementation will
handle itself the processing/dispatching of the WebSocket's request;
onMessage in interface WebSocketProtocolwebSocket - The WebSocket connectiondata - The Websocket messageAtmosphereResource, or null if the request won't be dispatched.public final java.util.List<AtmosphereRequest> onMessage(WebSocket webSocket, byte[] data, int offset, int length)
WebSocketProtocolAtmosphereFramework.asyncSupport or
to any existing technology. Invoking AtmosphereFramework.asyncSupport will delegate the request processing
to the AtmosphereHandler implementation. Returning null means this implementation will
handle itself the processing/dispatching of the WebSocket's request;
onMessage in interface WebSocketProtocolwebSocket - The WebSocket connectionoffset - offset message indexlength - length of the message.AtmosphereResource, or null if the request won't be dispatched.public void onOpen(WebSocket webSocket)
WebSocket is opened.onOpen in interface WebSocketProtocolwebSocket - public void onClose(WebSocket webSocket)
WebSocket is closed.onClose in interface WebSocketProtocolwebSocket - public void onError(WebSocket webSocket, WebSocketProcessor.WebSocketException t)
WebSocket produces an error.onError in interface WebSocketProtocolwebSocket - t - a WebSocketProcessor.WebSocketExceptionCopyright © 2018. All Rights Reserved.