Java and JMX: Building Manageable Systems
Addison-Wesley Professional, 2003 - Computers - 562 pages
Welcome! You have just opened your key to the secret art of management. This book is your comprehensive guide to the development of manageable application software using the Java Management Extensions (JMX). Now that Java has made the leap from cool to critical, every developer who has deployed a mission-critical application knows it is not enough just to write great code; to be truly useful, critical applications must be manageable as well. With the publishing of the JMX specification and the availability of multiple JMX implementations, Java programmers have a standard mechanism with which to instrument and manage their software products. This book will provide you with the information necessary to leverage JMX to create a new generation of better-instrumented, more manageable, and therefore more reliable mission-critical Java applications.
At the moment the two biggest growth areas for Java are enterprise and embedded systems. Tens of thousands of IT developers are now or soon will be using J2EE technologies to create mission-critical business systems. The major J2EE vendors, including IBM WebSphere and BEA WebLogic application servers, are using JMX to provide their own management, as well as to enable yours. The J2EE 1.4 standard is being extended to include management interfaces using JMX as defined by JSR (Java Specification Request) 77. At the other end of the spectrum, thousands more developers will be using Java to create embedded applications, from set-top boxes to remote pumping-station monitors.
It is essential that these applications, which run unattended on "invisible computers" for the most part, be as self-monitoring and self-managing as possible. JMX provides a substrate upon which to construct such self-monitoring/managing applications, and a copy of this book will substantially reduce your JMX learning curve.
JMX is also being accepted by the telephony industry as a management infrastructure for Java for the Advanced Intelligent Network (JAIN). As these specifications for the use of Java in telephony service environments emerge, whole new industries will need to become familiar with JMX. The probability that you will encounter JMX in one form or another, as part of your own designs or as the instrumentation mechanism for components of your infrastructure, is very high. This book will give you the foundation and technical details you need to make effective use of JMX wherever you find it.
Although it is well known that JMX is continuing to evolve, its basic architecture and interfaces will remain consistent. There is more to using JMX than understanding the architecture and interfaces; you also need to understand how it connects to management systems, the role it plays in the management industry, appropriate use of the technology, and management design patterns. In short, you need to understand how to create a manageable system.This book has been written in a comprehensive manner by experts in that space. It also will give you an in-depth understanding of the application of JMX in hot technologies: J2EE and Web services. You will find this book to be useful long after new versions of JMX become available because the concepts introduced here are classic applications of management concepts and technologies to the Java family. This book will do more than help you write MBeans; it will help guide you build manageable systems. This Book's Intended Audience
Our primary goal in writing this book is to explain Java-based management, manageability (i.e., enabling resources to be managed), and JMX in detail, and to make it easy to understand.
Architects and developers involved in the design and implementation of mission-critical Java applications are the primary audience for this book. They understand that their biggest challenges come well after the first successful installation of a new piece of software, when their client's business becomes critically dependent on that software. Then it is essential that administrators be able to monitor and manage the application day and night to keep the business in business. Until recently, each Java-based product had to develop its own ad hoc management solution. That changed with publication of the Java Management Extensions Instrumentation and Agent Specification, v1.0.This book has been written especially for Java developers who find themselves in a situation where they must enable their application to be managed by an "outside" management system. Other Java developers and architects who will find this book useful include
This book assumes that you do not have a background in systems or applications management and provides a comprehensive overview of the history of the management industry and the forces that combined to make JMX the ubiquitous management technology for Java resources across the Java community. Java resources deployed in the micro, standard, and enterprise editions of the JDK can all use JMX.
The authors have extensive firsthand experience with JMX from nearly every angle. Heather Kreger was an original member of the JMX Expert Group and personally contributed the specification, reference implementation (RI), and Technology Compatibility Kit (TCK) for model MBeans. She is now involved in Web services and applying management to this emerging space. Ward Harold is a member of the current JMX Expert Group (JSR 160), the lead architect for Tivoli's implementation of JMX and TMX4J, as well as Tivoli's Web Component Manager product, which uses JMX to manage resources. Leigh Williamson was a member of JSR 77 ("J2EE Management") and the architect for WebSphere's JMX support and JSR 77 support. This book represents our experience with JMX from all these projects: We bring you a unique insider perspective on the intent, implementation, application, and even pitfalls of JMX. All of this JMX experience is in the context of our extensive experience in all aspects of management systems and middleware.This book will be valuable for developers of applications that should be managed, developers of middleware, and developers of management systems. We hope that you will find it useful not only as an introduction to JMX, but also as a frequent desktop reference as you connect your application to an existing management system or start to develop your own management application. What You Need to Know before Reading This Book
This book assumes that you are familiar with developing applications using Java. We do not assume that you have experience with management systems. As such, the first chapter introduces management concepts, disciplines, and architectures. If you are familiar with management systems, then you may skip this chapter and start with Chapter 2 (Introduction to JMX).
Chapter 10(J2EE and JMX) explains JSR 77 ("J2EE Management") in depth, as well as how it relates to JMX. This chapter assumes that you have a high-level understanding of the components of the J2EE specification and its realization in J2EE application servers.Chapter 11(Web Services and JMX) explains how JMX can be used to develop manageable Web service applications. It will be helpful to have a general understanding of what a Web service is, and familiarity with common Web service architectures. What You Will Learn from Reading This Book
This book will provide you with the necessary information, insight, and examples for using JMX to build manageable mission-critical applications or provide a standard management interface to homegrown and third-party management applications.
It is sometimes as important to understand the context of Java technologies as it is to understand the technology itself. This is the case with JMX. Therefore, this book gives you almost two chapters (1 and 2) detailing the history of management systems, management architectures, applications, and technologies. In these chapters we also explain the forces that combined to make JMX so important for the Java community. This book gives you the background you need to understand and enter into conversations in the management industry.
Specifically, you will learn to develop standard and dynamic MBeans to represent JMX manageable resources in their applications. You will understand how and when to use the model MBean to rapidly develop extensible instrumentation and how to represent interdependent management components using the JMX relation service. Because instrumentation inevitably requires monitoring, this book discusses the use of JMX's various monitors and its notification model in detail. In addition, this book provides working sample code to illustrate the application of JMX technology in various settings, including J2EE and Web services.Software Needed to Complete the Examples All of the examples in this book, along with extras not in the book, can be downloaded from Addison-Wesley's Web site for this book:http://www.awprofessional.com/titles/0672324083.At a minimum, you will need to have a J2SE JDK and a JMX implementation installed on your computer to compile and run the samples shown throughout this book. These samples have been tested with the TMX4J. Some have also been tested with MX4J implementations. TMX4J is 100 percent Java code and should run on any platform, but it has been tested on a Windows operating system. TMX4J can be downloaded for free from the IBM alphaWorks Web site athttp://alphaworks.ibm.com.
The examples in Chapter 10 demonstrate solutions based on J2EE application server products such as WebSphere Application Server. The J2EE servers that support JMX and JSR 77 are listed in the appendix. Complete product information for WebSphere Application Server may be found on the Web athttp://www.ibm.com/products/websphere.
To run the examples in Chapter 11, you will need a Web services runtime including a Web server, servlet engine, SOAP engine, and JMX implementation. The samples in this chapter were tested with the IBM Web Services Tool Kit, which is available for free from the IBM alphaWorks Web site athttp://alphaworks.ibm.com.How This Book Is Organized
We have arranged the content of this book into three broad sections. Part I introduces management and JMX. Part II provides detailed and comprehensive coverage of the JMX architecture, APIs, programming techniques, and pitfalls. We even provide an entire chapter on design and implementation suggestions, along with our favorite pitfalls. Part III lays out the application of JMX in two fast-growing fields: J2EE and Web services.
We recognize that each reader will be interested in different portions of the book, and not everyone will need to read every chapter. Readers who are already familiar with management systems may skip Chapter 1 (Management Concepts), which introduces management concepts, disciplines, and architectures. We encourage everyone to read at least Chapter 2 (Introduction to JMX). You should feel free to read those chapters that most interest you or are most immediate to your needs. If you have a general understanding of JMX, then the rest of the chapters of the book can stand alone, so it is not necessary to read the book straight through.
The following is a quick summary of the contents of each of the three sections of the book:
Part I:JMX Introduction. The first part of the book, Chapters 1 and 2, introduces you to the management world and JMX. JMX is a management technology, and effective use of it requires some fundamental understanding of the aspects of management and JMX's role in each. Chapter 1 (Management Concepts) describes the basic concepts and vocabulary of system and applications management. It starts by highlighting the history of management technologies, and it explains management disciplines, applications, architectures, and information. Chapter 2 (Introduction to JMX) describes why and how JMX came about, and then introduces each of the fundamental elements of JMX, MBeans, MBeanServer, and notifications. We give you a hands-on tour of JMX, using a simple server and then instrumenting it for management using JMX to illustrate each of the elements. If you are new to management and JMX, we recommend that you read the chapters in this part first to provide common background material and terminology for the remainder of the book.
Part II:JMX Details. Part II is the meat of this book. This section gives you the comprehensive coverage of JMX along with practical examples and advice, including how to relate security to JMX. The management beans that you will need to be able to implement are introduced with extensive examples and advice in Chapter 3 (All about MBeans) and Chapter 4 (Model MBeans). Chapter 5 (The MBeanServer) describes the MBeanServer that is central to JMX's agent architecture and key to its flexibility. This chapter describes the interfaces and services that the MBeanServer provides: the MBean registry and object naming scheme, the generic MBean interface, the query mechanism, and the notification support. Chapter 6 (Monitors and Monitoring) and Chapter 7 (JMX Agent Services) will help you understand the standard services that JMX provides and how to use them. Chapter 8 (Securing JMX) covers a crucial topic that the JMX specification is silent on. This chapter describes the security exposures presented by the management domain and offers a transparent security layer based on the one designed for TMX4J. Finally, Part III closes with the pure gold of Chapter 9 (Designing with JMX). In this chapter, all the authors share their experiences with JMX and how these experiences can be used in real systems. Included are discussions on deployment models, instrumentation patterns, best practices, and pitfalls.
Part III:Application of JMX. Part III is where we see JMX positioned as a fundamental technology for new and fast-growing industries. Chapter 10 (J2EE and JMX) provides great detail, from one who was there, about how JMX's management of J2EE systems has been standardized with JSR 77. It includes examples of how JMX works in real-world application server products. The section ends with a look to the future in Chapter 11 (Web Services and JMX). This chapter gives a brief description of Web services and the management issues associated with them. It then illustrates how JMX can be used to make Web service-based applications manageable. It lays out how to manage the registry, the Web service execution environment, and the Web service itself.Appendix. The appendix provides a reference for implementers and users of JMX technology, including lists of JMX implementations, JMX-enabled management platforms, and JMX-instrumented products.