Class HouseKeeper

java.lang.Object
com.aspectran.utils.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.
  • Field Details

    • DEFAULT_SCAVENGING_INTERVAL_MS

      public static final long DEFAULT_SCAVENGING_INTERVAL_MS
      See Also:
  • Constructor Details

    • HouseKeeper

      public HouseKeeper(@NonNull SessionHandler sessionHandler)
      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

      protected void doStart() throws Exception
      Overrides:
      doStart in class AbstractLifeCycle
      Throws:
      Exception
    • doStop

      protected void doStop() throws Exception
      Overrides:
      doStop in class AbstractLifeCycle
      Throws:
      Exception
    • toString

      public String toString()
      Overrides:
      toString in class AbstractLifeCycle