The methods used for managing timer events are provided by the standard reactor interface (Reactor), as defined in the API package. The full set of methods used for timer management are shown in Listing 3.1.
The three timer API methods provide support for issuing a single timed callback (runTimerOneShot), issuing multiple timed callbacks at regular intervals (runTimerRepeating) and cancelling a running timer (cancelTimer). In each case a single timeable object which provides the Timeable interface is passed as a parameter. This is the timeable object to which the callbacks will be issued and is also used as a timer `ID' when cancelling or rescheduling a timer. The use of these various API methods is described in more detail in the following sections.