The only way I can think of is to examine the jmx jboss.j2ee domain to search for deployments. Each bean will have an "ear=XXX" parameter. Take a look at the jmx-console.
I think the correct way to do this according to specs is to have a reference in the deployment desciptor and then look up the bean via java:/comp/env.
The correct jndi reference should then be put into your deployment descriptor during the build.
This is my idiosyncratic reading of the specs but maybe somebody more knowledgable can fill in more information.
Always a best practice to use jndi references.