BEA Logo BEA WebLogic Server Release 6.1

  BEA Home  |  Events  |  Solutions  |  Partners  |  Products  |  Services  |  Download  |  Developer Center  |  WebSUPPORT

 

  |  

  WebLogic Server Doc Home   |     Programming JMX   |   Previous Topic   |   Next Topic   |   Contents   |   View as PDF

Overview of WebLogic JMX Services

 

The following sections provide an introduction to the WebLogic Server JMX management framework:

 


Overview

The WebLogic Server management architecture is based on the Sun Microsystems, Inc. Java Management Extensions (JMX) specification. BEA has instrumented many of the APIs and resources available in WebLogic Server, and provides the JMX-compliant Administration Console to monitor and manage those resources.

All WebLogic Server management functions are accessed using management beans, or MBeans, which retrieve their values from the WebLogic Server domain configuration or runtime state. MBeans provide developers with a means to access all configuration and monitoring information about WebLogic Server programmatically via the JMX standard API.

This guide provides an overview of the WebLogic Server JMX implementation, so that you can develop applications or management frameworks that monitor and manage WebLogic Server JMX-manageable resources.

 


The WebLogic Server Management System

The WebLogic Server management system implements all of the required components identified in the JMX 1.0 specification. Because a WebLogic Server installation can include multiple servers, JMX components are necessarily distributed throughout the installation. The figure below depicts JMX components in a typical WebLogic Server installation.

The sections that follow provide an overview of each JMX component.

Managed Resources

Managed resources comprise the APIs, services, and applications that are hosted on a WebLogic Server instance, and which BEA has instrumented for JMX management. Each managed resource provides one or more MBeans that can be used for monitoring or modifying the resource.

Instrumented APIs in WebLogic include EJB, JDBC, JMS, JTA, and XML. BEA has also instrumented WebLogic Server services such as startup classes, shutdown classes, and security realms. Finally, WebLogic Server provides JMX instrumentation for Web applications and their respective components, so that you can change an application's deployment parameters or monitor its deployment status using the JMX specification.

MBeans

MBeans (managed beans) are the JMX constructs that represent managed resources. Each managed resource in WebLogic Server (an API, service, or application component) uses one or more MBeans to provide an interface for modifying or monitoring the resource.

WebLogic Server MBeans provide all of the standard operations defined in the JMX specification such as:

In the context of the JMX specification, all WebLogic MBeans are implemented as standard MBeans—their attributes and operations are specified directly in their associated interfaces. WebLogic Server defines several distinct types of MBean, to describe their function within the WebLogic Server management system. See WebLogic Server MBeans for more information on specific MBean types.

MBean Servers

As described in the JMX specification, an MBean server is the principle agent for accessing MBeans in the management framework. The MBean server acts as a registry for MBeans. Using the MBean Server, management applications can look up MBeans, determine MBean attributes and methods, and listen for MBean notifications.

Each server in a WebLogic administration domain contains its own MBean Server. With the exception of the administration server's MBean Server, each MBean Server registers only those MBeans that apply to the local WebLogic Server instance. For example, an application using the MBean Server for a managed WebLogic Server instance could monitor a Web application that was deployed on that particular server, but it could not monitor a Web application deployed on another server in the domain.

Because the administration server is itself a WebLogic Server instance, it also has an MBean server. The administration server's MBean server is unique in that it hosts domain-wide administration MBeans as well as the server's own configuration and runtime MBeans.

MBean Homes

The JMX 1.0 specification does not provide guidelines for making the MBean server interface available to management clients outside of the MBean server's JVM. WebLogic Server Version 6.1 makes the MBean server interface available to any client (local or external to the server's JVM) via the MBeanHome interface.

An MBeanHome is simply a wrapper around an MBean server interface that can be used for accessing WebLogic Server MBeans. In most cases, applications can use MBeanHome in place of the MBean server for managing server resources. Any client can access management functions by using a simple JNDI lookup to obtain the MBeanHome of an MBean server.

The MBeanHome interface provides a strongly-typed interface for accessing WebLogic Server MBean attributes, which generally makes MBeanHome easier to use than MBean server. For example, once an application has obtained a serverMBean from MBeanHome, it can call serverMBean.getListenPort() to return an int value of the server's listen port. To perform a similar operation using MBean server, the application would need to first obtain the JMX object name of the serverMBean and request its ListenPort attribute. The attribute itself would be returned as a generic object, and the application would need to know that this particular attribute should be cast into an int value.

