[jboss-user] [EJB 3.0] - TimerService problem Timeout called twice

Cyberdoc do-not-reply at jboss.com
Thu Oct 19 12:09:08 EDT 2006


Hi,

i'm using JBoss 4.0.4GA with EJB 3 RC9.

I created a MBean that creates an timer in the start method:

  | @Service
  | @Management(CleanerServiceManagement.class)
  | public class CleanerService implements CleanerServiceManagement {
  |     @Resource 
  |     private TimerService timerService;
  | 
  |     private static final String CALL_CLEANER = "callCleaner"; 
  |     private Log log = LogFactory.getLog(this.getClass());
  |     
  |     public void create() throws Exception {
  |         //
  |     }
  | 
  |     public void destroy() {
  |         //
  |     }
  | 
  |     public void start() throws Exception {
  |         timerService.createTimer(System.currentTimeMillis()+16000, 8000, CALL_CLEANER);
  |     }
  | 
  |     public void stop() {
  | 
  |     }
  | 
  |     @Timeout
  |     public void timeout(Timer timer) {
  |         if (!(CALL_CLEANER.equals(timer.getInfo()))) {
  |             log.info("wrong timer");
  |             return;
  |         }
  |         
  |         log.info("***********************************");
  |         log.info("Timer called");
  |         log.info("***********************************");
  |     }
  | }
  | 

Now the timeout method is called every 8 seconds twice. What is wrong? Or what do i need to configure??


Thanks for help!

Michael

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3979409#3979409

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3979409



More information about the jboss-user mailing list