Package org.quartz

Examples of org.quartz.CronScheduleBuilder


   *
   * @param cronExpression the cron expression
   * @return the cron trigger
   */
  private Trigger getCronTrigger(String cronExpression) {
    CronScheduleBuilder cronScheduleBuilder = null;
    Trigger cronTrigger = null;
    try {
      cronScheduleBuilder = CronScheduleBuilder.cronSchedule(cronExpression);
      cronScheduleBuilder.withMisfireHandlingInstructionFireAndProceed();
      TriggerBuilder<Trigger> cronTtriggerBuilder = TriggerBuilder.newTrigger();
      cronTtriggerBuilder.withSchedule(cronScheduleBuilder);
      cronTrigger = cronTtriggerBuilder.build();
    } catch (ParseException pe) {
      logger.error("Error occurred while builiding the cronTrigger : " + pe.getMessage(), pe);
View Full Code Here


    try {
      Trigger trigger = scheduler.getTrigger(TriggerKey.triggerKey(name, group));
      if( trigger != null && trigger instanceof CronTrigger){
        JobInterval jobInterval = this.jobIntervalManager.get( name );
        if( jobInterval != null ){
          CronScheduleBuilder csb = CronScheduleBuilder.cronSchedule(
              jobInterval.getCronExpression());
         
          trigger = TriggerBuilder.newTrigger()
            .withIdentity( trigger.getKey() )
            .withDescription(trigger.getDescription())
View Full Code Here

    if( scheduler == null )
      return;
   
    try{
      if( run ){ //重设置trigger
        CronScheduleBuilder csb = CronScheduleBuilder.cronSchedule(cronExp);
       
        trigger = TriggerBuilder.newTrigger()
          .withIdentity( trigger.getKey() )
          .withDescription(trigger.getDescription())
          .withSchedule(csb).build();
View Full Code Here

    }

    private Trigger createJobCronTrigger(long jobId, String cron, String timeZoneId) {
        TimeZone timeZone = TimeZone.getTimeZone(timeZoneId);

        CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(cron)
            .withMisfireHandlingInstructionDoNothing()
            .inTimeZone(timeZone);

        JobKey jobKey = QzerverKeyUtils.jobKey(jobId);
        TriggerKey triggerKey = QzerverKeyUtils.triggerKey(jobId);
View Full Code Here

            if (rs.next()) {
                String cronExpr = rs.getString(COL_CRON_EXPRESSION);
                String timeZoneId = rs.getString(COL_TIME_ZONE_ID);

                CronScheduleBuilder cb = CronScheduleBuilder.cronSchedule(cronExpr);
             
                if (timeZoneId != null)
                    cb.inTimeZone(TimeZone.getTimeZone(timeZoneId));
               
                return new TriggerPropertyBundle(cb, null, null);
            }
           
            throw new IllegalStateException("No record found for selection of Trigger with key: '" + triggerKey + "' and statement: " + Util.rtp(SELECT_CRON_TRIGGER, tablePrefix, schedNameLiteral));
View Full Code Here

     * @see #getTriggerBuilder()
     */
    @Override
    public ScheduleBuilder<CronTrigger> getScheduleBuilder() {
       
        CronScheduleBuilder cb = CronScheduleBuilder.cronSchedule(getCronExpression())
                .inTimeZone(getTimeZone());
           
        switch(getMisfireInstruction()) {
            case MISFIRE_INSTRUCTION_DO_NOTHING : cb.withMisfireHandlingInstructionDoNothing();
            break;
            case MISFIRE_INSTRUCTION_FIRE_ONCE_NOW : cb.withMisfireHandlingInstructionFireAndProceed();
            break;
        }
       
        return cb;
    }
View Full Code Here

        if (calendarName != null) {
            tb.modifiedByCalendar(calendarName);
        }

        final CronScheduleBuilder csb = CronScheduleBuilder.cronSchedule(getCronExpression());
        if (timeZone != null) {
            csb.inTimeZone(TimeZone.getTimeZone(timeZone));
        }

        trigger = tb.withSchedule(csb).build();

        try {
View Full Code Here

                tb.endAt(parse(endTime));
        }
        if (calendarName != null) {
                tb.modifiedByCalendar(calendarName);
        }
        final CronScheduleBuilder csb = CronScheduleBuilder.cronSchedule(getCronExpression());
        if (timeZone != null) {
            csb.inTimeZone(TimeZone.getTimeZone(timeZone));
        }
        tb.withSchedule(CronScheduleBuilder.cronSchedule(getCronExpression()));
        trigger = tb.build();
       
View Full Code Here

                        TriggerKey triggerKey = triggerKey("Reconnect", "FritzBox");
                       
                        if (sched.checkExists(jobKey)) {
                            logger.debug("Daily reconnection job already exists");
                        } else {
                            CronScheduleBuilder scheduleBuilder =
                                CronScheduleBuilder.cronSchedule(cronSchedule);
                           
                            JobDetail job = newJob(ReconnectJob.class)
                                    .withIdentity(jobKey)
                                    .build();
View Full Code Here

TOP

Related Classes of org.quartz.CronScheduleBuilder

Copyright © 2018 www.massapicom. 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.