org.apache.activemq.broker.scheduler
Interface JobScheduler

All Known Implementing Classes:
JobSchedulerFacade

public interface JobScheduler


Method Summary
 void addListener(JobListener l)
          Add a Job listener
 List<Job> getAllJobs()
          Get all the outstanding Jobs
 List<Job> getAllJobs(long start, long finish)
          Get all outstanding jobs due to run between start and finish
 String getName()
           
 List<Job> getNextScheduleJobs()
          Get all the jobs scheduled to run next
 long getNextScheduleTime()
          Get the next time jobs will be fired
 void remove(long time)
          remove all jobs scheduled to run at this time
 void remove(String jobId)
          remove a job with the matching jobId
 void removeAllJobs()
          remove all the Jobs from the scheduler
 void removeAllJobs(long start, long finish)
          remove all the Jobs from the scheduler that are due between the start and finish times
 void removeListener(JobListener l)
          remove a JobListener
 void schedule(String jobId, org.apache.kahadb.util.ByteSequence payload, long delay)
          Add a job to be scheduled
 void schedule(String jobId, org.apache.kahadb.util.ByteSequence payload, String cronEntry)
          Add a job to be scheduled
 void schedule(String jobId, org.apache.kahadb.util.ByteSequence payload, String cronEntry, long delay, long period, int repeat)
          Add a job to be scheduled
 

Method Detail

getName

String getName()
               throws Exception
Returns:
the name of the scheduler
Throws:
Exception

addListener

void addListener(JobListener l)
                 throws Exception
Add a Job listener

Parameters:
l -
Throws:
Exception

removeListener

void removeListener(JobListener l)
                    throws Exception
remove a JobListener

Parameters:
l -
Throws:
Exception

schedule

void schedule(String jobId,
              org.apache.kahadb.util.ByteSequence payload,
              long delay)
              throws Exception
Add a job to be scheduled

Parameters:
jobId - a unique identifier for the job
payload - the message to be sent when the job is scheduled
delay - the time in milliseconds before the job will be run
Throws:
Exception

schedule

void schedule(String jobId,
              org.apache.kahadb.util.ByteSequence payload,
              String cronEntry)
              throws Exception
Add a job to be scheduled

Parameters:
jobId - a unique identifier for the job
payload - the message to be sent when the job is scheduled
cronEntry - - cron entry
Throws:
Exception

schedule

void schedule(String jobId,
              org.apache.kahadb.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 job
payload - the message to be sent when the job is scheduled
cronEntry - - cron entry
delay - time in ms to wait before scheduling
period - the time in milliseconds between successive executions of the Job
repeat - the number of times to execute the job - less than 0 will be repeated forever
Throws:
Exception

remove

void remove(long time)
            throws Exception
remove all jobs scheduled to run at this time

Parameters:
time -
Throws:
Exception

remove

void remove(String jobId)
            throws Exception
remove a job with the matching jobId

Parameters:
jobId -
Throws:
Exception

removeAllJobs

void removeAllJobs()
                   throws Exception
remove all the Jobs from the scheduler

Throws:
Exception

removeAllJobs

void removeAllJobs(long start,
                   long finish)
                   throws Exception
remove all the Jobs from the scheduler that are due between the start and finish times

Parameters:
start - time in milliseconds
finish - time in milliseconds
Throws:
Exception

getNextScheduleTime

long getNextScheduleTime()
                         throws Exception
Get the next time jobs will be fired

Returns:
the time in milliseconds
Throws:
Exception

getNextScheduleJobs

List<Job> getNextScheduleJobs()
                              throws Exception
Get all the jobs scheduled to run next

Returns:
a list of jobs that will be scheduled next
Throws:
Exception

getAllJobs

List<Job> getAllJobs()
                     throws Exception
Get all the outstanding Jobs

Returns:
a list of all jobs
Throws:
Exception

getAllJobs

List<Job> getAllJobs(long start,
                     long finish)
                     throws Exception
Get all outstanding jobs due to run between start and finish

Parameters:
start -
finish -
Returns:
a list of jobs
Throws:
Exception


Copyright © 2005-2012 The Apache Software Foundation. All Rights Reserved.