10 Timer Service
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
on 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 specific times or regular intervals.
This chapter shows you how to configure 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 led to the invention of one of the most important devices of modern life: the alarm clock. Today even basic cell phones and fitness trackers offer alarms that you can adjust to different times and different ...
Get Professional Java EE Design Patterns now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.