Package org.atmosphere.websocket
Interface WebSocketHandler
-
- All Known Subinterfaces:
WebSocketStreamingHandler
- All Known Implementing Classes:
WebSocketHandlerAdapter,WebSocketProcessor.WebSocketHandlerProxy,WebSocketStreamingHandlerAdapter
public interface WebSocketHandlerA very simple interface adapter class that implements all methods and expose a WebSocket API close to the JavaScript Counterpart.- Author:
- Jeanfrancois Arcand
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidonByteMessage(WebSocket webSocket, byte[] data, int offset, int length)Invoked when a byte message is received.voidonClose(WebSocket webSocket)Invoked when aWebSocketis closed.voidonError(WebSocket webSocket, WebSocketProcessor.WebSocketException t)Invoked when aWebSocketproduces an error.voidonOpen(WebSocket webSocket)Invoked when aWebSocketis opened.voidonTextMessage(WebSocket webSocket, java.lang.String data)Invoked when a String message is received
-
-
-
Method Detail
-
onByteMessage
void onByteMessage(WebSocket webSocket, byte[] data, int offset, int length) throws java.io.IOException
Invoked when a byte message is received.- Parameters:
webSocket- aWebSocketdata-offset-length-- Throws:
java.io.IOException
-
onTextMessage
void onTextMessage(WebSocket webSocket, java.lang.String data) throws java.io.IOException
Invoked when a String message is received- Parameters:
webSocket- aWebSocketdata-- Throws:
java.io.IOException
-
onOpen
void onOpen(WebSocket webSocket) throws java.io.IOException
Invoked when aWebSocketis opened.- Parameters:
webSocket-- Throws:
java.io.IOException
-
onClose
void onClose(WebSocket webSocket)
Invoked when aWebSocketis closed.- Parameters:
webSocket-
-
onError
void onError(WebSocket webSocket, WebSocketProcessor.WebSocketException t)
Invoked when aWebSocketproduces an error.- Parameters:
webSocket-
-
-