Class HouseKeeper

java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.session.HouseKeeper
All Implemented Interfaces:
org.eclipse.jetty.util.component.LifeCycle

@ManagedObject public class HouseKeeper extends org.eclipse.jetty.util.component.AbstractLifeCycle
There is 1 session HouseKeeper per SessionIdManager instance.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    protected class 
     

    Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopException

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle

    org.eclipse.jetty.util.component.LifeCycle.Listener
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
     
     
    protected org.eclipse.jetty.util.thread.Scheduler
     
     
    protected org.eclipse.jetty.util.thread.Scheduler.Task
     
    static final long
     

    Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    FAILED, STARTED, STARTING, STOPPED, STOPPING
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    protected void
     
    long
    Get the period between scavenge cycles.
    void
    Periodically do session housekeeping
    void
    setIntervalSec(long sec)
    Set the period between scavenge cycles
    void
    SessionIdManager associated with this scavenger
    protected void
    If scavenging is not scheduled, schedule it.
    protected void
    If scavenging is scheduled, stop it.
     

    Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    addEventListener, getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeEventListener, setEventListeners, start, stop

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • DEFAULT_PERIOD_MS

      public static final long DEFAULT_PERIOD_MS
      See Also:
    • _sessionIdManager

      protected SessionIdManager _sessionIdManager
    • _scheduler

      protected org.eclipse.jetty.util.thread.Scheduler _scheduler
    • _task

      protected org.eclipse.jetty.util.thread.Scheduler.Task _task
    • _runner

      protected HouseKeeper.Runner _runner
    • _ownScheduler

      protected boolean _ownScheduler
  • 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
      Overrides:
      doStart in class org.eclipse.jetty.util.component.AbstractLifeCycle
      Throws:
      Exception
    • 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
      Overrides:
      doStop in class org.eclipse.jetty.util.component.AbstractLifeCycle
      Throws:
      Exception
    • 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 org.eclipse.jetty.util.component.AbstractLifeCycle