Differences between revisions 1 and 2
Revision 1 as of 2005-03-22 05:44:02
Size: 1871
Editor: anonymous
Comment: missing edit-log entry for this revision
Revision 2 as of 2009-09-20 23:50:18
Size: 1862
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
'''Navigation trail:''' TurbineProjectPages - JakartaTurbine2 - [wiki:/Development Development] - [wiki:/Proposals Proposals] - [wiki:/SessionService SessionService] '''Navigation trail:''' TurbineProjectPages - JakartaTurbine2 - [[/Development|Development]] - [[/Proposals|Proposals]] - [[/SessionService|SessionService]]

Navigation trail: TurbineProjectPages - JakartaTurbine2 - Development - Proposals - SessionService


New Session Service

I posted a message to the list a while back asking for a way to access the session information from the container. The response was that there was no way to do it with Turbine yet.

I have now written a service that allows access to all sessions for the current context. I was hoping to get some feedback on how it works and what it can do before I add it into the Turbine source tree.... If you have any ideas for additional functionality, please make notes at the end of this page!!!!

How it works

I have a listener class that is configured in web.xml to listener for session creation and destruction events. Upon creation or destruction of a session, the session object is passed to the { { { SessionService } } }. This approach work on any container that support the servlet 2.3 API.

Functionality

Here is the javadocs from the interface for the SessionService.

{{{ /**

  • Gets all active sessions
  • @return Collection of HttpSession objects

  • /
  • public Collection getActiveSessions(); }}}

{{{ /**

  • Adds a session to the current list
  • @param session Session to add
  • /

{{{ /**

  • Removes a session from the current list
  • @param session Session to remove
  • /

{{{ /**

  • Determines if a given user is currently logged in
  • @param user User to check for
  • @return true id the user is logged in on one of the
  • active sessions.
  • /
  • public boolean isUserLoggedIn( User user ); }}}

JakartaTurbine2/SessionService (last edited 2009-09-20 23:50:18 by localhost)