public class

IdleConnectionHandler

extends Object
java.lang.Object
   ↳ org.apache.http.impl.conn.IdleConnectionHandler

This class is deprecated.
no longer used

Class Overview

A helper class for connection managers to track idle connections.

This class is not synchronized.

Summary

Public Constructors
IdleConnectionHandler()
Public Methods
void add(HttpConnection connection, long validDuration, TimeUnit unit)
Registers the given connection with this handler.
void closeExpiredConnections()
void closeIdleConnections(long idleTime)
Closes connections that have been idle for at least the given amount of time.
boolean remove(HttpConnection connection)
Removes the given connection from the list of connections to be closed when idle.
void removeAll()
Removes all connections referenced by this handler.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public IdleConnectionHandler ()

Also: HttpClient

Public Methods

public void add (HttpConnection connection, long validDuration, TimeUnit unit)

Also: HttpClient

Registers the given connection with this handler. The connection will be held until remove(HttpConnection) or closeIdleConnections(long) is called.

Parameters
connection the connection to add

public void closeExpiredConnections ()

Also: HttpClient

public void closeIdleConnections (long idleTime)

Also: HttpClient

Closes connections that have been idle for at least the given amount of time.

Parameters
idleTime the minimum idle time, in milliseconds, for connections to be closed

public boolean remove (HttpConnection connection)

Also: HttpClient

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.

Returns
  • True if the connection is still valid.

public void removeAll ()

Also: HttpClient

Removes all connections referenced by this handler.