Spring Web Flow

org.springframework.webflow.conversation.impl
Class ConversationContainer

java.lang.Object
  extended by org.springframework.webflow.conversation.impl.ConversationContainer
All Implemented Interfaces:
java.io.Serializable

public class ConversationContainer
extends java.lang.Object
implements java.io.Serializable

Container for conversations that is stored in the session. When the session expires this container will go with it, implicitly expiring all contained conversations.

This is an internal helper class of the SessionBindingConversationManager.

Author:
Erwin Vervaet
See Also:
Serialized Form

Constructor Summary
ConversationContainer(int maxConversations, java.lang.String sessionKey)
          Create a new conversation container.
 
Method Summary
protected  ContainedConversation createContainedConversation(ConversationId id, ConversationLock lock)
           
 Conversation createConversation(ConversationParameters parameters, ConversationLock lock)
          Create a new conversation based on given parameters and add it to the container.
 Conversation getConversation(ConversationId id)
          Return the identified conversation.
protected  java.util.List<ContainedConversation> getConversations()
           
protected  ConversationId nextId()
           
 void removeConversation(ConversationId id)
          Remove identified conversation from this container.
 int size()
          Returns the current size of the conversation container: the number of conversations contained within it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConversationContainer

public ConversationContainer(int maxConversations,
                             java.lang.String sessionKey)
Create a new conversation container.

Parameters:
maxConversations - the maximum number of allowed concurrent conversations, -1 for unlimited
sessionKey - the key of this conversation container in the session
Method Detail

size

public int size()
Returns the current size of the conversation container: the number of conversations contained within it.


createConversation

public Conversation createConversation(ConversationParameters parameters,
                                       ConversationLock lock)
Create a new conversation based on given parameters and add it to the container.

Parameters:
parameters - descriptive conversation parameters
lock - the conversation lock
Returns:
the created conversation

nextId

protected ConversationId nextId()

getConversation

public Conversation getConversation(ConversationId id)
                             throws NoSuchConversationException
Return the identified conversation.

Parameters:
id - the id to lookup
Returns:
the conversation
Throws:
NoSuchConversationException - if the conversation cannot be found

getConversations

protected final java.util.List<ContainedConversation> getConversations()

removeConversation

public void removeConversation(ConversationId id)
Remove identified conversation from this container.


createContainedConversation

protected ContainedConversation createContainedConversation(ConversationId id,
                                                            ConversationLock lock)

Spring Web Flow