JBoss JMX exposes all information about the server as MBean's.
Here is a simple way if you need get the JVM name and the host name in your application.
Here is a simple way if you need get the JVM name and the host name in your application.
For getting the JVM name
ServerConfigImplMBean serverConfigMbean = MBeanProxyExt.create( ServerConfigImplMBean.class, “jboss.system:type=ServerConfig”, MBeanServerLocator.locateJBoss()); serverConfigMbean. getServerName();
For getting the Host name
ServerInfoMBean serverInfoMbean = MBeanProxyExt.create( ServerInfoMBean.class, “jboss.system:type=ServerInfo”, MBeanServerLocator.locateJBoss()); serverInfoMbean.getHostName();
No comments:
Post a Comment