Java Reference
In-Depth Information
10
WHAT'S IN THIS CHAPTER?
Advancements made in the timer service
Automatic timers
Programmatic timers
Setting the schedule with schedule expressions
Timers and transactions
WROX.COM CODE DOWNLOAD FOR THIS CHAPTER
The wrox.com code download for this chapter is found at www.wrox.com/go/
projavaeedesignpatterns o n the Download Code tab. The code is in the Chapter 10
download and individually named according to the names throughout the chapter.
Business applications need to perform tasks based on either calendar events or a timed
schedule, whether it is to generate weekly user activity reports, repopulate a cache, or send a
client a reminder e-mail. There are many use case scenarios. The timer service enables you to
program timer events at specii c times or regular intervals.
This chapter shows you how to coni gure the timer service using both automatic and
programmatic techniques and how to schedule tasks using the cron‐like schedule expressions.
WHAT IS THE TIMER SERVICE?
Can you imagine needing to wake up every morning to check the clock to see if it is time to
get up? Probably not. Even before the invention of the alarm clock, people used sunlight or
roosters to wake up. But roosters and the sun are not customizable. This lack of customization
 
Search WWH ::




Custom Search