If you deploy an ear file named myapp.ear, you could look for an mbean named:
If it exists, the ear has been deployed. You could also look at the State or StateString attribute of that mbean.
can you give a code exmample? i was not able to find it.
i'm using jboss-4.0.3SP1...
Use jmx-console to look it up. Or you could use twiddle (http://docs.jboss.com/jbossas/guides/j2eeguide/r2/en/html_single/#d0e2252).
For code, first read about JMX coding at http://java.sun.com/j2se/1.5.0/docs/guide/jmx/tutorial/tutorialTOC.html
You can find many JMX coding examples in the forums, search for the term 'queryMBeans' or 'queryNames'. Here's one: http://www.jboss.com/index.html?module=bb&op=viewtopic&t=102021