Class HouseKeeper
java.lang.Object
com.aspectran.utils.lifecycle.AbstractLifeCycle
com.aspectran.core.component.session.HouseKeeper
- All Implemented Interfaces:
LifeCycle
The housekeeper for session scavenging.
There is 1 session HouseKeeper per SessionManager instance.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.aspectran.utils.lifecycle.LifeCycle
LifeCycle.Listener
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
doStart()
protected void
doStop()
int
Get the period between scavenge cycles.void
setScavengingInterval
(int intervalInSecs) Set the period between scavenge cycles.protected void
If scavenging is not scheduled, schedule it.protected void
If scavenging is scheduled, stop it.toString()
Methods inherited from class com.aspectran.utils.lifecycle.AbstractLifeCycle
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
-
Field Details
-
DEFAULT_SCAVENGING_INTERVAL_MS
public static final long DEFAULT_SCAVENGING_INTERVAL_MS- See Also:
-
-
Constructor Details
-
HouseKeeper
- Parameters:
sessionHandler
- SessionHandler associated with this scavenger
-
-
Method Details
-
getScavengingInterval
public int getScavengingInterval()Get the period between scavenge cycles.- Returns:
- the interval (in seconds)
-
setScavengingInterval
public void setScavengingInterval(int intervalInSecs) Set the period between scavenge cycles.- Parameters:
intervalInSecs
- the interval (in seconds)
-
startScavenging
protected void startScavenging()If scavenging is not scheduled, schedule it. -
stopScavenging
protected void stopScavenging()If scavenging is scheduled, stop it. -
doStart
- Overrides:
doStart
in classAbstractLifeCycle
- Throws:
Exception
-
doStop
- Overrides:
doStop
in classAbstractLifeCycle
- Throws:
Exception
-
toString
- Overrides:
toString
in classAbstractLifeCycle
-