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.AbstractLifeCycleListener, AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected HouseKeeper.Runnerprotected Schedulerprotected SessionIdManagerprotected Scheduler.Taskstatic final long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoStart()Method to override to start the lifecycleprotected voiddoStop()Method to override to stop the lifecyclelongGet 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
addEventListener, getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeEventListener, setEventListeners, start, stop
-
Field Details
-
DEFAULT_PERIOD_MS
public static final long DEFAULT_PERIOD_MS- See Also:
-
_sessionIdManager
-
_scheduler
-
_task
-
_runner
-
_ownScheduler
protected boolean _ownScheduler
-
-
Constructor Details
-
HouseKeeper
public HouseKeeper()
-
-
Method Details
-
setSessionIdManager
SessionIdManager associated with this scavenger- Parameters:
sessionIdManager- the session id manager
-
doStart
Description copied from class:AbstractLifeCycleMethod to override to start the lifecycle- Overrides:
doStartin classAbstractLifeCycle- Throws:
AbstractLifeCycle.StopException- If thrown, the lifecycle will immediately be stopped.Exception- If there was a problem starting. Will cause a transition to FAILED state
-
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
Description copied from class:AbstractLifeCycleMethod to override to stop the lifecycle- Overrides:
doStopin classAbstractLifeCycle- Throws:
Exception- If there was a problem stopping. Will cause a transition to FAILED state
-
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
-