gnodet-bot commented on code in PR #27280:
URL: https://github.com/apache/camel/pull/27280#discussion_r4165689494
##########
core/camel-management/src/main/java/org/apache/camel/management/DefaultManagementAgent.java:
##########
@@ -379,6 +399,65 @@ public void unregister(ObjectName name) throws JMException
{
}
}
+ /**
+ * Gets the names of the registered processor mbeans that belong to the
given route.
+ * <p/>
+ * This avoids querying (and reading the route id of) every processor
mbean of the CamelContext, which is slow when
+ * there are many routes.
+ *
+ * @param routeId the route id
+ * @param steps whether to get the step mbeans, instead of the
processor mbeans
+ * @return the names the mbeans are registered with in the mbean
server, or an empty list
+ */
+ public List<ObjectName> getRouteProcessorMBeanNames(String routeId,
boolean steps) {
+ Set<ObjectName> names = (steps ? routeSteps :
routeProcessors).get(routeId);
+ return names != null ? new ArrayList<>(names) : new ArrayList<>();
+ }
+
+ /**
+ * Gets the managed object of the registered processor mbean with the
given id.
+ * <p/>
+ * This avoids walking every route to find the processor and its
definition, which is slow when there are many
+ * routes.
+ *
+ * @param id the processor id
+ * @param steps whether to get a step mbean, instead of a processor mbean
+ * @return the managed object, or <tt>null</tt> if no such mbean is
registered
Review Comment:
💡 **Nit:** `<tt>` is deprecated HTML. Consider `{@code null}` instead:
```suggestion
* @return the managed object, or {@code null} if no such mbean is
registered
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]