public void removeJob()

in src/main/java/org/apache/sling/commons/scheduler/impl/QuartzScheduler.java [417:440]


    public void removeJob(final Long bundleId, final String jobName) throws NoSuchElementException {
        // as this method might be called from unbind and during
        // unbind a deactivate could happen, we check the scheduler first
        synchronized ( this.schedulers ) {
            if ( this.active ) {
                for(final SchedulerProxy proxy : this.schedulers.values()) {
                    try {
                        final JobKey key = JobKey.jobKey(jobName);
                        final JobDetail jobdetail = proxy.getScheduler().getJobDetail(key);
                        if (jobdetail != null) {
                            proxy.getScheduler().deleteJob(key);
                            this.logger.debug("Unscheduling job with name {}", jobName);
                            return;
                        }
                    } catch (final SchedulerException ignored) {
                        // ignore
                    }
                }
            }
        }
        if ( this.active ) {
            throw new NoSuchElementException("No job found with name " + jobName);
        }
    }