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 Cleaner
cleaner
private java.lang.String
fastMode
private java.util.Deque<java.nio.file.Path>
filesToDelete
private static Cleaner.BackgroundCleaner
instance
private static int
NEW
private static int
RUNNING
private int
status
private static int
STOPPED
-
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
-
-
-
-
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:
run
in interfacejava.lang.Runnable
- Overrides:
run
in 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()
-
-