I am using JBoss 4.2.2 GA
I assume that this is some code running outside of JBossAS? I can think of two ways.
1) Scan the server log, looking for the "started in" message.
2) Poll the JNDI (1099) and HTTP ports (8080). Once you get valid replies, the app server is ready to go.
When we had to do this for one of our products we used mechanism 2. Originally, we only polled to JNDI but it opens up fairly early in the startup process so many services are not yet available at that time. Come to think of it, I think we also asked for one of the server MBean (perhaps ServerInfo) and asked it for the server's status.
Thank you very much for your reply.
Here are the MBeans, Peter was referring in his post:
And this one about the various notifications emitted by JBoss: