Advertisement
EmirCalabuch

Locate server bind address

Sep 26th, 2012
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.37 KB | None | 0 0
  1. MBeanServerConnection server = MBeanServerLocator.locateJBoss();
  2. ObjectName mbean = (ObjectName)server.queryNames(
  3.         new ObjectName("jboss.web:type=Connector,address=*,port=*"),
  4.         Query.match(Query.attr("protocol"), Query.value("HTTP/1.1")))
  5.     .iterator().next();
  6. String address = mbean.getKeyProperty("address");
  7. String port = mbean.getKeyProperty("port");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement