Class HouseKeeper
- java.lang.Object
-
- com.aspectran.core.util.lifecycle.AbstractLifeCycle
-
- com.aspectran.core.component.session.HouseKeeper
-
- All Implemented Interfaces:
LifeCycle
public class HouseKeeper extends AbstractLifeCycle
The housekeeper for session scavenging. There is 1 session HouseKeeper per SessionManager instance.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.aspectran.core.util.lifecycle.LifeCycle
LifeCycle.Listener
-
-
Constructor Summary
Constructors Constructor Description HouseKeeper(SessionHandler sessionHandler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoStart()protected voiddoStop()intgetScavengingInterval()Get the period between scavenge cycles.voidsetScavengingInterval(int intervalInSecs)Set the period between scavenge cycles.protected voidstartScavenging()If scavenging is not scheduled, schedule it.protected voidstopScavenging()If scavenging is scheduled, stop it.java.lang.StringtoString()-
Methods inherited from class com.aspectran.core.util.lifecycle.AbstractLifeCycle
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
-
-
-
-
Field Detail
-
DEFAULT_SCAVENGING_INTERVAL_MS
public static final long DEFAULT_SCAVENGING_INTERVAL_MS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
HouseKeeper
public HouseKeeper(SessionHandler sessionHandler)
- Parameters:
sessionHandler- SessionHandler associated with this scavenger
-
-
Method Detail
-
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
protected void doStart() throws java.lang.Exception- Overrides:
doStartin classAbstractLifeCycle- Throws:
java.lang.Exception
-
doStop
protected void doStop() throws java.lang.Exception- Overrides:
doStopin classAbstractLifeCycle- Throws:
java.lang.Exception
-
toString
public java.lang.String toString()
- Overrides:
toStringin classAbstractLifeCycle
-
-