|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface WebSocketProcessor
Atmosphere's WebSocket Support implementation. The default behavior is implemented in DefaultWebSocketProcessor.
This class is targeted at framework developer as it requires Atmosphere's internal knowledge.
This class can also be used to implement the JSR 345 recommendation.
| Nested Class Summary | |
|---|---|
static class |
WebSocketProcessor.WebSocketException
An exception that can be used to flag problems with the WebSocket processing. |
| Method Summary | |
|---|---|
void |
close(WebSocket webSocket,
int closeCode)
Invked when the WebServer is closing the native WebSocket |
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,
WebSocketHandler webSockethandler)
Register a WebSocketHandler |
| Method Detail |
|---|
boolean handshake(javax.servlet.http.HttpServletRequest request)
HttpServletRequest might be null, so implementation must check for null.
request - HttpServletRequest
WebSocketProcessor registerWebSocketHandler(String path,
WebSocketHandler webSockethandler)
WebSocketHandler
path - the URI mapping the WebSocketHandlerwebSockethandler - an instance of WebSocketHandler
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()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||