com.google.code.rees.scope.conversation.context
Class TimeoutConversationContextManager
java.lang.Object
com.google.code.rees.scope.conversation.context.DefaultConversationContextManager
com.google.code.rees.scope.conversation.context.TimeoutConversationContextManager
- All Implemented Interfaces:
- ConversationContextManager, TimeoutListener<ConversationContext>, Serializable
public class TimeoutConversationContextManager
- extends DefaultConversationContextManager
- implements TimeoutListener<ConversationContext>
This class extends the DefaultConversationContextManager and uses a TimeoutMonitor to
monitor conversations for timeouts. Using the TimeoutListener interface, it removes conversations
from its cache when they have expired.
- Author:
- rees.byars
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
conversationTimeoutMonitor
protected TimeoutMonitor<ConversationContext> conversationTimeoutMonitor
TimeoutConversationContextManager
public TimeoutConversationContextManager()
setTimeoutMonitor
public void setTimeoutMonitor(TimeoutMonitor<ConversationContext> conversationTimeoutMonitor)
createContext
public ConversationContext createContext(String conversationName,
long maxIdleTimeMillis)
- Creates a new context for the given conversation name, using the given idle time
- Specified by:
createContext in interface ConversationContextManager- Overrides:
createContext in class DefaultConversationContextManager
- Returns:
remove
public ConversationContext remove(String conversationName,
String conversationId)
- Remove the context identified by the given information, returning the
context being removed
- Specified by:
remove in interface ConversationContextManager- Overrides:
remove in class DefaultConversationContextManager
- Returns:
onTimeout
public void onTimeout(ConversationContext expiredConversation)
- Called when the given
Timeoutable's timeout method is called.
- Specified by:
onTimeout in interface TimeoutListener<ConversationContext>
destroy
public void destroy()
- Cleanup and release the manager's resources
- Specified by:
destroy in interface ConversationContextManager- Overrides:
destroy in class DefaultConversationContextManager
Copyright © 2012-2013. All Rights Reserved.