Interface JobScheduler
- All Known Implementing Classes:
InMemoryJobScheduler, JobSchedulerFacade
public interface JobScheduler
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(JobListener listener) Add a Job listener which will receive events related to scheduled jobs.Get all the outstanding JobsgetAllJobs(long start, long finish) Get all outstanding jobs due to run between start and finishgetName()Get all the jobs scheduled to run nextlongGet the next time jobs will be firedvoidremove(long time) remove all jobs scheduled to run at this timevoidremove a job with the matching jobIdvoidremove all the Jobs from the schedulervoidremoveAllJobs(long start, long finish) remove all the Jobs from the scheduler that are due between the start and finish timesvoidremoveListener(JobListener listener) remove a JobListener that was previously registered.voidAdd a job to be scheduledvoidAdd a job to be scheduledvoidschedule(String jobId, org.apache.activemq.util.ByteSequence payload, String cronEntry, long delay, long period, int repeat) Add a job to be scheduledvoidStarts dispatch of scheduled Jobs to registered listeners.voidStops dispatching of scheduled Jobs to registered listeners.
-
Method Details
-
getName
-
startDispatching
-
stopDispatching
-
addListener
Add a Job listener which will receive events related to scheduled jobs.- Parameters:
listener- The job listener to add.- Throws:
Exception
-
removeListener
remove a JobListener that was previously registered. If the given listener is not in the registry this method has no effect.- Parameters:
listener- The listener that should be removed from the listener registry.- Throws:
Exception
-
schedule
void schedule(String jobId, org.apache.activemq.util.ByteSequence payload, long delay) throws Exception Add a job to be scheduled- Parameters:
jobId- a unique identifier for the jobpayload- the message to be sent when the job is scheduleddelay- the time in milliseconds before the job will be run- Throws:
Exception- if an error occurs while scheduling the Job.
-
schedule
void schedule(String jobId, org.apache.activemq.util.ByteSequence payload, String cronEntry) throws Exception Add a job to be scheduled- Parameters:
jobId- a unique identifier for the jobpayload- the message to be sent when the job is scheduledcronEntry- The cron entry to use to schedule this job.- Throws:
Exception- if an error occurs while scheduling the Job.
-
schedule
void schedule(String jobId, org.apache.activemq.util.ByteSequence payload, String cronEntry, long delay, long period, int repeat) throws Exception Add a job to be scheduled- Parameters:
jobId- a unique identifier for the jobpayload- the message to be sent when the job is scheduledcronEntry- cron entrydelay- time in ms to wait before schedulingperiod- the time in milliseconds between successive executions of the Jobrepeat- the number of times to execute the job - less than 0 will be repeated forever- Throws:
Exception
-
remove
-
remove
-
removeAllJobs
-
removeAllJobs
-
getNextScheduleTime
-
getNextScheduleJobs
-
getAllJobs
-
getAllJobs
-