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
@ManagedObject public class HouseKeeper extends AbstractLifeCycle
HouseKeeper There is 1 session HouseKeeper per SessionIdManager instance.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classHouseKeeper.RunnerRunner-
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean_ownSchedulerprotected HouseKeeper.Runner_runnerprotected Scheduler_schedulerprotected SessionIdManager_sessionIdManagerprotected Scheduler.Task_taskstatic longDEFAULT_PERIOD_MS
-
Constructor Summary
Constructors Constructor Description HouseKeeper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoStart()protected voiddoStop()longgetIntervalSec()Get 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 voidstartScavenging()If scavenging is not scheduled, schedule it.protected voidstopScavenging()If scavenging is scheduled, stop it.java.lang.StringtoString()-
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 Detail
-
DEFAULT_PERIOD_MS
public static final long DEFAULT_PERIOD_MS
- See Also:
- Constant Field Values
-
_sessionIdManager
protected SessionIdManager _sessionIdManager
-
_scheduler
protected Scheduler _scheduler
-
_task
protected Scheduler.Task _task
-
_runner
protected HouseKeeper.Runner _runner
-
_ownScheduler
protected boolean _ownScheduler
-
-
Method Detail
-
setSessionIdManager
public void setSessionIdManager(SessionIdManager sessionIdManager)
SessionIdManager associated with this scavenger- Parameters:
sessionIdManager- the session id manager
-
doStart
protected void doStart() throws java.lang.Exception- Overrides:
doStartin classAbstractLifeCycle- Throws:
java.lang.Exception
-
startScavenging
protected void startScavenging() throws java.lang.ExceptionIf scavenging is not scheduled, schedule it.- Throws:
java.lang.Exception- if any error during scheduling the scavenging
-
stopScavenging
protected void stopScavenging() throws java.lang.ExceptionIf scavenging is scheduled, stop it.- Throws:
java.lang.Exception- if any error during stopping the scavenging
-
doStop
protected void doStop() throws java.lang.Exception- Overrides:
doStopin classAbstractLifeCycle- Throws:
java.lang.Exception
-
setIntervalSec
public void setIntervalSec(long sec) throws java.lang.ExceptionSet the period between scavenge cycles- Parameters:
sec- the interval (in seconds)- Throws:
java.lang.Exception- if any error during restarting the scavenging
-
getIntervalSec
@ManagedAttribute(value="secs between scavenge cycles", readonly=true) public long getIntervalSec()
Get the period between scavenge cycles.- Returns:
- the interval (in seconds)
-
scavenge
public void scavenge()
Periodically do session housekeeping
-
toString
public java.lang.String toString()
- Overrides:
toStringin classAbstractLifeCycle
-
-