|
||||||||||
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. |
boolean |
isLockedForCurrentThread()
Return true if this object is currently locked by the calling thread. |
java.util.Iterator |
iterateConversations()
Iterates over all the conversations in this context. |
void |
lockInterruptablyForCurrentThread()
Block until no other thread has this instance marked as reserved, then mark the object as reserved for this thread. |
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. |
void |
unlockForCurrentThread()
Block until no other thread has this instance marked as reserved, then mark the object as reserved for this thread. |
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)
public void lockInterruptablyForCurrentThread() throws java.lang.InterruptedException
It is safe to call this method multiple times.
If this method is called, then an equal number of calls to unlockForCurrentThread MUST made, or this context object will remain locked until the http session times out.
java.lang.InterruptedException
public void unlockForCurrentThread()
public boolean isLockedForCurrentThread()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |