This is an automated email from the ASF dual-hosted git repository.
jbonofre pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq.git
The following commit(s) were added to refs/heads/main by this push:
new 81e6b90ac [AMQ-9450] Expose Job Scheduler views with destination via
JMX
81e6b90ac is described below
commit 81e6b90ac8f4354279cb00356232bfde4ccd1f31
Author: Matt Pavlovich <[email protected]>
AuthorDate: Thu Mar 7 15:41:10 2024 -0600
[AMQ-9450] Expose Job Scheduler views with destination via JMX
---
.../activemq/broker/jmx/JobSchedulerView.java | 3 ++
.../activemq/broker/jmx/JobSchedulerViewMBean.java | 42 ++++++++++++++++++++++
2 files changed, 45 insertions(+)
diff --git
a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/JobSchedulerView.java
b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/JobSchedulerView.java
index b0695ada2..60a4bceaf 100644
---
a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/JobSchedulerView.java
+++
b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/JobSchedulerView.java
@@ -58,6 +58,7 @@ public class JobSchedulerView implements
JobSchedulerViewMBean {
return getAllJobs(false);
}
+ @Override
public TabularData getAllJobs(boolean includeDestinationName) throws
Exception {
OpenTypeFactory factory = OpenTypeSupport.getFactory(Job.class);
CompositeType ct = factory.getCompositeType();
@@ -81,6 +82,7 @@ public class JobSchedulerView implements
JobSchedulerViewMBean {
return getAllJobs(startTime, finishTime, false);
}
+ @Override
public TabularData getAllJobs(String startTime, String finishTime, boolean
includeDestinationName) throws Exception {
OpenTypeFactory factory = OpenTypeSupport.getFactory(Job.class);
CompositeType ct = factory.getCompositeType();
@@ -124,6 +126,7 @@ public class JobSchedulerView implements
JobSchedulerViewMBean {
return getNextScheduleJobs(false);
}
+ @Override
public TabularData getNextScheduleJobs(boolean includeDestinationName)
throws Exception {
OpenTypeFactory factory = OpenTypeSupport.getFactory(Job.class);
CompositeType ct = factory.getCompositeType();
diff --git
a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/JobSchedulerViewMBean.java
b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/JobSchedulerViewMBean.java
index 8649ca5b2..fafb57702 100644
---
a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/JobSchedulerViewMBean.java
+++
b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/JobSchedulerViewMBean.java
@@ -98,6 +98,19 @@ public interface JobSchedulerViewMBean {
@MBeanInfo("get the next job(s) to be scheduled. Not HTML friendly ")
public abstract TabularData getNextScheduleJobs() throws Exception;
+ /**
+ * Get all the jobs scheduled to run next.
+ *
+ * @param includeDestinationName
+ * include the destination name with the job metadata.
+ *
+ * @return a list of jobs that will be scheduled next
+ *
+ * @throws Exception if an error occurs while reading the scheduler store.
+ */
+ @MBeanInfo("get the next job(s) to be scheduled including the destination
name. Not HTML friendly ")
+ public abstract TabularData getNextScheduleJobs(boolean
includeDestinationName) throws Exception;
+
/**
* Get all the outstanding Jobs that are scheduled in this scheduler store.
*
@@ -108,6 +121,19 @@ public interface JobSchedulerViewMBean {
@MBeanInfo("get the scheduled Jobs in the Store. Not HTML friendly ")
public abstract TabularData getAllJobs() throws Exception;
+ /**
+ * Get all the outstanding Jobs that are scheduled in this scheduler store.
+ *
+ * @param includeDestinationName
+ * include the destination name with the job metadata.
+ *
+ * @return a table of all jobs in this scheduler store.
+ *
+ * @throws Exception if an error occurs while reading the store.
+ */
+ @MBeanInfo("get the scheduled Jobs in the Store including the destination
name. Not HTML friendly ")
+ public abstract TabularData getAllJobs(boolean includeDestinationName)
throws Exception;
+
/**
* Get all outstanding jobs due to run between start and finish time range.
*
@@ -123,6 +149,22 @@ public interface JobSchedulerViewMBean {
@MBeanInfo("get the scheduled Jobs in the Store within the time range. Not
HTML friendly ")
public abstract TabularData getAllJobs(@MBeanInfo("start: yyyy-MM-dd
hh:mm:ss")String start,@MBeanInfo("finish: yyyy-MM-dd hh:mm:ss")String
finish)throws Exception;
+ /**
+ * Get all outstanding jobs due to run between start and finish time range.
+ *
+ * @param start
+ * the starting time range to query the store for jobs.
+ * @param finish
+ * the ending time of this query for scheduled jobs.
+ * @param includeDestinationName
+ * include the destination name with the job metadata.
+ *
+ * @return a table of jobs in the range given.
+ *
+ * @throws Exception if an error occurs while querying the scheduler store.
+ */
+ @MBeanInfo("get the scheduled Jobs in the Store within the time range
including the destination name. Not HTML friendly ")
+ public abstract TabularData getAllJobs(@MBeanInfo("start: yyyy-MM-dd
hh:mm:ss")String startTime, @MBeanInfo("finish: yyyy-MM-dd hh:mm:ss")String
finishTime, boolean includeDestinationName) throws Exception;
/**
* Get the number of messages in the scheduler.
*