|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.myfaces.orchestra.conversation.ConversationContext
public class ConversationContext
A ConversationContext is a container for a set of conversations.
Normally there is only one ConversationContext per http session. However there can be multiple instances if the user has multiple concurrent windows open into the same webapp, using the ox:separateConversationContext or other similar mechanism.
Like the conversation class, a context can also have a timeout which will cause it to be ended automatically if not accessed within the given period.
Constructor Summary | |
---|---|
protected |
ConversationContext(long id)
|
Method Summary | |
---|---|
protected void |
checkConversationTimeout()
Check the timeout for every conversation in this context. |
protected void |
clear()
Invalidate all conversations within this context. |
java.lang.Object |
getAttribute(java.lang.String name)
Get a specific attribute. |
protected Conversation |
getConversation(java.lang.String name)
Get a conversation by name. |
long |
getId()
The conversation context id, unique within the current http session. |
long |
getLastAccess()
The system time in millis when this conversation has been accessed last. |
long |
getTimeout()
Get the timeout after which this context will be closed. |
boolean |
hasAttribute(java.lang.String name)
Check if this conversationContext holds a specific attribute. |
protected boolean |
hasConversation(java.lang.String name)
Check if the given conversation exists. |
protected boolean |
hasConversations()
See if there is a conversation with the specified name. |
java.util.Iterator |
iterateConversations()
Iterates over all the conversations in this context. |
java.lang.Object |
removeAttribute(java.lang.String name)
Remove an attribute from the conversationContext. |
protected void |
removeConversation(Conversation conversation)
Remove the conversation from this context. |
protected void |
removeConversation(java.lang.String name)
Remove the conversation with the given name from this context. |
void |
setAttribute(java.lang.String name,
java.lang.Object attribute)
Add an attribute to the conversationContext. |
void |
setTimeout(long timeoutMillis)
Set the timeout after which this context will be closed. |
protected Conversation |
startConversation(java.lang.String name,
ConversationFactory factory)
Start a conversation if not already started. |
protected void |
touch()
Mark this context as having been used. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected ConversationContext(long id)
Method Detail |
---|
public long getId()
protected void touch()
public long getLastAccess()
public long getTimeout()
setTimeout(long)
public void setTimeout(long timeoutMillis)
A value of -1 means no timeout checking.
protected void clear()
protected Conversation startConversation(java.lang.String name, ConversationFactory factory)
protected void removeConversation(Conversation conversation)
Notice: It is assumed that the conversation has already been invalidated.
protected void removeConversation(java.lang.String name)
Notice: Its assumed that the conversation has already been invalidated
protected boolean hasConversations()
protected boolean hasConversation(java.lang.String name)
protected Conversation getConversation(java.lang.String name)
public java.util.Iterator iterateConversations()
protected void checkConversationTimeout()
This method does not check the timeout for this context object itself.
public void setAttribute(java.lang.String name, java.lang.Object attribute)
A context provides a map into which any arbitrary objects can be stored. It isn't a major feature of the context, but can occasionally be useful.
public boolean hasAttribute(java.lang.String name)
public java.lang.Object getAttribute(java.lang.String name)
public java.lang.Object removeAttribute(java.lang.String name)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |