-
Notifications
You must be signed in to change notification settings - Fork 392
Closed
Description
Many times, I think it is not the best choice to re implement the exit command by inherit Quit and implement Quit.Command.
In most cases, I just want to perform some cleanup when issuing the exit command. I suggest that you can consider referring to the shutdown hook method of the runtime.
Runtime.getRuntime().addShutdownHook( () -> System.out.println("I'm shutdown hook...") );
Can you consider adding a "QuitCommandHook" mechanism instead of always rewriting the quit class to perform exit cleanup logic. The way envisaged is similar to:
Quit.addCommandHook( () -> System.out.println("I'm shutdown hook...") );
If possible, I would be happy to submit a PR on this issue.
Metadata
Metadata
Assignees
Labels
No labels