Package org.quartz

Examples of org.quartz.SchedulerException


        if (existingJob != null) {
            if (rescheduleIfExists) {
                log.debug("Looks like repeating job [" + name + ':' + groupName
                    + "] is already scheduled - removing it so it can be rescheduled...");
                if (!this.scheduler.deleteJob(name, groupName)) {
                    throw new SchedulerException("Failed to delete repeating job [" + existingJob
                        + "] in order to reschedule it.");
                }
            } else {
                log.debug("Looks like repeating job [" + name + ':' + groupName
                    + "] is already scheduled - leaving the original job as-is.");
View Full Code Here


    }

    private void deleteJob(String name, String groupName, JobDetail job) throws SchedulerException {
        if (!this.scheduler.deleteJob(name, groupName)) {
            String jobString = (job != null) ? job.toString() : (name + ":" + groupName);
            throw new SchedulerException("Failed to delete job [" + jobString + "].");
        }
    }
View Full Code Here

            trigger = new CronTrigger(name, groupName, name, groupName, cronString);
            if (null != misfireInstruction) {
                trigger.setMisfireInstruction(misfireInstruction.intValue());
            }
        } catch (ParseException e) {
            throw new SchedulerException(e);
        }
        trigger.setVolatility(isVolatile);
        return trigger;
    }
View Full Code Here

        JobId jobIdObject = new JobId(jobId);
        JobDetail jobDetail = scheduler.getJobDetail(jobIdObject.getJobName(), jobIdObject.getJobGroup());
        ResourceOperationSchedule resourceOperationSchedule = getResourceOperationSchedule(subject, jobDetail);
        if (resourceOperationSchedule == null) {
            throw new SchedulerException("The job with ID [" + jobId + "] is no longer scheduled.");
        }
        return resourceOperationSchedule;
    }
View Full Code Here

    public GroupOperationSchedule getGroupOperationSchedule(Subject subject, String jobId) throws SchedulerException {
        JobId jobIdObject = new JobId(jobId);
        JobDetail jobDetail = scheduler.getJobDetail(jobIdObject.getJobName(), jobIdObject.getJobGroup());
        GroupOperationSchedule groupOperationSchedule = getGroupOperationSchedule(subject, jobDetail);
        if (groupOperationSchedule == null) {
            throw new SchedulerException("The job with ID [" + jobId + "] is no longer scheduled.");
        }
        return groupOperationSchedule;
    }
View Full Code Here

            if (LOG.isInfoEnabled()) {
                LOG.info("Loading Quartz properties file from classpath: " + getPropertiesFile());
            }
            InputStream is = getCamelContext().getClassResolver().loadResourceAsStream(getPropertiesFile());
            if (is == null) {
                throw new SchedulerException("Quartz properties file not found in classpath: " + getPropertiesFile());
            }
            answer = new Properties();
            try {
                answer.load(is);
            } catch (IOException e) {
                throw new SchedulerException("Error loading Quartz properties file from classpath: " + getPropertiesFile(), e);
            }
        }
        return answer;
    }
View Full Code Here

            // or setFactory(SchedulerFactory) methods

            // must use classloader from StdSchedulerFactory to work even in OSGi
            InputStream is = StdSchedulerFactory.class.getClassLoader().getResourceAsStream("org/quartz/quartz.properties");
            if (is == null) {
                throw new SchedulerException("Quartz properties file not found in classpath: org/quartz/quartz.properties");
            }
            prop = new Properties();
            try {
                prop.load(is);
            } catch (IOException e) {
                throw new SchedulerException("Error loading Quartz properties file from classpath: org/quartz/quartz.properties", e);
            }

            // camel context name will be a suffix to use one scheduler per context
            String identity = getCamelContext().getName();
View Full Code Here

      jobDetail.setDescription(getConfValue(config, "task.description"));
      CronTrigger trigger = new CronTrigger(getConfValue(config, "trigger.name"), getConfValue(config, "trigger.group"));
      trigger.setCronExpression(getConfValue(config, "trigger.cronExpression"));
      m_scheduler.scheduleJob(jobDetail, trigger);
    } catch (ClassNotFoundException e) {
      throw new SchedulerException("Failed to find job implementation class:", e);
    } catch (ParseException e) {
      throw new SchedulerException("Failed to parse cron trigger expression:", e);
    }
  }
View Full Code Here

      }
      if (ex instanceof SchedulerException) {
        throw (SchedulerException) ex;
      }
      if (ex instanceof Exception) {
        throw new SchedulerException(
            "Registration of jobs and triggers failed: " + ex.getMessage(), (Exception) ex);
      }
      throw new SchedulerException("Registration of jobs and triggers failed: " + ex.getMessage());
    }

    if (transactionStatus != null) {
      this.transactionManager.commit(transactionStatus);
    }
View Full Code Here

      try {
          if (__log.isDebugEnabled()) __log.debug("Starting transaction.");
          _txm.begin();
      } catch (Exception nse) {

          throw new SchedulerException(
                  "JTAJobRunShell could not start UserTransaction.", nse);
      }
  }
View Full Code Here

TOP

Related Classes of org.quartz.SchedulerException

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.