Package io.micronaut.servlet.websocket
package io.micronaut.servlet.websocket
Support for the Micronaut WebSocket programming model on servlet containers that
implement Jakarta WebSocket 2.1.
- Since:
- 6.2.0
- Author:
- graemerocher
-
ClassDescriptionThe dispatch a Jakarta
Endpointperforms onto a Micronaut WebSocket bean, shared by the server and the client side.A message that has been encoded ready to be written to a Jakarta WebSocket remote endpoint, as either a text or a binary frame.What a@ServerEndpointor@ClientEndpointdeclares, read once from its bean definition.Instantiates the classes a@ServerEndpointnames indecoders,encodersandconfigurator.Switches a matched upgrade request over to the servlet container's Jakarta WebSocket implementation.TheEndpointthat adapts a connection the server accepted onto a Micronaut@ServerWebSocketbean, or onto a Jakarta@ServerEndpointthe annotation processor mapped onto one.The JakartaWebSocketContainerof a Micronaut servlet application, for opening client connections.Registers a class the annotation processors never saw as a bean, reflectively.Applies the Micronaut defaults to a container'sWebSocketContainer.AWebSocketBroadcasterthat writes to every open session of this server.Configuration for WebSocket support on servlet containers.Configuration for thepermessage-deflateextension.Encodes an outbound WebSocket message the way the Netty server does: byte-like payloads become binary frames,CharSequenceandjava.langtypes become text frames, and anything else is written through theMessageBodyHandlerRegistryas a text frame using the configured media type, JSON by default.AWebSocketSessionbacked by ajakarta.websocket.Session.Keeps track of the open WebSocket sessions of this server.The services aMicronautServerEndpointneeds, resolved once and shared by every WebSocket connection.The servlet container's Jakarta WebSocket container, for opening client connections.The per-upgrade state aMicronautServerEndpointneeds, passed to the endpoint through the user properties of theServerEndpointConfigcreated for the upgrade.