Presented by   Haitham Raik Java Management Extension (JMX)
<ul><li>Overview. </li></ul><ul><li>Benefits. </li></ul><ul><li>JMX Architecture. </li></ul><ul><li>MBeans. </li></ul><ul>...
<ul><li>JMX is an API for managing java applications. </li></ul><ul><li>Defined by JSR 3 (JMX API) and JSR 160 (JMX Remote...
<ul><li>Easy of use. </li></ul><ul><li>Leveraging existing technologies. </li></ul><ul><li>Componentization. </li></ul><ul...
JMX Architecture
JMX Architecture  (cont.)
JMX Architecture  (cont.)
<ul><li>MBean stands for “managed bean”. </li></ul><ul><li>MBeans can represent a resource: </li></ul><ul><ul><li>Applicat...
<ul><li>MBeans provide: </li></ul><ul><ul><li>Information about resources using attributes that can be read and/or written...
<ul><li>MBean example: </li></ul>MBeans   (cont.) CacheControlMBean size: int  RW used: int  R Attributes save(): void dro...
<ul><li>The simplest way to define an MBean. </li></ul><ul><li>Create a java interface called  Something MBean that define...
Standard MBeans   (cont.)
Standard MBeans   (cont.)
<ul><li>The core of the agent. It provides a registry for MBeans. </li></ul><ul><li>Allows clients to discover and execute...
<ul><li>Registering your MBean </li></ul><ul><li>//  MBeanServerFactory.createMBeanServer() </li></ul><ul><li>MBeanServer ...
<ul><li>JMX Agent is the container for an MBean server. </li></ul><ul><li>JMX Agent provides a set of services for managin...
<ul><li>Add remote capability to the JMX spec. </li></ul><ul><li>Makes the JMX agent accessible from outside the JVM. </li...
<ul><li>Connector: makes MBean server accessible to remote java technology based clients (e.g., RMI). </li></ul><ul><li>Ad...
<ul><li>Example: </li></ul><ul><li>HtmlAdaptorServer adapter =  </li></ul><ul><li>new HtmlAdaptorServer(); </li></ul><ul><...
<ul><li>“ write once run anywhere”. </li></ul><ul><li>It was difficult to manage j2ee applications on different Applicatio...
<ul><li>It is based on JMX specification. </li></ul><ul><li>Part of j2ee 1.4 specification. </li></ul><ul><li>MEJB is a se...
<ul><li>JSR 3 defined the JMX API, version 1.0 </li></ul><ul><ul><li>Maintenance reviews defined versions 1.1, 1.2 </li></...
JMX API Versions  (cont.)
<ul><li>Sun JMX 1.2.1 and Remote API 1.0 RI. </li></ul><ul><li>JDMK 4.2 from Sun Microsystems. </li></ul><ul><li>TMX4J 1.0...
<ul><li>Tivoli Web Component Manager. </li></ul><ul><li>Dirig Software. </li></ul><ul><li>AdventNet Middleware Manager. </...
Demo
Thank you Java Management Extension (JMX)
Upcoming SlideShare
Loading in …5
×

JMX

3,199 views

Published on

Published in: Technology
0 Comments
5 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,199
On SlideShare
0
From Embeds
0
Number of Embeds
59
Actions
Shares
0
Downloads
0
Comments
0
Likes
5
Embeds 0
No embeds

No notes for slide
  • Figure 1.1 An environment with many applications that need management. Each has its own set of configuration and management tools.
  • Figure 1.2 An environment with many applications that need management. Each is represented by its own MBean and managed through a single management tool using any number of protocols or transports. The three JMX layers are delimited by dotted lines.
  • Services are themselves MBeans Relation Service: phone system – to disable one device you need to disable it and remove it from routing table Mlet: you can’t stop a monitoring application and you want to add more MBeans at runtime.
  • JMX

    1. 1. Presented by Haitham Raik Java Management Extension (JMX)
    2. 2. <ul><li>Overview. </li></ul><ul><li>Benefits. </li></ul><ul><li>JMX Architecture. </li></ul><ul><li>MBeans. </li></ul><ul><li>Standard MBeans. </li></ul><ul><li>MBean Server. </li></ul><ul><li>JMX Agents. </li></ul><ul><li>JMX Remote API. </li></ul><ul><li>J2EE Management. </li></ul><ul><li>JMX API Versions. </li></ul><ul><li>Available JMX Agent Implementations. </li></ul><ul><li>JMX Managers. </li></ul><ul><li>Demo. </li></ul>Agenda
    3. 3. <ul><li>JMX is an API for managing java applications. </li></ul><ul><li>Defined by JSR 3 (JMX API) and JSR 160 (JMX Remote API). </li></ul><ul><li>Standard in J2SE and J2EE 1.4 specifications. </li></ul><ul><li>Can be used for </li></ul><ul><ul><li>Management of running applications, for example: changing configuration settings. </li></ul></ul><ul><ul><li>Monitoring of running applications, for example: obtaining statistics and error notifications. </li></ul></ul>Overview
    4. 4. <ul><li>Easy of use. </li></ul><ul><li>Leveraging existing technologies. </li></ul><ul><li>Componentization. </li></ul><ul><li>Alerts, events, and statistics. </li></ul><ul><li>Rapid monitoring solutions. </li></ul>Benefits
    5. 5. JMX Architecture
    6. 6. JMX Architecture (cont.)
    7. 7. JMX Architecture (cont.)
    8. 8. <ul><li>MBean stands for “managed bean”. </li></ul><ul><li>MBeans can represent a resource: </li></ul><ul><ul><li>Application configuration settings. </li></ul></ul><ul><ul><li>Program module. </li></ul></ul><ul><ul><li>User identity. </li></ul></ul><ul><ul><li>Device. </li></ul></ul>MBeans
    9. 9. <ul><li>MBeans provide: </li></ul><ul><ul><li>Information about resources using attributes that can be read and/or written. </li></ul></ul><ul><ul><li>Operations that can be invoked on resources. </li></ul></ul><ul><ul><li>Notifications that the MBean can send. </li></ul></ul><ul><li>Use design patterns similar to JavaBeans. </li></ul><ul><li>The instrumentation layer of the JMX architecture is all about MBeans. </li></ul>MBeans (cont.)
    10. 10. <ul><li>MBean example: </li></ul>MBeans (cont.) CacheControlMBean size: int RW used: int R Attributes save(): void dropOldest(int n): int Operations “ com.b1me.cache.full” Notifications
    11. 11. <ul><li>The simplest way to define an MBean. </li></ul><ul><li>Create a java interface called Something MBean that defines the MBean attributes and operations. </li></ul><ul><li>Create a java class called Something that implements that interface. </li></ul>Standard MBeans
    12. 12. Standard MBeans (cont.)
    13. 13. Standard MBeans (cont.)
    14. 14. <ul><li>The core of the agent. It provides a registry for MBeans. </li></ul><ul><li>Allows clients to discover and execute operations exposed by the MBeans. </li></ul><ul><li>Each MBean is registered with its ObjectName. </li></ul><ul><li>You can have more than one MBean server per JVM </li></ul><ul><li>But usually everyone uses the Platform MBean server </li></ul><ul><ul><li>ManagementFactory.getPlatformMBeanServer(); </li></ul></ul>MBean Server
    15. 15. <ul><li>Registering your MBean </li></ul><ul><li>// MBeanServerFactory.createMBeanServer() </li></ul><ul><li>MBeanServer mbs = </li></ul><ul><li>ManagementFactory.getPlatformMBeanServer(); </li></ul><ul><li>ObjectName name = </li></ul><ul><li> new ObjectName( “ com.example : type=CacheControl ” ); </li></ul><ul><li>CacheControl cc = new CacheControl(cache); </li></ul><ul><li>mbs.registerMBean(cc, name); // createMBean </li></ul>MBean Server (cont.) Domain one or more key properties
    16. 16. <ul><li>JMX Agent is the container for an MBean server. </li></ul><ul><li>JMX Agent provides a set of services for managing a set of MBeans: </li></ul><ul><ul><li>Relation Service: allows the definition of relationships between MBeans. </li></ul></ul><ul><ul><li>Monitors: Observe MBean attributes and emit notifications when values change. </li></ul></ul><ul><ul><li>Timers: Emits user defined notifications at specific times. </li></ul></ul><ul><ul><li>Mlet: dynamically adds class files to the server either locally or from a remote location. </li></ul></ul>JMX Agent
    17. 17. <ul><li>Add remote capability to the JMX spec. </li></ul><ul><li>Makes the JMX agent accessible from outside the JVM. </li></ul><ul><li>Developed through the JCP JSR 160. </li></ul><ul><li>Standard support via RMI connector. </li></ul><ul><li>Optional support via TCP. </li></ul><ul><li>Also support lookup services and defines security between the client and server. </li></ul>JMX Remote API
    18. 18. <ul><li>Connector: makes MBean server accessible to remote java technology based clients (e.g., RMI). </li></ul><ul><li>Adaptor: makes MBean server accessible via protocol transalations (e.g., HTTP, SNMP). </li></ul>JMX Remote API (cont.)
    19. 19. <ul><li>Example: </li></ul><ul><li>HtmlAdaptorServer adapter = </li></ul><ul><li>new HtmlAdaptorServer(); </li></ul><ul><li>ObjectName adapterName = </li></ul><ul><li>new ObjectName ( “module1:name=htmladapter,port=9092“ ); </li></ul><ul><li>adapter.setPort( 9092 ); </li></ul><ul><li>mbs.registerMBean( adapter, adapterName ); </li></ul><ul><li>adapter.start(); </li></ul>JMX Remote API (cont.)
    20. 20. <ul><li>“ write once run anywhere”. </li></ul><ul><li>It was difficult to manage j2ee applications on different Application Servers. </li></ul><ul><li>“ write once manage anywhere”. </li></ul>J2EE Management
    21. 21. <ul><li>It is based on JMX specification. </li></ul><ul><li>Part of j2ee 1.4 specification. </li></ul><ul><li>MEJB is a session bean to expose the agent to remote clients. </li></ul>J2EE Management (cont.)
    22. 22. <ul><li>JSR 3 defined the JMX API, version 1.0 </li></ul><ul><ul><li>Maintenance reviews defined versions 1.1, 1.2 </li></ul></ul><ul><ul><li>Version 1.2 is what’s in j2se 5.0 and j2ee 1.4 </li></ul></ul><ul><li>JSR 160 defined the JMX remote API, version 1.0 </li></ul><ul><ul><li>Version 1.0 is what’s in j2se 5.0 </li></ul></ul><ul><li>JSR 255 merges and updates JSR 3 and 160 </li></ul><ul><ul><li>It will introduce JMX API version 2.0 in j2se 7.0 </li></ul></ul><ul><ul><li>Intermediate version 1.3 in j2se 6.0 </li></ul></ul>JMX API Versions
    23. 23. JMX API Versions (cont.)
    24. 24. <ul><li>Sun JMX 1.2.1 and Remote API 1.0 RI. </li></ul><ul><li>JDMK 4.2 from Sun Microsystems. </li></ul><ul><li>TMX4J 1.0 from Tivoli Systems. </li></ul><ul><li>AdventNet Agent Toolkit Java/JMX Edition. </li></ul><ul><li>AdventNet ManageEngine. </li></ul><ul><li>MX4J. </li></ul>Available JMX Agent Impl.
    25. 25. <ul><li>Tivoli Web Component Manager. </li></ul><ul><li>Dirig Software. </li></ul><ul><li>AdventNet Middleware Manager. </li></ul><ul><li>AdventNet Web NMS. </li></ul><ul><li>Vigor Soft hawkEye. </li></ul>JMX Managers
    26. 26. Demo
    27. 27. Thank you Java Management Extension (JMX)

    ×