Package org.apache.maven.plugins.clean
Class Cleaner.BackgroundCleaner
- java.lang.Object
-
- java.lang.Thread
-
- org.apache.maven.plugins.clean.Cleaner.BackgroundCleaner
-
- All Implemented Interfaces:
java.lang.Runnable
- Enclosing class:
- Cleaner
private static class Cleaner.BackgroundCleaner extends java.lang.Thread
-
-
Field Summary
Fields Modifier and Type Field Description private Cleanercleanerprivate java.lang.StringfastModeprivate java.util.Deque<java.nio.file.Path>filesToDeleteprivate static Cleaner.BackgroundCleanerinstanceprivate static intNEWprivate static intRUNNINGprivate intstatusprivate static intSTOPPED
-
Constructor Summary
Constructors Modifier Constructor Description privateBackgroundCleaner(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 voiddelete(Cleaner cleaner, java.nio.file.Path dir, java.lang.String fastMode)(package private) booleandoDelete(java.nio.file.Path dir)(package private) voiddoSessionEnd()(package private) voidinit(java.nio.file.Path fastDir, java.nio.file.Path dir)(package private) java.nio.file.PathpollNext()voidrun()(package private) static voidsessionEnd()private voidwrapExecutionListener()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
-
-
-
-
Field Detail
-
NEW
private static final int NEW
- See Also:
- Constant Field Values
-
RUNNING
private static final int RUNNING
- See Also:
- Constant Field Values
-
STOPPED
private static final int STOPPED
- See Also:
- Constant Field Values
-
instance
private static Cleaner.BackgroundCleaner instance
-
filesToDelete
private final java.util.Deque<java.nio.file.Path> filesToDelete
-
cleaner
private final Cleaner cleaner
-
fastMode
private final java.lang.String fastMode
-
status
private int status
-
-
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:
runin interfacejava.lang.Runnable- Overrides:
runin classjava.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 callsessionEnd(). 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()
-
-