6 Replies Latest reply on Oct 16, 2008 1:38 PM by Hugo Pragt

    Timer injection blocks @Asynchronous calls?

    Hugo Pragt Newbie

      Hi all. I observe some strange behavior in calling an @Asynchronous annotated method.


      When the class containing the implementation of the async method inject the timer object The method is never called!


      so this will work:


      @Stateless
      @Name("pump")
      public class Pump implements PumpAction {
           
           @In(create = true)
           private DataList dataList;
      
           @Logger
           private Log log;
      
           public void tick(long interval) {
                  // do something 
           } // tick
      }



      and this will not:


      @Stateless
      @Name("pump")
      public class Pump implements PumpAction {
           
           @In 
           Timer timer;
      
           @In(create = true)
           private DataList dataList;
      
           @Logger
           private Log log;
      
           public void tick(long interval) {
                  // do something 
           } // tick
      }



      When I put a log.debug statement in the tick() method I can see that the tick() method is not called in the second case.
      Any idea what causes this and if it is a bug?
      I'm using the following statements in my components.xml:


         <core:dispatcher/>  
         <core:timer-service-dispatcher/>