GlassFish Administration
上QQ阅读APP看书,第一时间看更新

Understanding the administration infrastructure of GlassFish

The administration infrastructure of the GlassFish Server is built on Java Management Extensions (JMX). In this section, we will introduce the JMX technology and then explain how it is related to configuration files in the GlassFish Server.

JMX defines a standard architecture, design patterns, APIs, and the services for application management and monitoring with the Java technology. The high-level architecture of JMX is illustrated in the following figure.

Understanding the administration infrastructure of GlassFish

In JMX, applications and resources to be managed are exposed as Java objects known as Managed Beans, or MBeans. These MBeans are registered in a managed object called an MBean Server. The MBean server behaves as an agent between management applications and the MBeans. Finally, management applications can communicate with the MBean Server with a variety of connectors and protocol adapters.

This figure highlights the architecture of JMX and the relationship among major components: MBeans, MBean Server, Connectors, Protocol Adapters, and Management Applications.

Support for JMX is built into the Java Virtual Machine. The JVM itself is instrumented heavily with MBeans, and these MBeans are registered in a Platform MBean Server that provides a RMI connector out-of-box. Furthermore, a very useful tool, JConsole, is bundled in JDK 1.5+ releases. Due to this, JMX can be readily applied to managing applications and resources.

The GlassFish Server takes full advantage of the JMX technology. GlassFish provides an AppServer Management Extensions (AMX) API to simplify GlassFish management. AMX defines a simplified API for implementing MBeans for configuring and monitoring the GlassFish Server, it also provides a dynamic proxy-based client layer. This allows GlassFish Server to be managed with tools without knowledge of JMX itself, even though you can still access the AMX based MBeans using a JMX-based management application.

AMX defines several types of MBeans, one of them are Configuration MBeans that expose virtually all configurable aspects of the GlassFish Server. In fact, each element in the domain.xml is defined by a corresponding AMX MBean interface in the com.sun.enterprise.config.servicebeans package. This is actually the reason why the domain.xml file no longer needs a DTD to control its structure: the structure is precisely defined by these MBean interfaces.

The AMX API is out of the scope of this book. If you are interested in the details of AMX and other advanced administration features of GlassFish, refer to the GlassFish community website for more information.

Now you have a solid understanding of the administration infrastructure of GlassFish, let's get familiar with the utilities we use to configure, manage, and monitor GlassFish.