MBeanServerNotificationFilter and ObjectName pattern

View: New views
2 Messages — Rating Filter:   Alert me  

MBeanServerNotificationFilter and ObjectName pattern

by Elodie Descarpentries :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I want to listen to MBeanServerNotification related to some MBeans,
therefore I use the MBeanServerNotificationFilter,
but when specifying pattern ObjectName (with wildcard) in my filter
criteria I do not receive the MBeanServerNotification I'm expecting.

The test I made :
MBeanServerNotificationFilter.enableObjectName(new ObjectName
("mydomain:mykey1=myvalue1,mykey2=myvalue2"))
    ==> notification correctly received
MBeanServerNotificationFilter.enableObjectName(new ObjectName
("mydomain:*"))
    ==> No notification received
MBeanServerNotificationFilter.enableObjectName(new ObjectName
("mydomain:mykey1=myvalue1,*"))
    ==> No notification received

Does MBeanServerNotificationFilter.enableObjectName(ObjectName)
support "pattern ObjectName" ?

Thanks
Elodie

===========================================================================
For information on the Java Management extensions (JMX), please visit
our home page at http://java.sun.com/products/JavaManagement/
The JMX-FORUM archives are accessible at http://archives.java.sun.com
To unsubscribe, send email to listserv@... and include in the body
of the message "signoff JMX-FORUM".  For general help, send email to
listserv@... and include in the body of the message "help".

Parent Message unknown Re: MBeanServerNotificationFilter and ObjectName pattern

by eamonn.mcmanus :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Bonjour Elodie,

Indeed, MBeanServerNotificationFilter does not work as you might expect when
given an ObjectName pattern.  You have to add an explicit list of ObjectNames.

It is easy enough to define your own NotificationFilter implementation that
does recognize ObjectName patterns (using ObjectName.apply to match), but
that does require both your client and server to have this class present.
You might also have problems serializing the NotificationFilter with some
connectors.  (The standard RMI and JMXMP connectors have no problem, though.)

I have logged a Request For Enhancement to track this, which you will be
able to see at <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6577604>
shortly.  But because this is a change in behaviour, we can only make it in
a new release of the Java platform.  That means you'll see it in JDK 7 but
not before.

Regards,
Éamonn McManus  --  JMX Spec Lead  --  http://weblogs.java.net/blog/emcmanus


On Thu, 5 Jul 2007 10:29:21 -0600, Elodie Descarpentries
<elodie.descarpentries@...> wrote:

>Hello,
>
>I want to listen to MBeanServerNotification related to some MBeans,
>therefore I use the MBeanServerNotificationFilter,
>but when specifying pattern ObjectName (with wildcard) in my filter
>criteria I do not receive the MBeanServerNotification I'm expecting.
>
>The test I made :
>MBeanServerNotificationFilter.enableObjectName(new ObjectName
>("mydomain:mykey1=myvalue1,mykey2=myvalue2"))
>    ==> notification correctly received
>MBeanServerNotificationFilter.enableObjectName(new ObjectName
>("mydomain:*"))
>    ==> No notification received
>MBeanServerNotificationFilter.enableObjectName(new ObjectName
>("mydomain:mykey1=myvalue1,*"))
>    ==> No notification received
>
>Does MBeanServerNotificationFilter.enableObjectName(ObjectName)
>support "pattern ObjectName" ?
>
>Thanks
>Elodie

===========================================================================
For information on the Java Management extensions (JMX), please visit
our home page at http://java.sun.com/products/JavaManagement/
The JMX-FORUM archives are accessible at http://archives.java.sun.com
To unsubscribe, send email to listserv@... and include in the body
of the message "signoff JMX-FORUM".  For general help, send email to
listserv@... and include in the body of the message "help".
LightInTheBox - Buy quality products at wholesale price!