Java Management Extensions

Book description

Steve Perry has spent his time "in the trenches". "I've been paged at 3:00 am to provide support because the system wasn't doing what it should and no one had a clue how to figure out why. I've scrolled through endless logfiles to decipher system problems, when a management solution could have presented an operator with a warning message hours earlier!" Wanting other developers to be able to learn from his experiences, Steve wrote Java Management Extensions.Java Management Extensions is a practical, hands-on guide to using the JMX APIs, Sun Microsystem's new Java-based tool for managing enterprise applications. This one-of-a kind book is a complete treatment of the JMX architecture (both the instrumentation level and the agent level), and it's loaded with real-world examples for implementing Management Extensions. It also contains useful information at the higher level about JMX (the "big picture") to help technical managers and architects who are evaluating various application management approaches and are considering JMX. The JMX technology is very new, and according to Steve, still has a few "potholes" in it. This book takes developers through it step by step, pointing out the "gotchas" before they have a chance to trip up smooth operation of the application. The author, a member of the expert group developing the JMX specification, points out that as J2EE becomes more widely adopted, the Java standard for management (JMX) becomes more and more crucial to avoid "splinter standards" where each vendor has their own distinct, arguably successful, way of doing things. "In my own company we have already identified and are tackling the problem of managing our Java applications. It's my belief that other companies will follow, as they come to realize the power that a standard manageability solution (ie, JMX) gives them." The book is divided into the following sections:

  • Part I:

  • Introduction and overview

  • Part II:

  • the JMX Instrumentation Level

  • Standard MBeans

  • Dynamic MBeans

  • Model Mbeans

  • Part III:

  • The JMX Agent Level

  • The Mbean Server

  • The JMX Notification Model

  • Dynamic Loading

  • Monitors

  • Timer Services

  • Relation Services

  • Appendix:

  • Related Technologies

  • Index

