Package org.eclipse.jetty.server.session
Class HouseKeeper
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.server.session.HouseKeeper
- All Implemented Interfaces:
LifeCycle
HouseKeeper
There is 1 session HouseKeeper per SessionIdManager instance.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate longprotected booleanprotected HouseKeeper.Runnerprotected Schedulerprotected SessionIdManagerprotected Scheduler.Taskstatic final longprivate static final Logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoStart()protected voiddoStop()longGet the period between scavenge cycles.voidscavenge()Periodically do session housekeepingvoidsetIntervalSec(long sec) Set the period between scavenge cyclesvoidsetSessionIdManager(SessionIdManager sessionIdManager) SessionIdManager associated with this scavengerprotected voidIf scavenging is not scheduled, schedule it.protected voidIf scavenging is scheduled, stop it.toString()Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stop
-
Field Details
-
LOG
-
DEFAULT_PERIOD_MS
public static final long DEFAULT_PERIOD_MS- See Also:
-
_sessionIdManager
-
_scheduler
-
_task
-
_runner
-
_ownScheduler
protected boolean _ownScheduler -
_intervalMs
private long _intervalMs
-
-
Constructor Details
-
HouseKeeper
public HouseKeeper()
-
-
Method Details
-
setSessionIdManager
SessionIdManager associated with this scavenger- Parameters:
sessionIdManager- the session id manager
-
doStart
- Overrides:
doStartin classAbstractLifeCycle- Throws:
Exception
-
startScavenging
If scavenging is not scheduled, schedule it.- Throws:
Exception- if any error during scheduling the scavenging
-
stopScavenging
If scavenging is scheduled, stop it.- Throws:
Exception- if any error during stopping the scavenging
-
doStop
- Overrides:
doStopin classAbstractLifeCycle- Throws:
Exception
-
setIntervalSec
Set the period between scavenge cycles- Parameters:
sec- the interval (in seconds)- Throws:
Exception- if any error during restarting the scavenging
-
getIntervalSec
Get the period between scavenge cycles.- Returns:
- the interval (in seconds)
-
scavenge
public void scavenge()Periodically do session housekeeping -
toString
- Overrides:
toStringin classAbstractLifeCycle
-