Class Cleaner.BackgroundCleaner

  • All Implemented Interfaces:
    java.lang.Runnable
    Enclosing class:
    Cleaner

    private static class Cleaner.BackgroundCleaner
    extends java.lang.Thread
    • Nested Class Summary

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

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

      Constructors 
      Modifier Constructor Description
      private BackgroundCleaner​(Cleaner cleaner, java.nio.file.Path dir, java.lang.String fastMode)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void delete​(Cleaner cleaner, java.nio.file.Path dir, java.lang.String fastMode)  
      (package private) boolean doDelete​(java.nio.file.Path dir)  
      (package private) void doSessionEnd()  
      (package private) void init​(java.nio.file.Path fastDir, java.nio.file.Path dir)  
      (package private) java.nio.file.Path pollNext()  
      void run()  
      (package private) static void sessionEnd()  
      private void wrapExecutionListener()
      If this has not been done already, we wrap the ExecutionListener inside a proxy which simply delegates call to the previous listener.
      • Methods inherited from class java.lang.Thread

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

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

      • BackgroundCleaner

        private BackgroundCleaner​(Cleaner cleaner,
                                  java.nio.file.Path dir,
                                  java.lang.String fastMode)
                           throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • delete

        public static void delete​(Cleaner cleaner,
                                  java.nio.file.Path dir,
                                  java.lang.String fastMode)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • sessionEnd

        static void sessionEnd()
      • run

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

        void init​(java.nio.file.Path fastDir,
                  java.nio.file.Path dir)
           throws java.io.IOException
        Throws:
        java.io.IOException
      • pollNext

        java.nio.file.Path pollNext()
      • doDelete

        boolean doDelete​(java.nio.file.Path dir)
      • wrapExecutionListener

        private void wrapExecutionListener()
        If this has not been done already, we wrap the ExecutionListener inside a proxy which simply delegates call to the previous listener. When the session ends, it will also call sessionEnd(). There's no clean API to do that properly as this is a very unusual use case for a plugin to outlive its main execution.
      • doSessionEnd

        void doSessionEnd()