Top Description Inners Methods
javax.enterprise.context

public @Interface ConversationScoped

extends Annotation
Known Direct Implementers
javax.enterprise.context.ConversationScoped.Literal
Annotations
@Target:TYPE, METHOD, FIELD
@Retention:RUNTIME
@Documented
@NormalScope
passivating:true
@Inherited
Static Imports
java.lang.annotation.ElementType.FIELD, .ElementType.METHOD, .ElementType.TYPE, .RetentionPolicy.RUNTIME

Specifies that a bean is conversation scoped.

While ConversationScoped must be associated with the built-in conversation context required by the specification, third-party extensions are allowed to also associate it with their own context. Behavior described below is only related to the built-in conversation context.

The conversation scope is active:

An event with qualifier @Initialized(ConversationScoped.class) is fired when the conversation context is initialized and an event with qualifier @Destroyed(ConversationScoped.class) is fired when the conversation is destroyed. The event payload is:

The conversation context provides access to state associated with a particular conversation. Every Servlet request has an associated conversation. This association is managed automatically by the container according to the following rules:

Any conversation is in one of two states: transient or long-running.

All long-running conversations have a string-valued unique identifier, which may be set by the application when the conversation is marked long-running, or generated by the container.

If the conversation associated with the current Servlet request is in the transient state at the end of a Servlet request, it is destroyed, and the conversation context is also destroyed.

If the conversation associated with the current Servlet request is in the long-running state at the end of a Servlet request, it is not destroyed. The long-running conversation associated with a request may be propagated to any Servlet request via use of a request parameter named cid containing the unique identifier of the conversation. In this case, the application must manage this request parameter.

If the current Servlet request is a JSF request, and the conversation is in long-running state, it is propagated according to the following rules:

When no conversation is propagated to a Servlet request, or if a request parameter named conversationPropagation has the value none the request is associated with a new transient conversation. All long-running conversations are scoped to a particular HTTP servlet session and may not cross session boundaries. In the following cases, a propagated long-running conversation cannot be restored and re-associated with the request:

Authors
Gavin King, Pete Muir, Antoine Sabot-Durand
See Also
javax.enterprise.context.Conversation, javax.enterprise.context.NonexistentConversationException, javax.enterprise.context.BusyConversationException

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
ConversationScoped.Literal

Supports inline instantiation of the ConversationScoped annotation.

Method Summary

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString
javax.enterprise.context back to summary

public final Class ConversationScoped.Literal

extends AnnotationLiteral<ConversationScoped>
implements ConversationScoped
Class Inheritance
All Implemented Interfaces
javax.enterprise.context.ConversationScoped, java.lang.annotation.Annotation

Supports inline instantiation of the ConversationScoped annotation.
Author
Martin Kouba
Since
2.0

Field Summary

Modifier and TypeField and Description
public static final ConversationScoped.Literal
private static final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from javax.enterprise.util.AnnotationLiteral:
annotationTypeequalshashCodetoString

Field Detail

INSTANCEback to summary
public static final ConversationScoped.Literal INSTANCE
serialVersionUIDback to summary
private static final long serialVersionUID

Hides javax.enterprise.util.AnnotationLiteral.serialVersionUID.

Constructor Detail

Literalback to summary
public Literal()