Class 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 
      Modifier and Type Class Description
      static class  FusedSslHandler.OverflowException  
      • 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

      Constructors 
      Constructor Description
      FusedSslHandler​(javax.net.ssl.SSLEngine engine)  
      FusedSslHandler​(javax.net.ssl.SSLEngine engine, java.util.concurrent.Executor delegatedTaskExecutor)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getOutboundQueueSize()
      The length of the outbound queue.
      int getOutboundQueueSizeLimit()  
      void handlerAdded​(io.netty.channel.ChannelHandlerContext ctx)  
      void setOutboundQueueSizeLimit​(int maxOutboundQueueSize)  
      void write​(io.netty.channel.ChannelHandlerContext ctx, java.lang.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 Detail

      • FusedSslHandler

        public FusedSslHandler​(javax.net.ssl.SSLEngine engine)
      • FusedSslHandler

        public FusedSslHandler​(javax.net.ssl.SSLEngine engine,
                               java.util.concurrent.Executor delegatedTaskExecutor)
    • Method Detail

      • 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,
                          java.lang.Object msg,
                          io.netty.channel.ChannelPromise promise)
                   throws java.lang.Exception
        Specified by:
        write in interface io.netty.channel.ChannelOutboundHandler
        Overrides:
        write in class io.netty.handler.ssl.SslHandler
        Throws:
        java.lang.Exception
      • handlerAdded

        public void handlerAdded​(io.netty.channel.ChannelHandlerContext ctx)
                          throws java.lang.Exception
        Specified by:
        handlerAdded in interface io.netty.channel.ChannelHandler
        Overrides:
        handlerAdded in class io.netty.handler.ssl.SslHandler
        Throws:
        java.lang.Exception