|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.code.rees.scope.conversation.context.DefaultConversationContextManager
public class DefaultConversationContextManager
The default implementation of the ConversationContextManager.
| Field Summary | |
|---|---|
protected ConversationContextFactory |
contextFactory
|
protected Map<String,Map<String,ConversationContext>> |
conversations
|
protected int |
maxInstances
|
protected long |
nextId
|
| Constructor Summary | |
|---|---|
DefaultConversationContextManager()
|
|
| Method Summary | |
|---|---|
ConversationContext |
createContext(String conversationName,
long maxIdleTimeMillis)
Creates a new context for the given conversation name, using the given idle time |
void |
destroy()
Cleanup and release the manager's resources |
ConversationContext |
getContext(String conversationName,
String conversationId)
Retrieve the context identified by the given information, creating a new one if none exists. |
protected String |
getNextId()
|
ConversationContext |
remove(String conversationName,
String conversationId)
Remove the context identified by the given information, returning the context being removed |
protected void |
removeMostStaleConversation(Map<String,ConversationContext> conversationContexts,
String conversationName,
long defaultDuration)
Recursively removes the least-recently accessed conversations until the number of remaining conversations equals maxInstances |
void |
setContextFactory(ConversationContextFactory contextFactory)
Set the ConversationContextFactory to be used by this manager |
void |
setMaxInstances(int maxInstances)
Set the max number of cached ConversationContexts. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ConversationContextFactory contextFactory
protected Map<String,Map<String,ConversationContext>> conversations
protected int maxInstances
protected long nextId
| Constructor Detail |
|---|
public DefaultConversationContextManager()
| Method Detail |
|---|
public void setMaxInstances(int maxInstances)
ConversationContexts.
setMaxInstances in interface ConversationContextManagerpublic void setContextFactory(ConversationContextFactory contextFactory)
ConversationContextFactory to be used by this manager
setContextFactory in interface ConversationContextManager
public ConversationContext createContext(String conversationName,
long maxIdleTimeMillis)
createContext in interface ConversationContextManager
public ConversationContext getContext(String conversationName,
String conversationId)
getContext in interface ConversationContextManager
public ConversationContext remove(String conversationName,
String conversationId)
remove in interface ConversationContextManagerpublic void destroy()
destroy in interface ConversationContextManager
protected void removeMostStaleConversation(Map<String,ConversationContext> conversationContexts,
String conversationName,
long defaultDuration)
maxInstances
protected String getNextId()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||