moka.event
Class Interrupt

java.lang.Object
  |
  +--moka.lang.Object
        |
        +--moka.event.Interrupt
Direct Known Subclasses:
Timer

public abstract class Interrupt
extends Object

The Interrupt interfaces for executing code while a thread is running.

Since:
MDK1.0a

Field Summary
static boolean busy
          Setting this flag to true will stop the interrupts execution.
 
Constructor Summary
Interrupt()
          Creates a new Interrupt.
 
Method Summary
abstract  boolean check()
          Used by a thread to verify if this interrupt should be executed.
 void finalize()
          Frees the ressources used by this Interrupt.
static void register(moka.event.Interrupt item)
          Registers the specified interrupt.
abstract  void run()
          Handles the code to execute when this object interrupts.
static void unregister(moka.event.Interrupt item)
          Unregisters the specified interrupt.
 
Methods inherited from class moka.lang.Object
equals, getClassName, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

busy

public static boolean busy
Setting this flag to true will stop the interrupts execution.

Constructor Detail

Interrupt

public Interrupt()
Creates a new Interrupt.

Since:
MDK2.1
Method Detail

register

public static void register(moka.event.Interrupt item)
Registers the specified interrupt.

Parameters:
item - the interrupt to be registered.
Since:
MDK2.1

unregister

public static void unregister(moka.event.Interrupt item)
Unregisters the specified interrupt.

Parameters:
item - the interrupt to be unregistered.
Since:
MDK2.1

finalize

public void finalize()
Frees the ressources used by this Interrupt.

Overrides:
finalize in class Object
Since:
MDK2.1

check

public abstract boolean check()
Used by a thread to verify if this interrupt should be executed.

Returns:
true if this interrupt should be executed

run

public abstract void run()
Handles the code to execute when this object interrupts.