Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is there a way to know how many HttpSession Objects in the container?

 
Lipman Li
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the information will be useful, if you want to know how many users
actively
are using your system currently.
 
Santosh Maskar
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
by using the getCreationTime()
it return the time when session is created by using this u can track the number of user currently logging in
 
Lipman Li
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
we know that the HttpSession.getCreationTime() could give some hints, but how could you get the reference to this HttpSession Object in the first place?
I'm thinking that there must be something with container, which could give a collection of those session object. maybe it is container specific feature.
 
R K Singh
Ranch Hand
Posts: 5384
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
there was one method which could give you all active session but now it is deprecated.
 
R K Singh
Ranch Hand
Posts: 5384
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you have to implement one of the listeners for session to keep active session count.
 
Lipman Li
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
probably I can do something withHttpSessionBindingListener to track the number of Active session
manually
. but I still strongly think that such information shall be provided by container.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic