tags:

views:

151

answers:

1

Hello everyone, I am trying to find a way to enumerate the EJB's and MBeans that have been deployed to a JBoss server. I was looking down the path of somehow using the JDI Context, but all I can get are the binding names and classes. Am I barking down the wrong path looking at JNDI? What should I do?

Thx!

~Bolt

+1  A: 

You need to look on the JMX console, rather than JNDI. You'll see a lot of stuff on there, including multiple entries for each deployed EJB. You can get a connection to the JMX server using MBeanServerLocator.locateJBoss(), and from there you can use the JMX API to iterate over the various beans.

skaffman
Excellent, I will give that a try! Thx!
Boltimuss
I looked at the javadocs for MBeanServer, and I don't see anything that would allow me to iterate over the list of mbeans that are registered :(
Boltimuss
@Boltimuss: Look harder :) There is a `queryMBeans()` method http://java.sun.com/javase/6/docs/api/javax/management/MBeanServerConnection.html#queryMBeans%28javax.management.ObjectName,%20javax.management.QueryExp%29
skaffman
Sorry ... I found it earlier, just overlooked that the parameters can be null. Is this it? I mean, will this list contain all of the mbeans and ejb's delpoyed? Thx for the help :)
Boltimuss