Package org.quartz

Examples of org.quartz.ObjectAlreadyExistsException


      JobDetail existingJob = scheduler_.getJobDetail(jobDetail.getKey());
      if (existingJob == null)
         return true;
      if (equals(existingJob, jobDetail))
         return false;
      throw new ObjectAlreadyExistsException(jobDetail);
   }
View Full Code Here


      schedulerControl.setReturnValue(null);
    }
    scheduler.addJob(jobDetail0, true);
    schedulerControl.setVoidCallable();
    scheduler.scheduleJob(trigger0);
    schedulerControl.setThrowable(new ObjectAlreadyExistsException(""));
    if (overwrite) {
      scheduler.rescheduleJob("myTrigger0", Scheduler.DEFAULT_GROUP, trigger0);
      schedulerControl.setReturnValue(new Date());
    }
    scheduler.start();
View Full Code Here

        boolean existingJob = jobExists(conn, newJob.getName(), newJob
                .getGroup());
        try {
            if (existingJob) {
                if (!replaceExisting) {
                    throw new ObjectAlreadyExistsException(newJob);
                }
                getDelegate().updateJobDetail(conn, newJob);
            } else {
                getDelegate().insertJobDetail(conn, newJob);
            }
View Full Code Here

        boolean existingTrigger = triggerExists(conn, newTrigger.getName(),
                newTrigger.getGroup());

        if ((existingTrigger) && (!replaceExisting)) {
            throw new ObjectAlreadyExistsException(newTrigger);
        }
       
        try {

            boolean shouldBepaused = false;
View Full Code Here

            String calName, Calendar calendar, boolean replaceExisting, boolean updateTriggers)
        throws ObjectAlreadyExistsException, JobPersistenceException {
        try {
            boolean existingCal = calendarExists(conn, calName);
            if (existingCal && !replaceExisting) {
                throw new ObjectAlreadyExistsException(
                    "Calendar with name '" + calName + "' already exists.");
            }

            if (existingCal) {
                if (getDelegate().updateCalendar(conn, calName, calendar) < 1) {
View Full Code Here

        boolean repl = false;

        synchronized (lock) {
            if (jobsByFQN.get(jw.key) != null) {
                if (!replaceExisting) {
                    throw new ObjectAlreadyExistsException(newJob);
                }
                repl = true;
            }

            if (!repl) {
View Full Code Here

        TriggerWrapper tw = new TriggerWrapper((Trigger)newTrigger.clone());

        synchronized (lock) {
            if (triggersByFQN.get(tw.key) != null) {
                if (!replaceExisting) {
                    throw new ObjectAlreadyExistsException(newTrigger);
                }
   
                removeTrigger(ctxt, newTrigger.getName(), newTrigger.getGroup(), false);
            }
   
View Full Code Here

        synchronized (lock) {
   
            Object obj = calendarsByName.get(name);
   
            if (obj != null && replaceExisting == false) {
                throw new ObjectAlreadyExistsException(
                    "Calendar with name '" + name + "' already exists.");
            } else if (obj != null) {
                calendarsByName.remove(name);
            }
   
View Full Code Here

        boolean repl = false;

        synchronized (lock) {
            if (jobsByKey.get(jw.key) != null) {
                if (!replaceExisting) {
                    throw new ObjectAlreadyExistsException(newJob);
                }
                repl = true;
            }

            if (!repl) {
View Full Code Here

        synchronized (lock) {
            // make sure there are no collisions...
            if(!replace) {
                for(Entry<JobDetail, Set<? extends Trigger>> e: triggersAndJobs.entrySet()) {
                    if(checkExists(e.getKey().getKey()))
                        throw new ObjectAlreadyExistsException(e.getKey());
                    for(Trigger trigger: e.getValue()) {
                        if(checkExists(trigger.getKey()))
                            throw new ObjectAlreadyExistsException(trigger);
                    }
                }
            }
            // do bulk add...
            for(Entry<JobDetail, Set<? extends Trigger>> e: triggersAndJobs.entrySet()) {
View Full Code Here

TOP

Related Classes of org.quartz.ObjectAlreadyExistsException

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.