Package org.jobrunr.scheduling
Class AbstractJobScheduler
java.lang.Object
org.jobrunr.scheduling.AbstractJobScheduler
- Direct Known Subclasses:
JobRequestScheduler
,JobScheduler
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractJobScheduler
(StorageProvider storageProvider, List<JobFilter> jobFilters) Creates a new AbstractJobScheduler using the provided storageProvider and the list of JobFilters that will be used for every background job -
Method Summary
Modifier and TypeMethodDescriptionvoid
Deletes the recurring job based on the given id.void
Deletes a job and sets its state to DELETED.void
Deletes a job and sets its state to DELETED.void
void
void
shutdown()
Utility method to register the shutdown of JobRunr in various containers - it is even automatically called by Spring Framework.
-
Constructor Details
-
AbstractJobScheduler
Creates a new AbstractJobScheduler using the provided storageProvider and the list of JobFilters that will be used for every background job- Parameters:
storageProvider
- the storageProvider to usejobFilters
- list of jobFilters that will be used for every job
-
-
Method Details
-
delete
- See Also:
-
delete
- See Also:
-
delete
Deletes a job and sets its state to DELETED. If the job is being processed, it will be interrupted.- Parameters:
id
- the id of the job
-
delete
Deletes a job and sets its state to DELETED. If the job is being processed, it will be interrupted.- Parameters:
id
- the id of the jobreason
- the reason why the job is deleted.
-
delete
Deletes the recurring job based on the given id.An example:
jobScheduler.delete("my-recurring-job"));
- Parameters:
id
- the id of the recurring job to delete
-
shutdown
public void shutdown()Utility method to register the shutdown of JobRunr in various containers - it is even automatically called by Spring Framework. Note that this will stop the BackgroundJobServer, the Dashboard and the StorageProvider. JobProcessing will stop and enqueueing new jobs will fail.
-