Package com.linkedin.alpini.netty4.ssl
Class FusedSslHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.handler.codec.ByteToMessageDecoder
io.netty.handler.ssl.SslHandler
com.linkedin.alpini.netty4.ssl.FusedSslHandler
- All Implemented Interfaces:
io.netty.channel.ChannelHandler
,io.netty.channel.ChannelInboundHandler
,io.netty.channel.ChannelOutboundHandler
public class FusedSslHandler
extends io.netty.handler.ssl.SslHandler
An implementation of SslHandler which limits the number of objects held within the
pendingUnencryptedWrites queue. This queue is normally very small but when there is some badly
behaved code which writes to the channel in a tight loop, we would want to fail further writes
so that we don't fall into an OOM situation.
-
Nested Class Summary
Nested classes/interfaces inherited from class io.netty.handler.codec.ByteToMessageDecoder
io.netty.handler.codec.ByteToMessageDecoder.Cumulator
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable
-
Field Summary
Fields inherited from class io.netty.handler.codec.ByteToMessageDecoder
COMPOSITE_CUMULATOR, MERGE_CUMULATOR
-
Constructor Summary
ConstructorDescriptionFusedSslHandler
(SSLEngine engine) FusedSslHandler
(SSLEngine engine, Executor delegatedTaskExecutor) -
Method Summary
Modifier and TypeMethodDescriptionint
The length of the outbound queue.int
void
handlerAdded
(io.netty.channel.ChannelHandlerContext ctx) void
setOutboundQueueSizeLimit
(int maxOutboundQueueSize) void
write
(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise) Methods inherited from class io.netty.handler.ssl.SslHandler
applicationProtocol, bind, channelActive, channelInactive, channelReadComplete, close, close, close, closeOutbound, closeOutbound, connect, decode, deregister, disconnect, engine, exceptionCaught, flush, getCloseNotifyFlushTimeoutMillis, getCloseNotifyReadTimeoutMillis, getCloseNotifyTimeoutMillis, getHandshakeTimeoutMillis, handlerRemoved0, handshakeFuture, isEncrypted, read, renegotiate, renegotiate, setCloseNotifyFlushTimeout, setCloseNotifyFlushTimeoutMillis, setCloseNotifyReadTimeout, setCloseNotifyReadTimeoutMillis, setCloseNotifyTimeout, setCloseNotifyTimeoutMillis, setHandshakeTimeout, setHandshakeTimeoutMillis, setWrapDataSize, sslCloseFuture
Methods inherited from class io.netty.handler.codec.ByteToMessageDecoder
actualReadableBytes, callDecode, channelRead, decodeLast, discardSomeReadBytes, handlerRemoved, internalBuffer, isSingleDecode, setCumulator, setDiscardAfterReads, setSingleDecode, userEventTriggered
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelRegistered, channelUnregistered, channelWritabilityChanged
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, 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
handlerRemoved
-
Constructor Details
-
FusedSslHandler
-
FusedSslHandler
-
-
Method Details
-
setOutboundQueueSizeLimit
public void setOutboundQueueSizeLimit(@Nonnegative int maxOutboundQueueSize) -
getOutboundQueueSizeLimit
public int getOutboundQueueSizeLimit() -
getOutboundQueueSize
public int getOutboundQueueSize()The length of the outbound queue. This queue includes both ByteBuf and ChannelPromise objects. This operation is O(1) since the queue is an ArrayDeque.- Returns:
- number of objects in the queue
-
write
public void write(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise) throws Exception - Specified by:
write
in interfaceio.netty.channel.ChannelOutboundHandler
- Overrides:
write
in classio.netty.handler.ssl.SslHandler
- Throws:
Exception
-
handlerAdded
- Specified by:
handlerAdded
in interfaceio.netty.channel.ChannelHandler
- Overrides:
handlerAdded
in classio.netty.handler.ssl.SslHandler
- Throws:
Exception
-