agave-common/common-api/src/main/java/org/iplantc/service/common/quartz/util/QuartzUtility.java
/**
     * gets the scheduler.
     *
     * @return current scheduler
     */
gets the scheduler.
@return current scheduler
gets the scheduler . @return current scheduler
private Scheduler scheduler() {
        String schedulerName = "AgaveProducerScheduler";
        Form query = Request.getCurrent().getOriginalRef().getQueryAsForm();
        if (StringUtils.isNotEmpty(query.getFirstValue("scheduler"))) {
            schedulerName = query.getFirstValue("scheduler");
        }
        if (quartzScheduler == null) {
            try {
                if (StringUtils.isEmpty(schedulerName)) {
                    quartzScheduler = StdSchedulerFactory.getDefaultScheduler();
                } else {
                    StdSchedulerFactory factory = new StdSchedulerFactory();
                    quartzScheduler = factory.getScheduler(schedulerName);
                }
                return quartzScheduler;
            } catch (SchedulerException e) {
                throw new RuntimeException(e);
            }
        } else if (StringUtils.isEmpty(schedulerName)) {
            return quartzScheduler;
        } else {
            try {
                if (!StringUtils.equals(schedulerName, quartzScheduler.getSchedulerName())) {
                    StdSchedulerFactory factory = new StdSchedulerFactory();
                    quartzScheduler = factory.getScheduler(schedulerName);
                }
                return quartzScheduler;
            } catch (SchedulerException e) {
                log.error("Failed to load scheduler " + schedulerName, e);
                throw new RuntimeException(e);
            }
        }
    }
private Scheduler scheduler ( ) { String schedulerName = "AgaveProducerScheduler" ; Form query = Request . getCurrent ( ) . getOriginalRef ( ) . getQueryAsForm ( ) ; if ( StringUtils . isNotEmpty ( query . getFirstValue ( "scheduler" ) ) ) { schedulerName = query . getFirstValue ( "scheduler" ) ; } if ( quartzScheduler == null ) { try { if ( StringUtils . isEmpty ( schedulerName ) ) { quartzScheduler = StdSchedulerFactory . getDefaultScheduler ( ) ; } else { StdSchedulerFactory factory = new StdSchedulerFactory ( ) ; quartzScheduler = factory . getScheduler ( schedulerName ) ; } return quartzScheduler ; } catch ( SchedulerException e ) { throw new RuntimeException ( e ) ; } } else if ( StringUtils . isEmpty ( schedulerName ) ) { return quartzScheduler ; } else { try { if ( ! StringUtils . equals ( schedulerName , quartzScheduler . getSchedulerName ( ) ) ) { StdSchedulerFactory factory = new StdSchedulerFactory ( ) ; quartzScheduler = factory . getScheduler ( schedulerName ) ; } return quartzScheduler ; } catch ( SchedulerException e ) { log . error ( "Failed to load scheduler " + schedulerName , e ) ; throw new RuntimeException ( e ) ; } } }
gets the scheduler.
gets the scheduler .