javax.realtime
Interface Interruptible


public interface Interruptible

Interruptible is an interface implemented by classes that will be used as arguments on the method doInterruptible() of AsynchronouslyInterruptedException and its subclasses. doInterruptible() invokes the implementation of the method in this interface.


Method Summary
 void interruptAction(AsynchronouslyInterruptedException exception)
          This method is called by the system if the run() method is interrupted.
 void run(AsynchronouslyInterruptedException exception)
          The main piece of code that is executed when an implementation is given to doInterruptible().
 

Method Detail

run

void run(AsynchronouslyInterruptedException exception)
         throws AsynchronouslyInterruptedException
The main piece of code that is executed when an implementation is given to doInterruptible(). When a class is created that implements this interface (for example through an anonymous inner class) it must include the throws clause to make the method interruptible. If the throws clause is omitted the run() method will not be interruptible.

Parameters:
exception - The AIE object whose doInterruptible method is calling the run method. Used to invoke methods on AsynchronouslyInterruptedException from within the run() method.
Throws:
AsynchronouslyInterruptedException

interruptAction

void interruptAction(AsynchronouslyInterruptedException exception)
This method is called by the system if the run() method is interrupted. Using this, the program logic can determine if the run() method completed normally or had its control asynchronously transferred to its caller.

Parameters:
exception - The currently pending AIE. Used to invoke methods on AsynchronouslyInterruptedException from within the interruptAction() method.