de.schlichtherle.io
Class ArchiveControllers.ShutdownHook
java.lang.Object
java.lang.Thread
de.schlichtherle.io.ArchiveControllers.ShutdownHook
- All Implemented Interfaces:
- Runnable
- Enclosing class:
- ArchiveControllers
static final class ArchiveControllers.ShutdownHook
- extends Thread
TrueZIP's singleton shutdown hook for the JVM.
This shutdown hook is always run, even if the JVM terminates due to an
uncatched Throwable.
Only a JVM crash could prevent this, but this is an extremely rare
situation.
|
Method Summary |
void |
run()
Deletes all files that have been marked by
File.deleteOnExit() and finally unmounts all controllers. |
| 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 |
SINGLETON
private static final ArchiveControllers.ShutdownHook SINGLETON
- The singleton instance.
deleteOnExit
static final Set deleteOnExit
- The set of files to delete when the shutdown hook is run.
When iterating over it, its elements are returned in insertion order.
ArchiveControllers.ShutdownHook
private ArchiveControllers.ShutdownHook()
- You cannot instantiate this singleton class.
run
public void run()
- Deletes all files that have been marked by
File.deleteOnExit() and finally unmounts all controllers.
Logging and password prompting will be disabled (they wouldn't work
in a JVM shutdown hook anyway) in order to provide a deterministic
behaviour and in order to avoid RuntimeExceptions or even Errors
in the API.
Any exceptions thrown throughout the umount will be printed on
standard error output.
Note that this method is not re-entrant and should not be
directly called except for unit testing (you couldn't do a unit test
on a shutdown hook otherwise, could you?).
- Specified by:
run in interface Runnable- Overrides:
run in class Thread
Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.