agave-files/files-core/src/main/java/org/iplantc/service/io/queue/JobProducerFactory.java
/**
     * Creates a new job on the consumer queue with a unique name based on the job uuid,
     * thus guaranteeing single execution within a JVM. If clustered, this should ensure
     * single execution across the cluster.
     *
     * @param jobClass the worker watch class to be instantiated
     * @param groupName the job group name
     * @param queueTaskId the id of the task to pass to the worker.
     * @throws SchedulerException
     */
Creates a new job on the consumer queue with a unique name based on the job uuid,
thus guaranteeing single execution within a JVM. If clustered, this should ensure
single execution across the cluster.

@param jobClass the worker watch class to be instantiated
@param groupName the job group name
@param queueTaskId the id of the task to pass to the worker.
Creates a new job on the consumer queue with a unique name based on the job uuid thus guaranteeing single execution within a JVM . If clustered this should ensure single execution across the cluster . @param jobClass the worker watch class to be instantiated @param groupName the job group name @param queueTaskId the id of the task to pass to the worker .
private void produceWorker(Class<? extends WorkerWatch> jobClass, String groupName, Long queueTaskId)
            throws SchedulerException {
        JobDetail jobDetail = org.quartz.JobBuilder.newJob(jobClass)
                .usingJobData("queueTaskId", queueTaskId)
                .withIdentity(jobClass.getName() + "-" + queueTaskId, groupName + "Workers-" + queueTaskId)
                .build();
        SimpleTrigger trigger = newTrigger()
                .withIdentity(jobClass.getName() + "-" + queueTaskId, groupName + "Workers-" + queueTaskId)
                .startNow()
                .withSchedule(simpleSchedule()
                        .withMisfireHandlingInstructionNextWithExistingCount()
                        .withIntervalInSeconds(1)
                        .withRepeatCount(0))
                .build();
        Scheduler sched = new StdSchedulerFactory().getScheduler("AgaveConsumerTransferScheduler");
        if (!sched.isStarted()) {
            sched.start();
        }
        if (log.isDebugEnabled())
            log.debug("Assigning " + jobClass.getSimpleName() + " " + queueTaskId + " for processing");
        sched.scheduleJob(jobDetail, trigger);
    }
private void produceWorker ( Class < ? extends WorkerWatch > jobClass , String groupName , Long queueTaskId ) throws SchedulerException { JobDetail jobDetail = org . quartz . JobBuilder . newJob ( jobClass ) . usingJobData ( "queueTaskId" , queueTaskId ) . withIdentity ( jobClass . getName ( ) + "-" + queueTaskId , groupName + "Workers-" + queueTaskId ) . build ( ) ; SimpleTrigger trigger = newTrigger ( ) . withIdentity ( jobClass . getName ( ) + "-" + queueTaskId , groupName + "Workers-" + queueTaskId ) . startNow ( ) . withSchedule ( simpleSchedule ( ) . withMisfireHandlingInstructionNextWithExistingCount ( ) . withIntervalInSeconds ( 1 ) . withRepeatCount ( 0 ) ) . build ( ) ; Scheduler sched = new StdSchedulerFactory ( ) . getScheduler ( "AgaveConsumerTransferScheduler" ) ; if ( ! sched . isStarted ( ) ) { sched . start ( ) ; } if ( log . isDebugEnabled ( ) ) log . debug ( "Assigning " + jobClass . getSimpleName ( ) + " " + queueTaskId + " for processing" ) ; sched . scheduleJob ( jobDetail , trigger ) ; }
Creates a new job on the consumer queue with a unique name based on the job uuid,
 thus guaranteeing single execution within a JVM.
Creates a new job on the consumer queue with a unique name based on the job uuid thus guaranteeing single execution within a JVM .