Basically:

1. you define an interface to describe your MBean (like this: https://github.com/apache/karaf/blob/master/http/src/main/java/org/apache/karaf/http/core/HttpMBean.java)

2. you implement your MBean. This class extends StandardMBean and implements your interface (like this: https://github.com/apache/karaf/blob/master/http/src/main/java/org/apache/karaf/http/core/internal/HttpMBeanImpl.java)

3. Then, you register this MBean as a service using service properties for ObjectName (in the activator, or DS, or whatever).

Regards
JB

On 07/18/2016 07:20 AM, Pratt, Jason wrote:
Hi JB,
Thanks for the response, does that mean extending the standardmbean class and 
calling the super in the constructor? Or is there a simpler way to do it?

Kind regards,
Jason

-----Original Message-----
From: Jean-Baptiste Onofré [mailto:[email protected]]
Sent: Sunday, July 17, 2016 9:48 PM
To: [email protected]
Subject: Re: JMX annotations

Hi Jason,

In karaf 4, you just directly register a StandardMBean service with property 
containing the ObjectName.

Aries JMX uses a whiteboard partner to automatically register MBean in the 
MBeanServer.

Regards
JB

On 07/18/2016 05:54 AM, Pratt, Jason wrote:
Hello - I am looking at wiring up a few bundles for JMX, but I can't
seem to find any good examples for it. Can the standard JMX @MBean not
be used? I did find the Aries JMX page, but that didn't really provide
any useful information. Can anyone point me at a good example to use?

Kind regards,

Jason


--
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com


--
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com

Reply via email to