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(int maxConnectionPerHost,
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.
|
boolean |
isOpen()
Return true if a connection can be cached.
|
boolean |
offer(org.jboss.netty.channel.Channel channel,
String poolKey)
Add a connection to the pool
|
org.jboss.netty.channel.Channel |
poll(String poolKey)
Remove the connection associated with the uri.
|
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(int maxConnectionPerHost,
long maxIdleTime,
int maxConnectionTTL,
boolean sslConnectionPoolEnabled,
org.jboss.netty.util.Timer nettyTimer)
public boolean offer(org.jboss.netty.channel.Channel channel,
String poolKey)
offer in interface ChannelPoolchannel - an I/O connectionpoolKey - a key used to retrieve the cached connectionpublic org.jboss.netty.channel.Channel poll(String poolKey)
poll in interface ChannelPoolpoolKey - the uri used when invoking addConnectionpublic boolean removeAll(org.jboss.netty.channel.Channel channel)
removeAll in interface ChannelPoolchannel - a connectionpublic boolean isOpen()
ChannelPool#offer(Object, Object)isOpen in interface ChannelPoolpublic void destroy()
destroy in interface ChannelPoolCopyright © 2014. All Rights Reserved.