-
May 26th, 2006, 05:00 PM
#1
NotificationBroadcastSupport with Spring's JMX
I have started using Spring's JMX wiring mechanism and everything works fine with the exception of a class that extends javax.management.NotificationBroadcasterSupport.
When using the very cool and convenient wiring as follows;
<bean id="ebsMonitorHighErrorTranslator" class="com.ebs.commons.management.EBSMonitorHighEr rorTranslator" init-method="init">
<property name="monitors">
<list>
<ref bean="overallLatencyHighMonitor"/>
<ref bean="overallLatencyAvgMonitor"/>
</list>
</property>
</bean>
<entry key="${jmx_domain_name}:adapter=MonitorHighErrorAd apter" value-ref="ebsMonitorHighErrorTranslator"/>
No MBeanNotificationInfo is surfaced to any JMX Client and the notifications never get broadcast.
When I change to the boorish and brute force method of creating a home grown proxy for the bean and manually registering it with the MBeanServer all works fine and well.
<bean id="ebsMonitorHighErrorTranslator" class="com.ebs.commons.management.EBSMonitorHighEr rorTranslator" init-method="init">
<property name="monitors">
<list>
<ref bean="overallLatencyHighMonitor"/>
<ref bean="overallLatencyAvgMonitor"/>
</list>
</property>
</bean>
<bean id="ebsMonitorHighErrorTranslatorMBean" class="com.ebs.commons.management.AnnotatedStandar dEmitterMBean">
<constructor-arg index="0" ref="ebsMonitorHighErrorTranslator"/>
<constructor-arg index="1" value="javax.management.NotificationEmitter"/>
</bean>
<bean id="HighErrorTxName" class="javax.management.ObjectName" factory-method="getInstance">
<constructor-arg value="${jmx_domain_name}:adapter=MonitorHighError Adapter"/>
</bean>
<bean class="org.springframework.beans.factory.config.Me thodInvokingFactoryBean">
<property name="targetObject" ref="mbeanServer"/>
<property name="targetMethod" value="registerMBean"/>
<property name="arguments">
<list>
<ref bean="ebsMonitorHighErrorTranslatorMBean"/>
<ref bean="HighErrorTxName"></ref>
</list>
</property>
</bean>
Having had a similar experience with a previous project, before Spring’s JMX support was available, I am wondering if perhaps the same bug that plagued me then is causing this problem in Spring.
Sun’s implementation of StandardMBean has a problem when used with JMXNotifications. See supplied link http://bugs.sun.com/bugdatabase/view...bug_id=6252526
In the supplied sample Spring configuration, my class, com.ebs.commons.management.AnnotatedStandardEmitte rMBean is an implementation of the suggested bug fix that understands J2SE 5.0 annotations.
My question is, does there exist a Spring based work around for this problem, or am I chasing a non-existent problem through my own ignorance on using Spring and JMX?
Thanx
-jay-
jsimonini@ebs.com
Semper Fi
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