Class MyThread

  • All Implemented Interfaces:
    Runnable
    Direct Known Subclasses:
    Cleanup, LastAccessedThread

    public class MyThread
    extends Thread
    Top-level thread class for anything that needs to run in OA4MP. Has barebones logging, getting alarms and sleep intervals plus stopThread method to shut it down cleanly.

    Created by Jeff Gaynor
    on 3/29/23 at 1:10 PM

    • Field Detail

      • cleanupInterval

        public long cleanupInterval
    • Method Detail

      • isTestMode

        public boolean isTestMode()
      • setTestMode

        public void setTestMode​(boolean testMode)
      • getCleanupInterval

        public long getCleanupInterval()
        The amount of time, in milliseconds, to wait between attempts to age the cache.
        Returns:
      • setCleanupInterval

        public void setCleanupInterval​(long cleanupInterval)
      • isStopThread

        public boolean isStopThread()
        Is this thread set to stop?
        Returns:
      • setStopThread

        public void setStopThread​(boolean stopThread)
        Sets the flag to stop this thread. The next time the thread wakes up after this is enabled, the thread will exit. This allows for a clean shutdown of caching.
        Parameters:
        stopThread -
      • info

        protected void info​(String x)
      • warn

        protected void warn​(String x)
      • debug

        protected void debug​(String x)
      • getNextSleepInterval

        protected long getNextSleepInterval()