MBeanHome can be used only for accessing WebLogic Server MBeans—applications cannot obtain user-defined MBeans using MBeanHome. Pure JMX applications, or applications that need to access registered user MBeans, can obtain and use the MBean server interface by first looking up MBeanHome and invoking getMBeanServer().

As shown in the previous figure, each WebLogic Server instance in an administration domain has an MBean server and a corresponding MBeanHome. Using these MBeanHome interfaces, an application can work with configuration and runtime MBeans for an individual WebLogic Server.

In addition to providing a standard MBeanHome interface (for a server instance's local configuration and runtime MBeans), the administration server provides an additional, domain-wide MBeanHome interface, as described below.

Administration MBeanHome

The WebLogic Server management system utilizes a domain-wide MBeanHome interface that can access all WebLogic MBeans for all server instances in a management domain. This includes the administration MBeans for the domain as a whole, as well as the configuration and runtime MBeans for the administration server and all managed servers.

Although the domain-wide MBeanHome interface does not have an associated MBean server, it operates in the same manner as a server-specific MBeanHome. Only the list of available MBeans differs. The administration MBeanHome accesses another server's MBeans using the respective server's MBeanHome interface, as shown by the dotted lines in the previous figure.

Applications obtain the domain-wide MBeanHome interface via the WebLogic administration server. After obtaining the domain-wide MBeanHome, an application can work with domain-wide administration MBeans or any individual server's MBeans by filtering the list of available MBeans in the domain. Accessing WebLogic Server MBeans explains how to obtain an MBeanHome interface programmatically, and also provides information about which MBeanHome interface an application should obtain.

 


WebLogic Server MBeans

WebLogic Server defines three distinct types of MBeans:

The following sections describe each MBean type.

Administration MBeans

Administration MBeans represent the configured properties of an entire WebLogic Server administration domain. When you start up the administration server for a domain, the server creates administration MBeans using the elements and attributes specified in the domain's config.xml file.

All administration MBeans are registered automatically when the administration server starts up. This includes administration MBeans for managed servers that are not yet running, or that have not yet attached to the administration server.

JMX management applications can modify the administration domain's config.xml file indirectly by changing attributes of administration MBeans. Every 5 minutes, the administration MBean server checks to determine if administration MBeans have been changed, and writes the changes back to config.xml as necessary.

Changes to administration MBeans are also written back to the config.xml file when the administration server shuts down, or when MBean attributes are modified by a WebLogic Server utility such as the Administration Console, weblogic.Admin, or weblogic.Deploy.

Configuration MBeans

Whereas administration MBeans represent the persistent value of config.xml elements, configuration MBeans represent the "active" value of those same elements. It is the active value of the configuration attributes (the configuration MBeans) that WebLogic Server subsystems use for operation during the life span of the server.

When you start up a WebLogic Server, most of its configuration MBean attributes are derived from the server's administration MBeans as registered in the administration server. For example, a managed server might connect to the administration server and derive all of its configuration MBeans from the associated administration MBeans.

However, when you start up a WebLogic Server, it is also possible to override config.xml properties using command-line options. In this case, a server's configuration MBean attributes are populated from the override values, rather than the administration MBean values. Attributes that do not have override values are then derived via administration MBeans registered in the administration server.

JMX applications can modify configuration MBeans to temporarily affect the configuration of an active WebLogic Server instance. However, changes to configuration MBeans are lost when the server reboots or shuts down. To make permanent changes to a server's configuration, the application should instead modify the corresponding resource's administration MBean, which is automatically persisted back to the config.xml file. Changes made to an administration MBean are also propagated to the corresponding configuration MBean, so that the WebLogic Server subsystems use the newly-configured attribute value.

Runtime MBeans

A runtime MBean represents the run-time transient state of the underlying resource or subsystem that it represents. Runtime MBeans differ from administration and configuration MBeans in that their attribute values are not derived or overridden—rather, they represent the current state of a server resource at a given point in time.

For example, runtime MBeans are used to represent the current number of sockets a WebLogic Server has opened, or the current state of the server (whether it is running, suspended, or is about to be shut down).

Applications can use runtime MBeans to monitor the resource usage of managed resources, such as Web applications, and to potentially diagnose performance bottlenecks.

MBean Naming Conventions

All WebLogic Server MBeans have a name, a type and a domain. These attributes are reflected in the MBean's JMX Object Name. The Object Name is the unique identifier for a given MBean across all domains, and has the following structure:

domain name:Name=name,Type=type[,attr=value]... 

Name is a unique identifier for a given domain and type of MBean.

Type indicates type of managed resource the MBean exposes. Examples of resource types include Server, WebComponent or JDBCConnectionPoolRuntime. Type is also used to distinguish between administration, configuration, and runtime MBeans by appending the following standard suffixes:

For example, the value of Type for a JDBCConnectionPool MBean is:

Note that the "MBean" suffix is removed from the MBean interface name to get the base type of an MBean. In the case of the JDBCConnectionPool MBean, the actual MBean interface name is JDBCConnectionPoolMBean.

Specific kinds of MBeans have additional attributes in the JMX object name. All runtime and configuration MBeans have a Location component that uses the name of the server on which that MBean is located as its value. For example:

mydomain:Name=myServlet,Type=ServletRuntime,Location=myserver

Any MBean that has a child relationship with a parent MBean has an extra attribute in its object name to identify the relationship. The format of the attribute is:

TypeOfParentMBean=NameOfParentMBean

In the following example, Server is the type of Parent MBean, and myserver is the name of the Parent MBean:

mydomain:Name=mylog,Type=Log,Server=myserver

Package Naming Conventions

All interface types for administration and configuration MBeans are located in the weblogic.management.configuration API.

All interfaces types for runtime MBeans are located in the weblogic.management.runtime API.

Agent-level interfaces (for example, the MBeanHome and RemoteMBeanServer interfaces) are located in the weblogic.management API.

 


Quick Reference to WebLogic Server MBeans

WebLogic Server provides a large number of MBeans used for configuring the server system as well as applications. In many cases, related MBeans are easily accessed via a "parent" mbean that provide getter to obtain one or more related MBeans. This section provides an overview and quick reference to the major categories of WebLogic Server MBeans to help you better focus your JMX programming efforts.

Note: The WebLogic Server Management API is fully documented online in the Javadoc. The WebLogic Server Programming Guides provide additional information about the programming APIs and services modeled by WebLogic Server MBeans.

Domain MBean

DomainMBean is a high-level WebLogic Server MBean that represents an entire management domain. Once you have obtained a DomainMBean, you can use its getter methods to obtain MBeans representing the domain's log, security, SNMP, and JTA configuration, as shown in the figure below. Similarly, MBeans such as SecurityMBean and SNMPAgentMBean provide getters to access MBeans that control portions of their configuration.

Target MBeans

Target MBeans represent objects that you can select when deploying applications and resources in a management domain. These include MBeans that represent WebLogic Server instances and WebLogic Server clusters.

All Target MBeans implement the weblogic.management.configuration.TargetMBean interface. This means that both clusters and servers can be selected as a target for deploying application components, or as targets for deploying resources such as connection pools.

Server and Kernel MBeans

The ServerMBean, which extends the KernelMBean interface, represents a particular WebLogic Server instance in a management domain. Applications that obtain the ServerMBean can conveniently access child MBeans that control the configuration of the associated server and WebLogic Server Kernel.

The figure below depicts the child MBeans that can be obtained via getter methods in the KernelMBean and ServerMBean interfaces.

Cluster MBeans

Applications can also select a configured WebLogic Server cluster as a target when deploying Web applications or WebLogic Server resources. ClusterMBean primarily uses getter and setter methods to configure cluster properties, such as load balancing algorithms and multicast message properties. ClusterMBean also has a getter method to return all ServerMBeans that are members of the cluster.

Deployable Unit MBeans

A large number of WebLogic Server MBeans implement the DeploymentMBean interface. DeploymentMBean represents any type of web application, web application component, or WebLogic Server resources that can be deployed to a server or cluster in the domain.

If you are interested in working with deployable units, first familiarize yourself with weblogic.management.configuration.DeploymentMBean, as this interface provides the basic methods used to obtain or add targets, as well as set the deployment order.

Once you are familiar with the basic operations DeploymentMBean, refer to the individual deployable unit MBeans that implement the interface. MBeans that represent deployable application components include:

MBeans that represent deployable WebLogic Server resources include:

 

back to top previous page next page