简体   繁体   中英

JBoss 7.2: Active Sessions Count

How can I get the number of active session counts at the Jboss AS 7.2 (all sessions, not at single war)? I looked deeply for a MXBean that could give me that information but I didn't find one. There are a lot of information about that, but just for older versions. This seens to be an easy thing to do, but it's been very difficult to find an answer.

JMX is not a must if I can get this programatically by another way. I just cant modify the older projects to add listeners to check for that.

Well, after some digging I found an way using JBoss CLI (just google a little about it and the special syntax called Detyped Management Model). With that in mind just call this command at the CLI:

/deployment=<YOUR-EAR-NAME>.ear/subdeployment=<YOUR-WAR-NAME>.war/subsystem=\\"web\\"/:read-attribute(name=active-sessions)

With that you can know the connected users for that specific war. This can be tunned with different ways to look for all wars, so just play with it. There's an API to do that programatically too.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM