public final class DefaultChannelPool extends Object implements ChannelPool
ChannelPool based on a ConcurrentHashMap| Constructor and Description |
|---|
DefaultChannelPool(AsyncHttpClientConfig config,
org.jboss.netty.util.Timer hashedWheelTimer) |
DefaultChannelPool(long maxIdleTime,
int maxConnectionTTL,
boolean sslConnectionPoolEnabled,
org.jboss.netty.util.Timer nettyTimer) |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Destroy all connections that has been cached by this instance.
|
void |
flushPartition(String partitionId)
Flush a partition
|
void |
flushPartitions(ChannelPoolPartitionSelector selector)
Flush partitions based on a selector
|
boolean |
isOpen()
Return true if a connection can be cached.
|
boolean |
offer(org.jboss.netty.channel.Channel channel,
String partition)
Add a connection to the pool
|
org.jboss.netty.channel.Channel |
poll(String partitionId)
Get a connection from a partition
|
boolean |
removeAll(org.jboss.netty.channel.Channel channel)
Remove all connections from the cache.
|
public DefaultChannelPool(AsyncHttpClientConfig config, org.jboss.netty.util.Timer hashedWheelTimer)
public DefaultChannelPool(long maxIdleTime,
int maxConnectionTTL,
boolean sslConnectionPoolEnabled,
org.jboss.netty.util.Timer nettyTimer)
public boolean offer(org.jboss.netty.channel.Channel channel,
String partition)
ChannelPooloffer in interface ChannelPoolchannel - an I/O connectionpartition - a key used to retrieve the cached connectionpublic org.jboss.netty.channel.Channel poll(String partitionId)
ChannelPoolpoll in interface ChannelPoolpartitionId - the id of the partition used when invoking offerpublic boolean removeAll(org.jboss.netty.channel.Channel channel)
ChannelPoolremoveAll in interface ChannelPoolchannel - a connectionpublic boolean isOpen()
ChannelPoolChannelPool#offer(Object, Object)isOpen in interface ChannelPoolpublic void destroy()
ChannelPooldestroy in interface ChannelPoolpublic void flushPartition(String partitionId)
ChannelPoolflushPartition in interface ChannelPoolpublic void flushPartitions(ChannelPoolPartitionSelector selector)
ChannelPoolflushPartitions in interface ChannelPoolCopyright © 2014. All Rights Reserved.