Hi,

Am Dienstag, den 02.08.2011, 18:07 -0500 schrieb Matt Madhavan:
> Hello,
> I want to export one of bundle (service) as a JMX service. It was so
> easy to do so in SpringDM. I'm sure we have something similar in
> Aries. But I cannot find any documentation on it at all.
> 
> 
> I have see the Aries(BluePrint) JMX extender bundles. But not sure how
> to use them.
> 
> 
> Can some one point me to the right documentation/sample please?

There are basically two options:

  * Get the MBeanServer service and register your MBean therewith
  * Register your MBean as a service have the Aries JMX Whiteboard
    support handle the rest.

I prefer the latter since it is more like OSGi and easier to do. Just
ensure your MBean implements some MBean interface (mostly extending from
DynamicMBean) and have a jmx.objectname service registration property
defining the MBean name.

The jmx.objectname service registration property is mandatory and
identifies the service to be an MBean. If the property is empty, the
service must implement the MBeanRegistration interface to provide the
ObjectName during registration. The actual MBean interface implemented
by the service is found by introspection.

Thus an extremely simple sample would be:

   class SampleBean implements SampleMBean { ... }
   bundleContext.registerService(Object.class,
        new SampleBean(),
        new Hashtable() {{
           put("jmx.objectname", "domain:name=sample");}});

Regards
Felix

> 
> 
> Thanks in advance!
> 
> 
> Matt
> 
> 
> 
> 


Reply via email to