Java Reference
In-Depth Information
As you become more experienced with JMX and writing your own MBeans, you
may envision a time when you have a JMX agent containing dozens of MBeans of
different class types and purposes. Keeping track of all your MBeans, their pur-
poses, and their management interfaces can be difficult as the number of MBeans
in an agent increases. Fortunately, the MBeanServer class comes with a querying
mechanism that allows you to build and execute custom MBean queries to identify
specific MBeans.
You have used the MBean server in several of the previous chapters. In partic-
ular, you registered MBeans and used the HTML protocol adapter to access
information from an instance of the MBeanServer class. This chapter discusses the
MBean server in more detail, giving you a better understanding of its features.
Specifically, we will cover two main areas:
The MBeanServer interface
Using the MBean server querying mechanism to find MBeans
However, before we begin exploring these topics, let's quickly review the overall
JMX agent architecture information from chapter 1.
8.1 J MX agent architecture in review
Remember from chapter 1 that a JMX agent is a Java process that contains a set of
MBeans and enables management applications to interact with them. JMX agents
contain one or more MBean servers that act as registries for MBeans. Remember
also that agents use one or more protocol adapters or connectors. Adapters and
connectors make JMX agents available to different management applications.
Figure 8.1 depicts the agent-level components. After reviewing the figure, if
you still have questions, look back to chapter 1.
8.1.1
Using protocol adapters and connectors
As you can see from figure 8.1, protocol adapters and connectors provide access
to the MBean server. Adapters and connectors help you to interact with the
MBean server as if you were working with it directly.
Management applications can interact with MBeans by using protocols such
as Simple Network Management Protocol ( SNMP ) or HTTP . Essentially, protocol
adapters let you use existing management applications to interact with JMX
agents. You can map your existing protocols into a JMX agent, allowing you to
interact with and manage its MBeans.
Search WWH ::




Custom Search