• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown

HTTP Session listening

Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does Spring 2.5 provide any possibility to listen for session events (as this is done by HttpSessionListener) in session-scoped bean ?
In my application users work with some kind of shared data. Thus, I need to lock some piece of this data based on user http session when this user is currently modifying it. I need some reliable way to release the lock as soon as the corresponding http session is invalidated (no matter whether on user's logout action or on session timeout).

The reason I don't wan't to use HttpSessionListener is simple - releasing the lock includes some actions invoked on spring beans. I don't wan't to hardcode bean names when getting those beans from my implementation of HttpSessionListener.

I tried using both destroy-method="" and implementing DisposableBean for my session scoped beans. But it seems that destroy method is used only for singleton beans when the container is shutdown.

So the question is: is there any way to notify my session-scoped bean on http session invalidation?
    Bookmark Topic Watch Topic
  • New Topic