[jboss-user] [Management, JMX/JBoss] - Re: Listing all EJBs through JMX
danieldestro
do-not-reply at jboss.com
Thu Dec 21 14:07:24 EST 2006
Good news!
Ok, this works:
String name = "jboss.management.local:*,j2eeType=StatelessSessionBean";
| server = (MBeanServer) MBeanServerLocator.locateJBoss();
| Set matches = server.queryMBeans(new ObjectName(name), null);
| ServerObjectInstance[] names = (ServerObjectInstance[]) matches.toArray( new ServerObjectInstance[matches.size()] );
| for( int i=0; i< names.length; i++ ) {
| out.println(names.getObjectName()+" <br>");
| }
And outputs:
anonymous wrote : jboss.management.local:name=ejb/MyCoolEjb,J2EEServer=Local,EJBModule=cool.jar,J2EEApplication=null,j2eeType=StatelessSessionBean
| jboss.management.local:name=ejb/AnotherCoolEjb,J2EEServer=Local,EJBModule=still-cool.jar,J2EEApplication=null,j2eeType=StatelessSessionBean
| jboss.management.local:name=ejb/EjbOrNotEjb,J2EEServer=Local,EJBModule=myapp.jar,J2EEApplication=myapp.ear,j2eeType=StatelessSessionBean
Very close now.
Here I have the JNDI names for lookup. But what I really need is the Bean, and if possible Local and Remote classes/interfaces names.
I know it is possible throgh jmx-console. Just need to get things clear. Any help?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995698#3995698
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995698
More information about the jboss-user
mailing list