public final class DefaultChannelPool extends Object implements ChannelPool
ChannelPool based on a ConcurrentHashMap| Modifier and Type | Class and Description |
|---|---|
static class |
DefaultChannelPool.PoolLeaseStrategy |
| Constructor and Description |
|---|
DefaultChannelPool(AsyncHttpClientConfig config,
Timer hashedWheelTimer) |
DefaultChannelPool(int maxIdleTime,
int connectionTtl,
DefaultChannelPool.PoolLeaseStrategy poolLeaseStrategy,
Timer nettyTimer,
int cleanerPeriod) |
DefaultChannelPool(int maxIdleTime,
int connectionTtl,
Timer nettyTimer,
int cleanerPeriod) |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Destroy all channels that has been cached by this instance.
|
void |
flushPartition(Object partitionKey)
Flush a partition
|
void |
flushPartitions(ChannelPoolPartitionSelector selector)
Flush partitions based on a selector
|
boolean |
isOpen()
Return true if a channel can be cached.
|
boolean |
offer(Channel channel,
Object partitionKey)
Add a channel to the pool
|
Channel |
poll(Object partitionKey)
Remove the channel associated with the uri.
|
boolean |
removeAll(Channel channel)
Remove all channels from the cache.
|
public DefaultChannelPool(AsyncHttpClientConfig config, Timer hashedWheelTimer)
public DefaultChannelPool(int maxIdleTime,
int connectionTtl,
Timer nettyTimer,
int cleanerPeriod)
public DefaultChannelPool(int maxIdleTime,
int connectionTtl,
DefaultChannelPool.PoolLeaseStrategy poolLeaseStrategy,
Timer nettyTimer,
int cleanerPeriod)
public boolean offer(Channel channel, Object partitionKey)
offer in interface ChannelPoolchannel - an I/O channelpartitionKey - a key used to retrieve the cached channelpublic Channel poll(Object partitionKey)
poll in interface ChannelPoolpartitionKey - the partition used when invoking offerpublic boolean removeAll(Channel channel)
removeAll in interface ChannelPoolchannel - a channelpublic boolean isOpen()
ChannelPool.offer(Channel, Object)isOpen in interface ChannelPoolpublic void destroy()
destroy in interface ChannelPoolpublic void flushPartition(Object partitionKey)
ChannelPoolflushPartition in interface ChannelPoolpartitionKey - the partitionpublic void flushPartitions(ChannelPoolPartitionSelector selector)
ChannelPoolflushPartitions in interface ChannelPoolselector - the selectorCopyright © 2017. All Rights Reserved.