|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.atmosphere.websocket.protocol.StreamingHttpProtocol
public class StreamingHttpProtocol
Like the AsynchronousProcessor class, this class is responsible for dispatching WebSocket stream to the
proper WebSocket implementation by wrapping the Websocket message's bytes within
an HttpServletRequest.
ApplicationConfig.WEBSOCKET_CONTENT_TYPE property
The method is defined using ApplicationConfig.WEBSOCKET_METHOD property
| Field Summary | |
|---|---|
protected String |
contentType
|
protected String |
delimiter
|
protected boolean |
destroyable
|
protected String |
methodType
|
protected static String |
TEXT
|
| Constructor Summary | |
|---|---|
StreamingHttpProtocol()
|
|
| Method Summary | |
|---|---|
void |
configure(AtmosphereConfig config)
Allow an implementation to query the AtmosphereConfig of init-param, etc. |
List<AtmosphereRequest> |
onBinaryStream(WebSocket webSocket,
InputStream stream)
Parse the WebSocket stream, and delegate the processing to the AtmosphereFramework.asyncSupport or
to any existing technology. |
void |
onClose(WebSocket webSocket)
Invoked when a WebSocket is closed |
void |
onError(WebSocket webSocket,
WebSocketProcessor.WebSocketException t)
Invoked when an error occurs. |
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 |
List<AtmosphereRequest> |
onTextStream(WebSocket webSocket,
Reader r)
Parse the WebSocket stream, and delegate the processing to the AtmosphereFramework.asyncSupport or
to any existing technology. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final String TEXT
protected String contentType
protected String methodType
protected String delimiter
protected boolean destroyable
| Constructor Detail |
|---|
public StreamingHttpProtocol()
| Method Detail |
|---|
public void configure(AtmosphereConfig config)
WebSocketProtocol
configure in interface WebSocketProtocolconfig - AtmosphereConfig
public List<AtmosphereRequest> onTextStream(WebSocket webSocket,
Reader r)
WebSocketProtocolStreamAtmosphereFramework.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;
onTextStream in interface WebSocketProtocolStreamwebSocket - The WebSocket connectionr - a Reader
AtmosphereRequest
public List<AtmosphereRequest> onBinaryStream(WebSocket webSocket,
InputStream stream)
WebSocketProtocolStreamAtmosphereFramework.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;
onBinaryStream in interface WebSocketProtocolStreamwebSocket - The WebSocket connectionstream - a Reader
AtmosphereRequest
public 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
AtmosphereRequest
public 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.
AtmosphereRequestpublic void onOpen(WebSocket webSocket)
WebSocketProtocol
onOpen in interface WebSocketProtocolwebSocket - WebSocketpublic void onClose(WebSocket webSocket)
WebSocketProtocol
onClose in interface WebSocketProtocolwebSocket - WebSocket
public void onError(WebSocket webSocket,
WebSocketProcessor.WebSocketException t)
WebSocketProtocol
onError in interface WebSocketProtocolwebSocket - WebSockett - a WebSocketProcessor.WebSocketException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||