Allows the application to manage the conversation context by marking the current conversation as transient or long-running, specifying a conversation identifier, or setting the conversation timeout.
An instance may be injected:
@Inject Conversation conversation;
The conversation timeout is a hint to the container that a conversation should not be destroyed if it has been active within the last given interval in milliseconds.
CDI Lite implementations are not required to provide support for conversations.
- See Also:
- 
Method SummaryModifier and TypeMethodDescriptionvoidbegin()Mark the current transient conversation long-running.voidMark the current transient conversation long-running, with a specified identifier.voidend()Marks the current long-running conversation transient.getId()Get the identifier of the current long-running conversation.longGet the timeout of the current conversation.booleanDetermine if the conversation is marked transient or long-running.voidsetTimeout(long milliseconds) Set the timeout of the current conversation.
- 
Method Details- 
beginvoid begin()Mark the current transient conversation long-running. A conversation identifier is generated by the container. - Throws:
- IllegalStateException- if the current conversation is already marked long-running.
 
- 
beginMark the current transient conversation long-running, with a specified identifier. - Parameters:
- id- conversation id
- Throws:
- IllegalStateException- if the current conversation is already marked long-running.
- IllegalArgumentException- if a conversation with the specified identifier already exists.
 
- 
endvoid end()Marks the current long-running conversation transient. - Throws:
- IllegalStateException- if the current conversation is already marked transient.
 
- 
getIdString getId()Get the identifier of the current long-running conversation. - Returns:
- the identifier of the current long-running conversation, or a null value if the current conversation is transient.
 
- 
getTimeoutlong getTimeout()Get the timeout of the current conversation. - Returns:
- the current timeout in milliseconds.
 
- 
setTimeoutvoid setTimeout(long milliseconds) Set the timeout of the current conversation. - Parameters:
- milliseconds- the new timeout in milliseconds.
 
- 
isTransientboolean isTransient()Determine if the conversation is marked transient or long-running. - Returns:
- trueif the conversation is marked transient, or- falseif it is marked long-running.
 
 
-