Java Management Extensions

Last updated

Java Management Extensions (JMX) is a Java technology that supplies tools for managing and monitoring applications, system objects, devices (such as printers) and service-oriented networks. Those resources are represented by objects called MBeans (for Managed Bean ). In the API, classes can be dynamically loaded and instantiated. Managing and monitoring applications can be designed and developed using the Java Dynamic Management Kit. [1]

Contents

JSR 003 [2] of the Java Community Process defined JMX 1.0, 1.1 and 1.2. JMX 2.0 was being developed under JSR 255, but this JSR was subsequently withdrawn. [3] The JMX Remote API 1.0 for remote management and monitoring is specified by JSR 160. [4] An extension of the JMX Remote API for Web Services was being developed under JSR 262. [5]

Adopted early on by the J2EE community, JMX has been a part of J2SE since version 5.0. "JMX" is a trademark of Oracle Corporation.

Architecture

JMX architecture JMX Architecture.svg
JMX architecture

JMX uses a three-level architecture:

  1. The Probe level – also called the Instrumentation level – contains the probes (called MBeans) instrumenting the resources
  2. The Agent level, or MBeanServer – the core of JMX. It acts as an intermediary between the MBean and the applications.
  3. The Remote Management level enables remote applications to access the MBeanServer through connectors and adaptors. A connector provides full remote access to the MBeanServer API using various communication (RMI, IIOP, JMS, WS-* …), while an adaptor adapts the API to another protocol (SNMP, …) or to Web-based GUI (HTML/HTTP, WML/HTTP, …).

Applications can be generic consoles (such as JConsole [6] and MC4J [7] ) or domain-specific (monitoring) applications. External applications can interact with the MBeans through the use of JMX connectors and protocol adapters. Connectors serve to connect an agent with a remote JMX-enabled management application. This form of communication involves a connector in the JMX agent and a connector client in the management application.

Protocol adapters provide a management view of the JMX agent through a given protocol. Management applications that connect to a protocol adapter are usually specific to the given protocol.

Managed beans

A managed bean – sometimes simply referred to as an MBean – is a type of JavaBean, created with dependency injection. Managed Beans are particularly used in the Java Management Extensions technology – but with Java EE 6 the specification provides for a more detailed meaning of a managed bean.

The MBean represents a resource running in the Java virtual machine, such as an application or a Java EE technical service (transactional monitor, JDBC driver, etc.). They can be used for collecting statistics on concerns like performance, resources usage, or problems (pull); for getting and setting application configurations or properties (push/pull); and notifying events like faults or state changes (push).

Java EE 6 provides that a managed bean is a bean that is implemented by a Java class, which is called its bean class. A top-level Java class is a managed bean if it is defined to be a managed bean by any other Java EE technology specification (for example, the JavaServer Faces technology specification), or if it meets all of the following conditions:

  1. It is not a non-static inner class.
  2. It is a concrete class, or is annotated @Decorator.
  3. It is not annotated with an EJB component-defining annotation or declared as an EJB bean class in ejb-jar.xml.

No special declaration, such as an annotation, is required to define a managed bean.

A MBean can notify the MBeanServer of its internal changes (for the attributes) by implementing the javax.management.NotificationEmitter. The application interested in the MBean's changes registers a listener (javax.management.NotificationListener) to the MBeanServer. Note that JMX does not guarantee that the listeners will receive all notifications. [8]

Types

There are two basic types of MBean:

Additional types are Open MBeans, Model MBeans and Monitor MBeans. Open MBeans are dynamic MBeans that rely on the basic data types. They are self-explanatory and more user-friendly. Model MBeans are dynamic MBeans that can be configured during runtime. A generic MBean class is also provided for dynamically configuring the resources during program runtime.

A MXBean (Platform MBean) is a special type of MBean that reifies Java virtual machine subsystems such as garbage collection, JIT compilation, memory pools, multi-threading, etc.

A MLet (Management applet) is a utility MBean to load, instantiate and register MBeans in a MBeanServer from an XML description. The format of the XML descriptor is: [9]

 <MLET CODE = ''class'' | OBJECT = ''serfile''    ARCHIVE = ''archiveList''    [CODEBASE = ''codebaseURL'']    [NAME = ''objectName'']    [VERSION = ''version'']  >    [arglist]  </MLET> 

