2 Replies Latest reply on Oct 31, 2003 6:23 PM by adrian.brock

    java Timer class VS TimerMBean

    sugramoin

      i can write a Mbean and call in it a Timer object which servers me the purpose of scheduling. Or i can use a TimerMBean which is provided my jboss. which is the best.

      for me to write a new MBean and add a Timer in its start method is very simple, but i am not sure if it is the right way to do scheduling.

      TIA
      MOIN.

        • 1. Re: java Timer class VS TimerMBean
          genman


          I wrote my own MBeans with the java Timer class and it works okay. There's nothing wrong with using JMX for that.

          You get a little more flexibility with the JBoss scheduler in terms of when and how often tasks are run, but I wasn't too sure if the timer tasks were executed all in the same thread or could pontentially "block" other unreleated tasks.

          • 2. Re: java Timer class VS TimerMBean

            The JMX reference implementation uses the java timer
            class under the hood.
            It doesn't scale very well.
            I'm not sure whether is a problem with the java
            timer implementation or the reference implementation's usage.

            Regards,
            Adrian