Top Fields Constructors Methods
org.eclipse.jetty.websocket.common

public Class SessionTracker

extends AbstractLifeCycle
implements WebSocketSessionListener, Graceful, Dumpable
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.component.Graceful, org.eclipse.jetty.websocket.api.WebSocketSessionListener
Imports
java.io.IOException, java.util.Collection, .Collections, .Set, java.util.concurrent.CompletableFuture, .ConcurrentHashMap, org.eclipse.jetty.util.annotation.ManagedAttribute, org.eclipse.jetty.util.component.AbstractLifeCycle, .Dumpable, .Graceful, org.eclipse.jetty.websocket.api.Callback, .Session, .StatusCode, .WebSocketSessionListener

Field Summary

Modifier and TypeField and Description
private boolean
private final Set<Session>
Inherited from org.eclipse.jetty.util.component.AbstractLifeCycle:
FAILEDSTARTEDSTARTINGSTOPPEDSTOPPING

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
doStart()

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.doStart.

Method to override to start the lifecycle

protected void
doStop()

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.doStop.

Method to override to stop the lifecycle

public void
dump(Appendable
The appendable to dump to
out
,
String
The indent to apply after any new lines.
indent
)

Implements org.eclipse.jetty.util.component.Dumpable.dump.

Dump this object (and children) into an Appendable using the provided indent after any new lines.

public int
public Collection<Session>
public boolean
public void
public void
public CompletableFuture<Void>
shutdown()

Implements org.eclipse.jetty.util.component.Graceful.shutdown.

Shutdown the component.

Inherited from org.eclipse.jetty.util.component.AbstractLifeCycle:
addEventListenergetEventListenersgetStategetStateisFailedisRunningisStartedisStartingisStoppedisStoppingremoveEventListenersetEventListenersstartstoptoString

Field Detail

isShutdownback to summary
private boolean isShutdown
sessionsback to summary
private final Set<Session> sessions

Constructor Detail

SessionTrackerback to summary
public SessionTracker()

Method Detail

doStartback to summary
protected void doStart() throws Exception

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.doStart.

Doc from org.eclipse.jetty.util.component.AbstractLifeCycle.doStart.

Method to override to start the lifecycle

Annotations
@Override
Exceptions
Exception:
If there was a problem starting. Will cause a transition to FAILED state
doStopback to summary
protected void doStop() throws Exception

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.doStop.

Doc from org.eclipse.jetty.util.component.AbstractLifeCycle.doStop.

Method to override to stop the lifecycle

Annotations
@Override
Exceptions
Exception:
If there was a problem stopping. Will cause a transition to FAILED state
dumpback to summary
public void dump(Appendable out, String indent) throws IOException

Implements org.eclipse.jetty.util.component.Dumpable.dump.

Doc from org.eclipse.jetty.util.component.Dumpable.dump.

Dump 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.

Parameters
out:Appendable

The appendable to dump to

indent:String

The indent to apply after any new lines.

Annotations
@Override
Exceptions
IOException:
if unable to write to Appendable
getNumSessionsback to summary
public int getNumSessions()
Annotations
@ManagedAttribute:Total number of active WebSocket Sessions
getSessionsback to summary
public Collection<Session> getSessions()
isShutdownback to summary
public boolean isShutdown()

Implements org.eclipse.jetty.util.component.Graceful.isShutdown.

Returns:boolean

Doc from org.eclipse.jetty.util.component.Graceful.isShutdown.

True if shutdown() has been called.

Annotations
@Override
onWebSocketSessionClosedback to summary
public void onWebSocketSessionClosed(Session session)

Overrides default org.eclipse.jetty.websocket.api.WebSocketSessionListener.onWebSocketSessionClosed.

Annotations
@Override
onWebSocketSessionOpenedback to summary
public void onWebSocketSessionOpened(Session session)

Overrides default org.eclipse.jetty.websocket.api.WebSocketSessionListener.onWebSocketSessionOpened.

Annotations
@Override
shutdownback to summary
public CompletableFuture<Void> shutdown()

Implements org.eclipse.jetty.util.component.Graceful.shutdown.

Doc from org.eclipse.jetty.util.component.Graceful.shutdown.

Shutdown the component. When this method returns, the component should not accept any new load.

Returns:CompletableFuture<Void>

A future that is completed once all load on the component is completed

Annotations
@Override