Package org.quartz

Examples of org.quartz.Scheduler.scheduleJob()


            trigger = createTrigger(jobDetail);

            QuartzHelper.updateJobDataMap(getCamelContext(), jobDetail, getEndpointUri());

            // Schedule it now. Remember that scheduler might not be started it, but we can schedule now.
            Date nextFireDate = scheduler.scheduleJob(jobDetail, trigger);
            if (LOG.isInfoEnabled()) {
                LOG.info("Job {} (triggerType={}, jobClass={}) is scheduled. Next fire date is {}",
                         new Object[] {trigger.getKey(), trigger.getClass().getSimpleName(),
                                       jobDetail.getJobClass().getSimpleName(), nextFireDate});
            }
View Full Code Here


      }
      logger
          .debug( MessageFormat
              .format(
                  "Scheduling job {0} with trigger {1} and job parameters [ {2} ]", jobId.toString(), trigger, prettyPrintMap( jobParams ) ) ); //$NON-NLS-1$
      scheduler.scheduleJob( jobDetail, quartzTrigger );
    } catch ( org.quartz.SchedulerException e ) {
      throw new SchedulerException( Messages.getInstance().getString(
          "QuartzScheduler.ERROR_0001_FAILED_TO_SCHEDULE_JOB", jobName ), e ); //$NON-NLS-1$
    }
View Full Code Here

                .withSchedule(SimpleScheduleBuilder.simpleSchedule().withRepeatCount(0).withIntervalInMilliseconds(125L))
                .build();

        JobDetail jobDetail = JobBuilder.newJob(QuartzSchedulerMockJob.class).withIdentity("testCollectionPointJob", "testCollectionPointJobGroup").build();

        sched.scheduleJob(jobDetail, trigger);
        sched.start();
        // let the program have an opportunity to run the job
        assertTrue("No signal from job", SIGNALLER.tryAcquire(5L, TimeUnit.SECONDS));
        sched.shutdown(true);
View Full Code Here

    private void doSchedule() throws SchedulerException {
        Scheduler scheduler = getScheduler();

        JobDetail jobDetail = getParams().getJob();
        Trigger trigger = getParams().getTrigger();
        scheduler.scheduleJob(jobDetail, trigger);
    }

    /**
     * TODO Javadoc.
     *
 
View Full Code Here

            .withIdentity(new TriggerKey("mytrigger"))
            .startAt(runTime)
            .build();
       
        // Tell quartz to schedule the job using our trigger
        sched.scheduleJob(job, trigger);
        log.info(job.getKey() + " will run at: " + runTime)

        // Start up the scheduler (nothing can actually run until the
        // scheduler has been started)
        sched.start();
View Full Code Here

        CronTrigger trigger = newTrigger()
            .withIdentity("trigger1", "group1")
            .withSchedule(cronSchedule("5/5 * * * * ?"))
            .build();

        Date ft = sched.scheduleJob(job, trigger);
        log.info(job.getKey() + " has been scheduled to run at: " + ft
                + " and repeat based on expression: "
                + trigger.getCronExpression());

        // job 2 will run every other minute (at 15 seconds past the minute)
View Full Code Here

        trigger = newTrigger()
            .withIdentity("trigger2", "group1")
            .withSchedule(cronSchedule("15 0/2 * * * ?"))
            .build();
       
        ft = sched.scheduleJob(job, trigger);
        log.info(job.getKey() + " has been scheduled to run at: " + ft
                + " and repeat based on expression: "
                + trigger.getCronExpression());

        // job 3 will run every other minute but only between 8am and 5pm
View Full Code Here

        trigger = newTrigger()
            .withIdentity("trigger3", "group1")
            .withSchedule(cronSchedule("0 0/2 8-17 * * ?"))
            .build();
       
        ft = sched.scheduleJob(job, trigger);
        log.info(job.getKey() + " has been scheduled to run at: " + ft
                + " and repeat based on expression: "
                + trigger.getCronExpression());

        // job 4 will run every three minutes but only between 5pm and 11pm
View Full Code Here

        trigger = newTrigger()
            .withIdentity("trigger4", "group1")
            .withSchedule(cronSchedule("0 0/3 17-23 * * ?"))
            .build();
       
        ft = sched.scheduleJob(job, trigger);
        log.info(job.getKey() + " has been scheduled to run at: " + ft
                + " and repeat based on expression: "
                + trigger.getCronExpression());

        // job 5 will run at 10am on the 1st and 15th days of the month
View Full Code Here

        trigger = newTrigger()
            .withIdentity("trigger5", "group1")
            .withSchedule(cronSchedule("0 0 10am 1,15 * ?"))
            .build();
       
        ft = sched.scheduleJob(job, trigger);
        log.info(job.getKey() + " has been scheduled to run at: " + ft
                + " and repeat based on expression: "
                + trigger.getCronExpression());

        // job 6 will run every 30 seconds but only on Weekdays (Monday through Friday)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.