16
Java Management Extensions (JMX) Jmx Introduction

Java Management Extensions (JMX) Jmx Introduction

Embed Size (px)

Citation preview

Page 1: Java Management Extensions (JMX) Jmx Introduction

Java Management Extensions(JMX)

Jmx Introduction

Page 2: Java Management Extensions (JMX) Jmx Introduction

JMX

What is JMX?Architecture

Instrumentation, Agent and ManagerJMX Components

MBeanServer MBeans (Standard, Dynamic, Model) Notification Adaptors Connectors

Development Kits for JMX

Page 3: Java Management Extensions (JMX) Jmx Introduction

JMX – What is it?

Sun - The Java Management extensions (JMX) provide a standard for instrumenting manageable resources and developing dynamic agents.

Tom – JMX is a standard API and architecture for accessing and controlling Java classes.

Page 4: Java Management Extensions (JMX) Jmx Introduction

JMX - Architecture Instrumentation level - gives instant

manageability to any Java technology-based object.

Agent level - agents are containers that provide core management services which can be dynamically extended by adding JMX resources.

Manager level - provides management components that can operate as a manager or agent for distribution and consolidation of management services.

Page 5: Java Management Extensions (JMX) Jmx Introduction

JMX - Architecture

Page 6: Java Management Extensions (JMX) Jmx Introduction

JMX ComponentsMBeanServer - Contains the methods

necessary for the creation, registration, and deletion of MBeans as well as the access methods for registered MBeans.

MBean – a class whose implementation exposes an interface for allowing management of its attributes and methods. Standard Dynamic Model

Page 7: Java Management Extensions (JMX) Jmx Introduction

Standard MBeanA Standard MBean is a class that

implements a custom MBean interface. It must be a concrete class so that it

can be instantiated. It must expose at least one public

constructor so that any other class can create an instance

Page 8: Java Management Extensions (JMX) Jmx Introduction

Dynamic MBeanA Dynamic MBean implements its

management interface programmatically, instead of through static method names.

Requires implementing the JMX interface java.management.DynamicMBean

Page 9: Java Management Extensions (JMX) Jmx Introduction

DynamicMBean Interfacepublic interface DynamicMBean { public Object getAttribute(String attribute)

throws AttributeNotFoundException, MBeanException, ReflectionException;

public void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException,

MBeanException, ReflectionException ; public AttributeList getAttributes(String[] attributes); public AttributeList setAttributes(AttributeList attributes); public Object invoke(String actionName, Object params[],

String signature[]) throws MBeanException, ReflectionException ; public MBeanInfo getMBeanInfo();}

Page 10: Java Management Extensions (JMX) Jmx Introduction

Model MBeanDynamic MBean that has been

implemented so that its management interface and its actual resource can be set programmatically.

Accomplished by creating and registering the RequiredModelMBean with the MBeanServer and declaring the manageable resource (called the target object).

Page 11: Java Management Extensions (JMX) Jmx Introduction

Model MBean (cont.)A Descriptor contains the

information describing the Model MBean’s target objects and the policies for accessing the target objects.

The Descriptor is an interface which is implemented in the DescriptorSupport class.

Page 12: Java Management Extensions (JMX) Jmx Introduction

NotificationMBeans, called broadcasters, send

notification events to other registered MBeans or objects, called listeners.

Typical types of notification comes from the MBeanServer (register/unregister events) and MBeans (attribute changes).

All notification events must implement the javax.management.Notification interface.

Page 13: Java Management Extensions (JMX) Jmx Introduction

AdaptorsProtocol adaptors provide a view of

the MBeans registered with a MBeanServer through some communication protocol.

Typically used to provide a user interface for managing the MBeans directly.

Run in the same process as the MBeans and MBeanServer

Examples: HTML or SNMP

Page 14: Java Management Extensions (JMX) Jmx Introduction

ConnectorsProtocol connectors and proxy MBeans

allow for management of MBeans programmatically over a network.

Connector clients expose a remote version of the MBean server interface. The connector server transmits management requests to the MBean server and forwards any replies.

Example: RMI, HTTP or IIOP

Page 15: Java Management Extensions (JMX) Jmx Introduction

JMX – Tool kitsJMX Reference Implementation – free

core implementation of the basic JMX interfaces.

Java Dynamic Management Kit (JDMK) – Sun’s full implementation of the JMX specification. Includes HTML, RMI, and SNMP adapters.

A few others being developed. Will likely be standard in most application servers.

Page 16: Java Management Extensions (JMX) Jmx Introduction

ResourcesJMX Site -

http://java.sun.com/products/JavaManagement/

JMX White Paper - http://java.sun.com/products/JavaManagement/wp/

JavaWorld JMX article - http://www.javaworld.com/javaworld/jw-06-2001/jw-0608-jmx.html

JDMK Site - http://java.sun.com/products/jdmk