Class DelayedPersist

  • All Implemented Interfaces:
    java.lang.Runnable

    public class DelayedPersist
    extends java.lang.Thread
    class to persist stuff later either an IPersistable or Runnable may be queued
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.lang.Thread

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • Field Summary

      • Fields inherited from class java.lang.Thread

        MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static DelayedPersist getCurrentDelayedPersist()  
      static DelayedPersist getDelayedPersist()  
      void queue​(IPersistable persistable, long deltaTime)  
      void queueRunnable​(java.lang.Runnable r, long deltaTime)  
      void run()  
      static void shutDown()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Thread

        activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, yield
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • getDelayedPersist

        public static DelayedPersist getDelayedPersist()
        Returns:
      • getCurrentDelayedPersist

        public static DelayedPersist getCurrentDelayedPersist()
        Returns:
      • shutDown

        public static void shutDown()
      • queueRunnable

        public void queueRunnable​(java.lang.Runnable r,
                                  long deltaTime)
        Parameters:
        persistable - the thing to send off
        deltaTime - max wait time in milliseconds - if<=null persist immediately
      • queue

        public void queue​(IPersistable persistable,
                          long deltaTime)
        Parameters:
        persistable - the thing to send off
        deltaTime - max wait time in milliseconds - if<=null persist immediately
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
        Overrides:
        run in class java.lang.Thread
        See Also:
        Thread.run()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Thread
        Returns:
        See Also:
        Thread.toString()