You can try:
org.springframework.jmx.support.JmxUtils.locateMBeanServer();
and
org.springframework.jmx.support.JmxUtils.locateMBeanServer(String agentId);
Both are public static methods and return an instance of MBeanServer
.
see: JavaDoc
Question
I have a requirement in which I have to get the mbean server dynamically and register a new MBean to it.The Mbean Server is created using spring.Can anyone suggest me how can it be implemented?
Thanks,
Solution
You can try:
org.springframework.jmx.support.JmxUtils.locateMBeanServer();
and
org.springframework.jmx.support.JmxUtils.locateMBeanServer(String agentId);
Both are public static methods and return an instance of MBeanServer
.
see: JavaDoc