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.
@ConversationScoped
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public void | |
| public String | Returns: the identifier of the current long-running conversation, or a null value if the current conversation is transient.Get the identifier of the current long-running conversation. |
| public long | Returns: the current timeout in milliseconds.Get the timeout of the current conversation. |
| public boolean | Returns: true if the conversation is marked transient, or falseif it is marked long-running.Determine if the conversation is marked transient or long-running. |
| public void | setTimeout(long
the new timeout in milliseconds. milliseconds)Set the timeout of the current conversation. |
| begin | back to summary |
|---|---|
| public void begin() Mark the current transient conversation long-running. A conversation identifier is generated by the container.
| |
| begin | back to summary |
|---|---|
| public void begin(String id) Mark the current transient conversation long-running, with a specified identifier.
| |
| end | back to summary |
|---|---|
| public void end() Marks the current long-running conversation transient.
| |
| getId | back to summary |
|---|---|
| public String getId() Get the identifier of the current long-running conversation.
| |
| getTimeout | back to summary |
|---|---|
| public long getTimeout() Get the timeout of the current conversation.
| |
| isTransient | back to summary |
|---|---|
| public boolean isTransient() Determine if the conversation is marked transient or long-running.
| |
| setTimeout | back to summary |
|---|---|
| public void setTimeout(long milliseconds) Set the timeout of the current conversation.
| |