You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Juergen Mayrbaeurl <ju...@hvb.sozvers.at> on 2007/02/21 17:03:02 UTC

MBeans for components - exposing properties of components

I've just tried to expose the properties of a component as MBean attributes.
First I've overriden the method MBeanInfoProvider.getAttributeInfos() in my
component class. Nothing changed and the properties didn't show up.
Therefore I looked at the sources and found out that
ComponentMBeanImpl.registerMBeans() registers only 1 MBean for the LifeCyle
of the component and completly ignores any MBean attributes from the
component. Why is the method called 'registerMBeans'? It only registers one!

As a workaround I added a MBean exporter Spring bean. Works fine. But what's
about properties of LW components like the FilePoller (same for BC
servicemix-file). Create a new MBean? And where? What jmx domain?

Kind regards
Juergen

-- 
View this message in context: http://www.nabble.com/MBeans-for-components---exposing-properties-of-components-tf3267599s12049.html#a9083560
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: MBeans for components - exposing properties of components

Posted by Guillaume Nodet <gn...@gmail.com>.
The spec defines a helper available on the ComponentContext
to help creating mbeans for a given component.  You should use
it to create the mbean name, and register / unregister your mbeans
in the init / shutdown methods of the component.

On 2/21/07, Juergen Mayrbaeurl <ju...@hvb.sozvers.at> wrote:
>
> I've just tried to expose the properties of a component as MBean attributes.
> First I've overriden the method MBeanInfoProvider.getAttributeInfos() in my
> component class. Nothing changed and the properties didn't show up.
> Therefore I looked at the sources and found out that
> ComponentMBeanImpl.registerMBeans() registers only 1 MBean for the LifeCyle
> of the component and completly ignores any MBean attributes from the
> component. Why is the method called 'registerMBeans'? It only registers one!
>
> As a workaround I added a MBean exporter Spring bean. Works fine. But what's
> about properties of LW components like the FilePoller (same for BC
> servicemix-file). Create a new MBean? And where? What jmx domain?
>
> Kind regards
> Juergen
>
> --
> View this message in context: http://www.nabble.com/MBeans-for-components---exposing-properties-of-components-tf3267599s12049.html#a9083560
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet
------------------------
Architect, LogicBlaze (http://www.logicblaze.com/)
Blog: http://gnodet.blogspot.com/