<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hello Arun,<br>
<br>
I usethis code w/ Jboss 7 and wildfly 8, i didn't test with wildfly
9/10.<br>
<br>
<meta http-equiv="content-type" content="text/html;
charset=windows-1252">
MBeanServer mBeanServer =
ManagementFactory.getPlatformMBeanServer();<br>
String url = null;<br>
try {<br>
<br>
ObjectName http = new
ObjectName("jboss.as:socket-binding-group=standard-sockets,socket-binding=http");<br>
String jbossHttpAddress = (String)
mBeanServer.getAttribute(http,"boundAddress");<br>
int jbossHttpPort = (Integer)
mBeanServer.getAttribute(http,"boundPort");<br>
url = jbossHttpAddress + ":" + jbossHttpPort;<br>
log.fine("Url obtained from the system: " + url);<br>
} catch (Exception e) {<br>
log.severe(e.getStackTrace().toString());<br>
}<br>
return url;<br>
<br>
regards.<br>
<br>
<br>
<div class="moz-cite-prefix">On 09/01/2015 02:20 PM, Arun Gupta
wrote:<br>
</div>
<blockquote
cite="mid:CAGBoHQXtnO7R5BH-a+ZbQSY8CSbt1EV8K+y-XLmmbsP_zXnQrw@mail.gmail.com"
type="cite">
<pre wrap="">Assuming WildFly is bound to all available IP addresses using -b
0.0.0.0, is there a WildFly-specific API that can be used to obtain
the IP address where the server is running?
Ideally, I'd like something like:
WildFly.getHostAddress()
WildFly.getHostPort()
It could be running in a Docker container, in AWS, on my local laptop,
in OpenShift, or any where else and would like the IP address to be
returned correctly.
Suggestions?
Arun
</pre>
</blockquote>
<br>
</body>
</html>