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:
- Handles the condition and recovers, or
- Enters a controlled shut down sequence where it:
- Produces dumps, to describe the JVM state at the point of failure
- Calls your application's signal handler for that signal
- Calls any application-installed unexpected shut down hook
- Performs the necessary JVM cleanup
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:
- Calls your application's signal handler for that signal
- Calls all application shut down hooks
- Calls any application-installed exit hook
- 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.
- Signals used by the JVM
The types of signals are Interrupts, and Controls.- Linking a native code driver to the signal-chaining library
The Runtime Environment contains signal-chaining. Signal-chaining enables the JVM to interoperate more efficiently with native code that installs its own signal handlers.
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.