Package org.quartz

Examples of org.quartz.SchedulerException


            Publication publication;
            try {
                publication =
                    PublicationFactory.getPublication(publicationId, getServletContextPath());
            } catch (PublicationException e) {
                throw new SchedulerException(e);
            }
            jobsFile = new File(publication.getDirectory(), SNAPSHOT_FILE);
        } else {
            jobsFile = new File(getServletContextPath(), "lenya" + File.separator + SNAPSHOT_FILE);
        }
View Full Code Here


                Element schedulerElement = document.getDocumentElement();
                NamespaceHelper helper = getNamespaceHelper(document);

                Element jobGroupElement = helper.getFirstChild(schedulerElement, ELEMENT_JOB_GROUP);
                if (jobGroupElement == null) {
                    throw new SchedulerException("No <job-group> element found!");
                }

                String jobGroupAttribute = jobGroupElement.getAttribute("name");

                if (!jobGroupAttribute.equals(jobGroup)) {
                    throw new SchedulerException(
                        "The jobs.xml file contains a wrong job group: ["
                            + jobGroupAttribute
                            + "]");
                } else {
                    Element[] jobElements = helper.getChildren(jobGroupElement, ELEMENT_JOB);
View Full Code Here

        throws SchedulerException {
        log.debug("Modifying job [" + jobId + "][" + jobGroup + "]");

        JobDetail jobDetail = getScheduler().getJobDetail(jobId, jobGroup);
        if (jobDetail == null) {
            throw new SchedulerException("Job not found!");
        }

        Trigger trigger = getTrigger(jobDetail.getName(), jobGroup);
        if (trigger == null) {
            log.debug("    No trigger found.");
View Full Code Here

        throws SchedulerException {
        JobDataMap map = new JobDataMap();
        String key = NamespaceMap.getFullName(LoadQuartzServlet.PREFIX, PARAMETER_DOCUMENT_URL);
        String documentUrl = request.getParameter(key);
        if (documentUrl == null) {
            throw new SchedulerException("Document URL must not be null!");
        }
        map.put(key, documentUrl);
        return map;
    }
View Full Code Here

            jobElement.setAttribute(ATTRIBUTE_DOCUMENT_URL, documentUrl);
           
            return jobElement;
        } catch (final DOMException e) {
            log.error("" +e.toString());
            throw new SchedulerException(e);
        }
    }
View Full Code Here

     */
    public void addJob(String jobGroup, Date startTime, HttpServletRequest request)
        throws SchedulerException {

        if (jobGroup == null) {
            throw new SchedulerException("Job group must not be null!");
        }

        try {
            log.debug("----------------------------------------------");
            log.debug("Adding Job for group [" + jobGroup + "]");

            // FIXME: more flexible
            Class jobClass = TaskJob.class;

            ServletJob job = ServletJobFactory.createJob(jobClass);
            JobDataMap map = job.createJobData(request);

            addJob(jobGroup, startTime, jobClass, map);
        } catch (final SchedulerException e) {
            log.error("Adding job failed: ", e);
            throw new SchedulerException(e);
        } catch (final PublicationException e) {
            log.error("Adding job failed: ", e);
            throw new SchedulerException(e);
        }
    }
View Full Code Here

        try {
            element = getStore().createSnapshot(helper, getPublication(group), jobs);
        } catch (SchedulerException e) {
            throw e;
        } catch (PublicationException e) {
            throw new SchedulerException(e);
        }
        return element;
    }
View Full Code Here

                    addJob(jobs[i].getJobDetail());
                }
            }
        } catch (final SchedulerException e) {
            log.error("" +e.toString());
            throw new SchedulerException(e);
        } catch (final PublicationException e) {
            log.error("" +e.toString());
            throw new SchedulerException(e);
        }

    }
View Full Code Here

        throws SchedulerException {
        log.debug("Modifying job [" + _jobId + "][" + jobGroup + "]");

        JobDetail jobDetail = getScheduler().getJobDetail(_jobId, jobGroup);
        if (jobDetail == null) {
            throw new SchedulerException("Job not found!");
        }

        Trigger trigger = getTrigger(jobDetail.getName(), jobGroup);
        if (trigger == null) {
            log.debug("    No trigger found.");
        } else {
            log.debug("    Trigger found. Setting new start time.");
            jobDetail.setDurability(true);
            if (startTime.after(new GregorianCalendar().getTime())) {
                log.debug("    Start time is in future - re-scheduling job.");
                getScheduler().unscheduleJob(trigger.getName(), trigger.getGroup());
                trigger = TriggerHelper.createSimpleTrigger(_jobId, jobGroup, startTime);
                getScheduler().scheduleJob(trigger);
            } else {
                log.debug("    Start time has already expired - deleting job.");
                getScheduler().deleteJob(_jobId, jobGroup);
            }
            try {
                getStore().writeSnapshot(getPublication(jobGroup), getJobWrappers(jobGroup));
            } catch (SchedulerException e) {
                throw e;
            } catch (PublicationException e) {
                throw new SchedulerException(e);
            }
        }
    }
View Full Code Here

            PublicationFactory factory = PublicationFactory.getInstance(new ConsoleLogger());
            Publication publication;
            try {
                publication = factory.getPublication(publicationId, getServletContextDirectory());
            } catch (PublicationException e) {
                throw new SchedulerException(e);
            }
            if (publication.exists()) {
                getScheduler().restoreJobs(publicationId);
            }
        }
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.