You are trying to match on the attribute of an
mbean, not a property in the ObjectName. For this you need to
only specify the scope value of the match call. For
example, to find all mbeans in the jboss domain with
the service=invoker property in their
ObjectName:
import java.util.*;
import javax.management.*; QueryExp nameExp =
null;
QueryExp exp = nameExp; ObjectName scope = new ObjectName("jboss:*"); System.out.println("Query _expression_="+ exp); System.out.println("Scope="+ scope); ArrayList mbeanServers =
MBeanServerFactory.findMBeanServer(null);
Iterator iter = mbeanServers.iterator(); while (iter.hasNext()) { MBeanServer mbeanServer = (MBeanServer) iter.next(); Set names = mbeanServer.queryNames(scope, exp); System.out.println("Found invokers: " + names); } 08:57:10,489 INFO [STDOUT] Query
_expression_=null
08:57:10,489 INFO [STDOUT] Scope=jboss:service=invoker,* 08:57:10,519 INFO [STDOUT] Found invokers: [jboss:service=invoker,type=http,target=Naming,readonly=true, jb oss:service=invoker,type=jrmp, jboss:service=invoker,type=local, jboss:service=invoker,type=httpHA, jboss:se rvice=invoker,type=pooled, jboss:service=invoker,type=http, jboss:service=invoker,type=http,target=Naming] xxxxxxxxxxxxxxxxxxxxxxxx
Scott Stark Chief Technology Officer JBoss Group, LLC xxxxxxxxxxxxxxxxxxxxxxxx
|
Title: Message
- [JBoss-user] MBeanServer.queryNames() not working Callies, Peter
- Re: [JBoss-user] MBeanServer.queryNames() not working Scott M Stark
- RE: [JBoss-user] MBeanServer.queryNames() not working Callies, Peter
- Scott M Stark