【发布时间】:2015-05-28 01:07:09
【问题描述】:
我们曾经使用以下代码查询活动会话计数,直到 JBoss 7:
ObjectName name = new ObjectName(jboss.web:type=Manager,path=/MyWebApp,host=default-host);
MBeanServer jboss = MBeanServerLocator.locateJBoss();
this.sessions = new Long((Integer) jboss.getAttribute(name, "activeSessions"));
这不再适用于 JBoss Wildfly。我真的找不到合适的文档来使用当前版本的 JBoss AS 访问相同的信息。
我遇到了一些链接,例如 http://blog.akquinet.de/2014/09/15/monitoring-the-jboss-eap-wildfly-application-server-with-the-command-line-interface-cli/,这意味着该信息的位置完全不同 - 但我不知道如何通过 Java 代码访问它。
/deployment=example.ear/subdeployment=example-web.war/subsystem=under
JBoss 7 中对-Dorg.apache.tomcat.util.ENABLE_MODELER=true 的旧引用也没有帮助。我通过MBean "jboss.web:type=Manager,path=/,host=localhost" not found 提出的旧问题不再有效。
【问题讨论】: