Class WebSocketMessageEncoder


  • @Singleton
    public class WebSocketMessageEncoder
    extends java.lang.Object
    Encapsulate functionality to encode WebSocket messages.
    Since:
    1.0
    • Constructor Summary

      Constructors 
      Constructor Description
      WebSocketMessageEncoder​(io.micronaut.http.codec.MediaTypeCodecRegistry codecRegistry)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      io.netty.handler.codec.http.websocketx.WebSocketFrame encodeMessage​(java.lang.Object message, io.micronaut.http.MediaType mediaType)
      Encode the given message with the given media type.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WebSocketMessageEncoder

        public WebSocketMessageEncoder​(io.micronaut.http.codec.MediaTypeCodecRegistry codecRegistry)
        Parameters:
        codecRegistry - The codec registry
    • Method Detail

      • encodeMessage

        public io.netty.handler.codec.http.websocketx.WebSocketFrame encodeMessage​(java.lang.Object message,
                                                                                   io.micronaut.http.MediaType mediaType)
        Encode the given message with the given media type.
        Parameters:
        message - The message
        mediaType - The media type
        Returns:
        The encoded frame