This content has been marked as final.
Show 2 replies
-
1. Re: JBoss: Query JMX agent to find all deployed war
peterj Jun 4, 2010 5:37 PM (in response to vsrivastav)Vivek, welcome to the JBoss forums!
You can do this using twiddle from the command line as follows:
twiddle query "jboss.web.deployment:*"
Prgrammatically, you would create an ObjectName using "jboss.web.deployment:*" and pass that to the MBeanServerConnection.queryMBeans method.to the
-
2. Re: JBoss: Query JMX agent to find all deployed war
vsrivastav Jun 9, 2010 1:58 PM (in response to peterj)Thanks Peter. That was helpful.
try {Context ctx = new javax.naming.InitialContext();ObjectName obj = new ObjectName("jboss.web.deployment:*");MBeanServerConnection c = (MBeanServerConnection) ctx.lookup("jmx/invoker/RMIAdaptor");Set<ObjectInstance> set = c.queryMBeans(obj, null);for(ObjectInstance oi : set){log.info(oi.getObjectName().getCanonicalName());}} catch (IOException ex) {Logger.getLogger(UIMgrService.class.getName()).log(Level.SEVERE, null, ex);}Regards
Vivek