org.atmosphere.websocket.protocol
Class SimpleHttpProtocol

java.lang.Object
  extended by org.atmosphere.websocket.WebSocketProcessor
      extended by org.atmosphere.websocket.protocol.SimpleHttpProtocol
All Implemented Interfaces:
Serializable

public class SimpleHttpProtocol
extends WebSocketProcessor
implements Serializable

Like the AsynchronousProcessor class, this class is responsible for dispatching WebSocket messages to the proper WebSocket implementation by wrapping the Websocket message's bytes within an HttpServletRequest.

The content-type is defined using ApplicationConfig.WEBSOCKET_CONTENT_TYPE property The method is defined using ApplicationConfig.WEBSOCKET_METHOD property

Author:
Jeanfrancois Arcand
See Also:
Serialized Form

Constructor Summary
SimpleHttpProtocol(AtmosphereServlet atmosphereServlet, WebSocket webSocket)
           
 
Method Summary
 void parseMessage(byte[] d, int offset, int length)
          Parse the WebSocket message, and delegate the processing to the AtmosphereServlet.cometSupport or to any existing technology.
 void parseMessage(String d)
          Parse the WebSocket message, and delegate the processing to the AtmosphereServlet.cometSupport or to any existing technology.
 
Methods inherited from class org.atmosphere.websocket.WebSocketProcessor
close, configureHeader, dispatch, dispatch, notifyListener, request, resource, toString, webSocketSupport
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleHttpProtocol

public SimpleHttpProtocol(AtmosphereServlet atmosphereServlet,
                          WebSocket webSocket)
Method Detail

parseMessage

public void parseMessage(String d)
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:
d - The Websocket message

parseMessage

public void parseMessage(byte[] d,
                         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:
d - The Websocket message
offset - offset message index
length - length of the message.


Copyright © 2011. All Rights Reserved.