Support

JMX is supported at various levels by different vendors:

See also

Related Research Articles

<span class="mw-page-title-main">OSGi</span> Open standards organisation

OSGi is an open specification and open source project under the Eclipse Foundation. It is a continuation of the work done by the OSGi Alliance, which was an open standards organization for computer software founded in March 1999. The foundation originally specified and maintained the OSGi standard. The alliance transferred its work to the Eclipse Foundation at the end of 2020. The OSGi specification describes a modular system and a service platform for the Java programming language that implements a complete and dynamic component model, something that does not exist in standalone Java or VM environments. It has a service-oriented architecture based on micro services each implemented as an extended Java class file archive.

Jakarta Enterprise Beans is one of several Java APIs for modular construction of enterprise software. EJB is a server-side software component that encapsulates business logic of an application. An EJB web container provides a runtime environment for web related software components, including computer security, Java servlet lifecycle management, transaction processing, and other web services. The EJB specification is a subset of the Java EE specification.

The Jakarta Transactions, one of the Jakarta EE APIs, enables distributed transactions to be done across multiple X/Open XA resources in a Java environment. JTA was a specification developed under the Java Community Process as JSR 907. JTA provides for:

The Jakarta Messaging API is a Java application programming interface (API) for message-oriented middleware. It provides generic messaging models, able to handle the producer–consumer problem, that can be used to facilitate the sending and receiving of messages between software systems. Jakarta Messaging is a part of Jakarta EE and was originally defined by a specification developed at Sun Microsystems before being guided by the Java Community Process.

<span class="mw-page-title-main">Jakarta EE</span> Set of specifications extending Java SE

Jakarta EE, formerly Java Platform, Enterprise Edition and Java 2 Platform, Enterprise Edition (J2EE), is a set of specifications, extending Java SE with specifications for enterprise features such as distributed computing and web services. Jakarta EE applications are run on reference runtimes, that can be microservices or application servers, which handle transactions, security, scalability, concurrency and management of the components it is deploying.

Java Data Objects (JDO) is a specification of Java object persistence. One of its features is a transparency of the persistence services to the domain model. JDO persistent objects are ordinary Java programming language classes (POJOs); there is no requirement for them to implement certain interfaces or extend from special classes. JDO 1.0 was developed under the Java Community Process as JSR 12. JDO 2.0 was developed under JSR 243 and was released on May 10, 2006. JDO 2.1 was completed in Feb 2008, developed by the Apache JDO project. JDO 2.2 was released in October 2008. JDO 3.0 was released in April 2010.

<span class="mw-page-title-main">Apache Tomcat</span> Java-based HTTP web server environment

Apache Tomcat is a free and open-source implementation of the Jakarta Servlet, Jakarta Expression Language, and WebSocket technologies. It provides a "pure Java" HTTP web server environment in which Java code can also run. Thus it is a Java web application server, although not a full JEE application server.

Jakarta Faces, formerly Jakarta Server Faces and JavaServer Faces (JSF) is a Java specification for building component-based user interfaces for web applications and was formalized as a standard through the Java Community Process being part of the Java Platform, Enterprise Edition. It is also an MVC web framework that simplifies the construction of user interfaces (UI) for server-based applications by using reusable UI components in a page.

Jakarta Connectors is a Java programming language tool for connecting application servers and enterprise information systems (EIS) as part of enterprise application integration (EAI). While JDBC is specifically used to connect Java applications to databases, JCA is a more generic architecture for connection to legacy systems. JCA was developed under the Java Community Process as JSR 16, JSR 112 and JSR 322.

<span class="mw-page-title-main">MX4J</span>

MX4J is a project to create an open-source implementation of Java Management Extensions (JMX). The JMX specification is a Java Specification Request currently in maintenance release 1.2; the new JSR 160 has been issued to address connectivity to a remote JMX agent. MX4J implements both JSR 3 and JSR 160.

