Added author to all java files with class comments.
[utils] / mythtv / timer / src / main / java / org / wamblee / timer / TimerBean.java
index 048e94b55041575f0815b12a699b01758d49ad1b..5019ebd5c35136116f6b24c5e9bbff50e1db1b8b 100644 (file)
@@ -16,6 +16,8 @@
 
 package org.wamblee.timer;
 
+import java.util.Collection;
+
 import javax.annotation.Resource;
 import javax.ejb.MessageDriven;
 import javax.ejb.Timeout;
@@ -38,6 +40,8 @@ import org.wamblee.io.DirectoryMonitor;
 
 /**
  * 
+ *
+ * @author Erik Brakkee
  */
 @MessageDriven(name = "TimerBean")
 // Spring's JTA transaction manager does not work with container managed transactions
@@ -59,6 +63,10 @@ public class TimerBean implements MessageListener {
         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());