Package org.asynchttpclient.channel
Enum NoopChannelPool
- java.lang.Object
-
- java.lang.Enum<NoopChannelPool>
-
- org.asynchttpclient.channel.NoopChannelPool
-
- All Implemented Interfaces:
Serializable
,Comparable<NoopChannelPool>
,ChannelPool
public enum NoopChannelPool extends Enum<NoopChannelPool> implements ChannelPool
AChannelPool
implementation that doesn't pool anything.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
Does nothing since this is aNoopChannelPool
void
flushPartitions(Predicate<Object> predicate)
Does nothing since this is aNoopChannelPool
Map<String,Long>
getIdleChannelCountPerHost()
boolean
isOpen()
Return true if a channel can be cached.boolean
offer(io.netty.channel.Channel channel, Object partitionKey)
Add a channel to the pool@Nullable io.netty.channel.Channel
poll(Object partitionKey)
Remove the channel associated with the uri.boolean
removeAll(io.netty.channel.Channel channel)
Remove all channels from the cache.static NoopChannelPool
valueOf(String name)
Returns the enum constant of this type with the specified name.static NoopChannelPool[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INSTANCE
public static final NoopChannelPool INSTANCE
-
-
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 nameNullPointerException
- 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 interfaceChannelPool
- Parameters:
channel
- an I/O channelpartitionKey
- a key used to retrieve the cached channel- Returns:
- always false since this is a
NoopChannelPool
-
poll
@Nullable public @Nullable io.netty.channel.Channel poll(Object partitionKey)
Description copied from interface:ChannelPool
Remove the channel associated with the uri.- Specified by:
poll
in interfaceChannelPool
- Parameters:
partitionKey
- the partition used when invoking offer- Returns:
- always null since this is a
NoopChannelPool
-
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 interfaceChannelPool
- Parameters:
channel
- a channel- Returns:
- always false since this is a
NoopChannelPool
-
isOpen
public boolean isOpen()
Description copied from interface:ChannelPool
Return true if a channel can be cached. An implementation can decide based on some rules to allow caching Calling this method is equivalent of checking the returned value ofChannelPool.offer(Channel, Object)
- Specified by:
isOpen
in interfaceChannelPool
- Returns:
- always true since this is a
NoopChannelPool
-
destroy
public void destroy()
Does nothing since this is aNoopChannelPool
- Specified by:
destroy
in interfaceChannelPool
-
flushPartitions
public void flushPartitions(Predicate<Object> predicate)
Does nothing since this is aNoopChannelPool
- Specified by:
flushPartitions
in interfaceChannelPool
- Parameters:
predicate
- the predicate
-
getIdleChannelCountPerHost
public Map<String,Long> getIdleChannelCountPerHost()
- Specified by:
getIdleChannelCountPerHost
in interfaceChannelPool
- Returns:
- always
Collections.emptyMap()
since this is aNoopChannelPool
-
-