Class JobSchedulerView

java.lang.Object
org.apache.activemq.broker.jmx.JobSchedulerView
All Implemented Interfaces:
JobSchedulerViewMBean

public class JobSchedulerView extends Object implements JobSchedulerViewMBean
MBean object that can be used to manage a single instance of a JobScheduler. The object provides methods for querying for jobs and removing some or all of the jobs that are scheduled in the managed store.
  • Constructor Details

    • JobSchedulerView

      public JobSchedulerView(JobScheduler jobScheduler)
      Creates a new instance of the JobScheduler management MBean.
      Parameters:
      jobScheduler - The scheduler instance to manage.
  • Method Details

    • getAllJobs

      public TabularData getAllJobs() throws Exception
      Description copied from interface: JobSchedulerViewMBean
      Get all the outstanding Jobs that are scheduled in this scheduler store.
      Specified by:
      getAllJobs in interface JobSchedulerViewMBean
      Returns:
      a table of all jobs in this scheduler store.
      Throws:
      Exception - if an error occurs while reading the store.
    • getAllJobs

      public TabularData getAllJobs(String startTime, String finishTime) throws Exception
      Description copied from interface: JobSchedulerViewMBean
      Get all outstanding jobs due to run between start and finish time range.
      Specified by:
      getAllJobs in interface JobSchedulerViewMBean
      Parameters:
      startTime - the starting time range to query the store for jobs.
      finishTime - the ending time of this query for scheduled jobs.
      Returns:
      a table of jobs in the range given.
      Throws:
      Exception - if an error occurs while querying the scheduler store.
    • getDelayedMessageCount

      public int getDelayedMessageCount() throws Exception
      Description copied from interface: JobSchedulerViewMBean
      Get the number of delayed messages.
      Specified by:
      getDelayedMessageCount in interface JobSchedulerViewMBean
      Returns:
      the number of delayed messages.
      Throws:
      Exception - if an error occurs while querying the scheduler store.
    • getScheduledMessageCount

      public int getScheduledMessageCount() throws Exception
      Description copied from interface: JobSchedulerViewMBean
      Get the number of messages in the scheduler.
      Specified by:
      getScheduledMessageCount in interface JobSchedulerViewMBean
      Returns:
      the number of messages in the scheduler.
      Throws:
      Exception - if an error occurs while querying the scheduler store.
    • getNextScheduleJobs

      public TabularData getNextScheduleJobs() throws Exception
      Description copied from interface: JobSchedulerViewMBean
      Get all the jobs scheduled to run next.
      Specified by:
      getNextScheduleJobs in interface JobSchedulerViewMBean
      Returns:
      a list of jobs that will be scheduled next
      Throws:
      Exception - if an error occurs while reading the scheduler store.
    • getNextScheduleTime

      public String getNextScheduleTime() throws Exception
      Description copied from interface: JobSchedulerViewMBean
      Get the next time jobs will be fired from this scheduler store.
      Specified by:
      getNextScheduleTime in interface JobSchedulerViewMBean
      Returns:
      the time in milliseconds of the next job to execute.
      Throws:
      Exception - if an error occurs while accessing the store.
    • removeAllJobs

      public void removeAllJobs() throws Exception
      Description copied from interface: JobSchedulerViewMBean
      Remove all the Jobs from the scheduler,
      Specified by:
      removeAllJobs in interface JobSchedulerViewMBean
      Throws:
      Exception - if an error occurs while purging the store.
    • removeAllJobs

      public void removeAllJobs(String startTime, String finishTime) throws Exception
      Description copied from interface: JobSchedulerViewMBean
      Remove all the Jobs from the scheduler that are due between the start and finish times.
      Specified by:
      removeAllJobs in interface JobSchedulerViewMBean
      Parameters:
      startTime - the starting time to remove jobs from.
      finishTime - the finish time for the remove operation.
      Throws:
      Exception - if an error occurs while attempting to remove the jobs.
    • removeAllJobsAtScheduledTime

      public void removeAllJobsAtScheduledTime(String time) throws Exception
      Description copied from interface: JobSchedulerViewMBean
      Remove all jobs scheduled to run at this time. If there are no jobs scheduled at the given time this methods returns without making any modifications to the scheduler store.
      Specified by:
      removeAllJobsAtScheduledTime in interface JobSchedulerViewMBean
      Parameters:
      time - the string formated time that should be used to remove jobs.
      Throws:
      Exception - if an error occurs while performing the remove.
    • removeJob

      public void removeJob(String jobId) throws Exception
      Description copied from interface: JobSchedulerViewMBean
      Remove a job with the matching jobId. If the method does not find a matching job then it returns without throwing an error or making any modifications to the job scheduler store.
      Specified by:
      removeJob in interface JobSchedulerViewMBean
      Parameters:
      jobId - the Job Id to remove from the scheduler store.
      Throws:
      Exception - if an error occurs while attempting to remove the Job.
    • getExecutionCount

      public int getExecutionCount(String jobId) throws Exception
      Description copied from interface: JobSchedulerViewMBean
      Gets the number of times a scheduled Job has been executed.
      Specified by:
      getExecutionCount in interface JobSchedulerViewMBean
      Returns:
      the total number of time a scheduled job has executed.
      Throws:
      Exception - if an error occurs while querying for the Job.