Interface IJobSchedulerService
public interface IJobSchedulerService
Job scheduler service.
Runs jobs at certain times and intervals.
- Version:
- $Revision$ $Date$
- Author:
- Stepan Roh, Polarion Software
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturn all scheduled jobs.getJobSchedules
(IContextId scope) Return all scheduled jobs which have given scope.boolean
Whether the scheduler is running.scheduleImmediately
(JobExecutionRequest request) Immediately schedule job for execution.void
Start scheduler.void
Stop scheduler.
-
Method Details
-
startScheduler
Start scheduler.Jobs which were scheduled at the time the scheduler was stopped ARE NOT executed out-of-order.
Scheduler is started after initialization.
- Throws:
GenericJobException
- if error occurs
-
stopScheduler
Stop scheduler.- Throws:
GenericJobException
- if error occurs.
-
isSchedulerRunning
boolean isSchedulerRunning()Whether the scheduler is running.- Returns:
true
if scheduler is running,false
otherwise
-
getJobSchedules
Collection<JobSchedule> getJobSchedules()Return all scheduled jobs.Works even if the scheduler is stopped.
- Returns:
Collection
ofJobSchedule
s (notnull
)
-
getJobSchedules
Return all scheduled jobs which have given scope.Works even if the scheduler is stopped.
- Parameters:
scope
- job scope (can benull
)- Returns:
Collection
ofJobSchedule
s (notnull
)
-
scheduleImmediately
Immediately schedule job for execution.Job is both spawned (
IJobManager.spawnJob(com.polarion.platform.jobs.IJobUnit, IJob)
) and scheduled (IJob.schedule()
).Executed job will not be visible in
getJobSchedules()
.- Parameters:
request
- job execution request- Returns:
- executed job (not
null
) - Throws:
GenericJobException
- if error occursIllegalArgumentException
- if request ifnull
-