org.riotfamily.common.web.util
Class SessionReferenceRemover

java.lang.Object
  extended by org.riotfamily.common.web.util.SessionReferenceRemover
All Implemented Interfaces:
EventListener, HttpSessionBindingListener

public class SessionReferenceRemover
extends Object
implements HttpSessionBindingListener

Utility class that removes a value from a collection when the HTTP session is invalidated.

Use this class if you need to keep a global reference to an object that is bound to a user's session.

Since:
6.4
Author:
Felix Gnass [fgnass at neteye dot de]

Method Summary
static void removeFromCollectionOnInvalidation(HttpSession session, Collection<?> collection, Object value)
          Removes the given value from the collection when the session is invalidated.
 void valueBound(HttpSessionBindingEvent event)
           
 void valueUnbound(HttpSessionBindingEvent event)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

valueBound

public void valueBound(HttpSessionBindingEvent event)
Specified by:
valueBound in interface HttpSessionBindingListener

valueUnbound

public void valueUnbound(HttpSessionBindingEvent event)
Specified by:
valueUnbound in interface HttpSessionBindingListener

removeFromCollectionOnInvalidation

public static void removeFromCollectionOnInvalidation(HttpSession session,
                                                      Collection<?> collection,
                                                      Object value)
Removes the given value from the collection when the session is invalidated.