A system for interrupt handling in Java is provided that includes an
execution flow class, an execution flow scheduler, a Java virtual machine
(JVM), and an interrupt handler class that extends the execution flow
class. The execution flow class defines an execution flow execution
method and a constructor that creates an execution flow context. The
interrupt handler class defines a handler method for an interrupt and an
execution flow execution method that overrides the execution flow
execution method of the execution flow class. An interrupt handler object
is instantiated using the interrupt handler class, the constructor
creates an execution flow context for the handler method, and when the
interrupt is signaled, the JVM invokes a native execution flow activation
method in the execution flow scheduler to switch to the handler execution
flow context and the execution flow execution method to initiate
execution of the handler method.