public class GrizzlyConnectionsPool extends Object implements ConnectionsPool<String,org.glassfish.grizzly.Connection>
ConnectionsPool
implementation.Modifier and Type | Class and Description |
---|---|
static class |
GrizzlyConnectionsPool.DelayedExecutor |
Constructor and Description |
---|
GrizzlyConnectionsPool(AsyncHttpClientConfig config) |
GrizzlyConnectionsPool(boolean cacheSSLConnections,
int timeout,
int maxConnectionLifeTimeInMs,
int maxConnectionsPerHost,
int maxConnections,
GrizzlyConnectionsPool.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 GrizzlyConnectionsPool(boolean cacheSSLConnections, int timeout, int maxConnectionLifeTimeInMs, int maxConnectionsPerHost, int maxConnections, GrizzlyConnectionsPool.DelayedExecutor delayedExecutor)
public GrizzlyConnectionsPool(AsyncHttpClientConfig config)
public boolean offer(String uri, org.glassfish.grizzly.Connection connection)
offer
in interface ConnectionsPool<String,org.glassfish.grizzly.Connection>
uri
- a uri used to retrieve the cached connectionconnection
- an I/O connectionpublic org.glassfish.grizzly.Connection poll(String uri)
poll
in interface ConnectionsPool<String,org.glassfish.grizzly.Connection>
uri
- the uri used when invoking addConnectionpublic boolean removeAll(org.glassfish.grizzly.Connection connection)
removeAll
in interface ConnectionsPool<String,org.glassfish.grizzly.Connection>
connection
- a connectionpublic boolean canCacheConnection()
ConnectionsPool.offer(Object, Object)
canCacheConnection
in interface ConnectionsPool<String,org.glassfish.grizzly.Connection>
public void destroy()
destroy
in interface ConnectionsPool<String,org.glassfish.grizzly.Connection>
Copyright © 2014. All Rights Reserved.