users@glassfish.java.net

Re: Should MBean IMPL call the sendNotification() method inside setter?

From: <glassfish_at_javadesktop.org>
Date: Thu, 18 Oct 2007 22:31:59 PDT

Hi ,
As you suggested ,I have created the StringMonitor as below.
  [i]try {
        JMXMonitorMgr mntrMgr=getDomainRoot().getJMXMonitorMgr();
        try{
            mntrMgr.remove(monitorName);
            System.out.println("Existing Monitor removed");
        }catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
       AMXStringMonitor strMonitor=(AMXStringMonitor) ntrMgr.createStringMonitor(monitorName);
        strMonitor.addObservedObject(on);
        strMonitor.setNotifyDiffer(valueDifferNotification);
        strMonitor.setNotifyMatch(valueMatchNotification);
        strMonitor.setObservedAttribute(attribute);
        strMonitor.setStringToCompare(attributeMatchValue);
        strMonitor.setGranularityPeriod(1000);
        strMonitor.start();
        
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }[/i]

But I am not getting any notifications.I can see the logs for every second(GranularityPeriod is one second).

What could be the issue?
[Message sent by forum member 'karanvpraba' (karanvpraba)]

http://forums.java.net/jive/thread.jspa?messageID=241106