Java Reference
In-Depth Information
When discussing protocol adapters and connectors as means of exposing your
JMX agents to management tools, it is important to understand the differences
between them.
9.1 Comparing connectors and protocol adapters
Protocol adapters and connectors are very similar in that they serve the same
overall purpose: to open a JMX agent to managing entities. The difference
between them is how they go about it. Protocol adapters generally must listen for
incoming messages that are constructed in a particular protocol like HTTP or
SNMP . In this sense, protocol adapters are made up of only one component that
resides in the agent at all times.
Connectors, on the other hand, are made up of two components: one compo-
nent resides in the JMX agent, and the other is used by client-side applications.
Clients use the client-side connector component to contact the server-side com-
ponent and communicate with a JMX agent. In this manner, connectors hide the
actual protocol being used to contact the agent; the entire process happens
between the connector's two components.
9.2 Connecting by using RMI
Recall from chapter 2's discussion of Sun Microsystems' JMX Reference Imple-
mentation ( RI ) that the RI includes a jmx folder and a contrib folder. The contrib
folder contains the RMI connector that you included in the JMXBookAgent from
chapter 3. This section is intended to make you more familiar with how the RMI
connector works. It is unsupported in the RI , but it is also contained in Sun
Microsystems' commercial JMX product, the Java Dynamic Management Kit
( JDMK ). (For more information about the JDMK , go to http://www.javasoft.com.)
9.2.1
Using the RMI connector
Figure 9.2 illustrates the components of the RMI connector. It is an MBean regis-
tered on an MBean server, just like the HTML adapter you have already used.
However, whereas you used a web browser previously to contact the HTML adapter,
the RMI connector comes with an RMI client.
You can use the RMI connector client to connect to the RMI server MBean
and invoke methods that correspond directly to methods on the MBean
server in which the MBean is registered. For example, after connecting to the
server with an RMI connector client rmiClient , you could invoke the method
Search WWH ::




Custom Search