public class GrizzlyConnectionPool extends Object implements ConnectionPool
ConnectionPool
implementation.Modifier and Type | Class and Description |
---|---|
static class |
GrizzlyConnectionPool.DelayedExecutor |
Constructor and Description |
---|
GrizzlyConnectionPool(AsyncHttpClientConfig config) |
GrizzlyConnectionPool(boolean cacheSSLConnections,
int timeout,
int maxConnectionLifeTime,
int maxConnectionsPerHost,
int maxConnections,
GrizzlyConnectionPool.DelayedExecutor delayedExecutor) |
Modifier and Type | Method and Description |
---|---|
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,
org.glassfish.grizzly.Connection connection)
Add a connection tpo the pool
|
org.glassfish.grizzly.Connection |
poll(String uri)
Remove the connection associated with the uri.
|
boolean |
removeAll(org.glassfish.grizzly.Connection connection)
Remove all connections from the cache.
|
public GrizzlyConnectionPool(boolean cacheSSLConnections, int timeout, int maxConnectionLifeTime, int maxConnectionsPerHost, int maxConnections, GrizzlyConnectionPool.DelayedExecutor delayedExecutor)
public GrizzlyConnectionPool(AsyncHttpClientConfig config)
public boolean offer(String uri, org.glassfish.grizzly.Connection connection)
ConnectionPool
offer
in interface ConnectionPool
uri
- a uri used to retrieve the cached connectionconnection
- an I/O connectionpublic org.glassfish.grizzly.Connection poll(String uri)
ConnectionPool
poll
in interface ConnectionPool
uri
- the uri used when invoking addConnectionpublic boolean removeAll(org.glassfish.grizzly.Connection connection)
ConnectionPool
removeAll
in interface ConnectionPool
connection
- a connectionpublic boolean canCacheConnection()
ConnectionPool
ConnectionPool#offer(Object, Object)
canCacheConnection
in interface ConnectionPool
public void destroy()
ConnectionPool
destroy
in interface ConnectionPool
Copyright © 2015. All Rights Reserved.