public final class DefaultChannelPool extends Object implements ChannelPool
ChannelPool
based on a ConcurrentHashMapV8
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(Object partitionKey)
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,
Object partitionKey)
Add a connection to the pool
|
org.jboss.netty.channel.Channel |
poll(Object partitionKey)
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, Object partitionKey)
ChannelPool
offer
in interface ChannelPool
channel
- an I/O connectionpublic org.jboss.netty.channel.Channel poll(Object partitionKey)
ChannelPool
poll
in interface ChannelPool
public boolean removeAll(org.jboss.netty.channel.Channel channel)
ChannelPool
removeAll
in interface ChannelPool
channel
- a connectionpublic boolean isOpen()
ChannelPool
ChannelPool#offer(Object, Object)
isOpen
in interface ChannelPool
public void destroy()
ChannelPool
destroy
in interface ChannelPool
public void flushPartition(Object partitionKey)
ChannelPool
flushPartition
in interface ChannelPool
public void flushPartitions(ChannelPoolPartitionSelector selector)
ChannelPool
flushPartitions
in interface ChannelPool
Copyright © 2015. All Rights Reserved.