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:
org.eclipse.jetty.util.component.LifeCycle
@ManagedObject public class HouseKeeper extends org.eclipse.jetty.util.component.AbstractLifeCycleHouseKeeper There is 1 session HouseKeeper per SessionIdManager instance.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classHouseKeeper.RunnerRunner
-
Field Summary
Fields Modifier and Type Field Description protected boolean_ownSchedulerprotected HouseKeeper.Runner_runnerprotected org.eclipse.jetty.util.thread.Scheduler_schedulerprotected SessionIdManager_sessionIdManagerprotected org.eclipse.jetty.util.thread.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()protected voidfindScheduler()Get a scheduler.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.StringtoString()
-
-
-
Field Detail
-
DEFAULT_PERIOD_MS
public static final long DEFAULT_PERIOD_MS
- See Also:
- Constant Field Values
-
_sessionIdManager
protected SessionIdManager _sessionIdManager
-
_scheduler
protected org.eclipse.jetty.util.thread.Scheduler _scheduler
-
_task
protected org.eclipse.jetty.util.thread.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 Exception- Overrides:
doStartin classorg.eclipse.jetty.util.component.AbstractLifeCycle- Throws:
Exception- See Also:
AbstractLifeCycle.doStart()
-
findScheduler
protected void findScheduler() throws ExceptionGet a scheduler. First try a common scheduler, failing that create our own.- Throws:
Exception- when the scheduler cannot be started
-
startScavenging
protected void startScavenging() throws ExceptionIf scavenging is not scheduled, schedule it.- Throws:
Exception- if any error during scheduling the scavenging
-
stopScavenging
protected void stopScavenging() throws ExceptionIf scavenging is scheduled, stop it.- Throws:
Exception- if any error during stopping the scavenging
-
doStop
protected void doStop() throws Exception- Overrides:
doStopin classorg.eclipse.jetty.util.component.AbstractLifeCycle- Throws:
Exception- See Also:
AbstractLifeCycle.doStop()
-
setIntervalSec
public void setIntervalSec(long sec) throws ExceptionSet the period between scavenge cycles- Parameters:
sec- the interval (in seconds)- Throws:
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 String toString()
- Overrides:
toStringin classorg.eclipse.jetty.util.component.AbstractLifeCycle- See Also:
Object.toString()
-
-