Package jline.internal
Class ShutdownHooks
- java.lang.Object
-
- jline.internal.ShutdownHooks
-
public class ShutdownHooks extends java.lang.ObjectManages the JLine shutdown-hook thread and tasks to execute on shutdown.- Since:
- 2.7
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceShutdownHooks.TaskEssentially aRunnablewhich allows running to throw an exception.
-
Field Summary
Fields Modifier and Type Field Description private static booleanenabledprivate static java.lang.Threadhookstatic java.lang.StringJLINE_SHUTDOWNHOOKprivate static java.util.List<ShutdownHooks.Task>tasks
-
Constructor Summary
Constructors Constructor Description ShutdownHooks()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends ShutdownHooks.Task>
Tadd(T task)private static java.lang.ThreadaddHook(java.lang.Thread thread)static voidremove(ShutdownHooks.Task task)private static voidremoveHook(java.lang.Thread thread)private static voidrunTasks()
-
-
-
Field Detail
-
JLINE_SHUTDOWNHOOK
public static final java.lang.String JLINE_SHUTDOWNHOOK
- See Also:
- Constant Field Values
-
enabled
private static final boolean enabled
-
tasks
private static final java.util.List<ShutdownHooks.Task> tasks
-
hook
private static java.lang.Thread hook
-
-
Method Detail
-
add
public static <T extends ShutdownHooks.Task> T add(T task)
-
runTasks
private static void runTasks()
-
addHook
private static java.lang.Thread addHook(java.lang.Thread thread)
-
remove
public static void remove(ShutdownHooks.Task task)
-
removeHook
private static void removeHook(java.lang.Thread thread)
-
-