Java Reference
In-Depth Information
that building such an environment is difficult and can leave administrators with
many different tools in which to manage the system. As this topic will show, using
Java Management Extensions, you can build a management environment that's
less expensive and more flexible, in a shorter amount of time.
JMX
is a new
framework added to the Java language; it can provide a management solution
that covers the standards described in the previous section.
JMX
allows you to
encapsulate all your resources (hardware or software) with Java objects and
expose them in a distributed environment. In addition,
JMX
provides a mecha-
nism for easily mapping existing management protocols such as
SNMP
into its
own management structures.
Let's look at the management areas identified in the previous section and
how
JMX
can address them:
■
Platform health—
As previously mentioned, using
JMX
, you can wrap non-
Java resources and hardware interfaces with Java objects in order to fit
them into a
JMX
management system. Using Java wrappers, you can inter-
face to your web and application servers and communicate with the hard-
ware driving your system.
■
Configuring resources and collecting application statistics—
Using
JMX
, you can
directly expose the
API
of applications and services. In addition, you can
dynamically choose what parts of the
API
to expose. With a
JMX
manage-
ment tool, you can then invoke and query the
API
at any time. In fact, if
you know you will be using
JMX
ahead of time, you can build into your
application the simple
JMX
component that will expose it to the
JMX
man-
agement environment. However, you can use
JMX
to very quickly instru-
ment an application even if development is already completed.
■
Debug options—
Debug options are configurable like any other application
or resource attribute. Once an interface is exposed through
JMX
, it can
be invoked.
■
Application performance—
With
JMX
, you can easily monitor the system for
critical events. When an event is noticed,
JMX
can emit notifications to a
predefined listener process. Listeners can be configured to send pages,
write email messages, and so forth; the process is entirely customizable.
1.2.1
Benefits of using JMX
Using a Java-based solution such as
JMX
offers several benefits, some of which
are probably evident to you as a Java programmer. For example, Java is a porta-
ble language (write once run anywhere), so you can develop your application