org.atmosphere.websocket
Interface WebSocketProtocolStream

All Superinterfaces:
WebSocketProtocol

public interface WebSocketProtocolStream
extends WebSocketProtocol

A streaming API for WebServer that support WebSocket streaming. When a WebSocketProtocol implements this interface, bytes/text will ve streamed instead of read in memory.

Author:
Jeanfrancois Arcand

Method Summary
 List<AtmosphereRequest> onBinaryStream(WebSocket webSocket, InputStream stream)
          Parse the WebSocket stream, and delegate the processing to the AtmosphereFramework.asyncSupport or to any existing technology.
 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 interface org.atmosphere.websocket.WebSocketProtocol
configure, onClose, onError, onMessage, onMessage, onOpen
 

Method Detail

onTextStream

List<AtmosphereRequest> onTextStream(WebSocket webSocket,
                                     Reader r)
Parse the WebSocket stream, and delegate the processing to the AtmosphereFramework.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;
As an example, this is how Websocket messages are delegated to the Jersey runtime.

Parameters:
webSocket - The WebSocket connection
r - a Reader
Returns:
a List of AtmosphereRequest

onBinaryStream

List<AtmosphereRequest> onBinaryStream(WebSocket webSocket,
                                       InputStream stream)
Parse the WebSocket stream, and delegate the processing to the AtmosphereFramework.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;
As an example, this is how Websocket messages are delegated to the Jersey runtime.

Parameters:
webSocket - The WebSocket connection
stream - a Reader
Returns:
a List of AtmosphereRequest


Copyright © 2014. All Rights Reserved.