4 Replies Latest reply on Nov 25, 2008 9:13 PM by Amit Bafna

    How do you view Timers in the EJB3 timer service

    Darrell Wu Newbie

      Hi,


      I'm wondering how i can view scheduled asynchronous method and how can i cancel them?


      I can  create an asynchronous method without any problems as i can see the record for asynchronous method in the TIMERS table.


      But i can't figure out how to list them when I use the TimerService interface.


      I've used the resource annotation in by SLSB as shown below.



      @Resource TimerService timerService;




      And I have a method as shown below to output all the timers to the log file.  When ever i call the method the list is empty even though i can see a record in the TIMERS table in my database.



      public void showTimers(){
          for (Object obj:timerService.getTimers()){
              Timer timer = (Timer) obj;
              timer.getInfo();
              log.info(timer.getInfo());
         }
           
      }




      Does anyone know how i can list scheduled timers?
      And how can i go about cancelling them?


      Thanks