Java Reference
In-Depth Information
Table 8.4 Possible values for the
ObjectName
parameter passed into the two query methods of an
MBean server
Possible value
Example
Description
Indicates that the query should be applied to all MBeans
in the MBean server
null
null
Complete object
name
String
Indicates that the query should be applied to only a single
MBean (the MBean that has the
ObjectName
instance
equal to the one passed to the query method)
HelloWorld:type=a
Partial object
name
String
Indicates that the query should be applied to all MBeans
whose
ObjectName
matches the partial
ObjectName
passed to the query method
Hello*:type=a,*
After examining the partial object name
String
in the previous table, you are
probably wondering what the rules are for specifying partial object names. The
following list contains the few rules for creating partial object names:
■
*
indicates a wildcard for any characters, including none at all.
■
?
represents any single character.
■
Key properties (such as
type=a
) must always be complete, but the wildcard
*
can appear in the list.
In other words, you can use wildcards anywhere in the domain name, but you
cannot use them in the value of a property in the property list. Just to clarify
these rules, a few examples are presented in the table 8.5.
Table 8.5
Further examples of partial object name values that conform to the pattern-matching rules
Partial object name value
Matching MBeans
All MBeans in the domain
HelloAgent
HelloAgent:*
All MBeans in the domain
HelloAgent
whose names have at
least the property
type=a
HelloAgent:type=a,*
All MBeans in any domain with the property
type=a
*:type=a
All MBeans in a domain that begins with
Hello
plus any three
characters and that has a property
type=a
Hello???:type=a
All MBeans
*:*
Once the scope of the query has defined a set of MBeans, the query will be applied
to each MBean in the set. The query will be applied to each MBean individually—
currently,
JMX
has no way of forming a query across multiple MBeans. A query