I have two bean BeanA and BeanB. BeanA has a BeanB as its member variable.
public class BeanA{
private BeanB b
pubilc BeanB getBeanB(){
return b;
}
public void setBeanB(BeanB b){
this.b = b;
}
}
Both of them are registered as MBeans in configuration file like this
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<!-- Contains beans which needs to be exposed as MBeans by spring framework -->
<beans>
<bean id="exporter" class="org.springframework.jmx.export.MBeanExporte r">
<property name="beans">
<map>
<entry key="bean:name=MBeanA">
<ref local="beanA"/>
</entry>
<entry key="bean:name=MBeanB">
<ref local="beanB"/>
</entry>
</map>
</property>
</bean>
<!-- User defined beans -->
<bean id="beanA" class="BeanA">
<constructor-arg>
<ref bean="beanB"/>
</constructor-arg>
</bean>
<bean id="beanB" class="BeanB"/>
</beans>
How can i get beanB as an MBean inside MBeanA so that when i view MBeanA in jmx console i see beanB as an nested MBean inside MBeanA.
Thanks in advance
Sameer Garg.


Reply With Quote