Package org.apache.sling.event.impl.jobs
Class JobManagerImpl
java.lang.Object
org.apache.sling.event.impl.jobs.JobManagerImpl
- All Implemented Interfaces:
Runnable
,org.apache.sling.event.jobs.JobManager
,org.osgi.service.event.EventHandler
public class JobManagerImpl
extends Object
implements org.apache.sling.event.jobs.JobManager, org.osgi.service.event.EventHandler, Runnable
Implementation of the job manager.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.sling.event.jobs.JobManager
org.apache.sling.event.jobs.JobManager.QueryType
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Activate this component.org.apache.sling.event.jobs.Job
org.apache.sling.event.jobs.Job
Internal method to add a jobprotected static String
buildBaseQuery
(String queryRoot, String topic, org.apache.sling.event.jobs.JobManager.QueryType type, boolean isHistoryQuery) org.apache.sling.event.jobs.JobBuilder
protected void
Deactivate this component.Collection<org.apache.sling.event.jobs.Job>
findJobs
(org.apache.sling.event.jobs.JobManager.QueryType type, String topic, long limit, Map<String, Object>... templates) org.apache.sling.event.jobs.Job
org.apache.sling.event.jobs.Job
getJobById
(String id) org.apache.sling.event.jobs.Queue
Iterable<org.apache.sling.event.jobs.Queue>
Collection<org.apache.sling.event.jobs.ScheduledJobInfo>
Collection<org.apache.sling.event.jobs.ScheduledJobInfo>
getScheduledJobs
(String topic, long limit, Map<String, Object>... templates) org.apache.sling.event.jobs.Statistics
Return our internal statistics object.Iterable<org.apache.sling.event.jobs.TopicStatistics>
void
handleEvent
(org.osgi.service.event.Event event) boolean
removeJobById
(String jobId) org.apache.sling.event.jobs.Job
retryJobById
(String jobId) void
run()
This method is invoked periodically by the scheduler.void
stopJobById
(String jobId)
-
Constructor Details
-
JobManagerImpl
public JobManagerImpl()
-
-
Method Details
-
activate
protected void activate(org.osgi.framework.BundleContext ctx, Map<String, Object> props) throws LoginExceptionActivate this component.- Parameters:
props
- Configuration properties- Throws:
LoginException
-
deactivate
protected void deactivate()Deactivate this component. -
run
public void run()This method is invoked periodically by the scheduler. In the default configuration every minute -
handleEvent
public void handleEvent(org.osgi.service.event.Event event) - Specified by:
handleEvent
in interfaceorg.osgi.service.event.EventHandler
- See Also:
-
EventHandler.handleEvent(org.osgi.service.event.Event)
-
getStatistics
public org.apache.sling.event.jobs.Statistics getStatistics()Return our internal statistics object.- Specified by:
getStatistics
in interfaceorg.apache.sling.event.jobs.JobManager
- See Also:
-
JobManager.getStatistics()
-
getTopicStatistics
- Specified by:
getTopicStatistics
in interfaceorg.apache.sling.event.jobs.JobManager
- See Also:
-
JobManager.getTopicStatistics()
-
getQueue
- Specified by:
getQueue
in interfaceorg.apache.sling.event.jobs.JobManager
- See Also:
-
JobManager.getQueue(java.lang.String)
-
getQueues
- Specified by:
getQueues
in interfaceorg.apache.sling.event.jobs.JobManager
- See Also:
-
JobManager.getQueues()
-
addJob
- Specified by:
addJob
in interfaceorg.apache.sling.event.jobs.JobManager
- See Also:
-
JobManager.addJob(java.lang.String, java.util.Map)
-
getJobById
- Specified by:
getJobById
in interfaceorg.apache.sling.event.jobs.JobManager
- See Also:
-
JobManager.getJobById(java.lang.String)
-
getJob
- Specified by:
getJob
in interfaceorg.apache.sling.event.jobs.JobManager
- See Also:
-
JobManager.getJob(java.lang.String, java.util.Map)
-
removeJobById
- Specified by:
removeJobById
in interfaceorg.apache.sling.event.jobs.JobManager
- See Also:
-
JobManager.removeJobById(java.lang.String)
-
findJobs
public Collection<org.apache.sling.event.jobs.Job> findJobs(org.apache.sling.event.jobs.JobManager.QueryType type, String topic, long limit, Map<String, Object>... templates) - Specified by:
findJobs
in interfaceorg.apache.sling.event.jobs.JobManager
- See Also:
-
JobManager.findJobs(org.apache.sling.event.jobs.JobManager.QueryType, java.lang.String, long, java.util.Map[])
-
buildBaseQuery
-
stopJobById
- Specified by:
stopJobById
in interfaceorg.apache.sling.event.jobs.JobManager
- See Also:
-
JobManager.stopJobById(java.lang.String)
-
createJob
- Specified by:
createJob
in interfaceorg.apache.sling.event.jobs.JobManager
- See Also:
-
JobManager.createJob(java.lang.String)
-
getScheduledJobs
- Specified by:
getScheduledJobs
in interfaceorg.apache.sling.event.jobs.JobManager
- See Also:
-
JobManager.getScheduledJobs()
-
getScheduledJobs
public Collection<org.apache.sling.event.jobs.ScheduledJobInfo> getScheduledJobs(String topic, long limit, Map<String, Object>... templates) - Specified by:
getScheduledJobs
in interfaceorg.apache.sling.event.jobs.JobManager
- See Also:
-
JobManager.getScheduledJobs()
-
addJob
public org.apache.sling.event.jobs.Job addJob(String topic, Map<String, Object> properties, List<String> errors) Internal method to add a job -
retryJobById
- Specified by:
retryJobById
in interfaceorg.apache.sling.event.jobs.JobManager
- See Also:
-
JobManager.retryJobById(java.lang.String)
-
getJobScheduler
-