Package eu.webtoolkit.jwt
Class WebSocketSupport
java.lang.Object
eu.webtoolkit.jwt.WebSocketSupport
Handle web socket events for all running servlets
- Author:
- raf
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
handleMessage
(javax.websocket.Session session, String contents) Is called when a web socket message arrivesvoid
onClose
(javax.websocket.Session session, javax.websocket.CloseReason closeReason) Is called when a web socket is closedvoid
Is called when a socket exception occursvoid
onOpen
(javax.websocket.Session session, javax.websocket.EndpointConfig config) Is called when a new web socket connection is opened
-
Constructor Details
-
WebSocketSupport
public WebSocketSupport()
-
-
Method Details
-
onOpen
public void onOpen(javax.websocket.Session session, javax.websocket.EndpointConfig config) Is called when a new web socket connection is opened- Parameters:
session
- holds all state for this web socket sessionconfig
- holds the headers used to set up this socket session
-
handleMessage
Is called when a web socket message arrives- Parameters:
session
- holds all state for this web socket sessioncontents
- the contents of the message- Throws:
IOException
- on error writing to the socket session
-
onClose
public void onClose(javax.websocket.Session session, javax.websocket.CloseReason closeReason) Is called when a web socket is closed- Parameters:
session
- holds all state for this web sessioncloseReason
- the reason why the socket is closed
-
onError
Is called when a socket exception occurs- Parameters:
t
- the generated exception
-