Enterprise bean timer service
Stateless session beans and message-driven beans can have a method that is executed periodically at regular intervals of time. This can be accomplished by using the enterprise bean timer service. The following example illustrates how to take advantage of this feature:
package com.ensode.jakartaeebook; //imports omitted @Stateless public class JebTimerExampleBean implements JebTimerExample private static final Logger LOG = Logger.getLogger(JebTimerExampleBean.class.getName()); @Resource TimerService timerService; @Override public void startTimer(Serializable info) { timerService.createTimer(new Date(), 5000, info); } @Override public void stopTimer(Serializable info) { Collection<Timer> timers = timerService.getTimers(); timers.stream().filter...