Search in sources :

Example 1 with JobManagerConfiguration

use of org.apache.sling.event.impl.jobs.config.JobManagerConfiguration in project sling by apache.

the class QueueManager method restart.

/**
     * Outdate all queues.
     */
private void restart() {
    // let's rename/close all queues and clear them
    synchronized (queuesLock) {
        final List<JobQueueImpl> queues = new ArrayList<>(this.queues.values());
        for (final JobQueueImpl queue : queues) {
            this.outdateQueue(queue);
        }
    }
    // check if we're still active
    final JobManagerConfiguration config = this.configuration;
    if (config != null) {
        final List<Job> rescheduleList = this.configuration.clearJobRetryList();
        for (final Job j : rescheduleList) {
            final JobHandler jh = new JobHandler((JobImpl) j, null, this.configuration);
            jh.reschedule();
        }
    }
}
Also used : JobHandler(org.apache.sling.event.impl.jobs.JobHandler) JobManagerConfiguration(org.apache.sling.event.impl.jobs.config.JobManagerConfiguration) ArrayList(java.util.ArrayList) Job(org.apache.sling.event.jobs.Job)

Aggregations

ArrayList (java.util.ArrayList)1 JobHandler (org.apache.sling.event.impl.jobs.JobHandler)1 JobManagerConfiguration (org.apache.sling.event.impl.jobs.config.JobManagerConfiguration)1 Job (org.apache.sling.event.jobs.Job)1