The scheme is also dynamic (ftp, https, http, file...) so obviously I will have to assume that also. That leaves the host and port number. Is there a runtime config setting for those I can get at somewhere?
OK, there's jboss.bind.address so that will take care of the host name. That leaves the port number. That reduces my question to the following:
I How can I programatically retrieve the port number the web container is listening on before my first request comes in.
MBeanServer = ...; ObjectName query = new ObjectName("jboss.web:type=Connector,*"); Set matches = server.queryNames(query, null); ObjectName connector = findMatchingConnector(matches); Integer port = (Integer) server.getAttribute(connector, "port");