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 void
begin()
Mark the current transient conversation long-running.void
begin(String id)
Mark the current transient conversation long-running, with a specified identifier.void
end()
Marks the current long-running conversation transient.String
getId()
Get the identifier of the current long-running conversation.long
getLastUsed()
Gets the last time the conversation was used (for data access)long
getTimeout()
Get the timeout of the current conversation.boolean
isContextActive()
boolean
isTransient()
Determine if the conversation is marked transient or long-running.boolean
lock(long timeout)
Attempts to lock the conversation for exclusive usagevoid
setTimeout(long timeout)
Set the timeout of the current conversation.String
toString()
void
touch()
Touches the managed conversation, updating the "last used" timestampboolean
unlock()
Attempts to unlock the conversation
-
-
-
Constructor Detail
-
ConversationImpl
@Inject public ConversationImpl(BeanManagerImpl manager)
-
-
Method Detail
-
begin
public void begin()
Description copied from interface:Conversation
Mark the current transient conversation long-running. A conversation identifier is generated by the container.
- Specified by:
begin
in interfaceConversation
-
begin
public void begin(String id)
Description copied from interface:Conversation
Mark the current transient conversation long-running, with a specified identifier.
- Specified by:
begin
in interfaceConversation
- Parameters:
id
- conversation id
-
end
public void end()
Description copied from interface:Conversation
Marks the current long-running conversation transient.
- Specified by:
end
in interfaceConversation
-
getId
public String getId()
Description copied from interface:Conversation
Get the identifier of the current long-running conversation.
- Specified by:
getId
in 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:Conversation
Get the timeout of the current conversation.
- Specified by:
getTimeout
in interfaceConversation
- Returns:
- the current timeout in milliseconds.
-
setTimeout
public void setTimeout(long timeout)
Description copied from interface:Conversation
Set the timeout of the current conversation.
- Specified by:
setTimeout
in interfaceConversation
- Parameters:
timeout
- the new timeout in milliseconds.
-
isTransient
public boolean isTransient()
Description copied from interface:Conversation
Determine if the conversation is marked transient or long-running.
- Specified by:
isTransient
in interfaceConversation
- Returns:
- true if the conversation is marked transient, or falseif it is marked long-running.
-
getLastUsed
public long getLastUsed()
Description copied from interface:ManagedConversation
Gets the last time the conversation was used (for data access)- Specified by:
getLastUsed
in interfaceManagedConversation
- Returns:
- time (in ms) since the conversation was last used
-
touch
public void touch()
Description copied from interface:ManagedConversation
Touches the managed conversation, updating the "last used" timestamp- Specified by:
touch
in interfaceManagedConversation
-
lock
public boolean lock(long timeout)
Description copied from interface:ManagedConversation
Attempts to lock the conversation for exclusive usage- Specified by:
lock
in 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:ManagedConversation
Attempts to unlock the conversation- Specified by:
unlock
in interfaceManagedConversation
- Returns:
- true if the unlock was successful, false otherwise
-
isContextActive
public boolean isContextActive()
-
-