How to use java.lang.Terminator correctly?

  • What exactly does this class do?

  • What is shutdown shutdown?

  • Where did you use this in your program or what could be a good option for this class?

+3
source share
3 answers

Taking your points one at a time:

  • What does this class do? It processes termination signals received from the operating system.

  • What is a shutdown with shutdown? JVM shutdown caused by the operating system sending a signal to the Java process, for example. when you turn off the computer.

  • ? , JVM , .

+6

HUP (Hangup), INT () TERM (Termination) (. ). , System.exit() sig.getNumber() + 128, 1 + 128 = 129 (HUP), 2 + 128 = 130 (INT), 15 + 128 = 143 (TERM). , , , . , KILL .

, , .

+1

Source: https://habr.com/ru/post/1748003/


All Articles