public class DefaultWebSocketProcessor extends java.lang.Object implements WebSocketProcessor, java.io.Serializable
AsynchronousProcessor class, this class is responsible for dispatching WebSocket request to the
proper WebSocket implementation. This class can be extended in order to support any protocol
running on top websocket.WebSocketProcessor.WebSocketException| Constructor and Description |
|---|
DefaultWebSocketProcessor(AtmosphereFramework framework) |
| Modifier and Type | Method and Description |
|---|---|
void |
close(WebSocket webSocket,
int closeCode)
Invked when the WebServer is closing the native WebSocket
|
static java.util.Map<java.lang.String,java.lang.String> |
configureHeader(AtmosphereRequest request) |
void |
destroy()
Destroy all resources associated with this class.
|
void |
dispatch(WebSocket webSocket,
AtmosphereRequest request,
AtmosphereResponse r)
Dispatch to request/response to the
AsyncSupport implementation as it was a normal HTTP request. |
void |
invokeWebSocketProtocol(WebSocket webSocket,
byte[] data,
int offset,
int length)
Invoked when a WebSocket message gets received from the underlying container
|
void |
invokeWebSocketProtocol(WebSocket webSocket,
java.lang.String webSocketMessage)
Invoked when a WebSocket message gets received from the underlying container
|
void |
notifyListener(WebSocket webSocket,
WebSocketEventListener.WebSocketEvent event)
Notify all
WebSocketEventListener |
void |
open(WebSocket webSocket,
AtmosphereRequest request)
Invoked when a WebSocket gets opened by the underlying container
|
WebSocketProcessor |
registerWebSocketHandler(java.lang.String path,
WebSocketHandler webSockethandler)
Register a
WebSocketHandler |
public DefaultWebSocketProcessor(AtmosphereFramework framework)
public WebSocketProcessor registerWebSocketHandler(java.lang.String path, WebSocketHandler webSockethandler)
WebSocketProcessorWebSocketHandlerregisterWebSocketHandler in interface WebSocketProcessorpath - the URI mapping the WebSocketHandlerwebSockethandler - an instance of WebSocketHandlerpublic final void open(WebSocket webSocket, AtmosphereRequest request) throws java.io.IOException
open in interface WebSocketProcessorjava.io.IOExceptionpublic void invokeWebSocketProtocol(WebSocket webSocket, java.lang.String webSocketMessage)
invokeWebSocketProtocol in interface WebSocketProcessorpublic void invokeWebSocketProtocol(WebSocket webSocket, byte[] data, int offset, int length)
invokeWebSocketProtocol in interface WebSocketProcessorpublic final void dispatch(WebSocket webSocket, AtmosphereRequest request, AtmosphereResponse r)
AsyncSupport implementation as it was a normal HTTP request.request - a AtmosphereRequestr - a AtmosphereResponsepublic void close(WebSocket webSocket, int closeCode)
close in interface WebSocketProcessorpublic void destroy()
destroy in interface WebSocketProcessorpublic void notifyListener(WebSocket webSocket, WebSocketEventListener.WebSocketEvent event)
WebSocketEventListenernotifyListener in interface WebSocketProcessorpublic static final java.util.Map<java.lang.String,java.lang.String> configureHeader(AtmosphereRequest request)
Copyright © 2018. All Rights Reserved.