public interface WebSocketProcessor
DefaultWebSocketProcessor.
This class is targeted at framework developer as it requires Atmosphere's internal knowledge.
| Modifier and Type | Interface and Description |
|---|---|
static class |
WebSocketProcessor.WebSocketException
An exception that can be used to flag problems with the WebSocket processing.
|
static class |
WebSocketProcessor.WebSocketHandlerProxy |
| Modifier and Type | Method and Description |
|---|---|
void |
close(WebSocket webSocket,
int closeCode)
Invked when the WebServer is closing the native WebSocket
|
WebSocketProcessor |
configure(AtmosphereConfig config)
Configure, or post construct a WebSocketProcessor
|
void |
destroy()
Destroy all resources associated with this class.
|
boolean |
handshake(javax.servlet.http.HttpServletRequest request)
Determine if the WebSocket's handshake data can be processed, or if the request be cancelled.
|
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,
InputStream stream)
Invoked when a WebSocket message gets received from the underlying container
|
void |
invokeWebSocketProtocol(WebSocket webSocket,
Reader reader)
Invoked when a WebSocket message gets received from the underlying container
|
void |
invokeWebSocketProtocol(WebSocket webSocket,
String webSocketMessage)
Invoked when a WebSocket message gets received from the underlying container
|
void |
notifyListener(WebSocket webSocket,
WebSocketEventListener.WebSocketEvent webSocketEvent)
Notify all
WebSocketEventListener |
void |
open(WebSocket webSocket,
AtmosphereRequest request,
AtmosphereResponse response)
Invoked when a WebSocket gets opened by the underlying container
|
WebSocketProcessor |
registerWebSocketHandler(String path,
WebSocketProcessor.WebSocketHandlerProxy webSockethandler)
Register a
WebSocketHandler |
WebSocketProcessor configure(AtmosphereConfig config)
config - an AtmosphereConfigboolean handshake(javax.servlet.http.HttpServletRequest request)
HttpServletRequest might be null, so implementation must check for null.request - HttpServletRequestWebSocketProcessor registerWebSocketHandler(String path, WebSocketProcessor.WebSocketHandlerProxy webSockethandler)
WebSocketHandlerpath - the URI mapping the WebSocketHandlerwebSockethandler - an instance of WebSocketProcessor.WebSocketHandlerProxyvoid open(WebSocket webSocket, AtmosphereRequest request, AtmosphereResponse response) throws IOException
request - IOExceptionvoid invokeWebSocketProtocol(WebSocket webSocket, String webSocketMessage)
webSocketMessage - void invokeWebSocketProtocol(WebSocket webSocket, byte[] data, int offset, int length)
data - void invokeWebSocketProtocol(WebSocket webSocket, InputStream stream)
stream - void invokeWebSocketProtocol(WebSocket webSocket, Reader reader) throws IOException
reader - IOExceptionvoid close(WebSocket webSocket, int closeCode)
closeCode - void notifyListener(WebSocket webSocket, WebSocketEventListener.WebSocketEvent webSocketEvent)
WebSocketEventListenerwebSocketEvent - void destroy()
Copyright © 2016. All rights reserved.