[ Team LiB ] |
What Is JMX and Why Would You Want It?JMX provides both the architecture and the services needed to actively administer, monitor, and manage resources. The WebLogic 8.1 distribution supports JMX version 1.0. Although it's a relatively new API, JMX is quite robust and through the use of JMX management components can be used to monitor and manage most any resource. JMX can even map to any existing management protocol, such as SNMP or HTTP. What JMX Can Do for YouJMX allows for the administration of all resources in your environment. This is basically done by encapsulating a component in a JMX wrapper object and exposing its attributes and/or methods in a JMX server environment. JMX provides administration services for both hardware and software components. Let's look at the services JMX provides in a little more detail:
Through the use of critical event triggers, JMX can provide the capability to avert failure before it happens. You can program failover logic so that the applications handle themselves, send out pages, or write out data to files for human intervention. JMX also provides you with the flexibility and control to expose as little or as much of the resource as needed. For instance, you can choose to expose the ability to start and stop a Web server, but not to change configuration settings, or perhaps to expose a single method in an application that sends out a log file of transaction statistics. WebLogic Server employs JMX for all of its management and monitoring functions. As we cover later in the chapter, the Administration Console and the weblogic.Admin utility use them exclusively. The Structure of JMXA Java management system requires a number of basic components configured in adherence to the JMX architecture. To understand the structure of a JMX system, it is first necessary to identify and define a few of these components:
Now let's take a look at how these components work together in a JMX system. Suppose that we have an Entity EJB running on an application server that we would like to manage in some way. We would first encapsulate our managed resource (the EJB) into a Java wrapper object (an MBean), and deploy it into WebLogic Server (the JMX agent). The MBean must be managed by an MBean server, so we'll create an MBean server and configure it through the Administration Console. It's the job of the MBean server to manage a group of MBeans. JMX Agent runs in the WebLogic Server container and manages the MBean servers. Finally, we create a management application that communicates through the JMX agent to manage and monitor the resource via its associated MBean. The JMX agent provides protocol adapters and connectors that allow communication between the management application and the protocols. The management interface of an MBean is exposed, without exposing a reference to the object itself, through a process called instrumentation. Now that we've defined the players in a JMX system and given a high-level scenario of the management process, let's take a look at the architecture of a JMX system. The architecture of a JMX system is divided into three layers, as shown in Figure 37.1:
Figure 37.1. JMX architecture.MBean TemplatesThere are four basic models, or templates, on which MBeans are built:
It's important that you don't confuse the four MBean templates with the three functional MBean types defined by BEA: Runtime, Configuration, and Administrative MBeans. These will be covered in the next section. |
[ Team LiB ] |