JDK-6423780 : (process) need way to handle OS signals
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 5.0
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: generic
  • CPU: generic
  • Submitted: 2006-05-09
  • Updated: 2018-01-29
Related Reports
Relates :  
Description
There should be a way to handle operating system signals, especially UNIX's SIGINT.

Consider a command interpreter written in Java and running on any support Java
platform.  Essentially all operating systems provide a way to interrupt the
currently running program.  A Java command interpreter needs the ability to
catch this interrupt request and abort operations in progress, and then return
to the main command-reading loop.  Thus, handling this signal and aborting
operations must not require closing the input device.

Such a mechanism should also support handling POSIX-specific and other operating
system-specific signals as much as possible.  SIGTSTP and SIGCONT would be
especially important for a command interpreter.

Obviously any solution that effectively requires putting the terminal device into
raw mode and emulating terminal-generated signals would be completely unacceptable.
Any solution must integrate with the operating system's signal handling capabilities.

Comments
EVALUATION This is yet another part of the general OS-specific interface issue. Maybe we should have an EventListener for events coming from the OS? Should this be unified with file modification listeners? Do we expose all the signal names? As strings, or ints? Many tough questions.
10-05-2006