You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@karaf.apache.org by Christian Schneider <ch...@die-schneider.net> on 2012/03/29 23:06:12 UTC

Idea how to better register Mbeans

Hi all,

we currently use the MBeanRegistrer class to register MBeans in Karaf. 
This creates a dependency from the module registering the mbean to the 
management.server module. So we can only install the mbeans when the 
.server module is also started. When the .server project is started all 
mbeans will be registered and available. This means that we currently 
have to have the mbeans in separate modules as we do not always want to 
start them.

So I propose we simply register the MBeans as an OSGi service instead of 
using the MBeanRegistrer. Then we can react on these services in the 
.server module.

So the project offering the MBean is independent of the module that 
implements the MBeanServer setup. As long as the .server module is not 
installed the MBeans are passive.
This means we could move the MBean impl to the core module and so remove 
a lot of modules.

Christian

-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com


Re: Idea how to better register Mbeans

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Christian,

it makes sense. It will "simplify" our modules (as we can remove the 
management sub-modules) and allow a flexible approach.

Regards
JB

On 03/29/2012 11:06 PM, Christian Schneider wrote:
> Hi all,
>
> we currently use the MBeanRegistrer class to register MBeans in Karaf.
> This creates a dependency from the module registering the mbean to the
> management.server module. So we can only install the mbeans when the
> .server module is also started. When the .server project is started all
> mbeans will be registered and available. This means that we currently
> have to have the mbeans in separate modules as we do not always want to
> start them.
>
> So I propose we simply register the MBeans as an OSGi service instead of
> using the MBeanRegistrer. Then we can react on these services in the
> .server module.
>
> So the project offering the MBean is independent of the module that
> implements the MBeanServer setup. As long as the .server module is not
> installed the MBeans are passive.
> This means we could move the MBean impl to the core module and so remove
> a lot of modules.
>
> Christian
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Idea how to better register Mbeans

Posted by Christian Schneider <ch...@die-schneider.net>.
Would that completely replace the management.server module or do we 
still need it for the external connector config?

Christian

Am 29.03.2012 23:36, schrieb Łukasz Dywicki:
> FYI we need a jmx.objectname property set (string or ObjectName) on service registration. Service should also implement a *MBean interface. Then aries jmx whiteboard should do the work.
>
>
> Wiadomość napisana przez Łukasz Dywicki w dniu 29 mar 2012, o godz. 23:21:
>
>> Hey Christian,
>> That's good idea and I belive that aries-jmx already implements that.
>>
>> Best regards,
>> Lukasz
>>
>> Wiadomość napisana przez Christian Schneider w dniu 29 mar 2012, o godz. 23:06:
>>
>>> Hi all,
>>>
>>> we currently use the MBeanRegistrer class to register MBeans in Karaf. This creates a dependency from the module registering the mbean to the management.server module. So we can only install the mbeans when the .server module is also started. When the .server project is started all mbeans will be registered and available. This means that we currently have to have the mbeans in separate modules as we do not always want to start them.
>>>
>>> So I propose we simply register the MBeans as an OSGi service instead of using the MBeanRegistrer. Then we can react on these services in the .server module.
>>>
>>> So the project offering the MBean is independent of the module that implements the MBeanServer setup. As long as the .server module is not installed the MBeans are passive.
>>> This means we could move the MBean impl to the core module and so remove a lot of modules.
>>>
>>> Christian
>>>
>>> -- 
>>> Christian Schneider
>>> http://www.liquid-reality.de
>>>
>>> Open Source Architect
>>> Talend Application Integration Division http://www.talend.com
>>>


-- 

Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com


Re: Idea how to better register Mbeans

Posted by Łukasz Dywicki <lu...@code-house.org>.
FYI we need a jmx.objectname property set (string or ObjectName) on service registration. Service should also implement a *MBean interface. Then aries jmx whiteboard should do the work.


Wiadomość napisana przez Łukasz Dywicki w dniu 29 mar 2012, o godz. 23:21:

> Hey Christian,
> That's good idea and I belive that aries-jmx already implements that.
> 
> Best regards,
> Lukasz
> 
> Wiadomość napisana przez Christian Schneider w dniu 29 mar 2012, o godz. 23:06:
> 
>> Hi all,
>> 
>> we currently use the MBeanRegistrer class to register MBeans in Karaf. This creates a dependency from the module registering the mbean to the management.server module. So we can only install the mbeans when the .server module is also started. When the .server project is started all mbeans will be registered and available. This means that we currently have to have the mbeans in separate modules as we do not always want to start them.
>> 
>> So I propose we simply register the MBeans as an OSGi service instead of using the MBeanRegistrer. Then we can react on these services in the .server module.
>> 
>> So the project offering the MBean is independent of the module that implements the MBeanServer setup. As long as the .server module is not installed the MBeans are passive.
>> This means we could move the MBean impl to the core module and so remove a lot of modules.
>> 
>> Christian
>> 
>> -- 
>> Christian Schneider
>> http://www.liquid-reality.de
>> 
>> Open Source Architect
>> Talend Application Integration Division http://www.talend.com
>> 
> 


Re: Idea how to better register Mbeans

Posted by Łukasz Dywicki <lu...@code-house.org>.
Hey Christian,
That's good idea and I belive that aries-jmx already implements that.

Best regards,
Lukasz

Wiadomość napisana przez Christian Schneider w dniu 29 mar 2012, o godz. 23:06:

> Hi all,
> 
> we currently use the MBeanRegistrer class to register MBeans in Karaf. This creates a dependency from the module registering the mbean to the management.server module. So we can only install the mbeans when the .server module is also started. When the .server project is started all mbeans will be registered and available. This means that we currently have to have the mbeans in separate modules as we do not always want to start them.
> 
> So I propose we simply register the MBeans as an OSGi service instead of using the MBeanRegistrer. Then we can react on these services in the .server module.
> 
> So the project offering the MBean is independent of the module that implements the MBeanServer setup. As long as the .server module is not installed the MBeans are passive.
> This means we could move the MBean impl to the core module and so remove a lot of modules.
> 
> Christian
> 
> -- 
> Christian Schneider
> http://www.liquid-reality.de
> 
> Open Source Architect
> Talend Application Integration Division http://www.talend.com
>