users@glassfish.java.net

MBean and Management Rule: Observed Attribute not reachable

From: <glassfish_at_javadesktop.org>
Date: Mon, 14 Dec 2009 03:08:55 PST

I an trying to monitor a attributes value which is listed on jconsole. I am successfully retreiving the attributes value using JMX.

1. I create a custom MBean to get the value of this attribute.
2. I create anoter action mbean which will send notification if the value of this attribute changes.
3. I create a monitor management rule and observe the value of this attribute.

When the value of the attribute changes; i see "Observed attribute not accessible by the mbean" when i print notification.getMessage().

Following are the relevant entries from my domain.xml:

<mbean enabled="true" impl-class-name="com.instance.state.InstanceState" name="NAMBean" object-name="user:impl-class-name=com.instance.state.InstanceState,name=NAMBean" object-type="user"/>

<mbean enabled="true" impl-class-name="com.instance.state.InstanceStateAction" name="NAMBeanAction" object-name="user:impl-class-name=com.instance.state.InstanceStateAction,name=NAMBeanAction" object-type="user"/>

<management-rule enabled="true" name="instance_monitor">
<event level="WARNING" record-event="true" type="monitor">
<property name="observedmbean" value="NAMBean"/>
<property name="observedattribute" value="StateValue"/>
<property name="monitortype" value="stringmonitor"/>
<property name="stringnotify" value="notifydiffer"/>
<property name="stringtocompare" value="2"/>
</event>
<action action-mbean-name="NAMBeanAction"/>
</management-rule>


P.S the stateValue is the variable which my first custoem MBean returns.

Any help would be appreciated.
[Message sent by forum member 'lazania' ]

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