./twiddle.sh query "jboss.jca:service=DataSourceBinding,*"
can this help ?
Thanks a lot for the extremely quick response.
It is exactly what I am looking for. But I'd need a Servlet accesible API to do the same thing, so I can list all datasources in a WebPage.
I will have to see the source code for "twiddle" utility and I can extract some ideas from it.
If you guys have a better idea, or an URL to read from, please post it.
Use the JMX api. Here is an example that would work in a servlet:
Context ctx = new InitialContext(); MBeanServerConnection mconn = (MBeanServerConnection)ctx.lookup("jmx/invoker/RMIAdaptor"); ObjectName name = new ObjectName("jboss.jca:service=DataSourceBinding,*"); Set s = mconn.queryMBeans(name, null);
Variable s contains a collection of the desired mbeans.
Thank you very, very much. It is exactly what I am needing!