Class HouseKeeper

  • All Implemented Interfaces:
    org.eclipse.jetty.util.component.LifeCycle

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

      Nested Classes 
      Modifier and Type Class Description
      protected class  HouseKeeper.Runner
      Runner
      • 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
    • Constructor Summary

      Constructors 
      Constructor Description
      HouseKeeper()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void doStart()  
      protected void doStop()  
      long getIntervalSec()
      Get the period between scavenge cycles.
      void scavenge()
      Periodically do session housekeeping
      void setIntervalSec​(long sec)
      Set the period between scavenge cycles
      void setSessionIdManager​(SessionIdManager sessionIdManager)
      SessionIdManager associated with this scavenger
      protected void startScavenging()
      If scavenging is not scheduled, schedule it.
      protected void stopScavenging()
      If scavenging is scheduled, stop it.
      java.lang.String toString()  
      • 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 java.lang.Object

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

      • _scheduler

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

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

        protected boolean _ownScheduler
    • Constructor Detail

      • HouseKeeper

        public HouseKeeper()
    • Method Detail

      • setSessionIdManager

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

        protected void doStart()
                        throws java.lang.Exception
        Overrides:
        doStart in class org.eclipse.jetty.util.component.AbstractLifeCycle
        Throws:
        java.lang.Exception
      • startScavenging

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

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

        protected void doStop()
                       throws java.lang.Exception
        Overrides:
        doStop in class org.eclipse.jetty.util.component.AbstractLifeCycle
        Throws:
        java.lang.Exception
      • setIntervalSec

        public void setIntervalSec​(long sec)
                            throws java.lang.Exception
        Set the period between scavenge cycles
        Parameters:
        sec - the interval (in seconds)
        Throws:
        java.lang.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 java.lang.String toString()
        Overrides:
        toString in class org.eclipse.jetty.util.component.AbstractLifeCycle