Class NettyWebSocketClientHandler<T>

java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.SimpleChannelInboundHandler<Object>
io.micronaut.http.netty.websocket.AbstractNettyWebSocketHandler
io.micronaut.http.client.netty.websocket.NettyWebSocketClientHandler<T>
Type Parameters:
T - The type emitted.
All Implemented Interfaces:
io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler

@Internal public class NettyWebSocketClientHandler<T> extends io.micronaut.http.netty.websocket.AbstractNettyWebSocketHandler
Handler for WebSocket clients.
Since:
1.0
  • Nested Class Summary

    Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler

    io.netty.channel.ChannelHandler.Sharable
  • Field Summary

    Fields inherited from class io.micronaut.http.netty.websocket.AbstractNettyWebSocketHandler

    conversionService, ID, LOG, mediaTypeCodecRegistry, messageBodyHandlerRegistry, messageHandler, originatingRequest, pongHandler, subProtocol, uriVariables, webSocketBean, webSocketBinder, webSocketSessionRepository, webSocketVersion
  • Constructor Summary

    Constructors
    Constructor
    Description
    NettyWebSocketClientHandler(io.micronaut.http.MutableHttpRequest<?> request, io.micronaut.websocket.context.WebSocketBean<T> webSocketBean, io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker handshaker, io.micronaut.http.bind.RequestBinderRegistry requestBinderRegistry, io.micronaut.http.codec.MediaTypeCodecRegistry mediaTypeCodecRegistry, io.micronaut.http.body.MessageBodyHandlerRegistry messageBodyHandlerRegistry, io.micronaut.core.convert.ConversionService conversionService)
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    channelActive(io.netty.channel.ChannelHandlerContext ctx)
     
    protected void
    channelRead0(io.netty.channel.ChannelHandlerContext ctx, Object msg)
     
    protected io.micronaut.http.netty.websocket.NettyWebSocketSession
    createWebSocketSession(io.netty.channel.ChannelHandlerContext ctx)
     
    void
    exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause)
     
    io.micronaut.core.type.Argument<?>
     
    final reactor.core.publisher.Mono<T>
     
    io.micronaut.core.type.Argument<?>
     
    io.micronaut.http.netty.websocket.NettyWebSocketSession
     
    protected void
    handleCloseReason(io.netty.channel.ChannelHandlerContext ctx, io.micronaut.websocket.CloseReason cr, boolean writeCloseReason)
     
    void
    userEventTriggered(io.netty.channel.ChannelHandlerContext ctx, Object evt)
     

    Methods inherited from class io.micronaut.http.netty.websocket.AbstractNettyWebSocketHandler

    callOpenMethod, forwardErrorToUser, handlerRemoved, handleWebSocketFrame, instrumentPublisher, invokeExecutable, messageHandled, writeCloseFrameAndTerminate

    Methods inherited from class io.netty.channel.SimpleChannelInboundHandler

    acceptInboundMessage, channelRead

    Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter

    channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged

    Methods inherited from class io.netty.channel.ChannelHandlerAdapter

    ensureNotSharable, handlerAdded, isSharable

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.netty.channel.ChannelHandler

    handlerAdded
  • Constructor Details

    • NettyWebSocketClientHandler

      public NettyWebSocketClientHandler(io.micronaut.http.MutableHttpRequest<?> request, io.micronaut.websocket.context.WebSocketBean<T> webSocketBean, io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker handshaker, io.micronaut.http.bind.RequestBinderRegistry requestBinderRegistry, io.micronaut.http.codec.MediaTypeCodecRegistry mediaTypeCodecRegistry, io.micronaut.http.body.MessageBodyHandlerRegistry messageBodyHandlerRegistry, io.micronaut.core.convert.ConversionService conversionService)
      Default constructor.
      Parameters:
      request - The originating request that created the WebSocket.
      webSocketBean - The WebSocket client bean.
      handshaker - The handshaker
      requestBinderRegistry - The request binder registry
      mediaTypeCodecRegistry - The media type codec registry
      messageBodyHandlerRegistry - The handler registry
      conversionService - The conversionService
  • Method Details

    • userEventTriggered

      public void userEventTriggered(io.netty.channel.ChannelHandlerContext ctx, Object evt) throws Exception
      Specified by:
      userEventTriggered in interface io.netty.channel.ChannelInboundHandler
      Overrides:
      userEventTriggered in class io.netty.channel.ChannelInboundHandlerAdapter
      Throws:
      Exception
    • getBodyArgument

      public io.micronaut.core.type.Argument<?> getBodyArgument()
      Specified by:
      getBodyArgument in class io.micronaut.http.netty.websocket.AbstractNettyWebSocketHandler
    • getPongArgument

      public io.micronaut.core.type.Argument<?> getPongArgument()
      Specified by:
      getPongArgument in class io.micronaut.http.netty.websocket.AbstractNettyWebSocketHandler
    • getSession

      public io.micronaut.http.netty.websocket.NettyWebSocketSession getSession()
      Specified by:
      getSession in class io.micronaut.http.netty.websocket.AbstractNettyWebSocketHandler
    • channelActive

      public void channelActive(io.netty.channel.ChannelHandlerContext ctx)
      Specified by:
      channelActive in interface io.netty.channel.ChannelInboundHandler
      Overrides:
      channelActive in class io.netty.channel.ChannelInboundHandlerAdapter
    • channelRead0

      protected void channelRead0(io.netty.channel.ChannelHandlerContext ctx, Object msg)
      Overrides:
      channelRead0 in class io.micronaut.http.netty.websocket.AbstractNettyWebSocketHandler
    • createWebSocketSession

      protected io.micronaut.http.netty.websocket.NettyWebSocketSession createWebSocketSession(io.netty.channel.ChannelHandlerContext ctx)
      Specified by:
      createWebSocketSession in class io.micronaut.http.netty.websocket.AbstractNettyWebSocketHandler
    • exceptionCaught

      public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause)
      Specified by:
      exceptionCaught in interface io.netty.channel.ChannelHandler
      Specified by:
      exceptionCaught in interface io.netty.channel.ChannelInboundHandler
      Overrides:
      exceptionCaught in class io.micronaut.http.netty.websocket.AbstractNettyWebSocketHandler
    • getHandshakeCompletedMono

      public final reactor.core.publisher.Mono<T> getHandshakeCompletedMono()
    • handleCloseReason

      protected void handleCloseReason(io.netty.channel.ChannelHandlerContext ctx, io.micronaut.websocket.CloseReason cr, boolean writeCloseReason)
      Overrides:
      handleCloseReason in class io.micronaut.http.netty.websocket.AbstractNettyWebSocketHandler