org.atmosphere.websocket.protocol
Class EchoProtocol
java.lang.Object
org.atmosphere.websocket.WebSocketProcessor
org.atmosphere.websocket.protocol.EchoProtocol
- All Implemented Interfaces:
- Serializable
public class EchoProtocol
- extends WebSocketProcessor
Simple WebSocketProcessor that invoke the Broadcaster.broadcast(T) API when a WebSocket message
is received.
NOTE: If WebSocket frame are used the bytes will be decoded into a String, which reduce performance.
- Author:
- Jeanfrancois Arcand
- See Also:
- Serialized Form
EchoProtocol
public EchoProtocol(AtmosphereServlet atmosphereServlet,
WebSocket webSocket)
parseMessage
public void parseMessage(String data)
- Description copied from class:
WebSocketProcessor
- Parse the WebSocket message, and delegate the processing to the
AtmosphereServlet.cometSupport or
to any existing technology. Invoking AtmosphereServlet.cometSupport will delegate the request processing
to the AtmosphereHandler implementation. As an example, this is how Websocket messages are delegated to the
Jersey runtime.
- Specified by:
parseMessage in class WebSocketProcessor
- Parameters:
data - The Websocket message
parseMessage
public void parseMessage(byte[] data,
int offset,
int length)
- Description copied from class:
WebSocketProcessor
- Parse the WebSocket message, and delegate the processing to the
AtmosphereServlet.cometSupport or
to any existing technology. Invoking AtmosphereServlet.cometSupport will delegate the request processing
to the AtmosphereHandler implementation. As an example, this is how Websocket messages are delegated to the
Jersey runtime.
- Specified by:
parseMessage in class WebSocketProcessor
- Parameters:
data - The Websocket messageoffset - offset message indexlength - length of the message.
Copyright © 2011. All Rights Reserved.