Skip to main content
Level 5
Oct 29, 2015 1:04 AM UTC
Solved

Programmatically modifying mbean properties

Is there a way to set properties of a JMX MBean in a bundle activator? I know this can be done through curl .. but was looking for inputs on how the same can be achieved in Java. Thanks.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
kautuk_sahni
kautuk_sahniAccepted solution
Level 9
Oct 29, 2015 4:53 AM UTC

Hi 

Adding one more reference link : https://helpx.adobe.com/experience-manager/using/sling_servlet_mbean.html

I hope it would be some help for you.

 

Thanks and regards

Kautuk Sahni

Kautuk Sahni

4 replies

smacdonald2008
Level 10
Oct 29, 2015 1:22 AM UTC

We have a communtiy artilce that shows how to work with MBean using an API. See this one: 

https://helpx.adobe.com/experience-manager/using/aem-first-components1.html

This one uses these APIs:

import javax.management.MBeanServerConnection;
import javax.management.MBeanServer ;
 
Translate
kautuk_sahni
kautuk_sahniAccepted solution
Level 9
Oct 29, 2015 4:53 AM UTC

Hi 

Adding one more reference link : https://helpx.adobe.com/experience-manager/using/sling_servlet_mbean.html

I hope it would be some help for you.

 

Thanks and regards

Kautuk Sahni

Translate
Kautuk Sahni
Level 5
Oct 30, 2015 2:48 AM UTC

Thanks so much for the links Donald / Kautuk.

I used MBeanServer and was able to get a reference to one of the MBeans.

But when I try it with "org.apache.jackrabbit.oak:type=CompactionStrategy" to set some of the flags related to online compaction, it returns back a null object. I can see this MBean in the jmx console.

Any ideas on why this may be happening?

Thanks again.

Translate
smacdonald2008
Level 10
Oct 30, 2015 11:30 AM UTC

If a null value is being returned, it means you are not referencing a proper mbean.

Translate