|
@@ -24,7 +24,7 @@ public class SessionCounter implements HttpSessionListener {
|
|
private static String dateStart = "2018-02-28";
|
|
private static String dateStart = "2018-02-28";
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public void sessionCreated(HttpSessionEvent httpSessionEvent) {
|
|
|
|
|
|
+ public synchronized void sessionCreated(HttpSessionEvent httpSessionEvent) {
|
|
activeSessions++;
|
|
activeSessions++;
|
|
|
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
@@ -42,7 +42,7 @@ public class SessionCounter implements HttpSessionListener {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public void sessionDestroyed(HttpSessionEvent httpSessionEvent) {
|
|
|
|
|
|
+ public synchronized void sessionDestroyed(HttpSessionEvent httpSessionEvent) {
|
|
if(activeSessions>0){
|
|
if(activeSessions>0){
|
|
activeSessions--;
|
|
activeSessions--;
|
|
LOG.info("session sessionDestroyed with session id "+httpSessionEvent.getSession().getId() +" and session count "+activeSessions);
|
|
LOG.info("session sessionDestroyed with session id "+httpSessionEvent.getSession().getId() +" and session count "+activeSessions);
|