Expand my Community achievements bar.

Applications for the 2024-2025 Adobe Experience Manager Champion Program are open!
SOLVED

Programmatically modifying mbean properties

Avatar

Level 5

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.

1 Accepted Solution

Avatar

Correct answer by
Administrator

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

View solution in original post

4 Replies

Avatar

Level 10

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 ;
 

Avatar

Correct answer by
Administrator

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

Avatar

Level 5

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.

Avatar

Level 10

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