public class

NettyConnectionsPool

extends Object
implements ConnectionsPool<U, V>
java.lang.Object
   ↳ com.ning.http.client.providers.netty.NettyConnectionsPool

Class Overview

A simple implementation of ConnectionsPool based on a java.util.concurrent.ConcurrentHashMap

Summary

Public Constructors
NettyConnectionsPool(NettyAsyncHttpProvider provider)
Public Methods
boolean canCacheConnection()
Return true if a connection can be cached.
void destroy()
Destroy all connections that has been cached by this instance.
boolean offer(String uri, Channel channel)
Channel poll(String uri)
boolean removeAll(Channel channel)
final String toString()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.ning.http.client.ConnectionsPool

Public Constructors

public NettyConnectionsPool (NettyAsyncHttpProvider provider)

Public Methods

public boolean canCacheConnection ()

Return true if a connection can be cached. A implementation can decide based on some rules to allow caching Calling this method is equivalent of checking the returned value of offer(Object, Object)

Returns
  • true if a connection can be cached.

public void destroy ()

Destroy all connections that has been cached by this instance.

public boolean offer (String uri, Channel channel)

public Channel poll (String uri)

public boolean removeAll (Channel channel)

public final String toString ()