This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Servlets and the fly likes APIs or patterns for listing authenticated users. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "APIs or patterns for listing authenticated users. " Watch "APIs or patterns for listing authenticated users. " New topic
Author

APIs or patterns for listing authenticated users.

Dave Patterson
Greenhorn

Joined: Jun 15, 2004
Posts: 10
Hi All,

I'm looking for some feedback on a working solution I've implemented that feels a bit clunky.

The basic requirement was to remove stale entries from a simple locking mechanisim if the user had logged off or timed out.

My solution (after a few suggestions from the websphere usenet group) was to implement a session binding listener and add one of these objects to each users session as they log in. (I use a global filter to test each request to ensure the users session contains a listener.)

The listener class has a static hashmap that stores a list of all logged on users. As bind and unbind events are fired the relevant user is added or removed from the list. A public method returns the current 'active' user list which we use to verify our lock entries.

Has anyone else tackled this kind of problem before?

Thanks

Dave Patterson.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: APIs or patterns for listing authenticated users.
 
Similar Threads
How to determine if a session has expired...
HttpSessionBinding interface
getServletContext from a ServletContextAttribute Listener
Session End in JSP
How to know when a session is removed?