Enum NoopChannelPool

    • Method Detail

      • values

        public static NoopChannelPool[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (NoopChannelPool c : NoopChannelPool.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static NoopChannelPool valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • offer

        public boolean offer​(io.netty.channel.Channel channel,
                             Object partitionKey)
        Description copied from interface: ChannelPool
        Add a channel to the pool
        Specified by:
        offer in interface ChannelPool
        Parameters:
        channel - an I/O channel
        partitionKey - a key used to retrieve the cached channel
        Returns:
        true if added.
      • poll

        public io.netty.channel.Channel poll​(Object partitionKey)
        Description copied from interface: ChannelPool
        Remove the channel associated with the uri.
        Specified by:
        poll in interface ChannelPool
        Parameters:
        partitionKey - the partition used when invoking offer
        Returns:
        the channel associated with the uri
      • removeAll

        public boolean removeAll​(io.netty.channel.Channel channel)
        Description copied from interface: ChannelPool
        Remove all channels from the cache. A channel might have been associated with several uri.
        Specified by:
        removeAll in interface ChannelPool
        Parameters:
        channel - a channel
        Returns:
        the true if the channel has been removed
      • isOpen

        public boolean isOpen()
        Description copied from interface: ChannelPool
        Return true if a channel can be cached. A implementation can decide based on some rules to allow caching Calling this method is equivalent of checking the returned value of ChannelPool.offer(Channel, Object)
        Specified by:
        isOpen in interface ChannelPool
        Returns:
        true if a channel can be cached.
      • destroy

        public void destroy()
        Description copied from interface: ChannelPool
        Destroy all channels that has been cached by this instance.
        Specified by:
        destroy in interface ChannelPool
      • flushPartitions

        public void flushPartitions​(Predicate<Object> predicate)
        Description copied from interface: ChannelPool
        Flush partitions based on a predicate
        Specified by:
        flushPartitions in interface ChannelPool
        Parameters:
        predicate - the predicate