geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bordet, Simone" <simone.bor...@hp.com>
Subject RE: anyone any idea how to get the RMI JMX connector running inside Geronimo?
Date Wed, 29 Oct 2003 09:26:18 GMT
Hi,

> I can see how to use JSR 160 from Java code...
> 
> http://mx4j.sourceforge.net/docs/bk01ch03s03.html
> 
> I wonder is there any 'pure MBean' way to install a JSR 160 server 
> connector. e.g. an equivalent of the following for JSR 160?
> 
>      <mbean code="mx4j.tools.naming.NamingService" 
> name="Naming:type=rmiregistry">
>      </mbean>
>      <mbean code="mx4j.adaptor.rmi.jrmp.JRMPAdaptor" 
> name="Adaptor:protocol=JRMP">
>          <attribute name="JNDIName">jrmp</attribute>
>      </mbean>

This XML syntax is limited, unless you can pass objects as arguments to JSR 160 constructors.
Also, in JSR 160 you would use factories instead of constructors.

I am committing today a configuration file that is able to perform this; the format would
be:

<?xml version="1.0" encoding="UTF-8" ?>
<configuration port="8872">
  <startup>
    <register objectname="connectors:protocol=rmi">
      <call method="newJMXConnectorServer" classname="javax.management.remote.JMXConnectorServerFactory">
        <arg type="javax.management.remote.JMXServiceURL">service:jmx:rmi://localhost</arg>
        <arg type="java.util.Map" />
        <arg type="javax.management.MBeanServer" />
      </call>
    </register>
    <call objectname="connectors:protocol=rmi" operation="start" />
  </startup>
  <shutdown>
    <call objectname="connectors:protocol=rmi" operation="stop" />
    <unregister objectname="connectors:protocol=rmi" />
  </shutdown>
</configuration>

It should be extensible enough, but I'd love to hear comments about it.

> I had a quick look at CVS HEAD of mx4j and couldn't see any 
> obvious way 
> of doing this. Maybe we need a little MBean wrapper around 
> the Java API 
> (if there's not one already)?

Either the wrapper or an extended configuration file as above.
The wrapper can take a string instead of a JMXServiceURL, and hardcode the environment Map
so its constructor will be 
GeronimoRMIConnectorServer(String jmxServiceURL) which should be handy enough.

Simon

Mime
View raw message