Java Reference
In-Depth Information
Listing 7.2. Scheduling newsletters and reminders
In this listing, the NewsletterBean class is first declared as running as an administrator.
This enables the bean to retrieve the list of users that's restricted for security reasons. Next,
the sendMonthlyNewsletter method is annotated with a schedule annotation spe-
cifying that the newsletter should be sent out on the first of each month. The sendHol-
idayNewsletter uses the @Schedules annotation to configure a broadcast for
Thanksgiving and Christmas.
Now that you have a basic grasp of declarative timers, let's dig into the syntax to see what's
truly possible. The example in listing 7.2 only scratches the surface.
7.2.5. Cron syntax rules
The syntax rules for calendar-based scheduling are straightforward. Table 7.1 documents
the attributes along with the valid values and the default values. But that table isn't the
complete story. You may have noticed that the second , minute , and hour attributes
 
Search WWH ::




Custom Search