Class HouseKeeper

All Implemented Interfaces:
LifeCycle

@ManagedObject public class HouseKeeper extends AbstractLifeCycle
HouseKeeper There is 1 session HouseKeeper per SessionIdManager instance.
  • Field Details

  • Constructor Details

    • HouseKeeper

      public HouseKeeper()
  • Method Details

    • setSessionIdManager

      public void setSessionIdManager(SessionIdManager sessionIdManager)
      SessionIdManager associated with this scavenger
      Parameters:
      sessionIdManager - the session id manager
    • doStart

      protected void doStart() throws Exception
      Description copied from class: AbstractLifeCycle
      Method to override to start the lifecycle
      Overrides:
      doStart in class AbstractLifeCycle
      Throws:
      AbstractLifeCycle.StopException - If thrown, the lifecycle will immediately be stopped.
      Exception - If there was a problem starting. Will cause a transition to FAILED state
    • startScavenging

      protected void startScavenging() throws Exception
      If scavenging is not scheduled, schedule it.
      Throws:
      Exception - if any error during scheduling the scavenging
    • stopScavenging

      protected void stopScavenging() throws Exception
      If scavenging is scheduled, stop it.
      Throws:
      Exception - if any error during stopping the scavenging
    • doStop

      protected void doStop() throws Exception
      Description copied from class: AbstractLifeCycle
      Method to override to stop the lifecycle
      Overrides:
      doStop in class AbstractLifeCycle
      Throws:
      Exception - If there was a problem stopping. Will cause a transition to FAILED state
    • setIntervalSec

      public void setIntervalSec(long sec) throws Exception
      Set the period between scavenge cycles
      Parameters:
      sec - the interval (in seconds)
      Throws:
      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 String toString()
      Overrides:
      toString in class AbstractLifeCycle