-
Nov 11th, 2005, 06:05 AM
#1
How to access JMX Mbeans in Spring
I am testing JMX support in Spring,
I have an exporter, MbeanServer and a MBean in a application Context.xml.
How can I test whether this bean has been registered as a MBean with the MBean Server. I mean I want to get the property of my registered bean. How do I do this.?
Also, when I do a getBean on my Bean and then
boolean isBean = JmxUtils.isMBean(jmxBean.getClass());
it returns a false.
Can someone help/.
Following is my applicationContext.xml file:
<bean id="exporter"
class="org.springframework.jmx.export.MBeanExporte r">
<property name="beans">
<map>
<entry key="bean:name=testBean1" value-ref="testBean">
</entry>
</map>
</property>
<property name="server" ref="mbeanServer"/>
<!-- Beans which are not exported via MBean exporter can be automatically detected-->
<!--property name="autodetect" value="true"/-->
</bean>
<!-- Test JMX MBean -->
<bean id="testBean"
class="test.jmx.JmxTestBean">
<property name="myValue">
<value>20</value>
</property>
</bean>
<!--MBean Server -->
<bean id="mbeanServer"
class="org.springframework.jmx.support.MBeanServer FactoryBean"/>
Thanks,
Poonam
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules