|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.myfaces.orchestra.conversation.servlet.ConversationManagerSessionListener
public class ConversationManagerSessionListener
An http session listener which periodically scans every http session for conversations and conversation contexts that have exceeded their timeout.
If a web application wants to configure a conversation timeout that is shorter than the http session timeout, then this class must be specified as a listener in the web.xml file.
A conversation timeout is useful because the session timeout is refreshed every time a request is made. If a user starts a conversation that uses lots of memory, then abandons it and starts working elsewhere in the same webapp then the session will continue to live, and therefore so will that old "unused" conversation. Specifying a conversation timeout allows the memory for that conversation to be reclaimed in this situation.
This listener starts a single background thread that periodically wakes up and scans all http sessions to find ConversationContext objects, and checks their timeout together with the timeout for all Conversations in that context. If a conversation or context timeout has expired then it is removed.
This code is probably not safe for use with distributed sessions, ie a "clustered" web application setup.
See ConversationWiperThread
for more details.
Constructor Summary | |
---|---|
ConversationManagerSessionListener()
|
Method Summary | |
---|---|
void |
attributeAdded(javax.servlet.http.HttpSessionBindingEvent event)
|
void |
attributeRemoved(javax.servlet.http.HttpSessionBindingEvent event)
|
void |
attributeReplaced(javax.servlet.http.HttpSessionBindingEvent event)
|
void |
contextDestroyed(javax.servlet.ServletContextEvent event)
|
void |
contextInitialized(javax.servlet.ServletContextEvent event)
|
void |
sessionCreated(javax.servlet.http.HttpSessionEvent event)
|
void |
sessionDestroyed(javax.servlet.http.HttpSessionEvent event)
|
void |
sessionDidActivate(javax.servlet.http.HttpSessionEvent se)
Run by the servlet container after deserializing an HttpSession. |
void |
sessionWillPassivate(javax.servlet.http.HttpSessionEvent se)
Run by the servlet container before serializing an HttpSession. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConversationManagerSessionListener()
Method Detail |
---|
public void contextInitialized(javax.servlet.ServletContextEvent event)
contextInitialized
in interface javax.servlet.ServletContextListener
public void contextDestroyed(javax.servlet.ServletContextEvent event)
contextDestroyed
in interface javax.servlet.ServletContextListener
public void sessionCreated(javax.servlet.http.HttpSessionEvent event)
sessionCreated
in interface javax.servlet.http.HttpSessionListener
public void sessionDestroyed(javax.servlet.http.HttpSessionEvent event)
sessionDestroyed
in interface javax.servlet.http.HttpSessionListener
public void attributeAdded(javax.servlet.http.HttpSessionBindingEvent event)
attributeAdded
in interface javax.servlet.http.HttpSessionAttributeListener
public void attributeRemoved(javax.servlet.http.HttpSessionBindingEvent event)
attributeRemoved
in interface javax.servlet.http.HttpSessionAttributeListener
public void attributeReplaced(javax.servlet.http.HttpSessionBindingEvent event)
attributeReplaced
in interface javax.servlet.http.HttpSessionAttributeListener
public void sessionDidActivate(javax.servlet.http.HttpSessionEvent se)
This method tells the current ConversationWiperThread instance to start monitoring all ConversationManager objects in the deserialized session.
sessionDidActivate
in interface javax.servlet.http.HttpSessionActivationListener
public void sessionWillPassivate(javax.servlet.http.HttpSessionEvent se)
This method tells the current ConversationWiperThread instance to stop monitoring all ConversationManager objects in the serialized session.
sessionWillPassivate
in interface javax.servlet.http.HttpSessionActivationListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |