-
Notifications
You must be signed in to change notification settings - Fork 161
Runnable Embedded GlassFish improvements (stop on error, print message at the end) #25745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Runnable Embedded GlassFish improvements (stop on error, print message at the end) #25745
Conversation
OndroMih
commented
Oct 22, 2025
- stop automatically on error when executing commands
- print Welcome message at the beginning
- print message after shutdown, as the last message. Either OK message or error message.
nucleus/core/kernel/src/main/java/org/glassfish/runnablejar/UberMain.java
Outdated
Show resolved
Hide resolved
nucleus/core/kernel/src/main/java/org/glassfish/runnablejar/UberMain.java
Outdated
Show resolved
Hide resolved
6cb3e42 to
15d0fe1
Compare
nucleus/core/kernel/src/main/java/org/glassfish/runnablejar/InfoPrinter.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shutdown hooks are there to do the cleanup. When they stop logging, all output properly closed, going against the stream is wrong. In extreme it can cause some damage.
If I remember well, the last message is already written by the shutdown hook, if it is not, we can fix it, but this is really a bad hack.
Handlers are also closeable (but don't implement Closeable), so they should not be used after the logging system was stopped.
I will take a look later ... embedded is bit different than Server, ie. shutdown hooks might not be executed as embedded was started inside existing JVM ... so perhaps something really has to be done, but not this way.
* stop automatically on error when executing commands * print Welcome message at the beginning * print message after shutdown, as the last message. Either OK message or error message.
Signed-off-by: David Matějček <[email protected]>
a1597d1 to
9e48bb0
Compare
- Better handling of System.exit and the goodbye message - Processing errors to error codes (TODO: extend) - enums processed completely - Using System.console instead of STDIN for prompt - Minimalized shutdown hook - UberMain is now AutoCloseable, however main doesn't stop it - its purpose is to start it and return. - goodbye message can be null - anything can initiate exit for any reason. Signed-off-by: David Matějček <[email protected]>
…ents Revised UberMain