On 8/8/05, Dave Newton <[EMAIL PROTECTED]> wrote:
> Rick Reumann wrote:
> 
> > I need to create a link to a servlet, that will invalidate all
> > Sessions. I'm assuming there is some sort of Collection or Array of
> > Sessions that is stored in the ServletContext?
> 
> Hmm, I'm not sure that there is--I think I remember having to keep a
> context-scoped list of sessions via some sort of listener and running
> through it myself, but that was awhile ago.
> 

Dave is right ... you would need to maintain your own list of
currently active sessions (by writing an HttpSessionListener).  To be
thorough, you'd also want to make your listener implement
HttpSessionActivationListener so it could deal with session migration
in a distributed environment.

For those not familiar with the latter interface, it includes two methods:

* public void sessionWilPassivate(HttpSession) -- the specified
  session is about to be removed from the active memory of this
  server instance, either to be migrated or to be swapped out due to
  lack of activity.

* public void sessionDidActivate(HttpSession) -- the specified
  session that used to be passivated has been activated in the
  current server instance.

> Dave

Craig

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to