Professional Documents
Culture Documents
JMX
Overview
• Purpose of JMX
• The JMX architecture
• A JMX example
• Q&A
Purpose of JMX
• JMX=Java Management eXtensions
• Manage Java components
– Control
– Configure
• Allow portable server components
• Integrate into existing management systems
The JMX architecture
• Three levels
– Instrumentation level (MBean)
– Agent level (MBeanServer)
– Distributed services level (Adaptor)
The JMX architecture
M anagem ent
c o n s o le
D is tr ib u t e d s e r v ic e s M Bean
(A d a p to r)
Agent M B e a n S e rv e r
M Bean M Bean
I n s t r u m e n t a t io n M Bean M Bean ( T im e r ) (M L e t)
The JMX architecture
• Standard MBeans
– MBean-specific interface declares methods and
attributes
• Dynamic MBeans
– Implements DynamicMBean interface
– Allows info about MBean to change at runtime
The JMX architecture
• Model MBeans
– Use a ModelMBean through delegation
M B e a n S e rv e r
M odel
M Bean
M anaged
re s o u rc e
A JMX example
package simplejmx;
import javax.management.MBeanRegistration;
import javax.management.MBeanServer;
import javax.management.ObjectName;
public class SimpleBean
implements MBeanRegistration, SimpleBeanMBean
{
String phrase;
public SimpleBean()
{
this("Hello World!");
}
public SimpleBean(String phrase)
{
setPhrase(phrase);
}
A JMX example
// SimpleBeanMBean implementation
public void printPhrase()
{
System.out.println(phrase);
}