E.g. if I set a timer to expire every day at midnight, what will happen if one "misfire" (does not trigger the callback because the server is down, for instance) ? I can't find that in the documentation.
Is there a way to make this timer triggers the callback as soons as the server restart ?
PS: I know about Quartz, i'm evaluating EJB timers as an alternative.
You can use a TimerHandle to make a timer persistent. EJB times were designed to survive container crashes.
See this article for a comparison between EJB times and other scheduler systems like Quartz.
From experience, I can tell you that in Glassfish a missed timer will fire as soon as the server is back up. If your server is down for two or more missed timeouts it will only fire once, not once for each missed timeout. It then goes back to your regularly scheduled program.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With