[jboss-user] [Management, JMX/JBoss] - Why am I not receiving Notifications?
mskonda
do-not-reply at jboss.com
Mon Oct 9 12:51:32 EDT 2006
My primary goal is to receive notifications from Naming (JNDI) MBean - that is, receive notifications for any additions or deletions or modificatios to the JNDI namespace.
I have followed the wiki ListenerServiceMBeanSupport example and created a dummy notication lsitener which just prints out the info messages.
The xxx-service.xml is given below:
<?xml version="1.0" encoding="UTF-8"?>
|
| <server>
|
| <mbean code="com.cmi2.facility.notifications.JNDINotificationListener"
| name="cmi2-listeners:faciltiy=jndiNotifactionListener">
| <attribute name="SubscriptionList">
| <subscription-list>
| <mbean name="jboss:service=Naming">
| <filter factory="AttributeChangeNotificationFilterFactory">
| <enable attribute-name="State"/>
| <enable attribute-name="Name"/>
| <enable attribute-name="MethodMap"/>
| </filter>
| </mbean>
| </subscription-list>
| </attribute>
| </mbean>
| </server>
Unfortunately I can't get see any notifications received when I bind/unbind objects to the jndi namespace.
My listener is below:
| public class JNDINotificationListener extends ListenerServiceMBeanSupport
| implements JNDINotificationListenerMBean {
| /*
| * Logger
| */
| private Logger logger =
| Logger.getLogger(AbstractFlowComponent.class.getName());
|
| public JNDINotificationListener()
| {
| logger.info("JNDINotificationListener constructor");
| }
|
| public void startService() throws Exception
| {
| super.subscribe(true);
| }
|
| public void stopService() throws Exception
| {
| super.unsubscribe();
| }
| public void handleNotification2(Notification n, Object handBack)
| {
| logger.info("Received Notification: "+n+", handback: "+handBack);
| }
| }
|
|
Ideally i want to extend the notification listeners for other services too..
Any pointers to what I'm doing wrong?
Thanks
Madhu
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3977022#3977022
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3977022
More information about the jboss-user
mailing list