Unihedro / JavaBot

Java based chat bot that runs in Java room of Stack Overflow Chat.
Apache License 2.0
15 stars 4 forks source link

Avoid System.exit #34

Closed Zomis closed 9 years ago

Zomis commented 9 years ago

Even though this question is about Swing, it applies here too: http://stackoverflow.com/a/3281935/1310566

As I plan on incorporating this in a web-based application, using System.exit would be devastating for me. Using System.exit is a mean way of terminating applications. Throw exceptions and/or interrupt threads instead.

Unihedro commented 9 years ago

I agree. I wonder why it's there. It really needs a soft exit, the force termination should be done by containers.

Vogel612 commented 9 years ago

I'm currently checking whether we can go through all threads with a poison pill to shut everything down orderly. I fear that might not be the case though. Let me investigate a bit more