Package org.quartz

Examples of org.quartz.ObjectAlreadyExistsException


            boolean replaceExisting) throws JobPersistenceException {
        TriggerWrapper tw = new TriggerWrapper(newTrigger);

        if (triggersByFQN.get(tw.key) != null) {
            if (!replaceExisting)
                    throw new ObjectAlreadyExistsException(newTrigger);

            removeTrigger(ctxt, newTrigger.getName(), newTrigger.getGroup());
        }

        if (retrieveJob(ctxt, newTrigger.getJobName(), newTrigger.getJobGroup()) == null)
View Full Code Here


    public void storeCalendar(SchedulingContext ctxt, String name,
            Calendar calendar, boolean replaceExisting, boolean updateTriggers)
            throws ObjectAlreadyExistsException {
        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);

        calendarsByName.put(name, calendar);
View Full Code Here

/*      */
/*  216 */     boolean repl = false;
/*      */
/*  218 */     if (this.jobsByFQN.get(jw.key) != null) {
/*  219 */       if (!replaceExisting)
/*  220 */         throw new ObjectAlreadyExistsException(newJob);
/*  221 */       repl = true;
/*      */     }
/*      */
/*  224 */     synchronized (this.jobLock) {
/*  225 */       if (!repl)
View Full Code Here

/*      */   {
/*  305 */     TriggerWrapper tw = new TriggerWrapper(newTrigger);
/*      */
/*  307 */     if (this.triggersByFQN.get(tw.key) != null) {
/*  308 */       if (!replaceExisting) {
/*  309 */         throw new ObjectAlreadyExistsException(newTrigger);
/*      */       }
/*  311 */       removeTrigger(ctxt, newTrigger.getName(), newTrigger.getGroup());
/*      */     }
/*      */
/*  314 */     if (retrieveJob(ctxt, newTrigger.getJobName(), newTrigger.getJobGroup()) == null) {
View Full Code Here

/*      */   public void storeCalendar(SchedulingContext ctxt, String name, Calendar calendar, boolean replaceExisting, boolean updateTriggers)
/*      */     throws ObjectAlreadyExistsException
/*      */   {
/*  555 */     Object obj = this.calendarsByName.get(name);
/*      */
/*  557 */     if ((obj != null) && (!replaceExisting)) throw new ObjectAlreadyExistsException("Calendar with name '" + name + "' already exists.");
/*      */
/*  559 */     if (obj != null) this.calendarsByName.remove(name);
/*      */
/*  561 */     this.calendarsByName.put(name, calendar);
/*      */
View Full Code Here

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

/*  934 */           state = "BLOCKED";
/*  935 */         if (("BLOCKED".equals(bstate)) && ("PAUSED".equals(state)))
/*  936 */           state = "PAUSED_BLOCKED";
/*      */       }
/*  938 */       if (existingTrigger) {
/*  939 */         if (!replaceExisting) throw new ObjectAlreadyExistsException(newTrigger);
/*      */
/*  941 */         if ((newTrigger instanceof SimpleTrigger)) {
/*  942 */           getDelegate().updateSimpleTrigger(conn, (SimpleTrigger)newTrigger);
/*      */         }
/*  944 */         else if ((newTrigger instanceof CronTrigger)) {
View Full Code Here

/*      */     throws ObjectAlreadyExistsException, JobPersistenceException
/*      */   {
/*      */     try
/*      */     {
/* 1170 */       boolean existingCal = calendarExists(conn, calName);
/* 1171 */       if ((existingCal) && (!replaceExisting)) throw new ObjectAlreadyExistsException("Calendar with name '" + calName + "' already exists.");
/*      */
/* 1174 */       if (existingCal) {
/* 1175 */         if (getDelegate().updateCalendar(conn, calName, calendar) < 1) throw new JobPersistenceException("Couldn't store calendar.  Update failed.");
/*      */
/* 1178 */         if (updateTriggers) {
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

                        state = STATE_BLOCKED;
                    if(STATE_BLOCKED.equals(bstate) && STATE_PAUSED.equals(state))
                        state = STATE_PAUSED_BLOCKED;
            }
            if (existingTrigger) {
                if (!replaceExisting) { throw new ObjectAlreadyExistsException(
                        newTrigger); }
                if (newTrigger instanceof SimpleTrigger) {
                    getDelegate().updateSimpleTrigger(conn,
                            (SimpleTrigger) newTrigger);
                } else if (newTrigger instanceof CronTrigger) {
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.