This functionality already exists in GlassFish :)
Just try asadmin list-jndi-entries. If it gives you nothing, it implies that nothing is available in the JNDI naming service (things are registered lazily here, I believe).
-Kedar
[Message sent by forum member 'km' (km)]
http://forums.java.net/jive/thread.jspa?messageID=315574