4 Replies Latest reply on Feb 13, 2006 8:46 AM by George Taylor

    Scheduler

    George Taylor Newbie

      Are there any annotations to create a scheduled service instead of having to put an XML file in the deployment

        • 1. Re: Scheduler
          Bill Burke Master

          Nope. Suggestions?

          • 2. Re: Scheduler
            George Taylor Newbie

            my sugestion would be to do something like the @Depends tag

            the xml is

             <mbean code="org.jboss.varia.scheduler.Scheduler"
             name=":service=Scheduler">
             <attribute name="StartAtStartup">true</attribute>
             <attribute name="SchedulableClass">org.jboss.varia.scheduler.example.SchedulableExample</attribute>
             <attribute name="SchedulableArguments">Schedulabe Test,12345</attribute>
             <attribute name="SchedulableArgumentTypes">java.lang.String,int</attribute>
             <attribute name="InitialStartDate">0</attribute>
             <attribute name="SchedulePeriod">10000</attribute>
             <attribute name="InitialRepetitions">-1</attribute>
             </mbean>
            


            so if in an mbean you could have a tag along the lines of

            @Schedule(initalStartDate="0", schedulePeriod="10000", initialRepetitions="-1", schedulableArguments="Test, 12345")

            This would then activate a schedule of the mbean.

            This would be a big benifit, and get away from having to deploy the xml file.


            • 3. Re: Scheduler
              Bill Burke Master

              looks like a good idea. I've created a JIRA task for it. It is scheduled for RC6, but I don't think we'll get there in time. I don't think there's any reason why this feature shouldn't be usable with @Stateless beans too.

              • 4. Re: Scheduler
                George Taylor Newbie

                very true, that would make alot of sense.

                thanks for that.