5 Replies Latest reply on Apr 30, 2010 10:50 AM by kapitanpetko

    Finding all Quartz jobs

    prem14261

      Hi,


      I have few questions related to Quartz Scheduling in Seam.



      1. Is there a way to fetch all the quartz jobs that were scheduled?

      2. Is it possible to trigger a job manually even before the next timeout?

      3. Can i change the cron string dynamically with out restarting the server?



      I'm using JBoss 4.2.3 GA application server.


      Thanks in advance.


      -Prem

        • 1. Re: Finding all Quartz jobs
          kapitanpetko

          Yes to all three. You have to use the Quartz APIs directly to achieve it.


          • 2. Re: Finding all Quartz jobs
            prem14261

            Thanks Nikolay. It means there is no API available in Seam to do all these operations?


            - Prem

            • 3. Re: Finding all Quartz jobs
              kapitanpetko

              Prem Chand wrote on Apr 30, 2010 09:08:


              It means there is no API available in Seam to do all these operations?



              Right. But Seam is just a thin wrapper and some syntactic sugar (@Asynchronous), so it has no way of providing all of this. Just get an instance of the Scheduler and proceed as with standalone Quartz.

              • 4. Re: Finding all Quartz jobs
                prem14261

                Okay. How can i fetch the Scheduler instance.


                I need to get Scheduler instance from SchedulerFactory while creating jobs itself?


                Else, can i create jobs with @Asynchronous methods and some how lookup the Scheduler instance later when required?


                - Prem

                • 5. Re: Finding all Quartz jobs
                  kapitanpetko

                  As usual, RTFM:


                  QuartzDispatcher dispatcher = QuartzDispatcher.instance();
                  Scheduler scheduler = dispatcher.getScheduler();
                  



                  If you create jobs with @Asynchronous, they will be available with the Scheduler Seam creates (see above). You can get the trigger/job names from the QuartzTriggerThandle Seam returns.