Class SdkChannelPoolMap<K,​P extends io.netty.channel.pool.ChannelPool>

  • All Implemented Interfaces:
    io.netty.channel.pool.ChannelPoolMap<K,​P>, Closeable, AutoCloseable, Iterable<Map.Entry<K,​P>>
    Direct Known Subclasses:
    AwaitCloseChannelPoolMap

    public abstract class SdkChannelPoolMap<K,​P extends io.netty.channel.pool.ChannelPool>
    extends Object
    implements io.netty.channel.pool.ChannelPoolMap<K,​P>, Iterable<Map.Entry<K,​P>>, Closeable
    Replacement for AbstractChannelPoolMap. This implementation guarantees only one instance of a ChannelPool is created for each key.
    • Constructor Detail

      • SdkChannelPoolMap

        public SdkChannelPoolMap()
    • Method Detail

      • get

        public final P get​(K key)
        Specified by:
        get in interface io.netty.channel.pool.ChannelPoolMap<K,​P extends io.netty.channel.pool.ChannelPool>
      • remove

        public final boolean remove​(K key)
        Remove the ChannelPool from this AbstractChannelPoolMap. Returns true if removed, false otherwise. Please note that null keys are not allowed.
      • size

        public final int size()
        Returns the number of ChannelPools currently in this AbstractChannelPoolMap.
      • isEmpty

        public final boolean isEmpty()
        Returns true if the AbstractChannelPoolMap is empty, otherwise false.
      • contains

        public final boolean contains​(K key)
        Specified by:
        contains in interface io.netty.channel.pool.ChannelPoolMap<K,​P extends io.netty.channel.pool.ChannelPool>
      • newPool

        protected abstract P newPool​(K key)
        Called once a new ChannelPool needs to be created as non exists yet for the key.
      • pools

        public final Map<K,​P> pools()