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 class
HouseKeeper.Runner
Runner-
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
_ownScheduler
protected HouseKeeper.Runner
_runner
protected Scheduler
_scheduler
protected SessionIdManager
_sessionIdManager
protected Scheduler.Task
_task
static long
DEFAULT_PERIOD_MS
-
Constructor Summary
Constructors Constructor Description HouseKeeper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doStart()
protected void
doStop()
long
getIntervalSec()
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
startScavenging()
If scavenging is not scheduled, schedule it.protected void
stopScavenging()
If scavenging is scheduled, stop it.java.lang.String
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 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:
doStart
in classAbstractLifeCycle
- Throws:
java.lang.Exception
-
startScavenging
protected void startScavenging() throws java.lang.Exception
If scavenging is not scheduled, schedule it.- Throws:
java.lang.Exception
- if any error during scheduling the scavenging
-
stopScavenging
protected void stopScavenging() throws java.lang.Exception
If 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:
doStop
in classAbstractLifeCycle
- Throws:
java.lang.Exception
-
setIntervalSec
public void setIntervalSec(long sec) throws java.lang.Exception
Set 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:
toString
in classAbstractLifeCycle
-
-