public class JobSchedulerImpl extends Object implements org.osgi.service.event.EventHandler, ConfigurationChangeListener, org.apache.sling.commons.scheduler.Job
Constructor and Description |
---|
JobSchedulerImpl(JobManagerConfiguration configuration,
org.apache.sling.commons.scheduler.Scheduler scheduler,
JobManagerImpl jobManager)
Create the scheduler
|
Modifier and Type | Method and Description |
---|---|
ScheduledJobInfo |
addScheduledJob(String topic,
Map<String,Object> properties,
String scheduleName,
boolean isSuspended,
List<ScheduleInfoImpl> scheduleInfos,
List<String> errors)
Add a scheduled job
|
void |
configurationChanged(boolean processingActive)
Notify about a configuration change.
|
JobBuilder.ScheduleBuilder |
createJobBuilder(ScheduledJobInfoImpl info)
Create a schedule builder for a currently scheduled job
|
void |
deactivate()
Deactivate this component.
|
void |
execute(org.apache.sling.commons.scheduler.JobContext context) |
Collection<ScheduledJobInfo> |
getScheduledJobs(String topic,
long limit,
Map<String,Object>... templates)
Get all scheduled jobs
|
void |
handleEvent(org.osgi.service.event.Event event) |
void |
maintenance() |
void |
scheduleJob(ScheduledJobInfoImpl info)
Add a scheduled job
|
void |
setSuspended(ScheduledJobInfoImpl info,
boolean flag)
Change the suspended flag for a scheduled job
|
void |
unscheduleJob(ScheduledJobInfoImpl info)
Remove a scheduled job
|
public JobSchedulerImpl(JobManagerConfiguration configuration, org.apache.sling.commons.scheduler.Scheduler scheduler, JobManagerImpl jobManager)
configuration
- Central job manager configurationscheduler
- The scheduler servicejobManager
- The job managerpublic void deactivate()
public void configurationChanged(boolean processingActive)
ConfigurationChangeListener
configurationChanged
in interface ConfigurationChangeListener
processingActive
- true
if job processing is active, otherwise false
ConfigurationChangeListener.configurationChanged(boolean)
public void scheduleJob(ScheduledJobInfoImpl info)
public void unscheduleJob(ScheduledJobInfoImpl info)
public void execute(org.apache.sling.commons.scheduler.JobContext context)
execute
in interface org.apache.sling.commons.scheduler.Job
Job.execute(org.apache.sling.commons.scheduler.JobContext)
public void handleEvent(org.osgi.service.event.Event event)
handleEvent
in interface org.osgi.service.event.EventHandler
EventHandler.handleEvent(org.osgi.service.event.Event)
public JobBuilder.ScheduleBuilder createJobBuilder(ScheduledJobInfoImpl info)
public Collection<ScheduledJobInfo> getScheduledJobs(String topic, long limit, Map<String,Object>... templates)
public void setSuspended(ScheduledJobInfoImpl info, boolean flag)
info
- The schedule infoflag
- The corresponding flagpublic ScheduledJobInfo addScheduledJob(String topic, Map<String,Object> properties, String scheduleName, boolean isSuspended, List<ScheduleInfoImpl> scheduleInfos, List<String> errors)
topic
- The job topicproperties
- The job propertiesscheduleName
- The schedule nameisSuspended
- Whether it is suspendedscheduleInfos
- The scheduling informationerrors
- Optional list to contain potential errorsnull
public void maintenance()
Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.