Top Description Methods
org.eclipse.jetty.websocket.api

public Interface WebSocketContainer

Imports
java.util.Collection, java.util.concurrent.Executor, java.util.function.Consumer

Generic interface to the Container (server or client)

Method Summary

Modifier and TypeMethod and Description
public void
addSessionListener(WebSocketSessionListener
the listener
listener
)

Register a WebSocketSessionListener with the container

public Executor
getExecutor()

The Container provided Executor.

public Collection<Session>

Returns:

the collection of open sessions
getOpenSessions
()

Get the collection of open Sessions being tracked by this container

public void
notifySessionListeners(Consumer<WebSocketSessionListener>
the consumer to call for each tracked listener
consumer
)

Notify the Session Listeners of an event.

public boolean

Returns:

true if listener was present and removed
removeSessionListener
(WebSocketSessionListener
the listener
listener
)

Remove a WebSocketSessionListener from the container

Method Detail

addSessionListenerback to summary
public void addSessionListener(WebSocketSessionListener listener)

Register a WebSocketSessionListener with the container

Parameters
listener:WebSocketSessionListener

the listener

getExecutorback to summary
public Executor getExecutor()

The Container provided Executor.

getOpenSessionsback to summary
public Collection<Session> getOpenSessions()

Get the collection of open Sessions being tracked by this container

Returns:Collection<Session>

the collection of open sessions

notifySessionListenersback to summary
public void notifySessionListeners(Consumer<WebSocketSessionListener> consumer)

Notify the Session Listeners of an event.

Parameters
consumer:Consumer<WebSocketSessionListener>

the consumer to call for each tracked listener

removeSessionListenerback to summary
public boolean removeSessionListener(WebSocketSessionListener listener)

Remove a WebSocketSessionListener from the container

Parameters
listener:WebSocketSessionListener

the listener

Returns:boolean

true if listener was present and removed