Package org.quartz

Examples of org.quartz.CronExpression


    if (jobClass == null)
      return null;
    jobDetail.setJobClass(jobClass);

    MyCronTrigger trigger = new MyCronTrigger(jobDetail);
    CronExpression cronExpression = getCronExpression(key);
    if (cronExpression != null)
    {
      trigger.setCronExpression(cronExpression);
      if (jobClass.equals(StartJob.class))
        _startImmediate = false;
View Full Code Here


    {
      return null;
    }
    try
    {
      return new CronExpression(str);
    }
    catch (ParseException e)
    {
      e.printStackTrace();
      return null;
View Full Code Here

    if (jobClass == null)
      return null;
    jobDetail.setJobClass(jobClass);

    MyCronTrigger trigger = new MyCronTrigger(jobDetail);
    CronExpression cronExpression = getCronExpression(key);
    if (cronExpression != null)
    {
      trigger.setCronExpression(cronExpression);
      if (jobClass.equals(StartJob.class))
        _startImmediate = false;
View Full Code Here

    {
      return null;
    }
    try
    {
      return new CronExpression(str);
    }
    catch (ParseException e)
    {
      e.printStackTrace();
      return null;
View Full Code Here

                      break;
        case CRON : if ( expression == null ) {
                         errors.add("Expression must be specified.");
                    }
                    try {
                        new CronExpression(this.expression);
                    } catch (final ParseException e) {
                        errors.add("Expression must be valid: " + this.expression);
                    }
        }
    }
View Full Code Here

                          if ( nextY.before(now) ) {
                              nextY.add(Calendar.YEAR, 1);
                          }
                          return nextY.getTime();
            case CRON : try {
                            final CronExpression exp = new CronExpression(this.expression);
                            return exp.getNextValidTimeAfter(new Date());
                        } catch (final ParseException e) {
                            // as we check the expression in check() everything should be fine here
                        }
        }
        return null;
View Full Code Here

    return null;
  }
 
  public String check() throws Exception {
   
        CronExpression cronExpression = new CronExpression(expression);
        Date date = new Date();
       
        for(int i = 0; i< 15; i++){
          date = cronExpression.getNextValidTimeAfter(date);
          dateList.add(date);
        }
    return "success";
  }
View Full Code Here

        boolean isValid = true;

        if (object.getCronExpression() != null) {
            try {
                new CronExpression(object.getCronExpression());
            } catch (ParseException e) {
                LOG.error("Invalid cron expression '" + object.getCronExpression() + "'", e);
                isValid = false;

                context.disableDefaultConstraintViolation();
View Full Code Here

                    object + ".jobClassName is not valid").addConstraintViolation();
        }

        if (isValid && object.getCronExpression() != null) {
            try {
                new CronExpression(object.getCronExpression());
            } catch (ParseException e) {
                LOG.error("Invalid cron expression '" + object.getCronExpression() + "'", e);
                isValid = false;

                context.disableDefaultConstraintViolation();
View Full Code Here

        if (repo.getName() == null || repo.getName().trim().equals("")) {
            throw new RepoException("Repo name is required");
        }
        if (repo.getSyncSchedule() != null) {
            try {
                CronExpression ce = new CronExpression(repo.getSyncSchedule());
            } catch (ParseException e) {
                throw new RepoException("Repo sync schedule is not a vaild format.");
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.quartz.CronExpression

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.