Deprecated
(4.1) no longer used
This class is not synchronized.
org.apache.http.conn.ClientConnectionManager#closeIdleConnections
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final Map | connectionToTimes
Holds connections and the time they were added. |
| private final Log |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | add(final HttpConnection
the connection to add connection, final long validDuration, final TimeUnit unit)Registers the given connection with this handler. |
| public void | |
| public void | closeIdleConnections(final long
the minimum idle time, in milliseconds, for connections to be closed idleTime)Closes connections that have been idle for at least the given amount of time. |
| public boolean | Returns: True if the connection is still valid.Removes the given connection from the list of connections to be closed when idle. |
| public void |
| connectionToTimes | back to summary |
|---|---|
| private final Map<HttpConnection, IdleConnectionHandler. Holds connections and the time they were added. | |
| log | back to summary |
|---|---|
| private final Log log | |
| IdleConnectionHandler | back to summary |
|---|---|
| public IdleConnectionHandler() | |
| add | back to summary |
|---|---|
| public void add(final HttpConnection connection, final long validDuration, final TimeUnit unit) Registers the given connection with this handler. The connection will be held until
| |
| closeExpiredConnections | back to summary |
|---|---|
| public void closeExpiredConnections() | |
| closeIdleConnections | back to summary |
|---|---|
| public void closeIdleConnections(final long idleTime) Closes connections that have been idle for at least the given amount of time.
| |
| remove | back to summary |
|---|---|
| public boolean remove(final HttpConnection connection) Removes the given connection from the list of connections to be closed when idle. This will return true if the connection is still valid, and false if the connection should be considered expired and not used.
| |
| removeAll | back to summary |
|---|---|
| public void removeAll() Removes all connections referenced by this handler. | |
| Modifier and Type | Field and Description |
|---|---|
| private final long | |
| private final long |
| Access | Constructor and Description |
|---|---|
| pack-priv | TimeValues(final long
The current time in milliseconds now, final long The duration this connection is valid for validDuration, final TimeUnit The unit of time the duration is specified in. validUnit)
|
| timeAdded | back to summary |
|---|---|
| private final long timeAdded | |
| timeExpires | back to summary |
|---|---|
| private final long timeExpires | |
| TimeValues | back to summary |
|---|---|
pack-priv TimeValues(final long now, final long validDuration, final TimeUnit validUnit)
| |