Class ServletWebSocketSupport

java.lang.Object
io.micronaut.servlet.websocket.ServletWebSocketSupport

@Internal @Singleton public final class ServletWebSocketSupport extends Object
The services a MicronautServerEndpoint needs, resolved once and shared by every WebSocket connection.
Since:
6.2.0
Author:
graemerocher
  • Constructor Details

    • ServletWebSocketSupport

      public ServletWebSocketSupport(io.micronaut.context.ApplicationContext applicationContext, io.micronaut.http.bind.RequestBinderRegistry requestBinderRegistry, io.micronaut.core.convert.ConversionService conversionService, io.micronaut.http.body.MessageBodyHandlerRegistry messageBodyHandlerRegistry, ServletWebSocketMessageEncoder encoder, ServletWebSocketSessionRegistry sessionRegistry, ServletWebSocketConfiguration configuration, io.micronaut.http.server.RouteExecutor routeExecutor, io.micronaut.http.server.HttpServerConfiguration serverConfiguration, JakartaEndpointComponents components)
      Default constructor.
      Parameters:
      applicationContext - The application context, used to publish WebSocket events
      requestBinderRegistry - The HTTP request binder registry
      conversionService - The conversion service
      messageBodyHandlerRegistry - The message body handler registry
      encoder - The outbound message encoder
      sessionRegistry - The session registry
      configuration - The WebSocket configuration
      routeExecutor - The route executor, used for @ExecuteOn support
      serverConfiguration - The server configuration
      components - Instantiates the components a Jakarta endpoint declares
  • Method Details

    • components

      public JakartaEndpointComponents components()
      Returns:
      The resolver for the decoders, encoders and configurator a Jakarta endpoint declares
    • applicationContext

      public io.micronaut.context.ApplicationContext applicationContext()
      Returns:
      The application context
    • binderRegistry

      public io.micronaut.websocket.bind.WebSocketStateBinderRegistry binderRegistry()
      Returns:
      The registry used to bind WebSocket handler method arguments
    • conversionService

      public io.micronaut.core.convert.ConversionService conversionService()
      Returns:
      The conversion service
    • messageBodyHandlerRegistry

      public io.micronaut.http.body.MessageBodyHandlerRegistry messageBodyHandlerRegistry()
      Returns:
      The message body handler registry
    • encoder

      Returns:
      The outbound message encoder
    • sessionRegistry

      public ServletWebSocketSessionRegistry sessionRegistry()
      Returns:
      The session registry
    • configuration

      public ServletWebSocketConfiguration configuration()
      Returns:
      The WebSocket configuration
    • executorSelector

      public io.micronaut.scheduling.executor.ExecutorSelector executorSelector()
      Returns:
      The executor selector, which honours @ExecuteOn
    • threadSelectionConfiguration

      public io.micronaut.scheduling.executor.ThreadSelectionConfiguration threadSelectionConfiguration()
      Returns:
      The thread selection configuration
    • idleTimeout

      public Duration idleTimeout()
      Returns:
      How long a session may stay idle before it is closed
    • coroutineHelper

      public @Nullable io.micronaut.http.server.CoroutineHelper coroutineHelper()
      Returns:
      The coroutine helper, or null when Kotlin coroutines are not on the classpath