|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.shibboleth.utilities.java.support.httpclient.IdleConnectionSweeper
public class IdleConnectionSweeper
A utility that periodically closes idle connections held by a HttpClient.
| Field Summary | |
|---|---|
private HttpClient |
client
Client whose connections will be swept. |
private boolean |
createdTimer
Whether this sweeper created a TimerTask to use and thus should destroy when destroy() is
invoked. |
private boolean |
destroyed
Whether this sweeper has been destroyed. |
private TimerTask |
sweeper
Sweeping task executed by the timer. |
private Timer |
taskTimer
Timer used to schedule and execute the sweeping task. |
| Constructor Summary | |
|---|---|
IdleConnectionSweeper(HttpClient httpClient,
long idleTimeout,
long sweepInterval)
Constructor. |
|
IdleConnectionSweeper(HttpClient httpClient,
long idleTimeout,
long sweepInterval,
Timer backgroundTimer)
Constructor. |
|
| Method Summary | |
|---|---|
void |
destroy()
Destroys the component. |
boolean |
isDestroyed()
Gets whether this component has been destroyed. |
long |
scheduledExecutionTime()
Gets the time, in milliseconds since the epoch, when the sweeper last executed or, if it has not yet executed, when it was first scheduled to run. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private boolean destroyed
private boolean createdTimer
TimerTask to use and thus should destroy when destroy() is
invoked.
private final HttpClient client
private final Timer taskTimer
private final TimerTask sweeper
| Constructor Detail |
|---|
public IdleConnectionSweeper(@Nonnull
HttpClient httpClient,
long idleTimeout,
long sweepInterval)
Timer and use it to periodically sweep connections.
httpClient - client whose connections will be sweptidleTimeout - length of time, in milliseconds, connection may be idle before being closed downsweepInterval - length of time, in milliseconds, between sweeps
public IdleConnectionSweeper(@Nonnull
HttpClient httpClient,
long idleTimeout,
long sweepInterval,
@Nonnull
Timer backgroundTimer)
httpClient - client whose connections will be sweptidleTimeout - length of time, in milliseconds, connection may be idle before being closed downsweepInterval - length of time, in milliseconds, between sweepsbackgroundTimer - timer used to schedule the background sweeping task| Method Detail |
|---|
public long scheduledExecutionTime()
public boolean isDestroyed()
isDestroyed in interface DestructableComponentpublic void destroy()
destroy in interface DestructableComponent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||