Replies: 1 comment
-
Have you thought about using any other means on your disposal to clean when application is going to exit? Bean destroy methods, application events from framework/boot etc? I think jline has its own shutdown hook and spring has one as well in its core so it's a bit bad practice to add more of those as afaik hooks cannot be ordered. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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.
Beta Was this translation helpful? Give feedback.
All reactions