|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.atmosphere.websocket.protocol.EchoProtocol
public class EchoProtocol
Simple WebSocketProcessor that invoke the Broadcaster.broadcast(T) API when a WebSocket message
is received.
| Constructor Summary | |
|---|---|
EchoProtocol()
|
|
| Method Summary | |
|---|---|
void |
configure(AtmosphereServlet.AtmosphereConfig config)
Allow an implementation to query the AtmosphereConfig of init-param, etc. |
byte[] |
handleResponse(AtmosphereResponse<?> res,
byte[] message,
int offset,
int length)
Give a chance to a AsyncProtocol to modify the final response using a fake HttpServletResponse that was
dispatched to a ServletContainer and it's framework or application running it. |
String |
handleResponse(AtmosphereResponse<?> res,
String message)
Give a chance to a AsyncProtocol to modify the final response using a fake HttpServletResponse that was
dispatched to a ServletContainer and it's framework or application running it. |
boolean |
inspectResponse()
Return true if this implementation will manipulate/change the WebSocket message; |
void |
onClose(WebSocket webSocket)
Invoked when a WebSocket is closed |
void |
onError(WebSocket webSocket,
WebSocketProcessor.WebSocketException t)
Invoked when an error occurs. |
AtmosphereRequest |
onMessage(WebSocket webSocket,
byte[] data,
int offset,
int length)
Parse the WebSocket message, and delegate the processing to the AtmosphereServlet.cometSupport or
to any existing technology. |
AtmosphereRequest |
onMessage(WebSocket webSocket,
String data)
Parse the WebSocket message, and delegate the processing to the AtmosphereServlet.cometSupport or
to any existing technology. |
void |
onOpen(WebSocket webSocket)
Invoked when a WebSocket is opened |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EchoProtocol()
| Method Detail |
|---|
public AtmosphereRequest onMessage(WebSocket webSocket,
String data)
AtmosphereServlet.cometSupport or
to any existing technology. Invoking AtmosphereServlet.cometSupport will delegate the request processing
to the AtmosphereHandler implementation. Returning null means this implementation will
handle itself the processing/dispatching of the WebSocket's request;
onMessage in interface WebSocketProtocolwebSocket - The WebSocket connectiondata - The Websocket message
public AtmosphereRequest onMessage(WebSocket webSocket,
byte[] data,
int offset,
int length)
AtmosphereServlet.cometSupport or
to any existing technology. Invoking AtmosphereServlet.cometSupport will delegate the request processing
to the AtmosphereHandler implementation. Returning null means this implementation will
handle itself the processing/dispatching of the WebSocket's request;
onMessage in interface WebSocketProtocolwebSocket - The WebSocket connectionoffset - offset message indexlength - length of the message.public void configure(AtmosphereServlet.AtmosphereConfig config)
configure in interface WebSocketProtocolconfig - AtmosphereServlet.AtmosphereConfigpublic void onOpen(WebSocket webSocket)
onOpen in interface WebSocketProtocolwebSocket - WebSocketpublic void onClose(WebSocket webSocket)
onClose in interface WebSocketProtocolwebSocket - WebSocket
public void onError(WebSocket webSocket,
WebSocketProcessor.WebSocketException t)
onError in interface WebSocketProtocolwebSocket - WebSockett - a WebSocketProcessor.WebSocketExceptionpublic boolean inspectResponse()
inspectResponse in interface AsyncProtocol
public String handleResponse(AtmosphereResponse<?> res,
String message)
AsyncProtocol to modify the final response using a fake HttpServletResponse that was
dispatched to a ServletContainer and it's framework or application running it.
This method is only invoked when AtmosphereResponse is about to write some data.
handleResponse in interface AsyncProtocolres - HttpServletResponsemessage - the String message;
public byte[] handleResponse(AtmosphereResponse<?> res,
byte[] message,
int offset,
int length)
AsyncProtocolAsyncProtocol to modify the final response using a fake HttpServletResponse that was
dispatched to a ServletContainer and it's framework or application running it.
This method is only invoked when AtmosphereResponse is about to write some data.
handleResponse in interface AsyncProtocolres - HttpServletResponsemessage - the WebSocket message;offset - offset of the messagelength - the length of the message
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||