Class SessionCountListener
- java.lang.Object
-
- org.ametys.runtime.plugins.admin.jvmstatus.SessionCountListener
-
- All Implemented Interfaces:
EventListener
,HttpSessionListener
public class SessionCountListener extends Object implements HttpSessionListener
Simple HttpSessionListener counting sessions.
-
-
Field Summary
Fields Modifier and Type Field Description private static boolean
_active
private static AtomicInteger
_count
private static org.slf4j.Logger
_logger
-
Constructor Summary
Constructors Constructor Description SessionCountListener()
Active the static listener
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static int
getSessionCount()
Returns the number of active Sessionsvoid
sessionCreated(HttpSessionEvent se)
void
sessionDestroyed(HttpSessionEvent se)
-
-
-
Field Detail
-
_count
private static AtomicInteger _count
-
_active
private static boolean _active
-
_logger
private static org.slf4j.Logger _logger
-
-
Constructor Detail
-
SessionCountListener
public SessionCountListener()
Active the static listener
-
-
Method Detail
-
sessionCreated
public void sessionCreated(HttpSessionEvent se)
- Specified by:
sessionCreated
in interfaceHttpSessionListener
-
sessionDestroyed
public void sessionDestroyed(HttpSessionEvent se)
- Specified by:
sessionDestroyed
in interfaceHttpSessionListener
-
getSessionCount
public static int getSessionCount()
Returns the number of active Sessions- Returns:
- the number of active Sessions
- Throws:
IllegalStateException
- if the listener is not registered
-
-