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 AtmosphereConfig
boolean handshake(javax.servlet.http.HttpServletRequest request)
HttpServletRequest
might be null, so implementation must check for null.request
- HttpServletRequest
WebSocketProcessor registerWebSocketHandler(String path, WebSocketProcessor.WebSocketHandlerProxy webSockethandler)
WebSocketHandler
path
- the URI mapping the WebSocketHandlerwebSockethandler
- an instance of WebSocketProcessor.WebSocketHandlerProxy
void open(WebSocket webSocket, AtmosphereRequest request, AtmosphereResponse response) throws IOException
request
- IOException
void 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
- IOException
void close(WebSocket webSocket, int closeCode)
closeCode
- void notifyListener(WebSocket webSocket, WebSocketEventListener.WebSocketEvent webSocketEvent)
WebSocketEventListener
webSocketEvent
- void destroy()
Copyright © 2016. All rights reserved.