The @Schedule annotation is used to mark an enterprise bean method as a timeout method according to the calendar schedule specified in the attributes of @Schedule. This annotation has elements that correspond to the calendar expressions and the persistent, info, and timezone elements.
The persistent element is an optional element that takes a boolean value. It is used to specify whether the automatic timer should survive a server restart or crash. By default, all automatic timers are persistent. The timezone element is an optional element and it is used to specify that the automatic timer is associated with a particular time zone. If this element is set, it will evaluate all timer expressions in relation to the specified time zone, regardless of the time zone in which the EJB container is running. By default, all automatic timers set are in relation to the default time zone of the server. The info element is an optional element and it is used to set an informational description of the timer. A timer information can be retrieved later using Timer.getInfo.
Responses to “What is the @Schedule annotation?”