Class HouseKeeper

  • All Implemented Interfaces:
    LifeCycle

    public class HouseKeeper
    extends AbstractLifeCycle
    The housekeeper for session scavenging. There is 1 session HouseKeeper per SessionManager instance.
    • 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:
        doStart in class AbstractLifeCycle
        Throws:
        java.lang.Exception
      • doStop

        protected void doStop()
                       throws java.lang.Exception
        Overrides:
        doStop in class AbstractLifeCycle
        Throws:
        java.lang.Exception