Using the timer interface
Timer interface has a number of methods that can be used by the callback method to assist in the execution of the callback. This interface is useful to obtain information about the timer event and in passing information to the event. The use of these methods is illustrated in this recipe.
The basic steps involve:
- Obtaining an instance of the
- Using the
The @Schedule annotated method is passed an instance of the
Timer object. For programmatic timers, the @Timeout annotated method is passed the
Timer object. These callback methods can subsequently use this object to control the callback. The
Timer interface's methods of interest to us include:
getInfoReturns information ...