Hibernate ORM is an object–relational mapping tool for the Java programming language. It provides a framework for mapping an object-oriented domain model to a relational database. Hibernate handles object–relational impedance mismatch problems by replacing direct, persistent database accesses with high-level object handling functions.

<span class="mw-page-title-main">JOnAS</span>

JOnAS is an open-source implementation of the Java EE application server specification, developed and hosted by the OW2 consortium, having been originally been created by Groupe Bull. JOnAS is released under the LGPL 2.1 open-source license.

WebSphere Application Server (WAS) is a software product that performs the role of a web application server. More specifically, it is a software framework and middleware that hosts Java-based web applications. It is the flagship product within IBM's WebSphere software suite. It was initially created by Donald F. Ferguson, who later became CTO of Software for Dell. The first version was launched in 1998. This project was an offshoot from IBM HTTP Server team starting with the Domino Go web server.

Apache Beehive is a discontinued Java Application Framework that was designed to simplify the development of Java EE-based applications. It makes use of various open-source projects at Apache such as XMLBeans. Apache Beehive uses Java 5, including JSR-175, a facility for annotating fields, methods, and classes so that they can be treated in special ways by runtime tools. It builds on the framework developed for BEA Systems Web logic Workshop for its 8.1 series. BEA later decided to donate the code to Apache.

In software engineering, a WAR file is a file used to distribute a collection of JAR-files, JavaServer Pages, Java Servlets, Java classes, XML files, tag libraries, static web pages and other resources that together constitute a web application.

The Spring Framework is an application framework and inversion of control container for the Java platform. The framework's core features can be used by any Java application, but there are extensions for building web applications on top of the Java EE platform. Although the framework does not impose any specific programming model, it has become popular in the Java community as an addition to the Enterprise JavaBeans (EJB) model. The Spring Framework is open source.

Jakarta PersistenceAPI is a Jakarta EE application programming interface specification that describes the management of relational data in enterprise Java applications.

The JBoss Enterprise Application Platform is a subscription-based/open-source Java EE-based application server runtime platform used for building, deploying, and hosting highly-transactional Java applications and services developed and maintained by Red Hat. The JBoss Enterprise Application Platform is part of Red Hat's Enterprise Middleware portfolio of software. Because it is Java-based, the JBoss application server operates across platforms; it is usable on any operating system that supports Java. JBoss Enterprise Application Platform was originally called JBoss and was developed by the eponymous company JBoss, acquired by Red Hat in 2006.

<span class="mw-page-title-main">WildFly</span>

WildFly, formerly known as JBoss AS, or simply JBoss, is an application server written by JBoss, now developed by Red Hat. WildFly is written in Java and implements the Java Platform, Enterprise Edition specification. It runs on multiple platforms.

Jakarta Management is a Java specification request (JSR-77) for standardization of Jakarta EE server management. Jakarta Management abstracts the manageable parts of the Jakarta EE architecture and defines an interface for accessing management information. This helps system administrators integrate Jakarta EE servers into a system management environment and also helps application developers create their own management tools from scratch.

References

  1. "Overview of the Java Dynamic Management Kit". docs.oracle.com. Retrieved January 12, 2021.
  2. JSR 003: JavaTM Management Extensions (JMXTM) Specification
  3. JSR 255: JavaTM Management Extensions (JMXTM) Specification, version 2.0
  4. JSR 160: JavaTM Management Extensions (JMX) Remote API
  5. JSR 262: Web Services Connector for Java Management Extensions (JMX) Agents
  6. Using JConsole to Monitor Applications
  7. "The MC4J project creates management software for J2EE application servers and other Java applications". Archived from the original on 2007-03-23. Retrieved 2006-08-27.
  8. Java Management Extensions (JMX) – Best Practices
  9. "MLet (Java 2 Platform SE 5.0)". Sun Microsystems . Retrieved 2008-06-22.
  10. UnboundID Corp. Archived 2012-03-06 at the Wayback Machine
  11. "Home".
  12. "JMX Data Collection". www.logicmonitor.com. Retrieved 2020-11-20.
  13. Apache Tomcat 6.0: Monitoring and Managing Tomcat (Tomcat manual)
  14. "JMX Exporter". GitHub . 14 February 2022.

Further reading

Articles

Books