org.atmosphere.websocket
Interface WebSocketHandler

All Known Subinterfaces:
WebSocketStreamingHandler
All Known Implementing Classes:
WebSocketHandlerAdapter, WebSocketProcessor.WebSocketHandlerProxy, WebSocketStreamingHandlerAdapter

public interface WebSocketHandler

A very simple interface adapter class that implements all methods and expose a WebSocket API close to the JavaScript Counterpart.

Author:
Jeanfrancois Arcand

Method Summary
 void onByteMessage(WebSocket webSocket, byte[] data, int offset, int length)
          Invoked when a byte message is received.
 void onClose(WebSocket webSocket)
          Invoked when a WebSocket is closed.
 void onError(WebSocket webSocket, WebSocketProcessor.WebSocketException t)
          Invoked when a WebSocket produces an error.
 void onOpen(WebSocket webSocket)
          Invoked when a WebSocket is opened.
 void onTextMessage(WebSocket webSocket, String data)
          Invoked when a String message is received
 

Method Detail

onByteMessage

void onByteMessage(WebSocket webSocket,
                   byte[] data,
                   int offset,
                   int length)
                   throws IOException
Invoked when a byte message is received.

Parameters:
webSocket - a WebSocket
data -
offset -
length -
Throws:
IOException

onTextMessage

void onTextMessage(WebSocket webSocket,
                   String data)
                   throws IOException
Invoked when a String message is received

Parameters:
webSocket - a WebSocket
data -
Throws:
IOException

onOpen

void onOpen(WebSocket webSocket)
            throws IOException
Invoked when a WebSocket is opened.

Parameters:
webSocket -
Throws:
IOException

onClose

void onClose(WebSocket webSocket)
Invoked when a WebSocket is closed.

Parameters:
webSocket -

onError

void onError(WebSocket webSocket,
             WebSocketProcessor.WebSocketException t)
Invoked when a WebSocket produces an error.

Parameters:
webSocket -


Copyright © 2014. All Rights Reserved.