Class WebSocketMessageEncoder
java.lang.Object
io.micronaut.http.netty.websocket.WebSocketMessageEncoder
@Requires(classes=io.micronaut.websocket.exceptions.WebSocketSessionException.class)
@Singleton
public class WebSocketMessageEncoder
extends Object
Encapsulate functionality to encode WebSocket messages.
- Since:
- 1.0
-
Constructor Summary
ConstructorsConstructorDescriptionWebSocketMessageEncoder(io.micronaut.http.codec.MediaTypeCodecRegistry codecRegistry) -
Method Summary
Modifier and TypeMethodDescriptionio.netty.handler.codec.http.websocketx.WebSocketFrameencodeMessage(Object message, io.micronaut.http.MediaType mediaType) Encode the given message with the given media type.
-
Constructor Details
-
WebSocketMessageEncoder
public WebSocketMessageEncoder(io.micronaut.http.codec.MediaTypeCodecRegistry codecRegistry) - Parameters:
codecRegistry- The codec registry
-
-
Method Details
-
encodeMessage
public io.netty.handler.codec.http.websocketx.WebSocketFrame encodeMessage(Object message, io.micronaut.http.MediaType mediaType) Encode the given message with the given media type.- Parameters:
message- The messagemediaType- The media type- Returns:
- The encoded frame
-