[jboss-dev-forums] [Design of POJO Server] - JMX Queries and beans registered via @JMX annotation

bstansberry@jboss.com do-not-reply at jboss.com
Fri Nov 17 21:57:24 EST 2006


Just wanted to mention something I ran across so others are aware of it.

If you deploy a bean via -beans.xml (say for example an instance of ClusterPartition) and register it in JMX using the @JMX annotation, queries like this won't work any more: 


  |       MBeanServer server = MBeanServerLocator.locate();
  |       QueryExp exp = Query.and(
  |                         Query.eq(
  |                            Query.classattr(),
  |                            Query.value(ClusterPartition.class.getName ())
  |                         ),
  |                         Query.match(
  |                            Query.attr("PartitionName"),
  |                            Query.value(name)
  |                         )
  |                       );
  | 
  |       Set mbeans = server.queryMBeans (null, exp);

Problem is the restriction using the ClusterPartition class -- the object registered in JMX is an instance of AopContainerProxy, not ClusterPartition.

I found workarounds for this exact issue; this post is just an FYI for others.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3987034#3987034

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3987034



More information about the jboss-dev-forums mailing list