package org.wamblee.timer;
+import java.util.Collection;
+
import javax.annotation.Resource;
import javax.ejb.MessageDriven;
import javax.ejb.Timeout;
try {
int interval = (Integer)msg.getObject();
LOG.info("Initializing timer with interval " + interval + " seconds");
+ for (Timer timer: (Collection<Timer>)_timerService.getTimers()) {
+ LOG.info("Canceling old timers: " + timer);
+ timer.cancel();
+ }
_timerService.createTimer(1000, interval*1000, null);
} catch (JMSException e) {
throw new RuntimeException(e.getMessage());