1 Reply Latest reply: May 28, 2009 11:29 AM by 807557 RSS

    When is Timer.fire() called

    807557
      Hi,

      in my application I have a timer running and a handler listening to the timer. The timer running is an own class that extends PeriodicTimer. In this timer I have overridden the fire() method like:
      @Override
      public void fire() {
        System.out.println(someString);
      }
      I hoped that everytime the timer fires, the String someString would be printed and no handler would be activated, because my overridden fire() method does not care about all the handlers, listening to this timer. But the string is never printed - the fire() method does not seem to be called, but the handlers are still activated everytime the timer fires. How come?

      Is there any possibility to get noticed by the timer directly (not an attached handler) that it fires (as i expected the method fire() would be called at this moment)?

      Thanks,
      Gordon
        • 1. Re: When is Timer.fire() called
          807557
          Timer.fire() is never called in Java RTS. I know the spec kind of implies it might be, but the reality is that fire() is the public API for triggering an event, it isn't used by the implementation - where the actually timer firing and AEH release all happens in native code.

          So there are no "hooks" other than release of the AEH themselves.

          David Holmes