Class QueueJobCache


  • public class QueueJobCache
    extends Object
    The queue job cache caches jobs per queue based on the topics the queue is actively processing.
    • Constructor Detail

      • QueueJobCache

        public QueueJobCache​(JobManagerConfiguration configuration,
                             String queueName,
                             StatisticsManager statisticsManager,
                             org.apache.sling.event.jobs.QueueConfiguration.Type queueType,
                             Set<String> topics)
        Create a new queue job cache
        Parameters:
        configuration - Current job manager configuration
        queueName - The queue name
        statisticsManager - The statistics manager
        queueType - The queue type
        topics - The topics handled by this queue.
    • Method Detail

      • getTopics

        public Set<String> getTopics()
        All topics of this queue.
        Returns:
        The topics.
      • isEmpty

        public boolean isEmpty()
        Check whether there are jobs for this queue
        Returns:
        true if there is any job outstanding.
      • setIsBlocked

        public void setIsBlocked​(boolean value)
      • handleNewTopics

        public void handleNewTopics​(Set<String> topics)
        Inform the queue cache about topics containing new jobs
        Parameters:
        topics - The set of topics to scan
      • reschedule

        public void reschedule​(String queueName,
                               JobHandler handler,
                               StatisticsManager statisticsManager)
        Reschedule a job Reschedule the job and add it back into the cache.
        Parameters:
        queueName - The queue name
        handler - The job handler
        statisticsManager - The statistics manager