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

JMX

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

Editor's Notes

  • #6 Figure 1.1 An environment with many applications that need management. Each has its own set of configuration and management tools.
  • #7 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.
  • #17 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.