Hey Matt,
Yes, you got the point - the mbean server is exposed by management bundle. 
Second part is registration of mbean. Because lack of jmx-whiteboard at the 
begining of Karaf there was bunch of places where MBeans were registered by 
hand (in XML). After all we extracted the "registrar" code and moved it to 
management core. Now every Karaf management bundle which going to expose own 
mbeans use it in following way:

<reference id="mbeanServer" interface="javax.management.MBeanServer">
   <reference-listener ref="mbeanRegistrer" bind-method="registerMBeanServer" 
unbind-method="unregisterMBeanServer"/>
</reference>

And then define mbeans
    <bean id="mbeanRegistrer" 
class="org.apache.karaf.management.MBeanRegistrer">
        <property name="mbeans">
            <map>
                <entry value="domain:type=blabla,name=${karaf.name}" 
key-ref="mbean-Implementation"/>
            </map>
        </property>
    </bean>

That's how it's handled in Karaf. Of course the JMX whiteboard is way's better 
to use because lack of direct dependencies to Karaf codebase.

Regards
Lukasz Dywicki
--
Code-House
http://code-house.org


Wiadomość napisana przez Matt Madhavan w dniu 2012-01-03, o godz. 19:16:

> Hi Lukasz,
> Could you please point me to an example? 
> 
> From your reply I understand that (pl correct me if I'm wrong),
> org.apache.karaf.management.core bundle exposes the MBean Server (Service
> Interface) which I can look it up and register my Mean using MBeanRegistrer.
> 
> But still some solid example will greatey help me!
> 
> Thanks
> Matt
> 
> --
> View this message in context: 
> http://karaf.922171.n3.nabble.com/KARAF-JMX-Aries-JMX-whiteboard-issue-tp3624040p3629858.html
> Sent from the Karaf - User mailing list archive at Nabble.com.


Reply via email to