SlideServe
Menu
Préférences
© SlideServe · v2026

Managing Components with JMX

dandre avatar
17 diapositives · 364 Views · Aug 22, 2014

Managing Components with JMX. Rickard Öberg JBoss. Overview. Purpose of JMX The JMX architecture A JMX example JMX in JBoss Q&A. Purpose of JMX. JMX=Java Management eXtensions Manage Java components Control Configure Allow portable server components

Managing Components with JMX - slide 1
01 / 17Managing Components with JMX
1 / 17

Télécharger la présentation

Managing Components with JMX
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Managing Components with JMX Rickard Öberg JBoss

  2. Overview • Purpose of JMX • The JMX architecture • A JMX example • JMX in JBoss • Q&A

  3. Purpose of JMX • JMX=Java Management eXtensions • Manage Java components • Control • Configure • Allow portable server components • Integrate into existing management systems

  4. The JMX architecture • Three levels • Instrumentation level (MBean) • Agent level (MBeanServer) • Distributed services level (Adaptor)

  5. The JMX architecture

  6. 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

  7. The JMX architecture • Model MBeans • Use a ModelMBean through delegation

  8. 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); }

  9. A JMX example // SimpleBeanMBean implementation public void printPhrase() { System.out.println(phrase); } public void setPhrase(String phrase) { this.phrase = phrase; } public String getPhrase() { return phrase; }

  10. A JMX example // MBeanRegistration implementation public ObjectName preRegister(MBeanServer server, ObjectName name) throws java.lang.Exception { return name == null ? new ObjectName(":service=SimpleBean") : name; } public void postRegister(java.lang.Boolean registrationDone) { if (registrationDone.booleanValue()) printPhrase(); } public void preDeregister() throws java.lang.Exception { } public void postDeregister() { } }

  11. A JMX example package simplejmx; public interface SimpleBeanMBean { public void printPhrase(); public void setPhrase(String phrase); public String getPhrase(); } • Name of interface is MBean class name suffixed with ”MBean” • Results in one manageable method, and one manageable attribute

  12. A JMX example • MLet configuration <MLET CODE = "simplejmx.SimpleBean" ARCHIVE="simplejmx.jar" CODEBASE="../../lib/ext/"> <ARG TYPE="java.lang.String" VALUE="Hey World!"> </MLET> <MLET CODE = "simplejmx.SimpleBean" ARCHIVE="simplejmx.jar" CODEBASE="../../lib/ext/” NAME=”:name=Simple”> </MLET> • ARG list needs to match constructor • Name is optional

  13. JMX in JBoss • JMX is used at core of Jboss • All functionality available as MBeans • Currently only Standard MBean model is used • Integration!

  14. JMX in JBoss • Some additional core services, which are MBeans too, have been added • ServiceControl • Lifecycle management (init/start/stop/destroy) • Configuration • Persistent configuration (as XML)

  15. JMX in JBoss • JBoss configuration XML: <server> <!-- Classloading --> <mbean code="org.jboss.web.WebService" name="DefaultDomain:service=Webserver"> <attribute name="Port">8083</attribute> </mbean> <!-- JNDI --> <mbean code="org.jboss.naming.NamingService" name="DefaultDomain:service=Naming"> <attribute name="Port">1099</attribute> </mbean> <!-- Transactions --> <mbean code="org.jboss.tm.TransactionManagerService" name="DefaultDomain:service=TransactionManager"> <attribute name="TransactionTimeout">300</attribute> </mbean> ...

  16. JMX in JBoss • Logging is done as an MBean, and uses notifications for filtering • Custom RMI adaptor • J2EE deployment services pluggable • EJB container factory is an MBean

  17. Q&A • JMX homepage:http://www.javasoft.com/products/JavaManagement/index.html • http://www.jboss.org • rickard@jboss.org