Top Description Inners Fields Constructors Methods
org.apache.http.impl.client

public final Class IdleConnectionEvictor

extends Object
Class Inheritance
Imports
java.util.concurrent.ThreadFactory, .TimeUnit, org.apache.http.conn.HttpClientConnectionManager, org.apache.http.util.Args

This class maintains a background thread to enforce an eviction policy for expired / idle persistent connections kept alive in the connection pool.
Since
4.4

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
private final HttpClientConnectionManager
private volatile Exception
private final long
private final long
private final Thread
private final ThreadFactory

Constructor Summary

AccessConstructor and Description
public
IdleConnectionEvictor(final HttpClientConnectionManager connectionManager, final ThreadFactory threadFactory, final long sleepTime, final TimeUnit sleepTimeUnit, final long maxIdleTime, final TimeUnit maxIdleTimeUnit)

public
IdleConnectionEvictor(final HttpClientConnectionManager connectionManager, final long sleepTime, final TimeUnit sleepTimeUnit, final long maxIdleTime, final TimeUnit maxIdleTimeUnit)

public
IdleConnectionEvictor(final HttpClientConnectionManager connectionManager, final long maxIdleTime, final TimeUnit maxIdleTimeUnit)

Method Summary

Modifier and TypeMethod and Description
public void
awaitTermination(final long time, final TimeUnit timeUnit)

public boolean
public void
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

connectionManagerback to summary
private final HttpClientConnectionManager connectionManager
exceptionback to summary
private volatile Exception exception
maxIdleTimeMsback to summary
private final long maxIdleTimeMs
sleepTimeMsback to summary
private final long sleepTimeMs
threadback to summary
private final Thread thread
threadFactoryback to summary
private final ThreadFactory threadFactory

Constructor Detail

IdleConnectionEvictorback to summary
public IdleConnectionEvictor(final HttpClientConnectionManager connectionManager, final ThreadFactory threadFactory, final long sleepTime, final TimeUnit sleepTimeUnit, final long maxIdleTime, final TimeUnit maxIdleTimeUnit)
IdleConnectionEvictorback to summary
public IdleConnectionEvictor(final HttpClientConnectionManager connectionManager, final long sleepTime, final TimeUnit sleepTimeUnit, final long maxIdleTime, final TimeUnit maxIdleTimeUnit)
IdleConnectionEvictorback to summary
public IdleConnectionEvictor(final HttpClientConnectionManager connectionManager, final long maxIdleTime, final TimeUnit maxIdleTimeUnit)

Method Detail

awaitTerminationback to summary
public void awaitTermination(final long time, final TimeUnit timeUnit) throws InterruptedException
isRunningback to summary
public boolean isRunning()
shutdownback to summary
public void shutdown()
startback to summary
public void start()
org.apache.http.impl.client back to summary

pack-priv Class IdleConnectionEvictor.DefaultThreadFactory

extends Object
implements ThreadFactory
Class Inheritance
  • java.lang.Object
  • org.apache.http.impl.client.IdleConnectionEvictor.DefaultThreadFactory
All Implemented Interfaces
java.util.concurrent.ThreadFactory

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Thread
newThread(final Runnable
a runnable to be executed by new thread instance
r
)

Implements java.util.concurrent.ThreadFactory.newThread.

Constructs a new unstarted Thread to run the given runnable.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

DefaultThreadFactoryback to summary
pack-priv DefaultThreadFactory()

Method Detail

newThreadback to summary
public Thread newThread(final Runnable r)

Implements java.util.concurrent.ThreadFactory.newThread.

Doc from java.util.concurrent.ThreadFactory.newThread.

Constructs a new unstarted Thread to run the given runnable.

Parameters
r:Runnable

a runnable to be executed by new thread instance

Returns:Thread

constructed thread, or null if the request to create a thread is rejected

Annotations
@Override