Package 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
Modifier and TypeMethodDescriptionvoidonByteMessage(WebSocket webSocket, byte[] data, int offset, int length) Invoked when a byte message is received.voidInvoked when aWebSocketis closed.voidonError(WebSocket webSocket, WebSocketProcessor.WebSocketException t) Invoked when aWebSocketproduces an error.voidInvoked when aWebSocketis opened.voidonTextMessage(WebSocket webSocket, String data) Invoked when a String message is received
-
Method Details
-
onByteMessage
Invoked when a byte message is received.- Parameters:
webSocket- aWebSocketdata-offset-length-- Throws:
IOException
-
onTextMessage
Invoked when a String message is received- Parameters:
webSocket- aWebSocketdata-- Throws:
IOException
-
onOpen
Invoked when aWebSocketis opened.- Parameters:
webSocket-- Throws:
IOException
-
onClose
Invoked when aWebSocketis closed.- Parameters:
webSocket-
-
onError
Invoked when aWebSocketproduces an error.- Parameters:
webSocket-
-