📜  tomcat 检查会话 mbean - 任何代码示例

📅  最后修改于: 2022-03-11 14:57:01.961000             🧑  作者: Mango

代码示例1
MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
ObjectName objectName = new ObjectName("Catalina:type=Manager,context=/,host=localhost");
int activeSessions = (Integer) mBeanServer.getAttribute(objectName, "activeSessions");