Class WebSocketSupport

java.lang.Object
eu.webtoolkit.jwt.WebSocketSupport

public class WebSocketSupport extends Object
Handle web socket events for all running servlets
Author:
raf
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    handleMessage(javax.websocket.Session session, 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
    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, String contents) throws 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:
      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(Throwable t)
      Is called when a socket exception occurs
      Parameters:
      t - the generated exception