org.apache.activemq.broker.scheduler
Class JobSchedulerFacade

java.lang.Object
  extended by org.apache.activemq.broker.scheduler.JobSchedulerFacade
All Implemented Interfaces:
JobScheduler

public class JobSchedulerFacade
extends Object
implements 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, ByteSequence payload, long delay)
          Add a job to be scheduled
 void schedule(String jobId, ByteSequence payload, String cronEntry)
          Add a job to be scheduled
 void schedule(String jobId, ByteSequence payload, String cronEntry, long start, long period, int repeat)
          Add a job to be scheduled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addListener

public void addListener(JobListener l)
                 throws Exception
Description copied from interface: JobScheduler
Add a Job listener

Specified by:
addListener in interface JobScheduler
Throws:
Exception

getAllJobs

public List<Job> getAllJobs()
                     throws Exception
Description copied from interface: JobScheduler
Get all the outstanding Jobs

Specified by:
getAllJobs in interface JobScheduler
Returns:
a list of all jobs
Throws:
Exception

getAllJobs

public List<Job> getAllJobs(long start,
                            long finish)
                     throws Exception
Description copied from interface: JobScheduler
Get all outstanding jobs due to run between start and finish

Specified by:
getAllJobs in interface JobScheduler
Returns:
a list of jobs
Throws:
Exception

getName

public String getName()
               throws Exception
Specified by:
getName in interface JobScheduler
Returns:
the name of the scheduler
Throws:
Exception

getNextScheduleJobs

public List<Job> getNextScheduleJobs()
                              throws Exception
Description copied from interface: JobScheduler
Get all the jobs scheduled to run next

Specified by:
getNextScheduleJobs in interface JobScheduler
Returns:
a list of jobs that will be scheduled next
Throws:
Exception

getNextScheduleTime

public long getNextScheduleTime()
                         throws Exception
Description copied from interface: JobScheduler
Get the next time jobs will be fired

Specified by:
getNextScheduleTime in interface JobScheduler
Returns:
the time in milliseconds
Throws:
Exception

remove

public void remove(long time)
            throws Exception
Description copied from interface: JobScheduler
remove all jobs scheduled to run at this time

Specified by:
remove in interface JobScheduler
Throws:
Exception

remove

public void remove(String jobId)
            throws Exception
Description copied from interface: JobScheduler
remove a job with the matching jobId

Specified by:
remove in interface JobScheduler
Throws:
Exception

removeAllJobs

public void removeAllJobs()
                   throws Exception
Description copied from interface: JobScheduler
remove all the Jobs from the scheduler

Specified by:
removeAllJobs in interface JobScheduler
Throws:
Exception

removeAllJobs

public void removeAllJobs(long start,
                          long finish)
                   throws Exception
Description copied from interface: JobScheduler
remove all the Jobs from the scheduler that are due between the start and finish times

Specified by:
removeAllJobs in interface JobScheduler
Parameters:
start - time in milliseconds
finish - time in milliseconds
Throws:
Exception

removeListener

public void removeListener(JobListener l)
                    throws Exception
Description copied from interface: JobScheduler
remove a JobListener

Specified by:
removeListener in interface JobScheduler
Throws:
Exception

schedule

public void schedule(String jobId,
                     ByteSequence payload,
                     long delay)
              throws Exception
Description copied from interface: JobScheduler
Add a job to be scheduled

Specified by:
schedule in interface JobScheduler
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

public void schedule(String jobId,
                     ByteSequence payload,
                     String cronEntry,
                     long start,
                     long period,
                     int repeat)
              throws Exception
Description copied from interface: JobScheduler
Add a job to be scheduled

Specified by:
schedule in interface JobScheduler
Parameters:
jobId - a unique identifier for the job
payload - the message to be sent when the job is scheduled
cronEntry - - cron entry
start - 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

schedule

public void schedule(String jobId,
                     ByteSequence payload,
                     String cronEntry)
              throws Exception
Description copied from interface: JobScheduler
Add a job to be scheduled

Specified by:
schedule in interface JobScheduler
Parameters:
jobId - a unique identifier for the job
payload - the message to be sent when the job is scheduled
cronEntry - - cron entry
Throws:
Exception


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