|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.atmosphere.websocket.DefaultWebSocketProcessor
public class DefaultWebSocketProcessor
Like the 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.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.atmosphere.websocket.WebSocketProcessor |
|---|
WebSocketProcessor.WebSocketException |
| Constructor Summary | |
|---|---|
DefaultWebSocketProcessor(AtmosphereFramework framework)
|
|
| Method Summary | |
|---|---|
void |
close(WebSocket webSocket,
int closeCode)
Invked when the WebServer is closing the native WebSocket |
static Map<String,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. |
protected void |
dispatchReader(WebSocket webSocket,
Reader r)
|
protected void |
dispatchStream(WebSocket webSocket,
InputStream is)
|
int |
getByteBufferMaxSize()
Obtain the current maximum size (in bytes) of the buffer used for binary messages. |
int |
getCharBufferMaxSize()
Obtain the current maximum size (in characters) of the buffer used for binary messages. |
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 event)
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 |
void |
setByteBufferMaxSize(int byteBufferMaxSize)
Set the maximum size (in bytes) of the buffer used for binary messages. |
void |
setCharBufferMaxSize(int charBufferMaxSize)
Set the maximum size (in characters) of the buffer used for textual messages. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultWebSocketProcessor(AtmosphereFramework framework)
| Method Detail |
|---|
public WebSocketProcessor registerWebSocketHandler(String path,
WebSocketHandler webSockethandler)
WebSocketProcessorWebSocketHandler
registerWebSocketHandler in interface WebSocketProcessorpath - the URI mapping the WebSocketHandlerwebSockethandler - an instance of WebSocketHandler
public final void open(WebSocket webSocket,
AtmosphereRequest request,
AtmosphereResponse response)
throws IOException
open in interface WebSocketProcessorIOException
public void invokeWebSocketProtocol(WebSocket webSocket,
String webSocketMessage)
invokeWebSocketProtocol in interface WebSocketProcessor
public void invokeWebSocketProtocol(WebSocket webSocket,
byte[] data,
int offset,
int length)
invokeWebSocketProtocol in interface WebSocketProcessor
public void invokeWebSocketProtocol(WebSocket webSocket,
InputStream stream)
invokeWebSocketProtocol in interface WebSocketProcessor
public void invokeWebSocketProtocol(WebSocket webSocket,
Reader reader)
invokeWebSocketProtocol in interface WebSocketProcessor
public final void dispatch(WebSocket webSocket,
AtmosphereRequest request,
AtmosphereResponse r)
AsyncSupport implementation as it was a normal HTTP request.
request - a AtmosphereRequestr - a AtmosphereResponse
public void close(WebSocket webSocket,
int closeCode)
close in interface WebSocketProcessor
public void notifyListener(WebSocket webSocket,
WebSocketEventListener.WebSocketEvent event)
WebSocketEventListener
notifyListener in interface WebSocketProcessorpublic void destroy()
destroy in interface WebSocketProcessorpublic static final Map<String,String> configureHeader(AtmosphereRequest request)
protected void dispatchStream(WebSocket webSocket,
InputStream is)
throws IOException
IOException
protected void dispatchReader(WebSocket webSocket,
Reader r)
throws IOException
IOExceptionpublic final int getByteBufferMaxSize()
public final void setByteBufferMaxSize(int byteBufferMaxSize)
public final int getCharBufferMaxSize()
public final void setCharBufferMaxSize(int charBufferMaxSize)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||