I'm not sure that I really understood your problem.
If you want to lookup, whether an MBean is registered in a MBeanserver, you can try this:
Checks whether an MBean, identified by its object name, is already registered with the MBean server.
To reach the remote server, you could go through JMX RMI (see related topics a few days ago).
Hope it helps!
well let me refrase the question again...
let's say that i have jboss running in a machine and i have a bean in another machine. i would like the server to lookup in a range of machines which one has a bean and when it finds a machine with a bean then add it to the MBeanServer.
if that is not possible, then should the remote bean register itself in the server when it runs...?
this is like a remote discovery of beans. the bean actually is not on the server but on the remote client. but the point is how to make the server aware of that bean....
I don't think it is really feasible to have a MBean on a remote server and expect a MBeanServer on another machine be able to find it directly. Instead, a more likely senerio (or a better one) is that you'll have the remote MBean registered with a local MBeanServer. MBeanServers will be able to recognize other MBeanServes on the network and share their information about their local MBeans.
This is the general approach used in the JDMK. However, there are no current specification covering how this is to be done, so there is no standard. I think that this type of feature will be added to JBoss-MX in the future (maybe near future).