Class AbstractReapTask

  • All Implemented Interfaces:
    Runnable
    Direct Known Subclasses:
    IncrementalReapTask, ParallelReapTask

    public abstract class AbstractReapTask
    extends Object
    implements Runnable
    Base class for reaping tasks. It takes care of scheduling the next reap cycle and provides common data members.
    • Field Detail

      • mStartTime

        protected long mStartTime
        The time stamp for when this reap cycle started.
      • mQueueWaitTime

        protected long mQueueWaitTime
        The amount of time the reap task waited in-queue to run.
    • Constructor Detail

      • AbstractReapTask

        public AbstractReapTask​(SessionHelper sessionHelper,
                                SessionReaperStatistics statistics,
                                Iterator iterIds)
        Construct an AbstractReapTask.
        Parameters:
        sessionHelper - a session helper
        statistics - a session reaper statistics
        iterIds - an iterator of session IDs to check
    • Method Detail

      • run

        public void run()
        The task process: Process a portion of the reaping cycle.
        Specified by:
        run in interface Runnable
      • scheduleNextCycle

        protected void scheduleNextCycle()
        Schedules the next reaping cycle.
      • done

        protected void done()
        Indicate that the reaping is done in this cycle.
      • reap

        protected abstract void reap()
        The method that implements the actual reaping.
      • getSessionIdIterator

        protected Iterator getSessionIdIterator()
      • checkAndInvalidate

        protected void checkAndInvalidate​(String id)
        Check the specified session to see if it has expired, and in that case invalidate it.
        Parameters:
        id - a session id
      • isDone

        protected boolean isDone()
      • getNrOfInvalidatedSessions

        protected int getNrOfInvalidatedSessions()
      • logInvalidationExceptions

        protected boolean logInvalidationExceptions()