Class SimpleChannelPool

    • Method Detail

      • bootstrap

        protected Bootstrap bootstrap()
        Returns the Bootstrap this pool will use to open new connections.
        Returns:
        the Bootstrap this pool will use to open new connections
      • releaseHealthCheck

        protected boolean releaseHealthCheck()
        Indicates whether this pool will check the health of channels before offering them back into the pool.
        Returns:
        true if this pool will check the health of channels before offering them back into the pool, or false if channel health is only checked at acquisition time
      • acquire

        public final io.netty.util.concurrent.Future<Channel> acquire()
        Description copied from interface: ChannelPool
        Acquire a Channel from this ChannelPool. The returned Future is notified once the acquire is successful and failed otherwise. Its important that an acquired is always released to the pool again, even if the Channel is explicitly closed..
        Specified by:
        acquire in interface ChannelPool
      • acquire

        public io.netty.util.concurrent.Future<Channel> acquire​(io.netty.util.concurrent.Promise<Channel> promise)
        Description copied from interface: ChannelPool
        Acquire a Channel from this ChannelPool. The given Promise is notified once the acquire is successful and failed otherwise. Its important that an acquired is always released to the pool again, even if the Channel is explicitly closed..
        Specified by:
        acquire in interface ChannelPool
      • release

        public final io.netty.util.concurrent.Future<Void> release​(Channel channel)
        Description copied from interface: ChannelPool
        Release a Channel back to this ChannelPool. The returned Future is notified once the release is successful and failed otherwise. When failed the Channel will automatically closed.
        Specified by:
        release in interface ChannelPool
      • release

        public io.netty.util.concurrent.Future<Void> release​(Channel channel,
                                                             io.netty.util.concurrent.Promise<Void> promise)
        Description copied from interface: ChannelPool
        Release a Channel back to this ChannelPool. The given Promise is notified once the release is successful and failed otherwise. When failed the Channel will automatically closed.
        Specified by:
        release in interface ChannelPool
      • pollChannel

        protected Channel pollChannel()
        Poll a Channel out of the internal storage to reuse it. This will return null if no Channel is ready to be reused. Sub-classes may override pollChannel() and offerChannel(Channel). Be aware that implementations of these methods needs to be thread-safe!
      • offerChannel

        protected boolean offerChannel​(Channel channel)
        Offer a Channel back to the internal storage. This will return true if the Channel could be added, false otherwise. Sub-classes may override pollChannel() and offerChannel(Channel). Be aware that implementations of these methods needs to be thread-safe!
      • closeAsync

        public io.netty.util.concurrent.Future<Void> closeAsync()
        Closes the pool in an async manner.
        Returns:
        Future which represents completion of the close task