I have a remote MBean that we registered without using Spring (ie without MBeanExporter).
Locally, I would like to register a NotificationListener - reference docs suggest that is possible. However, example given uses MBeanExporter to register a NotificationListener. Could someone please point an example of how to register a listener w/out using an exporter?
I did the following to no effect:
Code:<bean id="masterStatsNotificationListenerHolder" class="org.springframework.jmx.export.NotificationListenerBean"> <property name="notificationListener" ref="masterMBeanNotificationListener"/> <property name="mappedObjectName" value="Hibernate:type=statistics,dataSource=masterDataSource"/> </bean> <bean id="masterMBeanNotificationListener" class="com.doppelganger.test.EnvmanagerStatisticsServiceMBeanNotificationListener"/> import javax.management.Notification; import javax.management.NotificationListener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * * @author nikita */ public class EnvmanagerStatisticsServiceMBeanNotificationListener implements NotificationListener { private static final Logger LOG = LoggerFactory.getLogger(EnvmanagerStatisticsServiceMBeanNotificationListener.class); public void handleNotification(Notification notification, Object handback) { LOG.info("notification=" + notification); LOG.info("handback=" + handback); } }


Reply With Quote
