Package org.eclipse.jetty.websocket.api
Interface WebSocketContainer
-
- All Known Implementing Classes:
JettyWebSocketServerContainer,WebSocketClient
public interface WebSocketContainerGeneric interface to the Container (server or client)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddSessionListener(WebSocketSessionListener listener)Register a WebSocketSessionListener with the containerjava.util.concurrent.ExecutorgetExecutor()The Container provided Executor.java.util.Collection<Session>getOpenSessions()Get the collection of open Sessions being tracked by this containervoidnotifySessionListeners(java.util.function.Consumer<WebSocketSessionListener> consumer)Notify the Session Listeners of an event.booleanremoveSessionListener(WebSocketSessionListener listener)Remove a WebSocketSessionListener from the container
-
-
-
Method Detail
-
getExecutor
java.util.concurrent.Executor getExecutor()
The Container provided Executor.
-
getOpenSessions
java.util.Collection<Session> getOpenSessions()
Get the collection of open Sessions being tracked by this container- Returns:
- the collection of open sessions
-
addSessionListener
void addSessionListener(WebSocketSessionListener listener)
Register a WebSocketSessionListener with the container- Parameters:
listener- the listener
-
removeSessionListener
boolean removeSessionListener(WebSocketSessionListener listener)
Remove a WebSocketSessionListener from the container- Parameters:
listener- the listener- Returns:
- true if listener was present and removed
-
notifySessionListeners
void notifySessionListeners(java.util.function.Consumer<WebSocketSessionListener> consumer)
Notify the Session Listeners of an event.- Parameters:
consumer- the consumer to call for each tracked listener
-
-