Can't access mbean when objectname uses a wildcard
As far as I know, ObjectName
does not handle any wildcard patterns with the invoke
method. You are going to have to use the myMBeanServer.queryNames(...)
method to find the beans that match your pattern. Then you can call invoke
with the specific name.
Set<ObjectName> nameSet = myMBeanServer.queryNames(new ObjectName(
"UnifiedSystem-search Cluster Control *:class=myclass"), null);
// then use the first name from the set
// some error checking is needed here to make sure there is a name in the set
myMBeanServer.invoke(nameSet.iterator().next(), "areAlertsSuppressed")