29.4. Annotations for context demarcation
These annotations provide declarative conversation demarcation. They appear on Seam component methods, usually action listener methods.
Every web request is associated with a conversation context. Most of these conversations end when the request is complete. To span a conversation across multiple requests, you must "promote" the conversation to a long-running conversation by calling a method marked with
@Begin.
-
@Begin @BeginSpecifies that a long-running conversation begins when this method returns a non-null outcome without exception.@Begin(join=true)
Specifies that, if a long-running conversation is already in progress, the conversation context is propagated.@Begin(nested=true)
Specifies that, if a long-running conversation is already in progress, a new nested conversation context should begin. The nested conversation will end when the next@Endis encountered, and the outer conversation will resume. Multiple nested conversations can exist concurrently in the same outer conversation.@Begin(flushMode=FlushModeType.MANUAL)
Specifies the flush mode of any Seam-managed persistence contexts.flushMode=FlushModeType.MANUALsupports the use of atomic conversations, where all write operations are queued in the conversation context until an explicit call toflush()(which usually occurs at the end of the conversation) is made.join— determines the behavior when a long-running conversation is already in progress. Iftrue, the context is propagated. Iffalse, an exception is thrown. Defaults tofalse. This setting is ignored whennested=trueis specified.nested— specifies that a nested conversation should be started if a long-running conversation is already in progress.flushMode— sets the flush mode of any Seam-managed Hibernate sessions or JPA persistence contexts that are created during this conversation.
-
@End @EndSpecifies that a long-running conversation ends when this method returns a non-null outcome without exception.beforeRedirect— by default, the conversation will not actually be destroyed until after any redirect has occurred. SettingbeforeRedirect=truespecifies that the conversation should be destroyed at the end of the current request, and that the redirect will be processed in a new temporary conversation context.root— by default, ending a nested conversation simply pops the conversation stack and resumes the outer conversation. Settingroot=truespecifies that the root conversation should be destroyed, which destroys the entire conversation stack. If the conversation is not nested, the current conversation is destroyed.