Java Reference
In-Depth Information
The Object instantiate( String classname ) method
The MBeanServer interface also declares four instantiate() methods. Each
accepts different parameters, but the result of each is an instance of the supplied
classname. The result is returned as an instance of the Object class. This method
can be used to create objects from classnames instead of using reflection code in
your own MBeans.
8.3 Querying for MBeans
In a real-world situation, you may have a JMX agent that contains many MBeans.
Consider a JMX agent that contains MBeans for a set of applications, each of
which registers 10 MBeans in the agent. You could easily have 40 to 50 MBeans
residing in a single agent. If you need to work with the MBeans for a particular
application, you might not want to sort through the other applications' MBeans.
In essence, when you interact with the agent through a management application,
you could have some trouble viewing only the MBeans you need.
Even if you can filter the MBeans by their object names, you still might want
to further restrict your MBean view by attribute values. For example, maybe each
of the MBeans for an application has an identical attribute whose value indicates
the component of the application that the MBean manages. It would be nice to
be able to view just the specific MBean you are looking for.
In fact, it would be useful to be able to build a view like the following: All
MBeans from application A that have an attribute count whose value is greater than 10
but less than 20, or that have an attribute owner whose value equals ABC .
Reading through that statement, you should notice the following impor-
tant points:
The MBean view is restricted by object name.
The restricted set then must have a certain attribute.
The attribute must meet a numeric range.
Or, a different attribute must equal a String value.
JMX agents support a query mechanism that can build and execute complex
queries like this one. Queries are submitted to a JMX agent for the purpose of
retrieving a set of ObjectInstance objects. In essence, a query identifies all the
MBeans that conform to the rules of a given query.
Search WWH ::




Custom Search