Java Reference
In-Depth Information
In addition, you must use the
rmic
compiler to generate stubs for the
JINIConnectorImpl
class.
Set up the Jini environment. Doing so involves starting an
HTTP
server,
starting the Java activation daemon (
rmid
), and starting a Jini lookup ser-
vice. Read the Jini documentation to see how to perform these steps.
2
Start the
JMX
agent. You will need to start the agent with a policy file indi-
cated by the
-Djava.security.policy
property in the
java
command.
3
Run the client class (
JINIConnectorClient
). Doing so will invoke the
class's
main()
method. The method will use the
JINIConnector
to find the
JMX
agent, get its MBean count, and create a new
HelloWorld
MBean on
the agent.
4
the agent is still running) to the location http://localhost:9092 (assuming you are
on the same machine as the agent). You should see all three adapter/connector
9.4
J
MX and SNMP
A large number of vendors have distributed many devices with
SNMP
manage-
ment capabilities. It would be ideal if you could use this existing management
base with new applications and systems you are building today. For example, a
networking application could acquire knowledge of the health of the hardware it
requires before making routing decisions. For such situations, it makes sense to
use the
SNMP
technology already in place. Fortunately, due to the
JMX
architec-
ture, your
JMX
agents can expose MBeans using an
SNMP
adapter. This section
will review
SNMP
and provide information about using
JMX
with
SNMP
.
9.4.1
What is SNMP?
SNMP
is a monitoring standard that has been in wide use for several years.
(
SNMP
stands for Simple Network Management Protocol, but most developers
might argue that it is not that simple.) Two versions of
SNMP
(v1 and v2) already
exist, and a third version is being defined by the Internet Engineering Task
Fo rc e (
IETF
).
In an
SNMP
system, there are
managed devices
such as routers, hubs, comput-
ers, operating systems, and even applications. Basically, any device or system
that can expose information about itself can become a managed device.
SNMP
agents exist to convert requests or messages from the
SNMP
protocol to a device.