public class IdleConnectionSweeper extends Object implements DestructableComponent
HttpClientConnectionManager.| Modifier and Type | Field and Description |
|---|---|
private HttpClientConnectionManager |
connectionManager
HttpClientConnectionManager whose connections will be swept.
|
private boolean |
createdTimer
|
private boolean |
destroyed
Whether this sweeper has been destroyed.
|
private long |
executionTime
Time at which the sweeper last executed.
|
private TimerTask |
sweeper
Sweeping task executed by the timer.
|
private Timer |
taskTimer
Timer used to schedule and execute the sweeping task.
|
| Constructor and Description |
|---|
IdleConnectionSweeper(HttpClientConnectionManager manager,
long idleTimeout,
long sweepInterval)
Constructor.
|
IdleConnectionSweeper(HttpClientConnectionManager manager,
long idleTimeout,
long sweepInterval,
Timer backgroundTimer)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
private boolean destroyed
private boolean createdTimer
private final HttpClientConnectionManager connectionManager
private final Timer taskTimer
private final TimerTask sweeper
@Nullable private long executionTime
public IdleConnectionSweeper(@Nonnull HttpClientConnectionManager manager, long idleTimeout, long sweepInterval)
Timer and use it to periodically sweep connections.manager - HTTP client connection manager whose connections will be sweptidleTimeout - length of time, in milliseconds, connection may be idle before being closed downsweepInterval - length of time, in milliseconds, between sweepspublic IdleConnectionSweeper(@Nonnull HttpClientConnectionManager manager, long idleTimeout, long sweepInterval, @Nonnull Timer backgroundTimer)
manager - HTTP client connection manager 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 taskpublic long scheduledExecutionTime()
public boolean isDestroyed()
isDestroyed in interface DestructableComponentpublic void destroy()
destroy in interface DestructableComponentCopyright © 1999–2019 Shibboleth Consortium. All rights reserved.