Class SessionTracker
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.ee10.websocket.jakarta.common.SessionTracker
- All Implemented Interfaces:
JakartaWebSocketSessionListener, Dumpable, Graceful, LifeCycle
public class SessionTracker
extends AbstractLifeCycle
implements JakartaWebSocketSessionListener, Graceful, Dumpable
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface Dumpable
Dumpable.DumpableContainerNested classes/interfaces inherited from interface Graceful
Graceful.Shutdown, Graceful.ThrowingRunnableNested classes/interfaces inherited from interface LifeCycle
LifeCycle.Listener -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoStart()Method to override to start the lifecycleprotected voiddoStop()Method to override to stop the lifecyclevoiddump(Appendable out, String indent) Dump this object (and children) into an Appendable using the provided indent after any new lines.intSet<jakarta.websocket.Session> booleanvoidvoidshutdown()Shutdown the component.Methods inherited from class AbstractLifeCycle
addEventListener, getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeEventListener, setEventListeners, start, stop, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface JakartaWebSocketSessionListener
onJakartaWebSocketSessionCreated
-
Constructor Details
-
SessionTracker
public SessionTracker()
-
-
Method Details
-
getSessions
-
onJakartaWebSocketSessionOpened
- Specified by:
onJakartaWebSocketSessionOpenedin interfaceJakartaWebSocketSessionListener
-
onJakartaWebSocketSessionClosed
- Specified by:
onJakartaWebSocketSessionClosedin interfaceJakartaWebSocketSessionListener
-
doStart
Description copied from class:AbstractLifeCycleMethod to override to start the lifecycle- Overrides:
doStartin classAbstractLifeCycle- Throws:
Exception- If there was a problem starting. Will cause a transition to FAILED state
-
doStop
Description copied from class:AbstractLifeCycleMethod to override to stop the lifecycle- Overrides:
doStopin classAbstractLifeCycle- Throws:
Exception- If there was a problem stopping. Will cause a transition to FAILED state
-
shutdown
Description copied from interface:GracefulShutdown the component. When this method returns, the component should not accept any new load. -
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceGraceful- Returns:
- True if
Graceful.shutdown()has been called.
-
getNumSessions
-
dump
Description copied from interface:DumpableDump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.- Specified by:
dumpin interfaceDumpable- Parameters:
out- The appendable to dump toindent- The indent to apply after any new lines.- Throws:
IOException- if unable to write to Appendable
-