org.apache.sling.event.impl.jobs.queues
Class TopicRoundRobinJobQueue

java.lang.Object
  extended by org.apache.sling.event.impl.jobs.StatisticsImpl
      extended by org.apache.sling.event.impl.jobs.queues.AbstractJobQueue
          extended by org.apache.sling.event.impl.jobs.queues.AbstractParallelJobQueue
              extended by org.apache.sling.event.impl.jobs.queues.TopicRoundRobinJobQueue
All Implemented Interfaces:
JobStatusNotifier, Queue, Statistics

public final class TopicRoundRobinJobQueue
extends AbstractParallelJobQueue

This queue acts similar to the parallel job queue. Except that new jobs are selected based on a round robin topic selection scheme. Failing jobs are rescheduled and put at the end of the queue.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.sling.event.impl.jobs.JobStatusNotifier
JobStatusNotifier.NotifierContext
 
Field Summary
 
Fields inherited from class org.apache.sling.event.impl.jobs.queues.AbstractParallelJobQueue
jobCount
 
Fields inherited from class org.apache.sling.event.impl.jobs.queues.AbstractJobQueue
configuration, isWaiting, logger, queueName, running
 
Fields inherited from interface org.apache.sling.event.impl.jobs.JobStatusNotifier
CONTEXT_PROPERTY_NAME
 
Constructor Summary
TopicRoundRobinJobQueue(String name, InternalQueueConfiguration config, EnvironmentComponent env, Scheduler scheduler)
           
 
Method Summary
protected  boolean canBeMarkedForRemoval()
           
 void clear()
          Remove all outstanding jobs from the queue.
 String getStateInfo()
          Return some information about the current state of the queue.
protected  boolean isEmpty()
          Is the queue empty?
protected  void put(JobEvent event)
          Put another job into the queue.
protected  Collection<JobEvent> removeAllJobs()
          Remove all events from the queue and return them.
protected  JobEvent take()
          Get another job from the queue.
 
Methods inherited from class org.apache.sling.event.impl.jobs.queues.AbstractParallelJobQueue
notifyFinished, reschedule, start
 
Methods inherited from class org.apache.sling.event.impl.jobs.queues.AbstractJobQueue
checkForUnprocessedJobs, close, executeJob, finishedJob, getConfiguration, getName, getState, getStatistics, ignoreException, isMarkedForRemoval, isSuspended, markForRemoval, process, removeAll, rename, resume, sendAcknowledge, start, suspend
 
Methods inherited from class org.apache.sling.event.impl.jobs.StatisticsImpl
add, addActive, cancelledJob, clearQueued, copyFrom, decQueued, failedJob, finishedJob, getAverageProcessingTime, getAverageWaitingTime, getLastActivatedJobTime, getLastFinishedJobTime, getNumberOfActiveJobs, getNumberOfCancelledJobs, getNumberOfFailedJobs, getNumberOfFinishedJobs, getNumberOfJobs, getNumberOfProcessedJobs, getNumberOfQueuedJobs, getStartTime, incQueued, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TopicRoundRobinJobQueue

public TopicRoundRobinJobQueue(String name,
                               InternalQueueConfiguration config,
                               EnvironmentComponent env,
                               Scheduler scheduler)
Method Detail

getStateInfo

public String getStateInfo()
Description copied from interface: Queue
Return some information about the current state of the queue. This method is meant to see the internal state of the queue for debugging or monitoring purposes.

Specified by:
getStateInfo in interface Queue
Overrides:
getStateInfo in class AbstractParallelJobQueue
See Also:
Queue.getStateInfo()

canBeMarkedForRemoval

protected boolean canBeMarkedForRemoval()
Overrides:
canBeMarkedForRemoval in class AbstractParallelJobQueue

put

protected void put(JobEvent event)
Description copied from class: AbstractJobQueue
Put another job into the queue.

Specified by:
put in class AbstractJobQueue

take

protected JobEvent take()
Description copied from class: AbstractJobQueue
Get another job from the queue.

Specified by:
take in class AbstractJobQueue

isEmpty

protected boolean isEmpty()
Description copied from class: AbstractJobQueue
Is the queue empty?

Specified by:
isEmpty in class AbstractJobQueue

clear

public void clear()
Description copied from interface: Queue
Remove all outstanding jobs from the queue. This does not delete the jobs. The jobs are either processed by a different cluster node or on restart.

Specified by:
clear in interface Queue
Overrides:
clear in class AbstractJobQueue
See Also:
Queue.clear()

removeAllJobs

protected Collection<JobEvent> removeAllJobs()
Description copied from class: AbstractJobQueue
Remove all events from the queue and return them.

Specified by:
removeAllJobs in class AbstractJobQueue


Copyright © 2007-2013 The Apache Software Foundation. All Rights Reserved.