-
public interface Conversation
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.
- Author:
- Pete Muir, Gavin King
- See Also:
@ConversationScoped
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and 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
getTimeout()
Get the timeout of the current conversation.boolean
isTransient()
Determine if the conversation is marked transient or long-running.void
setTimeout(long milliseconds)
Set the timeout of the current conversation.
-
-
-
Method Detail
-
begin
void 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.
-
begin
void begin(String id)
Mark the current transient conversation long-running, with a specified identifier.
- Throws:
IllegalStateException
- if the current conversation is already marked long-running.IllegalArgumentException
- if a conversation with the specified identifier already exists.
-
end
void end()
Marks the current long-running conversation transient.
- Throws:
IllegalStateException
- if the current conversation is already marked transient.
-
getId
String 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.
-
getTimeout
long getTimeout()
Get the timeout of the current conversation.
- Returns:
- the current timeout in milliseconds.
-
setTimeout
void setTimeout(long milliseconds)
Set the timeout of the current conversation.
- Parameters:
milliseconds
- the new timeout in milliseconds.
-
isTransient
boolean isTransient()
Determine if the conversation is marked transient or long-running.
- Returns:
- true if the conversation is marked transient, or falseif it is marked long-running.
-
-
Document created the 11/06/2005, last modified the 18/08/2025
Source of the printed document:https://www.gaudry.be/en/java-api-javaee-rf-javax/enterprise/context/Conversation.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author of this site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.