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 classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopException
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected HouseKeeper.Runner
protected Scheduler
protected SessionIdManager
protected Scheduler.Task
static final long
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
doStart()
Method to override to start the lifecycleprotected void
doStop()
Method to override to stop the lifecyclelong
Get the period between scavenge cycles.void
scavenge()
Periodically do session housekeepingvoid
setIntervalSec
(long sec) Set the period between scavenge cyclesvoid
setSessionIdManager
(SessionIdManager sessionIdManager) SessionIdManager associated with this scavengerprotected void
If scavenging is not scheduled, schedule it.protected void
If 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:AbstractLifeCycle
Method to override to start the lifecycle- Overrides:
doStart
in 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:AbstractLifeCycle
Method to override to stop the lifecycle- Overrides:
doStop
in 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:
toString
in classAbstractLifeCycle
-