What is JMX?
The Java for Management eXtentions (JMX) specification defines a standard way of instrumenting and managing Java applications. The JMX Instrumentation and Agent Specification, v1.2 (October 2002) summarises JMX like this:
How does JAIN SLEE use JMX?
The JAIN SLEE 1.1 specification mandates using the JMX 1.2.1 MLet (management applet) specification for management clients to gain access to the SLEE MBean server and SLEE MBean objects.
What are m-lets?
An m-let is a management applet service that lets you instantiate and register one or more Java Management Beans (MBeans), from a remote URL, in the MBean server. The server loads text-based m-let configuration file that specifies information about MBeans to be loaded.
Metaswitch typically uses m-lets to implement JMX protocol adaptors. |
How does Rhino use m-lets?
Each node in a Rhino cluster runs an MBean server (Rhino {space-metadata-from:rhino-internal-version} uses the Java VM MBean server). When Rhino starts, it dynamically loads m-lets into those MBean servers, based on m-let text files stored in the following places:
-
Rhino SDK —
$RHINO_HOME/config/mlet.conf
-
Production Rhino —
$RHINO_HOME/node-XXX/config/permachine-mlet.conf
,$RHINO_HOME/node-XXX/config/pernode-node-mlet.conf
.
These configuration files conform to to the OpenCloud M-Let Config 1.1 DTD.
See the OpenCloud M-Let Config 1.1 DTD:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Use:
<!DOCTYPE mlets PUBLIC
"-//Open Cloud Ltd.//DTD JMX MLet Config 1.1//EN"
"http://www.opencloud.com/dtd/mlet_1_1.dtd">
-->
<!ELEMENT mlets (mlet*)>
<!--
The mlet element describes the configuration of an MLet. It contains an
optional description, an optional object name, an optional classpath, mandatory
class information, and optional class constructor arguments. Constructor
arguments must be specified in the order they are defined in the class
constructor.
-->
<!ELEMENT mlet (description?, object-name?, classpath?, class, arg*)>
<!--
The description element may contain any descriptive text about the parent
element.
Used in: mlet
-->
<!ELEMENT description (#PCDATA)>
<!--
The object-name element contains the JMX object name of the MLet. If the name
starts with a colon (:), the domain part of the object name is set to the
domain of the agent registering the MLet.
Used in: mlet
Example:
<object-name>Adaptors:name=MyMLet</object-name>
-->
<!ELEMENT object-name (#PCDATA)>
<!--
The classpath element contains zero or more jar-url elements specifying jars
to be included in the classpath of the MLet and an optional specification
identifying security permissions that should be granted to classes loaded
from the specifed jars.
Used in: mlet
-->
<!ELEMENT classpath (jar-url*, security-permission-spec?)>
<!--
The jar-url element contains a URL of a jar file to be included in the
classpath of the MLet.
Used in: classpath
Example:
<jar-url>file:/path/to/location/of/file.jar</jar-url>
-->
<!ELEMENT jar-url (#PCDATA)>
<!--
The security-permission-spec element specifies security permissions based on
the security policy file syntax. Refer to the following URL for definition of
Sun's security policy file syntax:
http://java.sun.com/j2se/1.3/docs/guide/security/PolicyFiles.html#FileSyntax
The security permissions specified here are granted to classes loaded from the
jar files identified in the jar-url elements in the classpath of the MLet.
Used in: jar
Example:
<security-permission-spec>
grant {
permission java.lang.RuntimePermission "modifyThreadGroup";
};
</security-permission-spec>
-->
<!ELEMENT security-permission-spec (#PCDATA)>
<!--
The class element contains the fully-qualified name of the MLet's MBean class.
Used in: mlet
Example:
<class>com.opencloud.slee.mlet.mymlet.MyMlet</class>
-->
<!ELEMENT class (#PCDATA)>
<!--
The arg element contains the type and value of a parameter of the MLet class'
constructor.
Used in: mlet
-->
<!ELEMENT arg (type, value)>
<!--
The type element contains the fully-qualified name of the parameter type. The
currently supported types for MLets are: Java primitive types, object wrappers
for Java primitive types, and java.lang.String.
Used in: arg
Example:
<type>int</type>
-->
<!ELEMENT type (#PCDATA)>
<!--
The value element contains the value for a parameter. The value must be
appropriate for the corresponding parameter type.
Used in: arg
Example:
<value>8055</value>
-->
<!ELEMENT value (#PCDATA)>
<!ATTLIST mlet enabled CDATA #IMPLIED >
Structure of the m-let text file
<mlets>
<mlet enabled="true">
<classpath>
<jar-url> </jar-url>
<security-permission-spec>
</security-permission-spec>
</classpath>
<class> </class>
<arg>
<type></type>
<value></value>
</arg>
</mlet>
<mlet enabled="true">
</mlet>
The m-let text file can contain any number of MLET tags, each for instantiating a different MBean.
-
classpath — The classpath defines the code source of the MBean to be loaded.
-
jar-url — The URL to be used for loading the MBean classes.
-
security-permission-spec — Defines the security environment of the MBean.
-
-
class — The main class of the MBean to be instantiated.
-
arg — There may be zero or more arguments to the MBean. Each argument is defined by an arg element. The set of arguments must correspond to a constructor defined by the MBean main class.
-
type — The Java type of the argument.
-
value — The value of the argument.
-
For details on m-lets included in Metaswitch Rhino, see JMX Remote Adaptor M-let |