Hi Am and Chetan,
Thanks for the reply. Can you guys send me some more examples or pointers to
some other examples?
Also the following config in spring (no springDM) will expose any POJO as a
JMX MBean.
<bean id="sample" class="com.xxxx.*SampleBean*">
<property name="beanProp" ref="whatEver" />
</bean>
<bean id="exporter" class="org.springframework.jmx.export.MBeanExporter"
lazy-init="false">
<property name="beans">
<map>
<entry key="bean:name=sample" value-ref="*sample*" />
</map>
</property>
</bean>
It essentially replaces the first part of code sample you sent as below
*class SampleBean implements SampleMBean { ... }*
Now I wonder how do I modify the xml code fragment you sent as below:
bundleContext.registerService(Object.class,
new SampleBean(),
new Hashtable() {{
put("jmx.objectname", "domain:name=sample");}});
I wonder if can marry the SpringJMX exporter exporting an JMX instrumented
class and creating an OSGi service using Aries JMX while board.
Also, is there any documentation on Aries JMX whiteboard?
Thanks
Matt
On Wed, Aug 3, 2011 at 2:35 AM, Felix Meschberger <[email protected]>wrote:
> 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
> >
> >
> >
> >
>
>
>