-
1. Re: JBoss7 get Management Port programmatically
jaikiran Mar 13, 2013 10:58 AM (in response to joba01)1 of 1 people found this helpfulI haven't checked but are those operations exposed via JMX? If so, then you can just use the MBeanServer API to handle this.
-
2. Re: JBoss7 get Management Port programmatically
jaikiran Mar 13, 2013 11:16 AM (in response to joba01)1 of 1 people found this helpfulTo answer your original question - take a look at this thread https://community.jboss.org/thread/199037
-
3. Re: JBoss7 get Management Port programmatically
joba01 Mar 13, 2013 11:27 AM (in response to jaikiran)Thanks Guys,
I just dound the necessary hint on
http://golovnin.blogspot.co.at/2012/04/jboss-7-and-websockets.html
Here is the method:
public Integer getJBoss7ManagementPort()
{
Integer jbossManagementPort;
MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
try
{
ObjectName http =
new ObjectName("jboss.as:socket-binding-group=standard-sockets,socket-binding=management-native");
jbossManagementPort =
(Integer) mBeanServer.getAttribute(http, "boundPort");
}
catch (Exception e)
{
throw new Error(e);
}
LOG.debug("Port: ", jbossManagementPort);
return jbossManagementPort;
}
Thanks for your help.
cheers Johannes