T
- The type emitted.@Internal public class NettyWebSocketClientHandler<T> extends AbstractNettyWebSocketHandler
ID, LOG, mediaTypeCodecRegistry, messageHandler, originatingRequest, pongHandler, subProtocol, uriVariables, webSocketBean, webSocketBinder, webSocketSessionRepository, webSocketVersion
Constructor and Description |
---|
NettyWebSocketClientHandler(MutableHttpRequest<?> request,
WebSocketBean<T> webSocketBean,
io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker handshaker,
RequestBinderRegistry requestBinderRegistry,
MediaTypeCodecRegistry mediaTypeCodecRegistry)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
channelActive(io.netty.channel.ChannelHandlerContext ctx) |
protected void |
channelRead0(io.netty.channel.ChannelHandlerContext ctx,
Object msg) |
protected NettyWebSocketSession |
createWebSocketSession(io.netty.channel.ChannelHandlerContext ctx)
Subclasses should implement to create the actual
NettyWebSocketSession . |
void |
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause) |
Argument<?> |
getBodyArgument() |
reactor.core.publisher.Mono<T> |
getHandshakeCompletedMono() |
Argument<?> |
getPongArgument() |
NettyWebSocketSession |
getSession() |
protected void |
handleCloseReason(io.netty.channel.ChannelHandlerContext ctx,
CloseReason cr,
boolean writeCloseReason)
Used to close the session with a given reason.
|
void |
userEventTriggered(io.netty.channel.ChannelHandlerContext ctx,
Object evt) |
callOpenMethod, forwardErrorToUser, handlerRemoved, handleWebSocketFrame, instrumentPublisher, invokeExecutable, messageHandled, writeCloseFrameAndTerminate
acceptInboundMessage, channelRead
channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged
ensureNotSharable, handlerAdded, isSharable
public NettyWebSocketClientHandler(MutableHttpRequest<?> request, WebSocketBean<T> webSocketBean, io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker handshaker, RequestBinderRegistry requestBinderRegistry, MediaTypeCodecRegistry mediaTypeCodecRegistry)
request
- The originating request that created the WebSocket.webSocketBean
- The WebSocket client bean.handshaker
- The handshakerrequestBinderRegistry
- The request binder registrymediaTypeCodecRegistry
- The media type codec registrypublic void userEventTriggered(io.netty.channel.ChannelHandlerContext ctx, Object evt) throws Exception
userEventTriggered
in interface io.netty.channel.ChannelInboundHandler
userEventTriggered
in class io.netty.channel.ChannelInboundHandlerAdapter
Exception
public Argument<?> getBodyArgument()
getBodyArgument
in class AbstractNettyWebSocketHandler
public Argument<?> getPongArgument()
getPongArgument
in class AbstractNettyWebSocketHandler
public NettyWebSocketSession getSession()
getSession
in class AbstractNettyWebSocketHandler
public void channelActive(io.netty.channel.ChannelHandlerContext ctx)
channelActive
in interface io.netty.channel.ChannelInboundHandler
channelActive
in class io.netty.channel.ChannelInboundHandlerAdapter
protected void channelRead0(io.netty.channel.ChannelHandlerContext ctx, Object msg)
channelRead0
in class AbstractNettyWebSocketHandler
protected NettyWebSocketSession createWebSocketSession(io.netty.channel.ChannelHandlerContext ctx)
AbstractNettyWebSocketHandler
NettyWebSocketSession
.createWebSocketSession
in class AbstractNettyWebSocketHandler
ctx
- The contextpublic void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause)
exceptionCaught
in interface io.netty.channel.ChannelHandler
exceptionCaught
in interface io.netty.channel.ChannelInboundHandler
exceptionCaught
in class AbstractNettyWebSocketHandler
public final reactor.core.publisher.Mono<T> getHandshakeCompletedMono()
protected void handleCloseReason(io.netty.channel.ChannelHandlerContext ctx, CloseReason cr, boolean writeCloseReason)
AbstractNettyWebSocketHandler
handleCloseReason
in class AbstractNettyWebSocketHandler
ctx
- The contextcr
- The reasonwriteCloseReason
- Whether to allow writing the close reason to the remote