Table of contents

  1. Java Management Extensions
    1. Preface
      1. Audience
      2. Organization
      3. Conventions Used in This Book
      4. Comments and Questions
      5. Source Code Availability
      6. Acknowledgments
    2. 1. Java Management Extensions Concepts
      1. Introducing JMX
      2. JMX Architecture
        1. The Instrumentation Level
          1. What is an MBean?
          2. Standard MBeans
          3. Dynamic MBeans
          4. Model MBeans
          5. Open MBeans
          6. JMX notifications
        2. The Agent Level
          1. The MBean server
          2. The M-Let service
          3. Monitoring services
          4. The timer service
          5. The relation service
        3. The Distributed Services Level
          1. Protocol adaptors and connectors
          2. JSR 160
      3. The Sample Producer/Consumer Application
        1. Design
        2. Source Code
        3. Building and Running the Application
        4. Monitoring and Managing the Application
    3. 2. Standard MBeans
      1. What Is a Management Interface?
      2. How Do Standard MBeans Work?
        1. Describing the Management Interface
          1. Pattern #1: Defining, naming, and implementing the MBean interface
          2. Pattern #2: Provide at least one public constructor
          3. Pattern #3: Attributes and how to name their getters and setters
          4. A word about introspection
        2. Standard MBean Inheritance Patterns
          1. Pattern #1: Basic inheritance
          2. Pattern #2: Simple inheritance
          3. Pattern #3: Simple inheritance with child class implementing an MBean interface
          4. Pattern #4: Simple inheritance with MBean inheritance
          5. Pattern #5: Compiler-enforced management interface inheritance
        3. Common Mistakes Not Caught by Introspection
          1. Mistake #1: MBean interface not given public visibility
          2. Mistake #2: Wrong return value type
          3. Mistake #3: Wrong number of parameters
        4. Implementing the MBean Interface
        5. Throwing Exceptions from Your MBeans
        6. The Driver Program: Controller.main( )
          1. The ObjectName class
          2. Registering the MBean with the MBean server
        7. The HTMLAdaptorServer Class
      3. Downloading and Installing the JMX Reference Implementation
    4. 3. Dynamic MBeans
      1. Why Use Dynamic MBeans?
      2. How Do Dynamic MBeans Work?
        1. Describing the Management Interface
          1. MBeanAttributeInfo
          2. MBeanParameterInfo
          3. MBeanConstructorInfo
          4. MBeanOperationInfo
          5. MBeanNotificationInfo
          6. MBeanInfo
        2. Implementing the DynamicMBean Interface
          1. Attribute
          2. AttributeList
          3. getAttribute( )
          4. setAttribute( )
          5. getAttributes( )
          6. setAttributes( )
          7. invoke( )
      3. Dynamic MBean Inheritance Patterns
        1. Explicit Superclass Exposure
          1. getAttribute( )
          2. setAttribute( )
          3. invoke( )
        2. Superclass Delegation
          1. getAttribute( )
          2. setAttribute( )
          3. invoke( )
        3. Mixing It Up
    5. 4. Model MBeans
      1. Why Use Model MBeans?
      2. How Do Model MBeans Work?
        1. Model MBean Descriptors
          1. class
          2. currencyTimeLimit
          3. default
          4. descriptorType
          5. export
          6. getMethod
          7. log
          8. logFile
          9. name
          10. persistPeriod
          11. persistPolicy
          12. role
          13. setMethod
          14. severity
          15. value
          16. visibility
          17. Other fields
        2. Describing the Management Interface
          1. ModelMBeanAttributeInfo
          2. ModelMBeanConstructorInfo
          3. ModelMBeanOperationInfo
          4. ModelMBeanNotificationInfo
          5. ModelMBeanInfo
          6. DescriptorAccess
        3. RequiredModelMBean
          1. ModelMBean
          2. DynamicMBean
          3. PersistentMBean
      3. Instrumenting Resources as Model MBeans
    6. 5. Open MBeans
      1. Open MBean Types
        1. Basic Types
          1. OpenType
          2. SimpleType
          3. Other basic types
        2. Complex Data
          1. CompositeType
          2. CompositeData
          3. CompositeDataSupport
          4. TabularType
          5. TabularData
          6. TabularDataSupport
      2. Open MBean Metadata Classes
        1. OpenMBeanParameterInfo
        2. OpenMBeanParameterInfoSupport
        3. OpenMBeanAttributeInfo
        4. OpenMBeanAttributeInfoSupport
        5. OpenMBeanConstructorInfo
        6. OpenMBeanConstructorInfoSupport
        7. OpenMBeanOperationInfo
        8. OpenMBeanOperationInfoSupport
        9. MBeanNotificationInfo
        10. OpenMBeanInfo
        11. OpenMBeanInfoSupport
    7. 6. The MBean Server
      1. What Is the MBean Server?
      2. Obtaining a Reference to the MBean Server
        1. Creating the MBean Server
        2. Finding the MBean Server
        3. Releasing a Reference to the MBeanServer
      3. The MBeanServer Interface
        1. Instantiation and Registration
          1. Instantiating an MBean
          2. Registering an MBean
          3. Combining the instantiation and registration of an MBean
          4. Removing a registered MBean from the MBean server
        2. Indirect MBean Manipulation
        3. Notification
        4. Query
        5. Utility
      4. Controlling MBean Registration
      5. MBeanServerDelegate
        1. MBean Server Information
        2. MBean Server Notifications
    8. 7. JMX Notifications
      1. The JMX Notification Model
      2. JMX Notification Classes and Interfaces
        1. Notification
        2. NotificationFilter
        3. The Handback Object
        4. NotificationBroadcaster
        5. NotificationListener
    9. 8. Dynamic Loading
      1. Overview
        1. The M-Let Service
        2. The M-Let File
          1. MLET
          2. CODE
          3. OBJECT
          4. ARCHIVE
          5. CODEBASE (optional)
          6. NAME (optional)
          7. VERSION (optional)
          8. ARG
          9. Bringing it all together
        3. Loading MBeans Without an M-Let File
      2. How Does Dynamic Loading Work?
        1. getMBeansFromURL( )
    10. 9. The Monitoring Services
      1. The MonitorNotification Class
        1. Error Conditions
        2. Counter Monitor Notification Types
        3. Gauge Monitor Notification Types
        4. String Monitor Notification Types
      2. Counter Monitors
      3. Gauge Monitors
      4. String Monitors
      5. Other Issues
    11. 10. The Timer Service
      1. The Timer Class
      2. Using the Timer Service
        1. Handling the Controller Start Notification
        2. Handling the Message Queue Flush Notification
    12. 11. The Relation Service
      1. Introduction
      2. The Basic Relation Service Classes
        1. RoleInfo
        2. RelationType
        3. Role
        4. RoleList
        5. RelationService
        6. RelationTypeSupport
        7. RelationSupport
      3. Using the Relation Service
      4. Using the Relation Service Support Classes
      5. Modifying a Role
    13. Index
    14. Colophon

Product information

  • Title: Java Management Extensions
  • Author(s): J. Steven Perry
  • Release date: June 2002
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9780596002459