I am researching the same issue. Did you ever find answers to your questions?
NO, I'm still dont have a clue.
if you find the answer please let me know.
The port is found in jboss.web:type=Connector,*
There are 3 connectors defined by default so query for protocol=HTTP/1.1 and secure=false (http) or secure=true (https).
MBeanServer server = MBeanServerLocator.locateJBoss(); QueryExp query = Query.and(Query.eq(Query.attr("secure"), Query.value(secure)), Query.eq(Query.attr("protocol"), Query.value(protocol))); Set ons = server.queryNames(null, query); Iterator i = ons.iterator(); ObjectName objectName = (ObjectName)i.next(); String port = objectName.getKeyProperty("port"); System.out.println("port = " + port);
I don't know if it can be modified.