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 arrives
    void onClose​(javax.websocket.Session session, javax.websocket.CloseReason closeReason)
    Is called when a web socket is closed
    void onError​(java.lang.Throwable t)
    Is called when a socket exception occurs
    void onOpen​(javax.websocket.Session session, javax.websocket.EndpointConfig config)
    Is called when a new web socket connection is opened

    Methods 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 session
      config - 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.IOException
      Is called when a web socket message arrives
      Parameters:
      session - holds all state for this web socket session
      contents - 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 session
      closeReason - 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