Programmatically modifying mbean properties | Community
Skip to main content
Level 5
October 29, 2015
Solved

Programmatically modifying mbean properties

  • October 29, 2015
  • 4 replies
  • 939 views

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.
Best answer by kautuk_sahni

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

4 replies

smacdonald2008
Level 10
October 29, 2015

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 ;
 
kautuk_sahni
Community Manager
kautuk_sahniCommunity ManagerAccepted solution
Community Manager
October 29, 2015

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
Level 5
October 30, 2015

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.

smacdonald2008
Level 10
October 30, 2015

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