java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.websocket.javax.common.SessionTracker
All Implemented Interfaces:
org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.component.Graceful, org.eclipse.jetty.util.component.LifeCycle, JavaxWebSocketSessionListener

public class SessionTracker extends org.eclipse.jetty.util.component.AbstractLifeCycle implements JavaxWebSocketSessionListener, org.eclipse.jetty.util.component.Graceful, org.eclipse.jetty.util.component.Dumpable
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopException

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable

    org.eclipse.jetty.util.component.Dumpable.DumpableContainer

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Graceful

    org.eclipse.jetty.util.component.Graceful.Shutdown, org.eclipse.jetty.util.component.Graceful.ThrowingRunnable

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle

    org.eclipse.jetty.util.component.LifeCycle.Listener
  • Field Summary

    Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    FAILED, STARTED, STARTING, STOPPED, STOPPING

    Fields inherited from interface org.eclipse.jetty.util.component.Dumpable

    KEY
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    protected void
     
    void
    dump(Appendable out, String indent)
     
    int
     
    Set<javax.websocket.Session>
     
    boolean
     
    void
     
    void
     
     

    Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    addEventListener, getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeEventListener, setEventListeners, start, stop, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.eclipse.jetty.util.component.Dumpable

    dump, dumpSelf

    Methods inherited from interface org.eclipse.jetty.websocket.javax.common.JavaxWebSocketSessionListener

    onJavaxWebSocketSessionCreated
  • Constructor Details

    • SessionTracker

      public SessionTracker()
  • Method Details

    • getSessions

      public Set<javax.websocket.Session> getSessions()
    • onJavaxWebSocketSessionOpened

      public void onJavaxWebSocketSessionOpened(JavaxWebSocketSession session)
      Specified by:
      onJavaxWebSocketSessionOpened in interface JavaxWebSocketSessionListener
    • onJavaxWebSocketSessionClosed

      public void onJavaxWebSocketSessionClosed(JavaxWebSocketSession session)
      Specified by:
      onJavaxWebSocketSessionClosed in interface JavaxWebSocketSessionListener
    • doStart

      protected void doStart() throws Exception
      Overrides:
      doStart in class org.eclipse.jetty.util.component.AbstractLifeCycle
      Throws:
      Exception
    • doStop

      protected void doStop() throws Exception
      Overrides:
      doStop in class org.eclipse.jetty.util.component.AbstractLifeCycle
      Throws:
      Exception
    • shutdown

      public CompletableFuture<Void> shutdown()
      Specified by:
      shutdown in interface org.eclipse.jetty.util.component.Graceful
    • isShutdown

      public boolean isShutdown()
      Specified by:
      isShutdown in interface org.eclipse.jetty.util.component.Graceful
    • getNumSessions

      @ManagedAttribute("Total number of active WebSocket Sessions") public int getNumSessions()
    • dump

      public void dump(Appendable out, String indent) throws IOException
      Specified by:
      dump in interface org.eclipse.jetty.util.component.Dumpable
      Throws:
      IOException