org.atmosphere.websocket
Class WebSocketProcessor

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

public class WebSocketProcessor
extends Object
implements Serializable

Like the AsynchronousProcessor class, this class is responsible for dispatching WebSocket request to the proper WebSocket implementation. This class can be extended in order to support any protocol running on top websocket.

Author:
Jeanfrancois Arcand
See Also:
Serialized Form

Nested Class Summary
static class WebSocketProcessor.WebSocketException
           
 
Constructor Summary
WebSocketProcessor(AtmosphereServlet atmosphereServlet, WebSocket webSocket, WebSocketProtocol webSocketProtocol)
           
 
Method Summary
 void close()
           
static Map<String,String> configureHeader(javax.servlet.http.HttpServletRequest request)
           
 void dispatch(javax.servlet.http.HttpServletRequest request)
           
protected  void dispatch(javax.servlet.http.HttpServletRequest request, AtmosphereResponse<?> r)
          Dispatch to request/response to the CometSupport implementation as it was a normal HTTP request.
 void invokeWebSocketProtocol(byte[] data, int offset, int length)
           
 void invokeWebSocketProtocol(String webSocketMessage)
           
 void notifyListener(WebSocketEventListener.WebSocketEvent event)
           
 String toString()
           
 WebSocket webSocket()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WebSocketProcessor

public WebSocketProcessor(AtmosphereServlet atmosphereServlet,
                          WebSocket webSocket,
                          WebSocketProtocol webSocketProtocol)
Method Detail

dispatch

public final void dispatch(javax.servlet.http.HttpServletRequest request)
                    throws IOException
Throws:
IOException

invokeWebSocketProtocol

public void invokeWebSocketProtocol(String webSocketMessage)

invokeWebSocketProtocol

public void invokeWebSocketProtocol(byte[] data,
                                    int offset,
                                    int length)

dispatch

protected final void dispatch(javax.servlet.http.HttpServletRequest request,
                              AtmosphereResponse<?> r)
Dispatch to request/response to the CometSupport implementation as it was a normal HTTP request.

Parameters:
request - a HttpServletRequest
r - a HttpServletResponse

webSocket

public WebSocket webSocket()

close

public void close()

toString

public String toString()
Overrides:
toString in class Object

notifyListener

public void notifyListener(WebSocketEventListener.WebSocketEvent event)

configureHeader

public static final Map<String,String> configureHeader(javax.servlet.http.HttpServletRequest request)


Copyright © 2011. All Rights Reserved.