Class JobQueueImpl
java.lang.Object
org.apache.sling.event.impl.jobs.queues.JobQueueImpl
- All Implemented Interfaces:
org.apache.sling.event.jobs.Queue
The job blocking queue extends the blocking queue by some
functionality for the job event handling.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close this queue.static JobQueueImpl
createQueue
(String name, InternalQueueConfiguration config, QueueServices services, Set<String> topics, Set<String> haltedTopicsBackRef, org.apache.sling.event.impl.jobs.queues.OutdatedJobQueueInfo outdatedQueueInfo) Create a new queue.Return the queue configurationgetName()
Get the name of the job queue.org.apache.sling.event.jobs.Statistics
boolean
void
maintain()
Periodic maintenancevoid
outdate()
Outdate this queue.void
void
resume()
void
Start the job queue.boolean
void
suspend()
boolean
Check if the queue can be closedvoid
wakeUpQueue
(Set<String> topics) Inform the queue about new job for the given topics.
-
Method Details
-
createQueue
public static JobQueueImpl createQueue(String name, InternalQueueConfiguration config, QueueServices services, Set<String> topics, Set<String> haltedTopicsBackRef, org.apache.sling.event.impl.jobs.queues.OutdatedJobQueueInfo outdatedQueueInfo) Create a new queue.- Parameters:
name
- The queue nameconfig
- The queue configurationservices
- The queue servicestopics
- The topics handled by this queueoutdatedQueueInfo
-haltedTopicsBackRef
- reference to pass newly halted topics back- Returns:
JobQueueImpl
if there are jobs to process,null
otherwise.
-
getConfiguration
Return the queue configuration- Specified by:
getConfiguration
in interfaceorg.apache.sling.event.jobs.Queue
-
getName
Get the name of the job queue.- Specified by:
getName
in interfaceorg.apache.sling.event.jobs.Queue
-
getStatistics
public org.apache.sling.event.jobs.Statistics getStatistics()- Specified by:
getStatistics
in interfaceorg.apache.sling.event.jobs.Queue
- See Also:
-
Queue.getStatistics()
-
startJobs
public void startJobs()Start the job queue. This method might be called concurrently, therefore we use a guard -
outdate
public void outdate()Outdate this queue. -
tryToClose
public boolean tryToClose()Check if the queue can be closed -
close
public void close()Close this queue. -
maintain
public void maintain()Periodic maintenance -
wakeUpQueue
Inform the queue about new job for the given topics.- Parameters:
topics
- the new topics
-
resume
public void resume()- Specified by:
resume
in interfaceorg.apache.sling.event.jobs.Queue
- See Also:
-
Queue.resume()
-
suspend
public void suspend()- Specified by:
suspend
in interfaceorg.apache.sling.event.jobs.Queue
- See Also:
-
Queue.suspend()
-
isSuspended
public boolean isSuspended()- Specified by:
isSuspended
in interfaceorg.apache.sling.event.jobs.Queue
- See Also:
-
Queue.isSuspended()
-
removeAll
public void removeAll()- Specified by:
removeAll
in interfaceorg.apache.sling.event.jobs.Queue
- See Also:
-
Queue.removeAll()
-
getState
- Specified by:
getState
in interfaceorg.apache.sling.event.jobs.Queue
- See Also:
-
Queue.getState(java.lang.String)
-
getStateInfo
- Specified by:
getStateInfo
in interfaceorg.apache.sling.event.jobs.Queue
- See Also:
-
Queue.getStateInfo()
-
stopJob
-