O'Reilly logo

EJB 3.1 Cookbook by Richard M. Reese

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the timer interface

The 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.

Getting ready

The basic steps involve:

  1. Obtaining an instance of the Timer object
  2. Using the Timer interface methods

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:

  • getInfo Returns information ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required