Package org.h2.engine

Class DelayedDatabaseCloser

  • All Implemented Interfaces:
    java.lang.Runnable

    class DelayedDatabaseCloser
    extends java.lang.Thread
    This class is responsible to close a database after the specified delay. A database closer object only exists if there is no user connected to the database.
    • Nested Class Summary

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

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

      Fields 
      Modifier and Type Field Description
      private java.lang.ref.WeakReference<Database> databaseRef  
      private int delayInMillis  
      private Trace trace  
      • Fields inherited from class java.lang.Thread

        MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) void reset()
      Stop and disable the database closer.
      void run()  
      • 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, toString, yield
      • Methods inherited from class java.lang.Object

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

      • trace

        private final Trace trace
      • databaseRef

        private volatile java.lang.ref.WeakReference<Database> databaseRef
      • delayInMillis

        private int delayInMillis
    • Constructor Detail

      • DelayedDatabaseCloser

        DelayedDatabaseCloser​(Database db,
                              int delayInMillis)
    • Method Detail

      • reset

        void reset()
        Stop and disable the database closer. This method is called after a session has been created.
      • run

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