Class ServletWebSocketSessionRegistry
java.lang.Object
io.micronaut.servlet.websocket.ServletWebSocketSessionRegistry
- All Implemented Interfaces:
io.micronaut.context.event.ApplicationEventListener<io.micronaut.runtime.server.event.ServerShutdownEvent>, EventListener
@Internal
@Singleton
public final class ServletWebSocketSessionRegistry
extends Object
implements io.micronaut.context.event.ApplicationEventListener<io.micronaut.runtime.server.event.ServerShutdownEvent>
Keeps track of the open WebSocket sessions of this server.
The Netty server tracks sessions in a single Netty ChannelGroup that spans
every endpoint, and both WebSocketSession.getOpenSessions() and the broadcaster
are built on it. This registry plays the same role, since the per-endpoint set offered
by jakarta.websocket.Session#getOpenSessions() has narrower scope.
- Since:
- 6.2.0
- Author:
- graemerocher
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSet<io.micronaut.websocket.WebSocketSession> voidonApplicationEvent(io.micronaut.runtime.server.event.ServerShutdownEvent event) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.context.event.ApplicationEventListener
supports
-
Constructor Details
-
ServletWebSocketSessionRegistry
public ServletWebSocketSessionRegistry()
-
-
Method Details
-
getOpenSessions
- Returns:
- The currently open sessions
-
onApplicationEvent
public void onApplicationEvent(io.micronaut.runtime.server.event.ServerShutdownEvent event) - Specified by:
onApplicationEventin interfaceio.micronaut.context.event.ApplicationEventListener<io.micronaut.runtime.server.event.ServerShutdownEvent>
-