Package org.apache.activemq.broker.jmx
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 Summary
Constructors Constructor Description JobSchedulerView(JobScheduler jobScheduler)Creates a new instance of the JobScheduler management MBean.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TabularDatagetAllJobs()Get all the outstanding Jobs that are scheduled in this scheduler store.TabularDatagetAllJobs(String startTime, String finishTime)Get all outstanding jobs due to run between start and finish time range.intgetDelayedMessageCount()Get the number of delayed messages.intgetExecutionCount(String jobId)Gets the number of times a scheduled Job has been executed.TabularDatagetNextScheduleJobs()Get all the jobs scheduled to run next.StringgetNextScheduleTime()Get the next time jobs will be fired from this scheduler store.intgetScheduledMessageCount()Get the number of messages in the scheduler.voidremoveAllJobs()Remove all the Jobs from the scheduler,voidremoveAllJobs(String startTime, String finishTime)Remove all the Jobs from the scheduler that are due between the start and finish times.voidremoveAllJobsAtScheduledTime(String time)Remove all jobs scheduled to run at this time.voidremoveJob(String jobId)Remove a job with the matching jobId.
-
-
-
Constructor Detail
-
JobSchedulerView
public JobSchedulerView(JobScheduler jobScheduler)
Creates a new instance of the JobScheduler management MBean.- Parameters:
jobScheduler- The scheduler instance to manage.
-
-
Method Detail
-
getAllJobs
public TabularData getAllJobs() throws Exception
Description copied from interface:JobSchedulerViewMBeanGet all the outstanding Jobs that are scheduled in this scheduler store.- Specified by:
getAllJobsin interfaceJobSchedulerViewMBean- 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:JobSchedulerViewMBeanGet all outstanding jobs due to run between start and finish time range.- Specified by:
getAllJobsin interfaceJobSchedulerViewMBean- 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 ExceptionDescription copied from interface:JobSchedulerViewMBeanGet the number of delayed messages.- Specified by:
getDelayedMessageCountin interfaceJobSchedulerViewMBean- Returns:
- the number of delayed messages.
- Throws:
Exception- if an error occurs while querying the scheduler store.
-
getScheduledMessageCount
public int getScheduledMessageCount() throws ExceptionDescription copied from interface:JobSchedulerViewMBeanGet the number of messages in the scheduler.- Specified by:
getScheduledMessageCountin interfaceJobSchedulerViewMBean- 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:JobSchedulerViewMBeanGet all the jobs scheduled to run next.- Specified by:
getNextScheduleJobsin interfaceJobSchedulerViewMBean- 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:JobSchedulerViewMBeanGet the next time jobs will be fired from this scheduler store.- Specified by:
getNextScheduleTimein interfaceJobSchedulerViewMBean- 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 ExceptionDescription copied from interface:JobSchedulerViewMBeanRemove all the Jobs from the scheduler,- Specified by:
removeAllJobsin interfaceJobSchedulerViewMBean- Throws:
Exception- if an error occurs while purging the store.
-
removeAllJobs
public void removeAllJobs(String startTime, String finishTime) throws Exception
Description copied from interface:JobSchedulerViewMBeanRemove all the Jobs from the scheduler that are due between the start and finish times.- Specified by:
removeAllJobsin interfaceJobSchedulerViewMBean- 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:JobSchedulerViewMBeanRemove 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:
removeAllJobsAtScheduledTimein interfaceJobSchedulerViewMBean- 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:JobSchedulerViewMBeanRemove 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:
removeJobin interfaceJobSchedulerViewMBean- 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:JobSchedulerViewMBeanGets the number of times a scheduled Job has been executed.- Specified by:
getExecutionCountin interfaceJobSchedulerViewMBean- Returns:
- the total number of time a scheduled job has executed.
- Throws:
Exception- if an error occurs while querying for the Job.
-
-