Count active sessions in J2EE app deployed on JBoss 3.2.1

后端 未结 2 1264
生来不讨喜
生来不讨喜 2021-01-07 14:37

I manage a J2EE application which is deployed on JBoss 3.2.1. As part of my service to my client I want to provide reports which show the number of active sessions. I have

相关标签:
2条回答
  • 2021-01-07 15:27

    Two possibilities spring to mind: Your JSP can be configured to not create a new session. Stick this at the top of your JSP:

    <%@ page session="false"%>
    

    Alternatively, write a JMX MBean which implements JBoss's ServiceMBean interface, and deploy it as a JBos service. This MBean would query the session count, and would appear on JBoss's JMX console. You can use your web browser to monitor it from there, without interfering with your session count.

    0 讨论(0)
  • 2021-01-07 15:33

    The JBoss JMX Console already has a integrated session counter in host=localhost,path=/YOUR_PROJECT,type=Manager

    By the way, you should use AtomicInteger or synchronize to take care of concurrency problems.

    0 讨论(0)
提交回复
热议问题