Top Description Fields Constructors Methods
io.netty.handler.codec.http.websocketx.extensions

public Class WebSocketClientExtensionHandler

extends ChannelDuplexHandler
Class Inheritance
Known Direct Subclasses
io.netty.handler.codec.http.websocketx.extensions.compression.WebSocketClientCompressionHandler
Static Imports
io.netty.util.internal.ObjectUtil.checkNonEmpty

This handler negotiates and initializes the WebSocket Extensions. This implementation negotiates the extension with the server in a defined order, ensures that the successfully negotiated extensions are consistent between them, and initializes the channel pipeline with the extension decoder and encoder. Find a basic implementation for compression extensions at io.netty.handler.codec.http.websocketx.extensions.compression.WebSocketClientCompressionHandler.

Field Summary

Modifier and TypeField and Description
private final List<WebSocketClientExtensionHandshaker>

Constructor Summary

AccessConstructor and Description
public
WebSocketClientExtensionHandler(WebSocketClientExtensionHandshaker...
The extension handshaker in priority order. A handshaker could be repeated many times with fallback configuration.
extensionHandshakers
)

Constructor

Method Summary

Modifier and TypeMethod and Description
public void
public void
write(final ChannelHandlerContext
the ChannelHandlerContext for which the write operation is made
ctx
,
Object
the message to write
msg
,
ChannelPromise
the ChannelPromise to notify once the operation completes
promise
)

Overrides io.netty.channel.ChannelDuplexHandler.write.

Implements io.netty.channel.ChannelOutboundHandler.write.

Calls ChannelHandlerContext#write(Object, ChannelPromise) to forward to the next ChannelOutboundHandler in the ChannelPipeline.
Inherited from io.netty.channel.ChannelDuplexHandler:
bindcloseconnectderegisterdisconnectflushread

Field Detail

extensionHandshakersback to summary
private final List<WebSocketClientExtensionHandshaker> extensionHandshakers

Constructor Detail

WebSocketClientExtensionHandlerback to summary
public WebSocketClientExtensionHandler(WebSocketClientExtensionHandshaker... extensionHandshakers)

Constructor

Parameters
extensionHandshakers:WebSocketClientExtensionHandshaker[]

The extension handshaker in priority order. A handshaker could be repeated many times with fallback configuration.

Method Detail

channelReadback to summary
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception

Overrides io.netty.channel.ChannelInboundHandlerAdapter.channelRead.

Implements io.netty.channel.ChannelInboundHandler.channelRead.

Doc from io.netty.channel.ChannelInboundHandlerAdapter.channelRead.

Calls ChannelHandlerContext#fireChannelRead(Object) to forward to the next ChannelInboundHandler in the ChannelPipeline. Sub-classes may override this method to change behavior.

Annotations
@Override
writeback to summary
public void write(final ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception

Overrides io.netty.channel.ChannelDuplexHandler.write.

Implements io.netty.channel.ChannelOutboundHandler.write.

Doc from io.netty.channel.ChannelDuplexHandler.write.

Calls ChannelHandlerContext#write(Object, ChannelPromise) to forward to the next ChannelOutboundHandler in the ChannelPipeline. Sub-classes may override this method to change behavior.

Parameters
ctx:ChannelHandlerContext

Doc from io.netty.channel.ChannelOutboundHandler.write.

the ChannelHandlerContext for which the write operation is made

msg:Object

Doc from io.netty.channel.ChannelOutboundHandler.write.

the message to write

promise:ChannelPromise

Doc from io.netty.channel.ChannelOutboundHandler.write.

the ChannelPromise to notify once the operation completes

Annotations
@Override
Exceptions
Exception:

Doc from io.netty.channel.ChannelOutboundHandler.write.

thrown if an error occurs