Author: shane.bryzak(a)jboss.com
Date: 2009-06-09 19:47:01 -0400 (Tue, 09 Jun 2009)
New Revision: 2801
Modified:
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
added section 11 assertions
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-06-09 17:55:58 UTC (rev 2800)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-06-09 23:47:01 UTC (rev 2801)
@@ -4044,6 +4044,744 @@
<text>For every event mapping, the container must send a message containing
the serialized event and its event bindings to every mapped topic whenever an event with
the mapped event type and bindings is fired, and monitor every mapped topic for messages
containing events of that mapped event type and bindings and notify all local observers
whenever a message containing an event is received. Thus, events with the mapped event
type and bindings are distributed to other processes which have the same event
mapping.</text>
</assertion>
</section>
+
+ <section id="11" title="Portable extensions and the bean
manager">
+ <assertion id="a">
+ <text>A portable extension way integrate with the container by providing its
own beans, interceptors and decorators to the container.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A portable extension way integrate with the container by injecting
dependencies into its own objects using the dependency injection service.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A portable extension way integrate with the container by providing a
context implementation for a custom scope.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Bean definitions provided by a portable extension may be associated
with a certain activity.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Integration with portable extensions is enabled via the important SPI
interfaces Bean and BeanManager.</text>
+ </assertion>
+ </section>
+
+ <section id="11.1" title="The Bean interface">
+ <assertion id="a">
+ <text>Implementations of |Bean| must also implement the inherited operations
defined by the |Contextual| interface defined in Section 6.1, "The Contextual
interface".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The methods |getTypes()|, |getBindings()|, |getScopeType()|,
|getDeploymentType()|, |getName()|, |getStereotypes()| and |getInterceptorBindings()| must
return the bean types, bindings, scope type, deployment type, EL name, stereotypes and
interceptor bindings of the bean, as defined in Chapter 2, Bean definition.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The method |getInjectionPoints()| returns a set of |InjectionPoint|
objects, defined in Section 5.4.9, "Injection point
+metadata", representing injection points of the bean, that will be validated by the
container at initialization time.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The method |isPassivationCapable()| must return |true| if the bean is
passivation capable, as defined in Section 6.6.1, "Passivation capable beans",
and |false| otherwise.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The method |isNullable()| must return |true| if the method |create()|
sometimes returns a |null| value, and |false| otherwise, as defined in Section 5.1.3,
"Primitive types and null values".</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>An instance of |Bean| exists for every enabled bean in a
deployment.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>An application or portable extension may add support for new kinds of
beans beyond those defined by the this specification (managed beans, session beans,
producer methods and fields, resources and message destinations) by implementing |Bean|
and registering beans with the container, using the mechanism defined in Section 11.2.6,
"Bean registration".</text>
+ </assertion>
+ </section>
+
+ <section id="11.1.1" title="The Decorator interface">
+ <assertion id="a">
+ <text>The |Bean| object for a decorator must implement the interface
|javax.enterprise.inject.spi.Decorator|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The method |getDecoratedTypes()| returns the decorated types of the
decorator.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The methods |getDelegateType()| and |getDelegateBindings()| return the
delegate type and bindings of the decorator.</text>
+ </assertion>
+ </section>
+
+ <section id="11.1.2" title="The Interceptor interface">
+ <assertion id="a">
+ <text>The |Bean| object for an interceptor must implement
|javax.enterprise.inject.spi.Interceptor|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The method |getInterceptorBindingTypes()| returns the interceptor
bindings of the interceptor.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The method |intercepts()| returns |true| if the interceptor intercepts
callbacks or business methods of the given type, and |false| otherwise.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The method |intercept()| invokes the specified kind of lifecycle
callback or business method upon the given instance.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>An |InterceptionType| identifies the kind of lifecycle callback or
business method.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2" title="The BeanManager object">
+ <assertion id="a">
+ <text>The container provides a built-in bean with bean type |BeanManager|,
scope |@Dependent|, deployment type |@Standard| and binding |(a)Current|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The built-in implementation must be a passivation capable dependency,
as defined in Section 6.6.2, "Passivation capable dependencies".</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Any bean may obtain an instance of |BeanManager| by injecting
it.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>A framework may obtain the |BeanManager| object from JNDI. The
container must register an instance of |BeanManager| with name |java:app/BeanManager| in
JNDI at initialization time.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Any operation of |BeanManager| may be called at any time during the
execution of the application.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.1" title="Obtaining a contextual reference for a
bean">
+ <assertion id="a">
+ <text>The method |BeanManager.getReference()| returns a contextual reference
for a given bean and bean type, as defined in Section 6.5.3, "Contextual reference
for a bean".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The first parameter is the |Bean| object representing the bean. The
second parameter represents the bean type that must be implemented by any client proxy
that is returned.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.2" title="Obtaining an injectable
reference">
+ <assertion id="a">
+ <text>The method |BeanManager.getInjectableReference()| returns an injectable
reference for a given injection point, as defined in Section 5.4.1, "Injectable
references".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If the |InjectionPoint| represents a decorator delegate injection
point, |getInjectableReference()| returns a delegate, as
+defined in Section 8.1.2, "Decorator delegate injection points".</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Implementations of |Bean| usually maintain a reference to an instance
of |BeanManager|. When the |Bean| implementation performs dependency injection, it must
obtain the contextual instances to inject by calling
|BeanManager.getInjectableReference()|, passing an instance of |InjectionPoint| that
represents the injection point and the instance of |CreationalContext| that was passed to
|Bean.create()|.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.3" title="Obtaining a Bean by type">
+ <assertion id="a">
+ <text>The |getBeans()| method of the |BeanManager| interface returns the
result of the typesafe resolution algorithm defined in Section 5.1, "Typesafe
resolution algorithm".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The first parameter is a required bean type. The remaining parameters
are required bindings.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If no bindings are passed to |getBeans()|, the default binding
|@Current| is assumed.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If a parameterized type with a type parameter or wildcard is passed to
|getBeans()|, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If two instances of the same binding type are passed to |getBeans()|, a
|DuplicateBindingTypeException| is thrown.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If an instance of an annotation that is not a binding type is passed to
|getBeans()|, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.4" title="Obtaining a Bean by name">
+ <assertion id="a">
+ <text>The |getBeans()| method of the |BeanManager| interface returns the
result of the name resolution algorithm defined in Section 5.2, "EL name resolution
algorithm".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The parameter is a bean EL name.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.5" title="Obtaining the most specialized
bean">
+ <assertion id="a">
+ <text>The method |BeanManager.getMostSpecializedBean()| returns the |Bean|
object representing the most specialized enabled bean registered with the container that
specializes the given bean, as defined in Section 4.3.2, "Most specialized enabled
bean for a bean".</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.6" title="Bean registration">
+ <assertion id="a">
+ <text>The |BeanManager.addBean()| method registers a new bean with the
container, thereby making it available for injection into other beans.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The |Bean| parameter may represent an interceptor or
decorator.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.7" title="Observer registration">
+ <assertion id="a">
+ <text>An observer instance may be registered with the container by calling
|BeanManager.addObserver()|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The first parameter is the observer object. The second parameter is the
observed event type. The remaining parameters are optional observed event bindings. The
observer is notified when an event object that is assignable to the observed event type is
raised with the observed event bindings.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>An observer instance may be deregistered by calling
|BeanManager.removeObserver()|.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If two instances of the same binding type are passed to |addObserver()|
or |removeObserver()|, a |DuplicateBindingTypeException| is thrown.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If an instance of an annotation that is not a binding type is passed to
|addObserver()| or |removeObserver()|, an |IllegalArgumentException| is
thrown.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.8" title="Firing an event">
+ <assertion id="a">
+ <text>The method |BeanManager.fireEvent()| fires an event and notifies
observers, according to Section 10.6, "Observer notification".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The first argument is the event object. The remaining parameters are
event bindings.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the runtime type of the event object passed to |fireEvent()|
contains a type variable, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If two instances of the same binding type are passed to |fireEvent()|,
a |DuplicateBindingTypeException| is thrown.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If an instance of an annotation that is not a binding type is passed to
|fireEvent()|, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.9" title="Observer resolution">
+ <assertion id="a">
+ <text>The method |BeanManager.resolveObservers()| resolves observers for an
event according to the observer resolution algorithm defined in Section 10.2,
"Observer resolution algorithm".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The first parameter of |resolveObservers()| is the event object. The
remaining parameters are event bindings.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the runtime type of the event object passed to |resolveObservers()|
contains a type variable, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If two instances of the same binding type are passed to
|resolveObservers()|, a |DuplicateBindingTypeException| is thrown.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If an instance of an annotation that is not a binding type is passed to
|resolveObservers()|, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.10" title="Decorator resolution">
+ <assertion id="a">
+ <text>The method |BeanManager.resolveDecorators()| returns the ordered list
of enabled decorators for a set of bean types and a set of bindings, as defined in Section
8.3, "Decorator resolution".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The first argument is the set of bean types of the decorated bean. The
annotations are bindings declared by the decorated bean.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If two instances of the same binding type are passed to
|resolveDecorators()|, a |DuplicateBindingTypeException| is thrown.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If an instance of an annotation that is not a binding type is passed to
|resolveDecorators()|, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If the set of bean types is empty, an |IllegalArgumentException| is
thrown.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.11" title="Interceptor resolution">
+ <assertion id="a">
+ <text>The method |BeanManager.resolveInterceptors()| returns the ordered list
of enabled interceptors for a set of interceptor bindings, as defined in Section 9.5,
"Interceptor resolution".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If two instances of the same interceptor binding type are passed to
|resolveInterceptors()|, a |DuplicateBindingTypeException| is thrown.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If no interceptor binding type instance is passed to
|resolveInterceptors()|, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If an instance of an annotation that is not an interceptor binding type
is passed to |resolveInterceptors()|, an |IllegalArgumentException| is
thrown.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.12" title="Dependency validation">
+ <assertion id="a">
+ <text>The |BeanManager.validate()| operation validates a
dependency.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The method |validate()| validates the dependency and throws an
|InjectionException| if there is a deployment problem (for example, an unsatisfied or
ambiguous dependency) associated with the injection point.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.13" title="Enabled deployment types">
+ <assertion id="a">
+ <text>The method |BeanManager.getEnabledDeploymentTypes()| exposes the list
of enabled deployment types, in order of lower to higher precedence, as defined by Section
2.5.5, "Enabled deployment types".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Portable extensions may use this method to inspect meta-annotations
that appear on the deployment types and thereby discover information about the
deployment.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.14" title="Registering a Context">
+ <assertion id="a">
+ <text>A custom implementation of |Context| may be associated with a scope
type by calling |BeanManager.addContext()|.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.15" title="Obtaining the active Context for a
scope">
+ <assertion id="a">
+ <text>The method |BeanManager.getContext()| retrieves an active context
object associated with the a given scope, as defined in Section 6.5.1, "The active
context object for a scope".</text>
+ </assertion>
+ </section>
+
+ <section id="11.3" title="Alternative metadata sources">
+ <assertion id="a">
+ <text>The interfaces |AnnotatedType|, |AnnotatedField|, |AnnotatedMethod|,
|AnnotatedConstructor| and |AnnotatedParameter| in the package
|javax.enterprise.inject.spi| allow a portable extension to specify metadata that
overrides the annotations that exist on a bean class. The portable extension is
responsible for implementing the interfaces, thereby exposing the metadata to the
container.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The interface |Annotated| exposes the overriding annotations and type
declarations.</text>
+ </assertion>
+ </section>
+
+ <section id="11.4" title="Helper objects for Bean
implementations">
+ <assertion id="a">
+ <text>The BeanManager provides access to helper objects which parse and
validate the standard metadata defined by this specification and perform injection upon an
object according to the standard injection lifecycle defined in Section 5.4.3,
"Injection using the bean constructor".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The method |createInjectionTarget()| returns a container provided
instance of |InjectionTarget| for the given type or throws an |IllegalArgumentException|
if there is a definition error associated with any injection point of the
type.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The method |createManagedBean()| returns an instance of |ManagedBean|
representing the given managed bean type, or throws an |IllegalArgumentException| if there
is any kind of definition error associated with the type.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>When an |AnnotatedType| is passed to |createInjectionTarget()| or
|createManagedBean()| the container ignores the annotations and types declared by the
elements of the actual Java class and uses the metadata provided via the |Annotated|
interface instead.</text>
+ </assertion>
+ </section>
+
+ <section id="11.4.1" title="The InjectionTarget interface">
+ <assertion id="a">
+ <text>The interface |javax.enterprise.inject.spi.InjectionTarget| provides
operations for instantiating and performing dependency injection on instances of a
type.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>For any container provided implementation of |InjectionTarget| that
represents a class, |produce()| calls the constructor annotated |@Initializer| if it
exists, or the constructor with no parameters otherwise, as defined in Section 5.4.3,
"Injection using the bean constructor".</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>For any container provided implementation of |InjectionTarget| that
represents a class, |inject()| performs dependency injection upon the given object. First,
the container performs Java EE component environment
+injection according to the semantics required by the Java EE platform specification.
Next, it sets the value all injected fields, and then calls all the initializer methods,
as defined in Section 5.4.4, "Injection of fields and initializer methods".
Finally, it calls the |@PostConstruct| callback, if it exists, according to the semantics
required by the Java EE platform specification.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>For any container provided implementation of |InjectionTarget| that
represents a class, |dispose()| calls the |@PreDestroy| callback, if it exists, according
to the semantics required by the Java EE platform
+specification.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>For any container provided implementation of |InjectionTarget| that
represents a class, |destroy()| destroys dependent objects of the given instance, as
defined in Section 5.4.5, "Destruction of dependent objects".</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>For any container provided implementation of |InjectionTarget| that
represents a class, |getInjectionPoints()| returns the set of |InjectionPoint| objects
representing all injected fields, bean constructor parameters and initializer method
parameters.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>For any container provided implementation of |InjectionTarget| that
represents a producer method or field, produce() calls the producer method on, or accesses
the producer field of, either the given instance or a contextual instance of the most
specialized bean that specializes the bean that declares the producer method, as defined
in Section 5.4.6, "Invocation of producer or disposal methods".</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>For any container provided implementation of |InjectionTarget| that
represents a producer method or field, |inject()| does nothing.</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>For any container provided implementation of |InjectionTarget| that
represents a producer method or field, |dispose()| calls the disposal method, if it
exists, on either the given instance or a contextual instance of the most specialized bean
that specializes the bean that declares the producer method, as defined in Section 5.4.6,
"Invocation of
+producer or disposal methods".</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>For any container provided implementation of |InjectionTarget| that
represents a producer method or field, |destroy()| destroys dependent objects of the given
object, as defined in Section 5.4.5, "Destruction of dependent
objects".</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>For any container provided implementation of |InjectionTarget| that
represents a producer method or field, |getInjectionPoints()| returns the set of
|InjectionPoint| objects representing all producer and disposal method
parameters.</text>
+ </assertion>
+ </section>
+
+ <section id="11.4.2" title="ManagedBean and ProducerBean">
+ <assertion id="a">
+ <text>The interface |javax.enterprise.inject.spi.ManagedBean| exposes
container provided implementations of |Bean| and |InjectionTarget| for a managed bean
class.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The method |getAnnotatedType()| returns the |AnnotatedType|
representing the managed bean class.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The method |getInjectionTarget()| returns a container provided
implementation of |InjectionTarget| for the managed bean class.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The method |getProducerBeans()| returns a set of |ProducerBean| objects
representing the producer methods and fields of the managed bean.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The method |getObserverMethods()| returns a set of |ObserverMethod|
objects representing the observer methods of the bean.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The |ProducerBean| interface exposes container provided implementations
of |Bean| and |InjectionTarget| for a producer method or field.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>The methods |getAnnotatedProducer()| and |getAnnotatedDisposer()|
return the |AnnotatedMembers| representing the producer method or field and disposal
method respectively.</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>The method |getDeclaringBean()| returns a container provided
implementation of |Bean| for the bean class that declares the producer method or
field.</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>The method |getInjectionTarget()| returns a container provided
implementation of |InjectionTarget| for the producer method or field.</text>
+ </assertion>
+ </section>
+
+ <section id="11.4.3" title="The ObserverMethod interface">
+ <assertion id="a">
+ <text>The interface |javax.enterprise.inject.spi.ObserverMethod| exposes a
container provided implementation of |Observer| for an observer method, as defined in
Section 10.6.1, "Observer method notification" along with the observed event
type and bindings and an operation for calling the method.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The methods |getAnnotatedMethod()| returns the |AnnotatedMethod|
representing the observer method.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The method |getDeclaringBean()| returns a container provided
implementation of |Bean| for the bean class that declares the observer
method.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The method |notify()| calls the observer method, upon the given bean
instance as defined in Section 5.4.8, "Invocation of observer
methods".</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The methods |getObservedEventType()| and |getObservedEventBindings()|
return the observed event type and bindings of the observer method.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The method |getInjectionPoints()| returns the set of |InjectionPoint|
objects representing all injected method parameters.</text>
+ </assertion>
+ </section>
+
+ <section id="11.5" title="Container lifecycle events">
+ <assertion id="a">
+ <text>During the application initialization process, the container fires a
series of events, allowing portable extensions to integrate with the container
initialization process defined in Section 12.2, "Application initialization
lifecycle".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Observers of these events must be service providers of the service
|javax.enterprise.inject.spi.Extension| declared in |META-INF/services|.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The container instantiates a single instance of each service provider
at the beginning of the application initialization process and maintains a reference to it
until the application shuts down.</text>
+ </assertion>
+ </section>
+
+ <section id="11.5.1" title="BeforeBeanDiscovery event">
+ <assertion id="a">
+ <text>The container must fire an event before it begins the bean discovery
process. The event object must be of type
|javax.enterprise.inject.spi.BeforeBeanDiscovery|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The operations of the |BeforeBeanDiscovery| instance allow a portable
extension to declare that any annotation as a binding type, scope type, stereotype or
interceptor binding type.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If any observer method of the |BeforeBeanDiscovery| event throws an
exception, the exception is treated as a definition error by the container.</text>
+ </assertion>
+ </section>
+
+ <section id="11.5.2" title="AfterBeanDiscovery event">
+ <assertion id="a">
+ <text>The container must fire a second event when it has fully completed the
bean discovery process, validated that there are no definition errors relating to the
discovered beans, and registered |Bean| and |Observer| objects for the discovered beans,
but before detecting deployment problems. The event object must be of type
|javax.enterprise.inject.spi.AfterBeanDiscovery|.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The method |addDefinitionError()| registers a definition error with the
container, causing the container to abort deployment after all observers have been
notified.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If any observer method of the |AfterBeanDiscovery| event throws an
exception, the exception is treated as a definition error by the container.</text>
+ </assertion>
+ </section>
+
+ <section id="11.5.3" title="AfterDeploymentValidation
event">
+ <assertion id="a">
+ <text>The container must fire a third event after it has validated that there
are no deployment problems and before creating contexts or processing requests. The event
object must be of type
|javax.enterprise.inject.spi.AfterDeploymentValidation|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The method |addDeploymentProblem()| registers a deployment problem with
the container, causing the container to abort deployment after all observers have been
notified.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If any observer method of the |AfterDeploymentValidation| event throws
an exception, the exception is treated as a deployment problem by the
container.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The container must not allow any request to be processed by the
deployment until all observers of this event return.</text>
+ </assertion>
+ </section>
+
+ <section id="11.5.4" title="BeforeShutdown event">
+ <assertion id="a">
+ <text>The container must fire a final event after it has finished processing
requests and destroyed all contexts. The event object must be of type
|javax.enterprise.inject.spi.BeforeShutdown|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If any observer method of the |BeforeShutdown| event throws an
exception, the exception is treated as a deployment problem by the
container.</text>
+ </assertion>
+ </section>
+
+ <section id="11.5.5" title="ProcessAnnotatedType event">
+ <assertion id="a">
+ <text>The container must fire an event for each Java class it discovers,
before it reads the declared annotations. The event object must be of type
|javax.enterprise.inject.spi.ProcessAnnotatedType<X>|, where |X| is the
class.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The |getAnnotatedType()|/|setAnnotatedType()| property accessor pair
provides access to the |AnnotatedType| object that will be used by the container to read
the declared annotations.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Any observer of this event is permitted to wrap and/or replace the
|annotatedType| property of |ProcessAnnotatedType|.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The container must use the final value of this property, after all
observers have been called, to read the annotations of this class.</text>
+ </assertion>
+ </section>
+
+ <section id="11.5.6" title="ProcessInjectionTarget event">
+ <assertion id="a">
+ <text>The container must fire an event for each managed bean, session bean,
Java EE component class supporting injection, producer method or producer field it
discovers. The event object must be of type
|javax.enterprise.inject.spi.ProcessInjectionTarget<X>|, where |X| is the
managed bean class, session bean class or Java EE component class supporting
injection.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The |getInjectionTarget()|/|setInjectionTarget()| property accessor
pair provides access to the |InjectionTarget| object that will be used by the container to
perform injection.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The method |getAnnotatedType()| returns the |AnnotatedType|
representing the managed bean, session bean or other Java EE component class supporting
injection.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The method |addDefinitionError()| registers a definition error with the
container, causing the container to abort deployment after bean discovery is
complete.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Any observer of this event is permitted to wrap and/or replace the
|injectionTarget| property of |ProcessInjectionTarget|. The container must use the final
value of this property, after all observers have been called, whenever it performs
injection upon the managed bean, session bean or other Java EE component class supporting
injection.</text>
+ </assertion>
+ </section>
+
+ <section id="11.5.7" title="ProcessBean event">
+ <assertion id="a">
+ <text>The container must fire an event for each bean it discovers, before
registering the |Bean| object. The event object must be of type
|javax.enterprise.inject.spi.ProcessBean|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>For a managed bean with bean class |X|, the container must raise an
event of type |ProcessBean<X>|.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>For a session bean with bean class local view |X|, the container must
raise an event of type |ProcessBean<X>|.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>For a session bean with no bean class local view |X|, the container
must raise an event of type |ProcessBean<Object>|.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>For a producer method or field with method return type or field type
|X|, the container must raise an event of type |ProcessBean<
+X>|.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The |getBean()|/|setBean()| property accessor pair provides access to
the |Bean| object that is about to be registered.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>The method |getAnnotated()| returns the |AnnotatedType|,
|AnnotatedField| or |AnnotatedMethod|.</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>The method |addDefinitionError()| registers a definition error with the
container, causing the container to abort deployment after bean discovery is
complete.</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>Any observer of this event is permitted to wrap and/or replace the bean
property of |ProcessBean|. When all observers have been called, the container registers
the final value of this property. The container must not register any |Bean| object if any
observer called |addDefinitionError()|.</text>
+ </assertion>
+ </section>
+
+ <section id="11.5.8" title="ProcessObserver event">
+ <assertion id="a">
+ <text>The container must fire an event for each observer method it discovers,
before registering the |Observer| object. The event object must be of type
|javax.enterprise.inject.spi.ProcessObserver<T>| where |T| is the observed
event type.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The |getObserver()|/|setObserver()| property accessor pair provides
access to the |Observer| object that is about to be registered.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The method |getAnnotatedMethod()| returns the
|AnnotatedMethod|.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The method |addDefinitionError()| registers a definition error with the
container, causing the container to abort deployment after bean discovery is
complete.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Any observer of this event is permitted to wrap and/or replace the
observer property of |ProcessObserver|. When all observers have been called, the container
registers the final value of this property. The container must not register any
|ObserverMethod| object if any observer called |addDefinitionError()|.</text>
+ </assertion>
+ </section>
+
+ <section id="11.6" title="Activities">
+ <assertion id="a">
+ <text>Activities are represented by instances of |BeanManager|. The method
|createActivity()| creates a new child activity of an activity.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A child activity inherits all beans, interceptors, decorators,
observers, and contexts defined by its direct and indirect parent
activities.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Every bean belonging to a parent activity also belongs to the child
activity, is eligible for injection into other beans belonging to the child activity and
may be obtained by dynamic lookup via the child activity.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Every interceptor and decorator belonging to a parent activity also
belongs to the child activity and may be applied to any bean belonging to the child
activity.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Every observer belonging to a parent activity also belongs to the child
activity and receives events fired via the child activity.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Every context object belonging to the parent activity also belongs to
the child activity.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Beans and observers may be registered with an activity by calling
|addBean()| or |addObserver()| on the |BeanManager| object that represents the
activity.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Beans and observers registered with an activity are visible only to
that activity and its children�they are never visible to direct or indirect parent
activities, or to other children of the parent activity.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>A bean registered with the child activity is not available for
injection into any bean registered with a parent activity.</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>A bean registered with a child activity is not available for injection
into a non-contextual instance.</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>A bean registered with a child activity may not be obtained by dynamic
lookup via the parent activity.</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>An observer registered with the child activity does not receive events
fired via a parent activity.</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>If a bean registered with a child activity has the bean type and all
bindings of some injection point of some bean registered with a direct or indirect parent
activity, the container automatically detects the problem and treats it as a deployment
problem, as defined in Section 12.4, "Problems detected automatically by the
container".</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>Interceptors and decorators may not be registered with a child
activity. The |addInterceptor()| and |addDecorator()| methods throw
|UnsupportedOperationException| when called on a |BeanManager| object that represents a
child activity.</text>
+ </assertion>
+ </section>
+
+ <section id="11.6.1" title="Current activity">
+ <assertion id="a">
+ <text>An activity may be associated with the current context for a normal
scope by calling |setCurrent()|, passing the normal scope type.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If the given scope is inactive when |setCurrent()| is called, a
|ContextNotActiveException| is thrown.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the given scope type is not a normal scope, an
|IllegalArgumentException| is thrown.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>All EL evaluations (as defined Section 5.6, "Integration with
Unified EL"), all calls to any injected |BeanManager| object or |BeanManager| object
obtained via JNDI lookup (as defined by Section 11.2, "The BeanManager object"),
all calls to any injected |Event| object (as defined in Section 10.4.1, "The Event
interface") and all calls to any injected Instance object (as defined by Section
5.5.1, "The Instance interface") are processed by the current
activity.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If the root activity has no active normal scope such that the current
context for that scope has an associated activity, the root activity is the current
activity.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If the root activity has exactly one active normal scope such that the
current context for that scope has an associated activity, that activity is the current
activity.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>Otherwise, there is no well-defined current activity, and the behavior
is undefined. Portable frameworks and applications should not depend upon the behavior of
the container when two different current contexts have an associated
activity.</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>A bean registered with an activity is only available to Unified EL
expressions that are evaluated when that activity or one of its children is the current
activity.</text>
+ </assertion>
+ </section>
+
+
+
+
+
+
+
+
<section id="11" title="Packaging and Deployment">