|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.atmosphere.websocket.WebSocketHandler
public abstract class WebSocketHandler
A very simple interface adapter class that implements all methods and expose a WebSocket API close to the JavaScript Counterpart.
| Constructor Summary | |
|---|---|
WebSocketHandler()
|
|
| Method Summary | |
|---|---|
void |
configure(AtmosphereConfig config)
Allow an implementation to query the AtmosphereConfig of init-param, etc. |
void |
onByteMessage(WebSocket webSocket,
byte[] data,
int offset,
int length)
Invoked when a byte message is received. |
void |
onClose(WebSocket webSocket)
Invoked when a WebSocket is closed. |
void |
onError(WebSocket webSocket,
WebSocketProcessor.WebSocketException t)
Invoked when a WebSocket produces an error. |
List<AtmosphereRequest> |
onMessage(WebSocket webSocket,
byte[] data,
int offset,
int length)
Parse the WebSocket message, and delegate the processing to the AtmosphereFramework.asyncSupport or
to any existing technology. |
List<AtmosphereRequest> |
onMessage(WebSocket webSocket,
String data)
Parse the WebSocket message, and delegate the processing to the AtmosphereFramework.asyncSupport or
to any existing technology. |
void |
onOpen(WebSocket webSocket)
Invoked when a WebSocket is opened. |
void |
onTextMessage(WebSocket webSocket,
String data)
Invoked when a String message is received |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WebSocketHandler()
| Method Detail |
|---|
public void onByteMessage(WebSocket webSocket,
byte[] data,
int offset,
int length)
webSocket - a WebSocketdata - offset - length -
public void onTextMessage(WebSocket webSocket,
String data)
webSocket - a WebSocketdata - public final void configure(AtmosphereConfig config)
WebSocketProtocol
configure in interface WebSocketProtocolconfig - AtmosphereConfig
public final List<AtmosphereRequest> onMessage(WebSocket webSocket,
String data)
WebSocketProtocolAtmosphereFramework.asyncSupport or
to any existing technology. Invoking AtmosphereFramework.asyncSupport 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
AtmosphereResource, or null if the request won't be dispatched.
public final List<AtmosphereRequest> onMessage(WebSocket webSocket,
byte[] data,
int offset,
int length)
WebSocketProtocolAtmosphereFramework.asyncSupport or
to any existing technology. Invoking AtmosphereFramework.asyncSupport 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.
AtmosphereResource, or null if the request won't be dispatched.public void onOpen(WebSocket webSocket)
WebSocket is opened.
onOpen in interface WebSocketProtocolwebSocket - public void onClose(WebSocket webSocket)
WebSocket is closed.
onClose in interface WebSocketProtocolwebSocket -
public void onError(WebSocket webSocket,
WebSocketProcessor.WebSocketException t)
WebSocket produces an error.
onError in interface WebSocketProtocolwebSocket - t - a WebSocketProcessor.WebSocketException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||