The JMXMonitor only supports literal ObjectNames, which makes it difficult to handle some mbeans. Many mbeans, including those for Quartz Scheduler and ActiveMQ, include instance-specific keys in their names, for example:
The code in ObjectNameWrapper, however, throws an IllegalArgumentException if any pattern is used, even if that pattern would only match a single bean.
Instead, I'd suggest that the code should allow patterns, and should instead throw some sort of exception if the pattern matches more than one bean.
The
JMXMonitor
only supports literal ObjectNames, which makes it difficult to handle some mbeans. Many mbeans, including those for Quartz Scheduler and ActiveMQ, include instance-specific keys in their names, for example:org.apache.activemq:type=Broker,service=Health,brokerName=foo.example.com
quartz:type=QuartzScheduler,name=MY_SCHEDULER,instance=foo.example.com12345678
The code in
ObjectNameWrapper
, however, throws anIllegalArgumentException
if any pattern is used, even if that pattern would only match a single bean.Instead, I'd suggest that the code should allow patterns, and should instead throw some sort of exception if the pattern matches more than one bean.
See also: