Class ConversationImpl
- java.lang.Object
-
- org.jboss.weld.contexts.conversation.ConversationImpl
-
- All Implemented Interfaces:
Serializable,Conversation,ManagedConversation
public class ConversationImpl extends Object implements ManagedConversation, Serializable
- Author:
- Nicklas Karlsson, Marko Luksa
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ConversationImpl(BeanManagerImpl manager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbegin()Mark the current transient conversation long-running.voidbegin(String id)Mark the current transient conversation long-running, with a specified identifier.voidend()Marks the current long-running conversation transient.StringgetId()Get the identifier of the current long-running conversation.longgetLastUsed()Gets the last time the conversation was used (for data access)longgetTimeout()Get the timeout of the current conversation.booleanisContextActive()booleanisTransient()Determine if the conversation is marked transient or long-running.booleanlock(long timeout)Attempts to lock the conversation for exclusive usagevoidsetTimeout(long timeout)Set the timeout of the current conversation.StringtoString()voidtouch()Touches the managed conversation, updating the "last used" timestampbooleanunlock()Attempts to unlock the conversation
-
-
-
Constructor Detail
-
ConversationImpl
@Inject public ConversationImpl(BeanManagerImpl manager)
-
-
Method Detail
-
begin
public void begin()
Description copied from interface:ConversationMark the current transient conversation long-running. A conversation identifier is generated by the container.
- Specified by:
beginin interfaceConversation
-
begin
public void begin(String id)
Description copied from interface:ConversationMark the current transient conversation long-running, with a specified identifier.
- Specified by:
beginin interfaceConversation- Parameters:
id- conversation id
-
end
public void end()
Description copied from interface:ConversationMarks the current long-running conversation transient.
- Specified by:
endin interfaceConversation
-
getId
public String getId()
Description copied from interface:ConversationGet the identifier of the current long-running conversation.
- Specified by:
getIdin interfaceConversation- Returns:
- the identifier of the current long-running conversation, or a null value if the current conversation is transient.
-
getTimeout
public long getTimeout()
Description copied from interface:ConversationGet the timeout of the current conversation.
- Specified by:
getTimeoutin interfaceConversation- Returns:
- the current timeout in milliseconds.
-
setTimeout
public void setTimeout(long timeout)
Description copied from interface:ConversationSet the timeout of the current conversation.
- Specified by:
setTimeoutin interfaceConversation- Parameters:
timeout- the new timeout in milliseconds.
-
isTransient
public boolean isTransient()
Description copied from interface:ConversationDetermine if the conversation is marked transient or long-running.
- Specified by:
isTransientin interfaceConversation- Returns:
- true if the conversation is marked transient, or falseif it is marked long-running.
-
getLastUsed
public long getLastUsed()
Description copied from interface:ManagedConversationGets the last time the conversation was used (for data access)- Specified by:
getLastUsedin interfaceManagedConversation- Returns:
- time (in ms) since the conversation was last used
-
touch
public void touch()
Description copied from interface:ManagedConversationTouches the managed conversation, updating the "last used" timestamp- Specified by:
touchin interfaceManagedConversation
-
lock
public boolean lock(long timeout)
Description copied from interface:ManagedConversationAttempts to lock the conversation for exclusive usage- Specified by:
lockin interfaceManagedConversation- Parameters:
timeout- The time in milliseconds to wait on the lock- Returns:
- True if lock was successful, false otherwise
-
unlock
public boolean unlock()
Description copied from interface:ManagedConversationAttempts to unlock the conversation- Specified by:
unlockin interfaceManagedConversation- Returns:
- true if the unlock was successful, false otherwise
-
isContextActive
public boolean isContextActive()
-
-