public class HouseKeeper extends AbstractLifeCycle
| Modifier and Type | Class and Description |
|---|---|
protected class |
HouseKeeper.Runner
Runner
|
AbstractLifeCycle.AbstractLifeCycleListenerLifeCycle.Listener| Modifier and Type | Field and Description |
|---|---|
protected boolean |
_ownScheduler |
protected HouseKeeper.Runner |
_runner |
protected Scheduler |
_scheduler |
protected SessionIdManager |
_sessionIdManager |
protected Scheduler.Task |
_task |
static long |
DEFAULT_PERIOD_MS |
FAILED, RUNNING, STARTED, STARTING, STOP_ON_FAILURE, STOPPED, STOPPING| Constructor and Description |
|---|
HouseKeeper() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doStart() |
protected void |
doStop() |
protected void |
findScheduler()
Get a scheduler.
|
long |
getIntervalSec()
Get the period between scavenge cycles.
|
void |
scavenge()
Periodically do session housekeeping
|
void |
setIntervalSec(long sec)
Set the period between scavenge cycles
|
void |
setSessionIdManager(SessionIdManager sessionIdManager)
SessionIdManager associated with this scavenger
|
protected void |
startScavenging()
If scavenging is not scheduled, schedule it.
|
protected void |
stopScavenging()
If scavenging is scheduled, stop it.
|
String |
toString() |
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stoppublic static final long DEFAULT_PERIOD_MS
protected SessionIdManager _sessionIdManager
protected Scheduler _scheduler
protected Scheduler.Task _task
protected HouseKeeper.Runner _runner
protected boolean _ownScheduler
public void setSessionIdManager(SessionIdManager sessionIdManager)
sessionIdManager - the session id managerprotected void doStart()
throws Exception
doStart in class AbstractLifeCycleExceptionAbstractLifeCycle.doStart()protected void findScheduler()
throws Exception
Exceptionprotected void startScavenging()
throws Exception
Exceptionprotected void stopScavenging()
throws Exception
Exceptionprotected void doStop()
throws Exception
doStop in class AbstractLifeCycleExceptionAbstractLifeCycle.doStop()public void setIntervalSec(long sec)
throws Exception
sec - the interval (in seconds)Exceptionpublic long getIntervalSec()
public void scavenge()
public String toString()
toString in class ObjectObject.toString()Copyright © 1995–2017 Webtide. All rights reserved.