Package eu.webtoolkit.jwt
Class WebSocketSupport
java.lang.Object
eu.webtoolkit.jwt.WebSocketSupport
public class WebSocketSupport
extends java.lang.Object
Handle web socket events for all running servlets
- Author:
- raf
-
Constructor Summary
Constructors Constructor Description WebSocketSupport()
-
Method Summary
Modifier and Type Method Description void
handleMessage(javax.websocket.Session session, java.lang.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
onError(java.lang.Throwable t)
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 openedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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
public void handleMessage(javax.websocket.Session session, java.lang.String contents) throws java.io.IOExceptionIs called when a web socket message arrives- Parameters:
session
- holds all state for this web socket sessioncontents
- the contents of the message- Throws:
java.io.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
public void onError(java.lang.Throwable t)Is called when a socket exception occurs- Parameters:
t
- the generated exception
-