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(AtmosphereFramework framework, WebSocket webSocket, WebSocketProtocol webSocketProtocol)
           
 
Method Summary
 void close(int closeCode)
           
static Map<String,String> configureHeader(AtmosphereRequest request)
           
 void dispatch(AtmosphereRequest request)
           
protected  void dispatch(AtmosphereRequest request, AtmosphereResponse r)
          Dispatch to request/response to the AsyncSupport 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(AtmosphereFramework framework,
                          WebSocket webSocket,
                          WebSocketProtocol webSocketProtocol)
Method Detail

dispatch

public final void dispatch(AtmosphereRequest 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(AtmosphereRequest request,
                              AtmosphereResponse r)
Dispatch to request/response to the AsyncSupport implementation as it was a normal HTTP request.

Parameters:
request - a AtmosphereRequest
r - a AtmosphereResponse

webSocket

public WebSocket webSocket()

close

public void close(int closeCode)

toString

public String toString()
Overrides:
toString in class Object

notifyListener

public void notifyListener(WebSocketEventListener.WebSocketEvent event)

configureHeader

public static final Map<String,String> configureHeader(AtmosphereRequest request)


Copyright © 2012. All Rights Reserved.