I'm not sure I understand what you want. The JNDI viewer in the management console shows you all that is bound in the JNDI (from what I know though).
Why would you use JNDI to lookup a MBean and not the MBean server?
In the JBoss5, if we register a mbean to mbean server, this mbean will be binded with a JNDI name automaticlly. By the preview JBoss versions, we also can lookup MBeanServer by a JNDI name. Add we can lookup all of the mbeans(registered to boss mbean server by ourself) by JNDI name. But for JBoss7, I can't lookup these MBeans.
Aha! The correct way is to use the JMX standard of looking up MBeans (and the getting access to the MBeanServer) and NOT going through JNDI. I guess your client is local (in the JBoss VM) and not remote, or?
1 of 1 people found this helpful
For AS7 you perform remote access to a JMX MBean with the new jmx-remoting protocol. See code sample here.
Note that you might need to enable the server to accept incoming calls. See comment in code sample for this.
Because by JNDI I can lookup a remote object as a local stub, then I can invoke remote object's method like it's in the local JVM. I don't whether JBoss7 don't register every mbean to JNDI server automaticlly. By for JBoss5, I can do this. And I don't think JBoss7 remove this good feature.
So we only can access the remote mbean by the MBeanconnection, if so, that's really bad. Because in JBoss5, I can get a remote mbean by JNDI lookup, then I can invoke the remote mbean's method like what happens in local JVM. I can't believe JBoss7 removed this feature.
JNDI code(vey simple)
// define remote ip, port and authtication parameters in this hashtable.
InitialContext ctx = new InitialContext(hashtable);
User user = (User) ctx.lookup("java:/user");
Well, if you want/need to make that kind och calls you could make make the MBean a SLSB.