IBM User Guide for Java V7 on Windows > Developing Java applications



How the JVM processes signals

When a signal is raised that is of interest to the JVM, a signal handler is called. This signal handler determines whether it has been called for a Java™ or non-Java thread.

If the signal is for a Java thread, the JVM takes control of the signal handling. If an application handler for this signal is installed and you did not specify the -Xnosigchain command-line option, the application handler for this signal is called after the JVM has finished processing.

If the signal is for a non-Java thread, and the application that installed the JVM had previously installed its own handler for the signal, control is given to that handler. Otherwise, if the signal is requested by the JVM or Java application, the signal is ignored or the default action is taken.

Where a signal is generated externally (for example, when you enter CTRL-BREAK), a new thread is created for the signal handler. In this case, the JVM signal handler performs its processing and if an application handler for this signal is installed and you did not specify the -Xnosigchain command-line option, the application handler for this signal is called.

For exception and error signals, the JVM either:

For information about writing a launcher that specifies the previous hooks, see: http://www.ibm.com/developerworks/java/library/i-signalhandling/. This item was written for Java V1.3.1, but still applies to later versions.

For interrupt signals, the JVM also enters a controlled shut down sequence, but this time it is treated as a normal termination that:

  1. Calls your application's signal handler for that signal
  2. Calls all application shut down hooks
  3. Calls any application-installed exit hook
  4. Performs the necessary JVM cleanup

The shut down is identical to the shut down initiated by a call to the Java method System.exit().

Other signals that are used by the JVM are for internal control purposes and do not cause it to stop. The only control signal of interest is SIGBREAK, which causes a Javadump to be generated.


Parent: Developing Java applications








Error 404 - Not Found

Error 404 - Not Found

The document you are looking for may have been removed or re-named. Please contact the web site owner for further assistance.