Date: 2005-03-01T13:31:15 Editor: AchimHuegen Wiki: Jakarta HiveMind Wiki Page: JmxDoc URL: http://wiki.apache.org/jakarta-hivemind/JmxDoc
no comment Change Log: ------------------------------------------------------------------------------ @@ -36,7 +36,7 @@ }}} -Ensure that mx4j.jar and mx-tools.jar (mx4j 2.0.1) and log4j.jar are included in the classpath of your application. Start your application/tomcat and enter http://localhost:9000 in your browser. Read on [#QuickStartResults here] +Ensure that mx4j.jar, mx4j-tools.jar (mx4j 2.0.1) and log4j.jar are included in the classpath of your application. Start your application/tomcat and enter http://localhost:9000 in your browser. Read on [#QuickStartResults here] == J2SE 1.5 - Quickstart == @@ -58,8 +58,7 @@ }}} -Ensure that mx4j.jar (mx4j 2.0.1) and log4j.jar are include in the classpath of your application. Start the application (it should run some time), start jconsole -and connect to the local application. +Ensure that mx4j.jar (mx4j 2.0.1) and log4j.jar are included in the classpath of your application. Start the application, start jconsole and connect to the local application. [[Anchor(QuickStartResults)]] == Quick start results == @@ -74,13 +73,32 @@ = Tutorial = This chapter describes more detailed how to build jmx support into your hivemind application. -Actually it's just plug and play. There are a lot of default services and settings that may be -sufficient for your use case. +Actually it's just plug and play. There are a lot of default services and settings that may be sufficient for your use case. You will need a MBean server, at least one connector and of course some beans to manage. +But first: + +== Choose a jmx implementation == + +As far as I can tell there are three implementations of jmx 1.2 that are freely available. [http://mx4j.sourceforge.net MX4J], [http://java.sun.com/j2se/1.5.0/ J2SE 1.5] and the [http://java.sun.com/products/JavaManagement/download.html Sun reference implementation]. I would suggest to use MX4J if you don't have the chance of using J2SE 1.5. + +Since HiveMind MBeans use MX4J AbstractDynamicMBean as ancestor the mx4j-tools.jar is always needed in your classpath. Be sure to _not_ include mx4j.jar in the classpath, if you use Sun RI oder J2SE 1.5! + +=== Sun RI === + +Add jmxri.jar and jmxtools.jar to the classpath. + +=== MX4j === + +Add mx4j.jar, mx4j-tools.jar to the classpath. +Add mx4j-remote.jar if you use JSR 160 connectors. + +=== J2SE 1.5 === + +No additional libraries needed. == MBean Server == -First of all you need a running MBean Server in your application. Since JMX 1.2 there is a standardized factory for finding running servers and starting new ones. +A running MBean Server is needed in your application. Since JMX 1.2 there is a standardized factory for finding running servers and starting new ones. HiveMind first tries to find a running server. This could be provided by an application server or servlet engine (like Tomcat 5) or your J2SE 1.5 runtime environment. Add these lines to your module descriptor: {{{ @@ -89,7 +107,7 @@ </contribution> }}} -Connecting to a running server results in a unified management of infrastructure (like tomcat) and your applications mbeans. If no running server has been found, a new one is started. +Connecting to a running server results in a unified management of infrastructure mbeans (from tomcat or J2SE 1.5) and your applications mbeans. If no running server has been found, a new one is started. == Connectors == @@ -99,21 +117,31 @@ HTML Connectors are always specific for the jmx library you are using (that is J2SE 1.5, Sun RI, MX4J). -MX4J: +=== MX4J HTML Connector === + +Enable the MX4J HTML Connector by including these lines in your descriptor: + {{{ +<contribution configuration-id="hivemind.management.MBeans"> + <mbean service-id="hivemind.management.connector.HttpAdaptorMBean" start-method="start" /> +</contribution> }}} -Change the HTTP port using the symbol "management...." +The default HTTP Port is 9000 and can be changed this way: {{{ +<contribution configuration-id="hivemind.ApplicationDefaults"> + <default symbol="management.http.Port" value="9000" /> +</contribution> }}} -Now you can connect to your application using a standard browser. +Now you can connect to your application using a standard browser pointing to http://localhost:9000. == JSR 160 Connector == to be done .. +http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html == Export services as MBeans == --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
