From c62e4e0efc110b3eb74c8b1aa130d064edba255f Mon Sep 17 00:00:00 2001 From: Pete Muir Date: Wed, 14 Jul 2010 22:54:19 +0000 Subject: [PATCH] remove CDI API from Weld APIs, and bump version to 1.1 --- bom/pom.xml | 9 +- cdi/pom.xml | 73 --- .../main/java/javax/decorator/Decorator.java | 56 -- .../main/java/javax/decorator/Delegate.java | 88 ---- .../java/javax/decorator/package-info.java | 96 ---- .../enterprise/context/ApplicationScoped.java | 74 --- .../context/BusyConversationException.java | 62 --- .../enterprise/context/ContextException.java | 52 -- .../context/ContextNotActiveException.java | 56 -- .../enterprise/context/Conversation.java | 104 ---- .../context/ConversationScoped.java | 128 ----- .../javax/enterprise/context/Dependent.java | 109 ---- .../NonexistentConversationException.java | 59 --- .../javax/enterprise/context/NormalScope.java | 53 -- .../enterprise/context/RequestScoped.java | 74 --- .../enterprise/context/SessionScoped.java | 62 --- .../enterprise/context/package-info.java | 129 ----- .../javax/enterprise/context/spi/Context.java | 88 ---- .../enterprise/context/spi/Contextual.java | 65 --- .../context/spi/CreationalContext.java | 48 -- .../enterprise/context/spi/package-info.java | 33 -- .../java/javax/enterprise/event/Event.java | 124 ----- .../enterprise/event/ObserverException.java | 52 -- .../java/javax/enterprise/event/Observes.java | 97 ---- .../javax/enterprise/event/Reception.java | 48 -- .../enterprise/event/TransactionPhase.java | 69 --- .../javax/enterprise/event/package-info.java | 109 ---- .../javax/enterprise/inject/Alternative.java | 72 --- .../inject/AmbiguousResolutionException.java | 52 -- .../java/javax/enterprise/inject/Any.java | 71 --- .../enterprise/inject/CreationException.java | 53 -- .../java/javax/enterprise/inject/Default.java | 87 ---- .../javax/enterprise/inject/Disposes.java | 97 ---- .../inject/IllegalProductException.java | 50 -- .../enterprise/inject/InjectionException.java | 50 -- .../javax/enterprise/inject/Instance.java | 172 ------ .../java/javax/enterprise/inject/Model.java | 48 -- .../java/javax/enterprise/inject/New.java | 84 --- .../javax/enterprise/inject/Produces.java | 109 ---- .../inject/ResolutionException.java | 50 -- .../javax/enterprise/inject/Specializes.java | 78 --- .../javax/enterprise/inject/Stereotype.java | 126 ----- .../java/javax/enterprise/inject/Typed.java | 67 --- .../UnproxyableResolutionException.java | 57 -- .../UnsatisfiedResolutionException.java | 54 -- .../javax/enterprise/inject/package-info.java | 492 ------------------ .../inject/spi/AfterBeanDiscovery.java | 92 ---- .../inject/spi/AfterDeploymentValidation.java | 45 -- .../enterprise/inject/spi/Annotated.java | 80 --- .../inject/spi/AnnotatedCallable.java | 39 -- .../inject/spi/AnnotatedConstructor.java | 41 -- .../enterprise/inject/spi/AnnotatedField.java | 39 -- .../inject/spi/AnnotatedMember.java | 54 -- .../inject/spi/AnnotatedMethod.java | 39 -- .../inject/spi/AnnotatedParameter.java | 47 -- .../enterprise/inject/spi/AnnotatedType.java | 63 --- .../javax/enterprise/inject/spi/Bean.java | 111 ---- .../enterprise/inject/spi/BeanManager.java | 372 ------------- .../inject/spi/BeforeBeanDiscovery.java | 85 --- .../enterprise/inject/spi/BeforeShutdown.java | 31 -- .../enterprise/inject/spi/Decorator.java | 58 --- .../enterprise/inject/spi/Extension.java | 44 -- .../enterprise/inject/spi/InjectionPoint.java | 121 ----- .../inject/spi/InjectionTarget.java | 73 --- .../inject/spi/InterceptionType.java | 60 --- .../enterprise/inject/spi/Interceptor.java | 67 --- .../enterprise/inject/spi/ObserverMethod.java | 80 --- .../inject/spi/PassivationCapable.java | 44 -- .../inject/spi/ProcessAnnotatedType.java | 73 --- .../enterprise/inject/spi/ProcessBean.java | 84 --- .../inject/spi/ProcessInjectionTarget.java | 91 ---- .../inject/spi/ProcessManagedBean.java | 42 -- .../inject/spi/ProcessObserverMethod.java | 66 --- .../inject/spi/ProcessProducer.java | 94 ---- .../inject/spi/ProcessProducerField.java | 44 -- .../inject/spi/ProcessProducerMethod.java | 52 -- .../inject/spi/ProcessSessionBean.java | 49 -- .../javax/enterprise/inject/spi/Producer.java | 91 ---- .../inject/spi/SessionBeanType.java | 39 -- .../enterprise/inject/spi/package-info.java | 133 ----- .../enterprise/util/AnnotationLiteral.java | 361 ------------- .../javax/enterprise/util/Nonbinding.java | 53 -- .../javax/enterprise/util/TypeLiteral.java | 149 ------ .../javax/enterprise/util/package-info.java | 4 - cdi/src/main/javadoc/overview.html | 54 -- cdi/src/main/resources/beans_1_0.xsd | 181 ------- .../cdi/api/test/AnnotationLiteralTest.java | 34 -- .../test/java/org/jboss/cdi/api/test/Foo.java | 31 -- parent/pom.xml | 6 +- pom.xml | 7 +- weld-spi/pom.xml | 2 +- weld/pom.xml | 2 +- 92 files changed, 13 insertions(+), 7300 deletions(-) delete mode 100644 cdi/pom.xml delete mode 100644 cdi/src/main/java/javax/decorator/Decorator.java delete mode 100644 cdi/src/main/java/javax/decorator/Delegate.java delete mode 100644 cdi/src/main/java/javax/decorator/package-info.java delete mode 100644 cdi/src/main/java/javax/enterprise/context/ApplicationScoped.java delete mode 100644 cdi/src/main/java/javax/enterprise/context/BusyConversationException.java delete mode 100644 cdi/src/main/java/javax/enterprise/context/ContextException.java delete mode 100644 cdi/src/main/java/javax/enterprise/context/ContextNotActiveException.java delete mode 100644 cdi/src/main/java/javax/enterprise/context/Conversation.java delete mode 100644 cdi/src/main/java/javax/enterprise/context/ConversationScoped.java delete mode 100644 cdi/src/main/java/javax/enterprise/context/Dependent.java delete mode 100644 cdi/src/main/java/javax/enterprise/context/NonexistentConversationException.java delete mode 100644 cdi/src/main/java/javax/enterprise/context/NormalScope.java delete mode 100644 cdi/src/main/java/javax/enterprise/context/RequestScoped.java delete mode 100644 cdi/src/main/java/javax/enterprise/context/SessionScoped.java delete mode 100644 cdi/src/main/java/javax/enterprise/context/package-info.java delete mode 100644 cdi/src/main/java/javax/enterprise/context/spi/Context.java delete mode 100644 cdi/src/main/java/javax/enterprise/context/spi/Contextual.java delete mode 100644 cdi/src/main/java/javax/enterprise/context/spi/CreationalContext.java delete mode 100644 cdi/src/main/java/javax/enterprise/context/spi/package-info.java delete mode 100644 cdi/src/main/java/javax/enterprise/event/Event.java delete mode 100644 cdi/src/main/java/javax/enterprise/event/ObserverException.java delete mode 100644 cdi/src/main/java/javax/enterprise/event/Observes.java delete mode 100644 cdi/src/main/java/javax/enterprise/event/Reception.java delete mode 100644 cdi/src/main/java/javax/enterprise/event/TransactionPhase.java delete mode 100644 cdi/src/main/java/javax/enterprise/event/package-info.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/Alternative.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/AmbiguousResolutionException.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/Any.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/CreationException.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/Default.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/Disposes.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/IllegalProductException.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/InjectionException.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/Instance.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/Model.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/New.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/Produces.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/ResolutionException.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/Specializes.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/Stereotype.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/Typed.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/UnproxyableResolutionException.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/UnsatisfiedResolutionException.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/package-info.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/spi/AfterBeanDiscovery.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/spi/AfterDeploymentValidation.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/spi/Annotated.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/spi/AnnotatedCallable.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/spi/AnnotatedConstructor.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/spi/AnnotatedField.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/spi/AnnotatedMember.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/spi/AnnotatedMethod.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/spi/AnnotatedParameter.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/spi/AnnotatedType.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/spi/Bean.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/spi/BeanManager.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/spi/BeforeBeanDiscovery.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/spi/BeforeShutdown.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/spi/Decorator.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/spi/Extension.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/spi/InjectionPoint.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/spi/InjectionTarget.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/spi/InterceptionType.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/spi/Interceptor.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/spi/ObserverMethod.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/spi/PassivationCapable.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/spi/ProcessAnnotatedType.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/spi/ProcessBean.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/spi/ProcessInjectionTarget.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/spi/ProcessManagedBean.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/spi/ProcessObserverMethod.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/spi/ProcessProducer.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/spi/ProcessProducerField.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/spi/ProcessProducerMethod.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/spi/ProcessSessionBean.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/spi/Producer.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/spi/SessionBeanType.java delete mode 100644 cdi/src/main/java/javax/enterprise/inject/spi/package-info.java delete mode 100644 cdi/src/main/java/javax/enterprise/util/AnnotationLiteral.java delete mode 100644 cdi/src/main/java/javax/enterprise/util/Nonbinding.java delete mode 100644 cdi/src/main/java/javax/enterprise/util/TypeLiteral.java delete mode 100644 cdi/src/main/java/javax/enterprise/util/package-info.java delete mode 100644 cdi/src/main/javadoc/overview.html delete mode 100644 cdi/src/main/resources/beans_1_0.xsd delete mode 100644 cdi/src/test/java/org/jboss/cdi/api/test/AnnotationLiteralTest.java delete mode 100644 cdi/src/test/java/org/jboss/cdi/api/test/Foo.java diff --git a/bom/pom.xml b/bom/pom.xml index 1462b0df..b1a870b3 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -3,7 +3,7 @@ org.jboss.weld weld-api-bom pom - 1.0-SNAPSHOT + 1.1-SNAPSHOT org.jboss.weld @@ -11,11 +11,11 @@ 12 - Weld and CDI APIs BOM + Weld APIs BOM - Weld and CDI APIs "bill of materials" which can be imported by any project using the Weld implementation of CDI. It provides dependency management for the developer APIs and SPIs, as well as container integrator SPIs + Weld APIs "bill of materials" which can be imported by any project using the Weld implementation of CDI. It provides dependency management for the developer APIs and SPIs, as well as container integrator SPIs http://www.seamframework.org/Weld @@ -73,6 +73,7 @@ 1 + 1.0-SP1 3.1.0 1.0 1.0 @@ -195,7 +196,7 @@ javax.enterprise cdi-api - ${project.version} + ${cdi.api.version} diff --git a/cdi/pom.xml b/cdi/pom.xml deleted file mode 100644 index e474fd11..00000000 --- a/cdi/pom.xml +++ /dev/null @@ -1,73 +0,0 @@ - - 4.0.0 - - - org.jboss.weld - weld-api-parent - 1.0-SNAPSHOT - ../parent/pom.xml - - - javax.enterprise - cdi-api - jar - - CDI APIs - APIs for JSR-299: Contexts and Dependency Injection for Java EE - - http://www.seamframework.org/Weld - - - Apache License, Version 2.0 - repo - http://www.apache.org/licenses/LICENSE-2.0.html - - - - - - - javax.el - el-api - true - - - - org.jboss.ejb3 - jboss-ejb3-api - true - - - - org.jboss.spec.javax.interceptor - jboss-interceptors-api_1.1_spec - - - - javax.annotation - jsr250-api - - - - javax.inject - javax.inject - - - - org.testng - testng - jdk15 - test - - - - - - scm:svn:http://anonsvn.jboss.org/repos/weld/api/trunk/cdi - scm:svn:https://svn.jboss.org/repos/weld/api/trunk/cdi - http://fisheye.jboss.org/browse/weld/api/trunk/cdi - - - - diff --git a/cdi/src/main/java/javax/decorator/Decorator.java b/cdi/src/main/java/javax/decorator/Decorator.java deleted file mode 100644 index c688810f..00000000 --- a/cdi/src/main/java/javax/decorator/Decorator.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.decorator; - -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import javax.enterprise.inject.Stereotype; - -/** - *

Specifies that a class is a decorator. May be applied to - * a managed bean class.

- * - *
- * @Decorator 
- * class TimestampLogger implements Logger { ... }
- * 
- * - *

Decorators of a session bean must comply with the bean provider - * programming restrictions defined by the EJB specification. - * Decorators of a stateful session bean must comply with the rules - * for instance passivation and conversational state defined by the - * EJB specification.

- * - * @see javax.decorator.Delegate @Delegate identifies the - * delegate injection point of a decorator. - * - * @author Gavin King - * @author Pete Muir - */ -@Target(TYPE) -@Retention(RUNTIME) -@Documented -@Stereotype -public @interface Decorator -{ -} diff --git a/cdi/src/main/java/javax/decorator/Delegate.java b/cdi/src/main/java/javax/decorator/Delegate.java deleted file mode 100644 index 9c4544f4..00000000 --- a/cdi/src/main/java/javax/decorator/Delegate.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.decorator; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - *

Identifies the delegate injection point of a decorator. - * May be applied to a field, bean constructor parameter or - * initializer method parameter of a decorator bean class.

- * - *
- * @Decorator 
- * class TimestampLogger implements Logger { 
- *    @Inject @Delegate @Any Logger logger; 
- *    ... 
- * } 
- * 
- *
- * @Decorator 
- * class TimestampLogger implements Logger { 
- *    private Logger logger;
- *    
- *    @Inject
- *    public TimestampLogger(@Delegate @Debug Logger logger) { 
- *       this.logger=logger; 
- *    } 
- *    ... 
- * } 
- * 
- * - *

A decorator must have exactly one delegate injection point. The - * delegate injection point must be an injected field, initializer - * method parameter or bean constructor method parameter.

- * - *

The container injects a delegate object to the delegate injection - * point. The delegate object implements the delegate type and delegates - * method invocations along the decorator stack. When the container calls - * a decorator during business method interception, the decorator may - * invoke any method of the delegate object. If a decorator invokes the - * delegate object at any other time, the invoked method throws an - * {@link java.lang.IllegalStateException}.

- * - *
- * @Decorator 
- * class TimestampLogger implements Logger { 
- *    @Inject @Delegate @Any Logger logger; 
- *    
- *    void log(String message) {
- *       logger.log( timestamp() + ": " + message );
- *    }
- *    ...
- * } 
- * 
- * - * @see javax.decorator.Decorator @Decorator specifies that a - * class is a decorator. - * - * @author Gavin King - * @author Pete Muir - */ -@Target({FIELD, PARAMETER}) -@Retention(RUNTIME) -@Documented -public @interface Delegate -{ -} diff --git a/cdi/src/main/java/javax/decorator/package-info.java b/cdi/src/main/java/javax/decorator/package-info.java deleted file mode 100644 index b5bf823b..00000000 --- a/cdi/src/main/java/javax/decorator/package-info.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - *

Annotations relating to decorators.

- * - *

A decorator implements one or more bean types and - * intercepts business method invocations of - * {@linkplain javax.enterprise.inject beans} which - * implement those bean types. These bean types are called - * decorated types.

- * - *

A decorator is a managed bean annotated {@link - * javax.decorator.Decorator @Decorator}.

- * - *

Decorators are superficially similar to interceptors, - * but because they directly implement operations with business - * semantics, they are able to implement business logic and, - * conversely, unable to implement the cross-cutting concerns - * for which interceptors are optimized. Decorators are called - * after interceptors.

- * - *

Decorated types

- * - *

The set of decorated types of a decorator includes all - * bean types of the managed bean that are Java interfaces, - * except for {@link java.io.Serializable}. The decorator bean - * class and its superclasses are not decorated types of the - * decorator. The decorator class may be abstract.

- * - *

A decorator intercepts every method:

- *
    - *
  • declared by a decorated type of the decorator
  • - *
  • that is implemented by the bean class of the decorator.
  • - *
- * - *

A decorator may be an abstract class, and is not required to - * implement every method of every decorated type.

- * - *

Delegate injection points

- * - *

All decorators have a - * {@linkplain javax.decorator.Delegate delegate injection point}. - * A delegate injection point is an injection point of the bean - * class annotated {@link javax.decorator.Delegate @Delegate}.

- * - *

The type of the delegate injection point must implement or - * extend every decorated type. A decorator is not required to - * implement the type of the delegate injection point.

- * - *

Enabled decorators

- * - *

By default, a bean archive has no enabled decorators. A - * decorator must be explicitly enabled by listing its bean class - * under the <decorators> element of the - * beans.xml file of the bean archive. The order of the - * decorator declarations determines the decorator ordering. - * Decorators which occur earlier in the list are called first.

- * - *

A decorator is bound to a bean if:

- * - *
    - *
  • The bean is {@linkplain javax.enterprise.inject eligible for injection} - * to the delegate injection point of the decorator.
  • - *
  • The decorator is enabled in the bean archive of the bean.
  • - *
- * - *

If a managed bean class is declared final, it may not have - * decorators. If a managed bean has a non-static, non-private, - * final method, it may not have any decorator which implements - * that method.

- * - *

A decorator instance is a - * {@linkplain javax.enterprise.context.Dependent dependent object} - * of the object it decorates.

- * - * @see javax.enterprise.inject - * - * @see javax.decorator.Decorator - * @see javax.decorator.Delegate - * - */ -package javax.decorator; diff --git a/cdi/src/main/java/javax/enterprise/context/ApplicationScoped.java b/cdi/src/main/java/javax/enterprise/context/ApplicationScoped.java deleted file mode 100644 index 8215d49d..00000000 --- a/cdi/src/main/java/javax/enterprise/context/ApplicationScoped.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.context; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Documented; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - - -/** - *

Specifies that a bean is application scoped.

- * - *

The application scope is active:

- * - *
    - *
  • during the service() method of any servlet in - * the web application, during the doFilter() method of - * any servlet filter and when the container calls any - * ServletContextListener, HttpSessionListener, - * AsyncListener or ServletRequestListener,
  • - *
  • during any Java EE web service invocation,
  • - *
  • during any remote method invocation of any EJB, during - * any asynchronous method invocation of any EJB, during any - * call to an EJB timeout method and during message delivery - * to any EJB message-driven bean,
  • - *
  • during any message delivery to a MessageListener - * for a JMS topic or queue obtained from the Java EE component - * environment, and
  • - *
  • when the disposer method or @PreDestroy callback of - * any bean with any normal scope other than @ApplicationScoped - * is called.
  • - *
- * - *

The application context is shared between all servlet requests, - * web service invocations, EJB remote method invocations, EJB - * asynchronous method invocations, EJB timeouts and message - * deliveries to message-driven beans that execute within the same - * application. The application context is destroyed when the - * application is shut down.

- * - * @author Gavin King - * @author Pete Muir - */ - -@Target( { TYPE, METHOD, FIELD }) -@Retention(RUNTIME) -@Documented -@NormalScope -@Inherited -public @interface ApplicationScoped -{ - -} diff --git a/cdi/src/main/java/javax/enterprise/context/BusyConversationException.java b/cdi/src/main/java/javax/enterprise/context/BusyConversationException.java deleted file mode 100644 index b75bb360..00000000 --- a/cdi/src/main/java/javax/enterprise/context/BusyConversationException.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.context; - -/** - *

Indicates that the container has rejected a request because a concurrent - * request is associated with the same conversation context.

- * - *

The container ensures that a long-running conversation may be associated with - * at most one request at a time, by blocking or rejecting concurrent requests. - * If the container rejects a request, it must associate the request with a new - * transient conversation and throw an exception of type - * BusyConversationException from the restore view phase of the JSF - * lifecycle.

- * - * @see javax.enterprise.context.ConversationScoped - * - * @author Pete Muir - * @author Gavin King - */ - -public class BusyConversationException extends ContextException -{ - - private static final long serialVersionUID = -3599813072560026919L; - - public BusyConversationException() - { - super(); - } - - public BusyConversationException(String message) - { - super(message); - } - - public BusyConversationException(Throwable cause) - { - super(cause); - } - - public BusyConversationException(String message, Throwable cause) - { - super(message, cause); - } - -} diff --git a/cdi/src/main/java/javax/enterprise/context/ContextException.java b/cdi/src/main/java/javax/enterprise/context/ContextException.java deleted file mode 100644 index 2a533061..00000000 --- a/cdi/src/main/java/javax/enterprise/context/ContextException.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.context; - - -/** - *

Indicates a problem relating to context management.

- * - * @author Pete Muir - * @author Shane Bryzak - */ -public class ContextException extends RuntimeException -{ - - private static final long serialVersionUID = -3599813072560026919L; - - public ContextException() - { - super(); - } - - public ContextException(String message) - { - super(message); - } - - public ContextException(Throwable cause) - { - super(cause); - } - - public ContextException(String message, Throwable cause) - { - super(message, cause); - } - -} diff --git a/cdi/src/main/java/javax/enterprise/context/ContextNotActiveException.java b/cdi/src/main/java/javax/enterprise/context/ContextNotActiveException.java deleted file mode 100644 index baa24489..00000000 --- a/cdi/src/main/java/javax/enterprise/context/ContextNotActiveException.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.context; - - -/** - *

Indicates that a context is not active.

- * - * @see javax.enterprise.context.spi.Context - * - * @author Pete Muir - * @author Shane Bryzak - * @author Gavin King - */ - -public class ContextNotActiveException extends ContextException -{ - - private static final long serialVersionUID = -3599813072560026919L; - - public ContextNotActiveException() - { - super(); - } - - public ContextNotActiveException(String message) - { - super(message); - } - - public ContextNotActiveException(Throwable cause) - { - super(cause); - } - - public ContextNotActiveException(String message, Throwable cause) - { - super(message, cause); - } - -} diff --git a/cdi/src/main/java/javax/enterprise/context/Conversation.java b/cdi/src/main/java/javax/enterprise/context/Conversation.java deleted file mode 100644 index 7df1d3b4..00000000 --- a/cdi/src/main/java/javax/enterprise/context/Conversation.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package javax.enterprise.context; - -/** - *

Allows the application to manage the - * {@linkplain javax.enterprise.context.ConversationScoped 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.

- * - * @see javax.enterprise.context.ConversationScoped @ConversationScoped - * - * @author Pete Muir - * @author Gavin King - * - */ -public interface Conversation -{ - - /** - *

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. - */ - public void begin(); - - /** - *

Mark the current transient conversation long-running, - * with a specified identifier.

- * - * @throws IllegalStateException if the current conversation - * is already marked long-running. - * @throws IllegalArgumentException if a conversation with - * the specified identifier already exists. - */ - public void begin(String id); - - /** - *

Marks the current long-running conversation transient.

- * - * @throws IllegalStateException if the current conversation - * is already marked transient. - */ - public void end(); - - - /** - *

Get the identifier of the current long-running conversation.

- * - * @return the identifier of the current long-running conversation, - * or a null value if the current conversation is transient. - */ - public String getId(); - - /** - *

Get the timeout of the current conversation.

- * - * @return the current timeout in milliseconds. - */ - public long getTimeout(); - - /** - *

Set the timeout of the current conversation.

- * - * @param milliseconds the new timeout in milliseconds. - */ - public void setTimeout(long milliseconds); - - /** - *

Determine if the conversation is marked transient or - * long-running.

- * - * @return true if the conversation is marked transient, - * or falseif it is marked long-running. - */ - public boolean isTransient(); -} \ No newline at end of file diff --git a/cdi/src/main/java/javax/enterprise/context/ConversationScoped.java b/cdi/src/main/java/javax/enterprise/context/ConversationScoped.java deleted file mode 100644 index f9918c81..00000000 --- a/cdi/src/main/java/javax/enterprise/context/ConversationScoped.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.context; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Documented; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - *

Specifies that a bean is conversation scoped.

- * - *

The conversation scope is active:

- * - *
    - *
  • during all standard lifecycle phases of any JSF faces or - * non-faces request.
  • - *
- * - *

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

- * - *
    - *
  • Any JSF request has exactly one associated conversation.
  • - *
  • The conversation associated with a JSF request is determined - * at the beginning of the restore view phase and does not change - * during the request.
  • - *
- * - *

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

- * - *
    - *
  • By default, a conversation is transient
  • - *
  • A transient conversation may be marked long-running by calling - * {@link javax.enterprise.context.Conversation#begin()}
  • - *
  • A long-running conversation may be marked transient by calling - * {@link javax.enterprise.context.Conversation#end()}
  • - *
- * - *

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 JSF request - * is in the transient state at the end of a JSF request, it is - * destroyed, and the conversation context is also destroyed.

- * - *

If the conversation associated with the current JSF request - * is in the long-running state at the end of a JSF request, it is - * not destroyed. Instead, it may be propagated to other requests - * according to the following rules:

- * - *
    - *
  • The long-running conversation context associated with a - * request that renders a JSF view is automatically propagated - * to any faces request (JSF form submission) that originates - * from that rendered page.
  • - *
  • The long-running conversation context associated with a - * request that results in a JSF redirect (a redirect resulting - * from a navigation rule or JSF NavigationHandler) is - * automatically propagated to the resulting non-faces request, - * and to any other subsequent request to the same URL. This is - * accomplished via use of a GET request parameter named cid - * containing the unique identifier of the conversation.
  • - *
  • The long-running conversation associated with a request - * may be propagated to any non-faces request via use of a GET - * request parameter named cid containing the unique identifier - * of the conversation. In this case, the application must manage - * this request parameter.
  • - *
- * - *

When no conversation is propagated to a JSF request, 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 reassociated with the request:

- * - *
    - *
  • When the HTTP servlet session is invalidated, all - * long-running conversation contexts created during the current - * session are destroyed, after the servlet service() - * method completes.
  • - *
  • The container is permitted to arbitrarily destroy any - * long-running conversation that is associated with no current - * JSF request, in order to conserve resources.
  • - *
- * - * @see javax.enterprise.context.Conversation - * @see javax.enterprise.context.NonexistentConversationException - * @see javax.enterprise.context.BusyConversationException - * - * @author Gavin King - * @author Pete Muir - */ - -@Target( { TYPE, METHOD, FIELD }) -@Retention(RUNTIME) -@Documented -@NormalScope(passivating = true) -@Inherited -public @interface ConversationScoped -{ -} diff --git a/cdi/src/main/java/javax/enterprise/context/Dependent.java b/cdi/src/main/java/javax/enterprise/context/Dependent.java deleted file mode 100644 index c01aa288..00000000 --- a/cdi/src/main/java/javax/enterprise/context/Dependent.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.context; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Documented; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import javax.enterprise.context.spi.Contextual; -import javax.inject.Scope; - -/** - *

Specifies that a bean belongs to the dependent pseudo-scope.

- * - *

Beans declared with scope @Dependent behave differently - * to beans with other built-in scope types. When a bean is declared - * to have scope @Dependent:

- * - *
    - *
  • No injected instance of the bean is ever shared between - * multiple injection points.
  • - *
  • Any instance of the bean injected into an object that is being - * created by the container is bound to the lifecycle of the newly - * created object.
  • - *
  • When a Unified EL expression in a JSF or JSP page that refers - * to the bean by its EL name is evaluated, at most one instance of - * the bean is instantiated. This instance exists to service just a - * single evaluation of the EL expression. It is reused if the bean - * EL name appears multiple times in the EL expression, but is never - * reused when the EL expression is evaluated again, or when another - * EL expression is evaluated.
  • - *
  • Any instance of the bean that receives a producer method, - * producer field, disposer method or observer method invocation - * exists to service that invocation only.
  • - *
  • Any instance of the bean injected into method parameters of a - * disposer method or observer method exists to service the method - * invocation only.
  • - *
- * - *

Every invocation of the - * {@link javax.enterprise.context.spi.Context#get(Contextual, CreationalContext)} - * operation of the context object for the @Dependent scope - * returns a new instance of the given bean.

- * - *

Every invocation of the - * {@link javax.enterprise.context.spi.Context#get(Contextual)} - * operation of the context object for the @Dependent scope - * returns a null value.

- * - *

The @Dependent scope is always active.

- * - *

Many instances of beans with scope @Dependent belong - * to some other bean or Java EE component class instance and are - * called dependent objects.

- * - *
    - *
  • Instances of decorators and interceptors are dependent - * objects of the bean instance they decorate.
  • - *
  • An instance of a bean with scope @Dependent injected - * into a field, bean constructor or initializer method is a dependent - * object of the bean or Java EE component class instance into - * which it was injected.
  • - *
  • An instance of a bean with scope @Dependent injected - * into a producer method is a dependent object of the producer method - * bean instance that is being produced.
  • - *
  • An instance of a bean with scope @Dependent obtained by - * direct invocation of an {@link javax.enterprise.inject.Instance} is - * a dependent object of the instance of - * {@link javax.enterprise.inject.Instance}.
  • - *
- * - *

When the container destroys an instance of a bean or of any Java - * EE component class supporting injection, the container destroys all - * its dependent objects, after the @PreDestroy callback completes - * and after the servlet destroy() method is called.

- * - * @author Gavin King - * @author Pete Muir - */ - -@Target( { METHOD, TYPE, FIELD }) -@Retention(RUNTIME) -@Documented -@Scope -@Inherited -public @interface Dependent -{ -} diff --git a/cdi/src/main/java/javax/enterprise/context/NonexistentConversationException.java b/cdi/src/main/java/javax/enterprise/context/NonexistentConversationException.java deleted file mode 100644 index ec2fdc5e..00000000 --- a/cdi/src/main/java/javax/enterprise/context/NonexistentConversationException.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.context; - -/** - *

Indicates that the conversation context could not be restored.

- * - *

If the propagated conversation cannot be restored, the container must - * associate the request with a new transient conversation and throw an - * exception of type NonexistentConversationException from the - * restore view phase of the JSF lifecycle.

- * - * @see javax.enterprise.context.ConversationScoped - * - * @author Pete Muir - * @author Gavin King - */ - -public class NonexistentConversationException extends ContextException -{ - - private static final long serialVersionUID = -3599813072560026919L; - - public NonexistentConversationException() - { - super(); - } - - public NonexistentConversationException(String message) - { - super(message); - } - - public NonexistentConversationException(Throwable cause) - { - super(cause); - } - - public NonexistentConversationException(String message, Throwable cause) - { - super(message, cause); - } - -} diff --git a/cdi/src/main/java/javax/enterprise/context/NormalScope.java b/cdi/src/main/java/javax/enterprise/context/NormalScope.java deleted file mode 100644 index 69688827..00000000 --- a/cdi/src/main/java/javax/enterprise/context/NormalScope.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.context; - -import static java.lang.annotation.ElementType.ANNOTATION_TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - *

Specifies that an annotation type is a normal scope type.

- * - * @author Gavin King - * @author Pete Muir - * - * @see javax.inject.Scope @Scope is used to declare pseudo-scopes. - */ -@Target(ANNOTATION_TYPE) -@Retention(RUNTIME) -@Documented -public @interface NormalScope -{ - - /** - *

Determines whether the normal scope type is a passivating scope.

- * - *

A bean is called passivation capable if the container is able to - * temporarily transfer the state of any idle instance to secondary - * storage. A passivating scope requires that beans with the scope are - * passivation capable.

- * - * @return true if the scope type is a passivating scope type - */ - boolean passivating() default false; - -} diff --git a/cdi/src/main/java/javax/enterprise/context/RequestScoped.java b/cdi/src/main/java/javax/enterprise/context/RequestScoped.java deleted file mode 100644 index 1ec67c52..00000000 --- a/cdi/src/main/java/javax/enterprise/context/RequestScoped.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.context; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Documented; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - *

Specifies that a bean is request scoped.

- * - *

The request scope is active:

- * - *
    - *
  • during the service() method of any servlet in the web - * application, during the doFilter() method of any servlet - * filter and when the container calls any ServletRequestListener - * or AsyncListener,
  • - *
  • during any Java EE web service invocation,
  • - *
  • during any remote method invocation of any EJB, during - * any asynchronous method invocation of any EJB, during any - * call to an EJB timeout method and during message delivery - * to any EJB message-driven bean, and
  • - *
  • during any message delivery to a MessageListener for - * a JMS topic or queue obtained from the Java EE component - * environment.
  • - *
- * - *

The request context is destroyed:

- * - *
    - *
  • at the end of the servlet request, after the service() - * method, all doFilter() methods, and all requestDestroyed() - * and onComplete() notifications return,
  • - *
  • after the web service invocation completes,
  • - *
  • after the EJB remote method invocation, asynchronous - * method invocation, timeout or message delivery completes, or
  • - *
  • after the message delivery to the MessageListener - * completes.
  • - *
- * - * @author Gavin King - * @author Pete Muir - */ - -@Target( { TYPE, METHOD, FIELD }) -@Retention(RUNTIME) -@Documented -@NormalScope -@Inherited -public @interface RequestScoped -{ -} diff --git a/cdi/src/main/java/javax/enterprise/context/SessionScoped.java b/cdi/src/main/java/javax/enterprise/context/SessionScoped.java deleted file mode 100644 index 05b894c4..00000000 --- a/cdi/src/main/java/javax/enterprise/context/SessionScoped.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.context; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Documented; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - *

Specifies that a bean is session scoped.

- * - *

The session scope is active:

- * - *
    - *
  • during the service() method of any servlet - * in the web application, during the doFilter() method of - * any servlet filter and when the container calls any - * HttpSessionListener, AsyncListener or - * ServletRequestListener.
  • - *
- * - *

The session context is shared between all servlet - * requests that occur in the same HTTP session. The session - * context is destroyed when the HTTPSession times out, - * after all HttpSessionListeners have been called, - * and at the very end of any request in which - * invalidate() was called, after all filters and - * ServletRequestListeners have been called.

- * - * @author Gavin King - * @author Pete Muir - */ - -@Target( { TYPE, METHOD, FIELD }) -@Retention(RUNTIME) -@Documented -@NormalScope(passivating = true) -@Inherited -public @interface SessionScoped -{ -} diff --git a/cdi/src/main/java/javax/enterprise/context/package-info.java b/cdi/src/main/java/javax/enterprise/context/package-info.java deleted file mode 100644 index 734afa35..00000000 --- a/cdi/src/main/java/javax/enterprise/context/package-info.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - *

Annotations and interfaces relating to scopes and contexts.

- * - *

A scope type is a Java annotation annotated - * {@link javax.inject.Scope @Scope} or - * {@link javax.enterprise.context.NormalScope @NormalScope}. - * The scope of a bean determines the lifecycle and visibility of - * its instances. In particular, the scope determines:

- * - *
    - *
  • When a new instance of the bean is created
  • - *
  • When an existing instance of the bean is destroyed
  • - *
  • Which injected references refer to any instance of the - * bean
  • - *
- * - *

Built-in scopes

- * - *

The following built-in scopes are provided: - * {@link javax.enterprise.context.Dependent @Dependent}, - * {@link javax.enterprise.context.RequestScoped @RequestScoped}, - * {@link javax.enterprise.context.ConversationScoped @ConversationScoped}, - * {@link javax.enterprise.context.SessionScoped @SessionScoped}, - * {@link javax.enterprise.context.ApplicationScoped @ApplicationScoped}, - * {@link javax.inject.Singleton @Singleton}.

- * - *

The container provides an implementation of the Context - * interface for each of the built-in scopes. The built-in request, - * session, and application contexts support servlet, web service - * and EJB invocations. The built-in conversation context supports - * JSF requests.

- * - *

For other kinds of invocations, a portable extension may define a - * custom {@linkplain javax.enterprise.context.spi.Context context object} - * for any or all of the built-in scopes. For example, a third-party web - * application framework might provide a conversation context object for - * the built-in conversation scope.

- * - *

The context associated with a built-in scope propagates across - * local, synchronous Java method calls, including invocation of EJB - * local business methods. The context does not propagate across remote - * method invocations or to asynchronous processes such as JMS message - * listeners or EJB timer service timeouts.

- * - *

Normal scopes and pseudo-scopes

- * - *

Most scopes are normal scopes. Normal scopes are declared - * using {@link javax.enterprise.context.NormalScope @NormalScope}. - * If a bean has a normal scope, every client executing in a certain - * thread sees the same contextual instance of the bean. This instance is - * called the current instance of the bean. The operation - * {@link javax.enterprise.context.spi.Context#get(Contextual)} of the - * context object for a normal scope type always returns the current - * instance of the given bean.

- * - *

Any scope that is not a normal scope is called a pseudo-scope. - * Pseudo-scopes are declared using {@link javax.inject.Scope @Scope}. - * The concept of a current instance is not well-defined in the case of - * a pseudo-scope. Different clients executing in the same thread may - * see different instances of the bean. In the extreme case of the - * {@link javax.enterprise.context.Dependent @Dependent} pseudo-scope, - * every client has its own private instance of the bean.

- * - *

All built-in scopes are normal scopes, except for the - * {@link javax.enterprise.context.Dependent @Dependent} and - * {@link javax.inject.Singleton @Singleton} pseudo-scopes.

- * - *

Contextual and injected reference validity

- * - *

A reference to a bean obtained from the container via {@linkplain - * javax.enterprise.inject.Instance programmatic lookup} is called a - * contextual reference. A contextual reference for a bean with a normal - * scope refers to the current instance of the bean. A contextual - * reference for a bean are valid only for a certain period of time. The - * application should not invoke a method of an invalid reference.

- * - *

The validity of a contextual reference for a bean depends upon - * whether the scope of the bean is a normal scope or a pseudo-scope:

- * - *
    - *
  • Any reference to a bean with a normal scope is valid as long as - * the application maintains a hard reference to it. However, it may - * only be invoked when the context associated with the normal scope is - * active. If it is invoked when the context is inactive, a - * {@link javax.enterprise.context.ContextNotActiveException} is thrown - * by the container.
  • - *
  • Any reference to a bean with a pseudo-scope is valid until the - * bean instance to which it refers is destroyed. It may be invoked - * even if the context associated with the pseudo-scope is not active. - * If the application invokes a method of a reference to an instance - * that has already been destroyed, the behavior is undefined.
  • - *
- * - *

A reference to a bean obtained from the container via {@linkplain - * javax.inject.Inject dependency injection} is a special kind of - * contextual reference, called an injected reference. Additional - * restrictions apply to the validity of an injected reference:

- * - *
    - *
  • A reference to a bean injected into a field, bean constructor or - * initializer method is only valid until the object into which it was - * injected is destroyed.
  • - *
  • A reference to a bean injected into a producer method is only - * valid until the producer method bean instance that is being produced - * is destroyed.
  • - *
  • A reference to a bean injected into a disposer method or observer - * method is only valid until the invocation of the method completes.
  • - *
- * - * @see javax.enterprise.inject - * - */ -package javax.enterprise.context; diff --git a/cdi/src/main/java/javax/enterprise/context/spi/Context.java b/cdi/src/main/java/javax/enterprise/context/spi/Context.java deleted file mode 100644 index e0a33e13..00000000 --- a/cdi/src/main/java/javax/enterprise/context/spi/Context.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.context.spi; - -import java.lang.annotation.Annotation; - -import javax.enterprise.context.ContextNotActiveException; - -/** - *

Provides an operation for obtaining contextual instances with a particular scope - * of any contextual type. Any instance of {@code Context} is called a context object.

- * - *

The context object is responsible for creating and destroying contextual instances - * by calling operations of {@link javax.enterprise.context.spi.Contextual}. In particular, - * the context object is responsible for destroying any contextual instance it creates by - * passing the instance to - * {@link javax.enterprise.context.spi.Contextual#destroy(Object, CreationalContext)}. A - * destroyed instance must not subsequently be returned by {@code get()}. - * The context object must pass the same instance of - * {@link javax.enterprise.context.spi.CreationalContext} to {@code Contextual.destroy()} - * that it passed to {@code Contextual.create()} when it created the instance.

- * - *

A custom context object may be registered with the container using - * {@link javax.enterprise.inject.spi.AfterBeanDiscovery#addContext(Context)}.

- * - * @author Gavin King - * @author Pete Muir - */ - -public interface Context -{ - - /** - * Get the scope type of the context object. - * - * @return the scope - */ - public Class getScope(); - - /** - * Return an existing instance of certain contextual type or create a new - * instance by calling - * {@link javax.enterprise.context.spi.Contextual#create(CreationalContext)} - * and return the new instance. - * - * @param the type of contextual type - * @param contextual the contextual type - * @param creationalContext the context in which the new instance will be created - * @return the contextual instance - * - * @throws ContextNotActiveException if the context is not active - */ - public T get(Contextual contextual, CreationalContext creationalContext); - - /** - * Return an existing instance of a certain contextual type or a null value. - * - * @param the type of the contextual type - * @param contextual the contextual type - * @return the contextual instance, or a null value - * - * @throws ContextNotActiveException if the context is not active - */ - public T get(Contextual contextual); - - /** - * Determines if the context object is active. - * - * @return true if the context is active, or false otherwise. - */ - boolean isActive(); - -} diff --git a/cdi/src/main/java/javax/enterprise/context/spi/Contextual.java b/cdi/src/main/java/javax/enterprise/context/spi/Contextual.java deleted file mode 100644 index 2056259b..00000000 --- a/cdi/src/main/java/javax/enterprise/context/spi/Contextual.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.context.spi; - -import javax.enterprise.inject.CreationException; - -/** - *

Defines operations to create and destroy contextual instances of a - * certain type. Any implementation of {@code Contextual} is called a - * contextual type. In particular, all beans are contextual types.

- * - * @see javax.enterprise.inject.spi.Bean - * - * @author Gavin King - * @author Nicklas Karlsson - * @author Pete Muir - */ -public interface Contextual -{ - /** - * Create a new instance of the contextual type. Instances should - * use the given {@link javax.enterprise.context.spi.CreationalContext} - * when obtaining contextual references to inject, in order to ensure - * that any dependent objects are associated with the contextual instance - * that is being created. An implementation may call - * {@link javax.enterprise.context.spi.CreationalContext#push(Object)} - * between instantiation and injection to help the container minimize the - * use of client proxy objects. - * - * @param creationalContext - * the context in which this instance is being created - * @return the contextual instance - * @throws CreationException - * if a checked exception occurs while creating the instance - */ - public T create(CreationalContext creationalContext); - - /** - * Destroy an instance of the contextual type. Implementations should - * call {@link javax.enterprise.context.spi.CreationalContext#release()} - * to allow the container to destroy dependent objects of the contextual - * instance. - * - * @param instance - * the contextual instance to destroy - * @param creationalContext - * the context in which this instance was created - */ - public void destroy(T instance, CreationalContext creationalContext); -} diff --git a/cdi/src/main/java/javax/enterprise/context/spi/CreationalContext.java b/cdi/src/main/java/javax/enterprise/context/spi/CreationalContext.java deleted file mode 100644 index c8757c72..00000000 --- a/cdi/src/main/java/javax/enterprise/context/spi/CreationalContext.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package javax.enterprise.context.spi; - -/** - *

Provides operations that are used by the - * {@link javax.enterprise.context.spi.Contextual} implementation during - * instance creation and destruction.

- * - * @author Gavin King - * @author Pete Muir - * - */ -public interface CreationalContext -{ - - /** - * Registers an incompletely initialized contextual instance the with the - * container. A contextual instance is considered incompletely initialized - * until it is returned by - * {@link javax.enterprise.context.spi.Contextual#create(CreationalContext)}. - * - * @param incompleteInstance the incompletely initialized instance - */ - public void push(T incompleteInstance); - - /** - * Destroys all dependent objects of the instance which is being destroyed, - * by passing each dependent object to - * {@link javax.enterprise.context.spi.Contextual#destroy(Object, CreationalContext)}. - */ - public void release(); - -} diff --git a/cdi/src/main/java/javax/enterprise/context/spi/package-info.java b/cdi/src/main/java/javax/enterprise/context/spi/package-info.java deleted file mode 100644 index f44c106c..00000000 --- a/cdi/src/main/java/javax/enterprise/context/spi/package-info.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - *

The custom context SPI.

- * - *

Associated with every - * {@linkplain javax.enterprise.context scope type} is a - * {@linkplain javax.enterprise.context.spi.Context context object}. - * The context object implements the semantics of the scope type.

- * - *

The context implementation collaborates with the container via - * the {@link javax.enterprise.context.spi.Context Context} and - * {@link javax.enterprise.context.spi.Contextual Contextual} - * interfaces to create and destroy contextual instances.

- * - * @see javax.enterprise.context - * @see javax.enterprise.inject.spi - */ -package javax.enterprise.context.spi; diff --git a/cdi/src/main/java/javax/enterprise/event/Event.java b/cdi/src/main/java/javax/enterprise/event/Event.java deleted file mode 100644 index 51e9dc5d..00000000 --- a/cdi/src/main/java/javax/enterprise/event/Event.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.event; - -import java.lang.annotation.Annotation; - -import javax.enterprise.util.TypeLiteral; - -/** - *

Allows the application to fire events of a particular type.

- * - *

Beans fire events via an instance of the Event - * interface, which may be injected:

- * - *
- * @Inject @Any Event<LoggedInEvent> loggedInEvent;
- * 
- * - *

The fire() method accepts an event object:

- * - *
- * public void login() { 
- *    ...
- *    loggedInEvent.fire( new LoggedInEvent(user) );
- * }
- * 
- * - *

Any combination of qualifiers may be specified at the injection - * point:

- * - *
- * @Inject @Admin Event<LoggedInEvent> adminLoggedInEvent;
- * 
- * - *

Or, the {@link javax.enterprise.inject.Any @Any} qualifier may - * be used, allowing the application to specify qualifiers dynamically:

- * - *
- * @Inject @Any Event<LoggedInEvent> loggedInEvent;
- * 
- * - *

For an injected Event:

- * - *
    - *
  • the specified type is the type parameter specified at the - * injection point, and
  • - *
  • the specified qualifiers are the qualifiers specified at - * the injection point.
  • - *
- * - * @author Gavin King - * @author Pete Muir - * @author David Allen - * - * @param the type of the event object - */ - -public interface Event -{ - - /** - *

Fires an event with the specified qualifiers and notifies - * observers.

- * - * @param event the event object - * @throws IllegalArgumentException if the runtime type of the event object contains a type variable - */ - public void fire(T event); - - /** - *

Obtains a child Event for the given additional - * required qualifiers.

- * - * @param qualifiers the additional specified qualifiers - * @return the child Event - * @throws IllegalArgumentException if passed two instances of the - * same qualifier type, or an instance of an annotation that is not - * a qualifier type - */ - public Event select(Annotation... qualifiers); - - /** - *

Obtains a child Event for the given required type and - * additional required qualifiers.

- * - * @param the specified type - * @param subtype a {@link java.lang.Class} representing the specified type - * @param qualifiers the additional specified qualifiers - * @return the child Event - * @throws IllegalArgumentException if passed two instances of the - * same qualifier type, or an instance of an annotation that is not - * a qualifier type - */ - public Event select(Class subtype, Annotation... qualifiers); - - /** - *

Obtains a child Event for the given required type and - * additional required qualifiers.

- * - * @param the specified type - * @param subtype a {@link javax.enterprise.util.TypeLiteral} representing the specified type - * @param qualifiers the additional specified qualifiers - * @return the child Event - * @throws IllegalArgumentException if passed two instances of the - * same qualifier type, or an instance of an annotation that is not - * a qualifier type - */ - public Event select(TypeLiteral subtype, Annotation... qualifiers); -} diff --git a/cdi/src/main/java/javax/enterprise/event/ObserverException.java b/cdi/src/main/java/javax/enterprise/event/ObserverException.java deleted file mode 100644 index 445b3245..00000000 --- a/cdi/src/main/java/javax/enterprise/event/ObserverException.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.event; - -/** - *

Indicates that a checked exception was thrown by an - * observer method during event notification.

- * - * @author Pete Muir - * @author Gavin King - */ -public class ObserverException extends RuntimeException -{ - - private static final long serialVersionUID = -801836224808304381L; - - public ObserverException() - { - - } - - public ObserverException(String message) - { - super(message); - } - - public ObserverException(Throwable cause) - { - super(cause); - } - - public ObserverException(String message, Throwable cause) - { - super(message, cause); - } - -} diff --git a/cdi/src/main/java/javax/enterprise/event/Observes.java b/cdi/src/main/java/javax/enterprise/event/Observes.java deleted file mode 100644 index 25f532a2..00000000 --- a/cdi/src/main/java/javax/enterprise/event/Observes.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.event; - -import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - *

Identifies the event parameter of an observer method. May be applied to - * a parameter of a method of a bean class or - * {@linkplain javax.enterprise.inject.spi.Extension extension}.

- * - *
- * public void afterLogin(@Observes LoggedInEvent event) { ... }
- * 
- * - *

An observer method is a non-abstract method of a managed bean class or - * session bean class (or of an extension). An observer method may be either - * static or non-static. If the bean is a session bean, the observer method - * must be either a business method of the EJB or a static method of the bean - * class.

- * - *

Each observer method must have exactly one event parameter, of the same - * type as the event type it observes. Event qualifiers may be declared - * by annotating the event parameter. When searching for observer methods for - * an event, the container considers the type and qualifiers of the event - * parameter.

- * - *

If the event parameter does not explicitly declare any qualifier, the - * observer method observes events with no qualifier.

- * - *

The event parameter type may contain a type variable or wildcard.

- * - *

In addition to the event parameter, observer methods may declare - * additional parameters, which may declare qualifiers. These additional - * parameters are injection points.

- * - *
- * public void afterLogin(@Observes LoggedInEvent event, @Manager User user, Logger log) { ... }
- * 
- * - *

A bean (or extension) may declare multiple observer methods.

- * - *

Observer methods are inherited by bean subclasses.

- * - *

Interceptors and decorators may not declare observer - * methods.

- * - * @author Gavin King - * @author Pete Muir - * @author David Allen - */ - -@Target(PARAMETER) -@Retention(RUNTIME) -@Documented -public @interface Observes -{ - /** - *

Specifies - * {@linkplain javax.enterprise.event.Reception under what conditions the - * observer method is notified}.

- * - *

By default, the observer method is notified even if no instance of - * the bean that defines the observer method already exists in the current - * context.

- */ - public Reception notifyObserver() default Reception.ALWAYS; - - /** - *

Specifies - * {@linkplain javax.enterprise.event.Reception at what time the observer - * method is notified}.

- * - *

By default, the observer method is notified when the event is fired.

- */ - public TransactionPhase during() default TransactionPhase.IN_PROGRESS; -} diff --git a/cdi/src/main/java/javax/enterprise/event/Reception.java b/cdi/src/main/java/javax/enterprise/event/Reception.java deleted file mode 100644 index a4dc9911..00000000 --- a/cdi/src/main/java/javax/enterprise/event/Reception.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package javax.enterprise.event; - -/** - *

Distinguishes conditional - * {@linkplain javax.enterprise.event.Observes observer methods} from observer - * methods which are always notified.

- * - *

A conditional observer method is an observer method which is notified - * of an event only if an instance of the bean that defines the observer - * method already exists in the current context.

- * - *

Beans with scope - * {@link javax.enterprise.context.Dependent @Dependent} may not - * have conditional observer methods.

- * - * @author Gavin King - * @author Dan Allen - * @author David Allen - */ -public enum Reception -{ - /** - * Specifies that an observer method is only called if the current instance - * of the bean declaring the observer method already exists. - */ - IF_EXISTS, - - /** - * Specifies that an observer method always receives event notifications. - */ - ALWAYS -} \ No newline at end of file diff --git a/cdi/src/main/java/javax/enterprise/event/TransactionPhase.java b/cdi/src/main/java/javax/enterprise/event/TransactionPhase.java deleted file mode 100644 index 4e779837..00000000 --- a/cdi/src/main/java/javax/enterprise/event/TransactionPhase.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package javax.enterprise.event; - -/** - *

Distinguishes the various kinds of transactional - * {@linkplain javax.enterprise.event.Observes observer methods} - * from regular observer methods which are notified immediately.

- * - *

Transactional observer methods are observer methods which receive - * event notifications during the before or after completion phase of the - * transaction in which the event was fired. If no transaction is in progress - * when the event is fired, they are notified at the same time as other - * observers.

- * - * @author Pete Muir - * @author Gavin King - * - */ -public enum TransactionPhase -{ - - /** - *

Identifies a regular observer method, called when the event - * is fired.

- */ - IN_PROGRESS, - - /** - *

Identifies a before completion observer method, called during - * the before completion phase of the transaction.

- */ - BEFORE_COMPLETION, - - /** - *

Identifies an after completion observer method, called during the - * after completion phase of the transaction.

- */ - AFTER_COMPLETION, - - /** - *

Identifies an after failure observer method, called during the - * after completion phase of the transaction, only when the transaction - * fails.

- */ - AFTER_FAILURE, - - /** - *

Identifies an after success observer method, called during the - * after completion phase of the transaction, only when the transaction - * completes successfully.

- */ - AFTER_SUCCESS - -} diff --git a/cdi/src/main/java/javax/enterprise/event/package-info.java b/cdi/src/main/java/javax/enterprise/event/package-info.java deleted file mode 100644 index d07ef782..00000000 --- a/cdi/src/main/java/javax/enterprise/event/package-info.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - *

Annotations and interfaces relating to events.

- * - *

{@linkplain javax.enterprise.inject Beans} may produce and - * consume events. Events allows beans to interact in a completely - * decoupled fashion, with no compile-time dependency between the - * interacting beans. Most importantly, it allows stateful beans - * in one architectural tier of the application to synchronize - * their internal state with state changes that occur in a - * different tier.

- * - *

An event comprises:

- * - *
    - *
  • A Java object, called the event object
  • - *
  • A (possibly empty) set of instances of qualifier types, called - * the event qualifiers
  • - *
- * - *

The {@link javax.enterprise.event.Event} interface is used to - * fire events.

- * - *

Event objects and event types

- * - *

The event object acts as a payload, to propagate state from - * producer to consumer. An event object is an instance of a concrete - * Java class with no type variables.

- * - *

The event types of the event include all superclasses and - * interfaces of the runtime class of the event object. An event type - * may not contain a type variable.

- * - *

Event qualifiers

- * - *

The event qualifiers act as topic selectors, allowing the consumer - * to narrow the set of events it observes. An event qualfier may be an - * instance of any {@linkplain javax.inject.Qualifier qualifier type}.

- * - *

Observer methods

- * - *

An {@linkplain javax.enterprise.event.Observes observer method} - * allows the application to receive and respond to event notifications. - * It acts as event consumer, observing events of a specific type, with a - * specific set of qualifiers. Any Java type may be observed by an - * observer method.

- * - *

An observer method is a method of a bean class or - * {@linkplain javax.enterprise.inject.spi.Extension extension} with a - * parameter annotated {@link javax.enterprise.event.Observes @Observes}.

- * - *

An observer method will be notified of an event if:

- * - *
    - *
  • the event object is assignable to the type observed by the observer - * method,
  • - *
  • the observer method has all the event qualifiers of the event, and
  • - *
  • either the event is not a - * {@linkplain javax.enterprise.inject.spi container lifecycle event}, or - * the observer method belongs to an - * {@linkplain javax.enterprise.inject.spi.Extension extension}. - *
- * - *

If the observer method is a - * {@linkplain javax.enterprise.event.TransactionPhase transactional - * observer method} and there is a JTA transaction in progress when the - * event is fired, the observer method is notified during the appropriate - * transaction completion phase. Otherwise, the observer is notified when - * the event is fired.

- * - *

The order in which observer methods are called is not defined, and - * so portable applications should not rely upon the order in which - * observers are called.

- * - *

Observer methods may throw exceptions:

- * - *
    - *
  • If the observer method is a - * {@linkplain javax.enterprise.event.TransactionPhase transactional - * observer method}, any exception is caught and logged by the container.
  • - *
  • Otherwise, the exception aborts processing of the event. - * No other observer methods of that event will be called. The - * exception is rethrown. If the exception is a checked exception, - * it is wrapped and rethrown as an (unchecked) - * {@link javax.enterprise.event.ObserverException}.
  • - *
- * - * @see javax.enterprise.inject - * - * @see javax.enterprise.event.Observes - * @see javax.enterprise.event.Event - * @see javax.inject.Qualifier - */ -package javax.enterprise.event; diff --git a/cdi/src/main/java/javax/enterprise/inject/Alternative.java b/cdi/src/main/java/javax/enterprise/inject/Alternative.java deleted file mode 100644 index 53961265..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/Alternative.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.inject; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - *

Specifies that a bean is an alternative. May be - * applied to a bean class, producer method or field - * or {@linkplain javax.enterprise.inject.Stereotype stereotype}.

- * - *
- * @Alternative
- * public class MockOrder extends Order { ... }
- * 
- * - *

An alternative is not available for injection, lookup - * or EL resolution to classes or JSP/JSF pages in a module - * unless the module is a bean archive and the alternative is - * explicitly selected in that bean archive. An - * alternative is never available for injection, lookup or EL - * resolution in a module that is not a bean archive.

- * - *

By default, a bean archive has no selected alternatives. - * An alternative must be explicitly declared using the - * <alternatives> element of the - * beans.xml file of the bean archive. The - * <alternatives> element contains a list of - * bean classes and stereotypes. An alternative is selected - * for the bean archive if either:

- * - *
    - *
  • the alternative is a managed bean or session bean and the - * bean class of the bean is listed,
  • - *
  • the alternative is a producer method, field or resource, - * and the bean class that declares the method or field is listed, - * or
  • - *
  • any @Alternative stereotype of the alternative - * is listed.
  • - *
- * - * @author Gavin King - * @author Pete Muir - */ -@Target({TYPE, METHOD, FIELD}) -@Retention(RUNTIME) -@Documented -public @interface Alternative -{ -} diff --git a/cdi/src/main/java/javax/enterprise/inject/AmbiguousResolutionException.java b/cdi/src/main/java/javax/enterprise/inject/AmbiguousResolutionException.java deleted file mode 100644 index bbd02e66..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/AmbiguousResolutionException.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package javax.enterprise.inject; - - -/** - *

Indicates that multiple beans match a certain combination of required - * type and required qualifiers and are eligible for injection into a - * certain class.

- * - * @author Pete Muir - * @author Gavin King - */ -public class AmbiguousResolutionException extends ResolutionException -{ - - private static final long serialVersionUID = -2132733164534544788L; - - public AmbiguousResolutionException() - { - } - - public AmbiguousResolutionException(String message, Throwable throwable) - { - super(message, throwable); - } - - public AmbiguousResolutionException(String message) - { - super(message); - } - - public AmbiguousResolutionException(Throwable throwable) - { - super(throwable); - } - -} diff --git a/cdi/src/main/java/javax/enterprise/inject/Any.java b/cdi/src/main/java/javax/enterprise/inject/Any.java deleted file mode 100644 index d11d402f..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/Any.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.inject; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import javax.inject.Qualifier; - -/** - *

The built-in qualifier type.

- * - *

Every bean has the qualifier @Any, - * even if it does not explicitly declare this qualifier, - * except for the special - * {@link javax.enterprise.inject.New @New qualified beans}.

- * - *

Every event has the qualifier @Any, - * even if it was raised without explicitly declaration - * of this qualifier.

- * - *

The @Any qualifier allows an injection - * point to refer to all beans or all events of a certain - * bean type.

- * - *
- * @Inject @Any Instance<PaymentProcessor> anyPaymentProcessor;
- * 
- * - *
- * @Inject @Any Event<User> anyUserEvent;
- * 
- * - *
- * @Inject @Delegate @Any Logger logger;
- * 
- * - * @author Gavin King - * @author David Allen - */ - -@Qualifier -@Retention(RUNTIME) -@Target( { TYPE, METHOD, FIELD, PARAMETER }) -@Documented -public @interface Any -{ - -} diff --git a/cdi/src/main/java/javax/enterprise/inject/CreationException.java b/cdi/src/main/java/javax/enterprise/inject/CreationException.java deleted file mode 100644 index 190e1436..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/CreationException.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.inject; - - -/** - *

Indicates that a checked exception was thrown during - * creation of a bean.

- * - * @author Pete Muir - * @author Gavin King - */ -public class CreationException extends InjectionException -{ - - private static final long serialVersionUID = 1002854668862145298L; - - public CreationException() - { - - } - - public CreationException(String message) - { - super(message); - } - - public CreationException(Throwable cause) - { - super(cause); - } - - public CreationException(String message, Throwable cause) - { - super(message, cause); - } - -} diff --git a/cdi/src/main/java/javax/enterprise/inject/Default.java b/cdi/src/main/java/javax/enterprise/inject/Default.java deleted file mode 100644 index 582258d8..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/Default.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.inject; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import javax.inject.Qualifier; - -/** - *

The default qualifier type.

- * - *

If a bean does not explicitly declare a qualifier other than - * {@link javax.inject.Named @Named}, the bean has the qualifier - * @Default.

- * - *

If an injection point declares no qualifier, the injection point - * has exactly one qualifier, the default qualifier - * @Default.

- * - *

The following are equivalent:

- * - *
- * @ConversationScoped
- * public class Order {
- * 
- *    private Product product;
- *    private User customer;
- * 
- *    @Inject
- *    public void init(@Selected Product product, User customer) {
- *       this.product = product;
- *       this.customer = customer;
- *   }
- *
- * }
- * 
- * - *
- * @Default @ConversationScoped
- * public class Order {
- *   
- *    private Product product;
- *    private User customer;
- *   
- *    @Inject
- *    public void init(@Selected Product product, @Default User customer) {
- *       this.product = product;
- *       this.customer = customer;
- *    }
- * 
- * }
- * 
- * - * @author Pete Muir - * @author Gavin King - */ - -@Target( { TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface Default -{ -} diff --git a/cdi/src/main/java/javax/enterprise/inject/Disposes.java b/cdi/src/main/java/javax/enterprise/inject/Disposes.java deleted file mode 100644 index 3392c523..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/Disposes.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.inject; - -import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - *

Identifies the disposed parameter of a disposer method. - * May be applied to a parameter of a method of a bean class.

- * - *
- * public class UserDatabaseEntityManager {
- *
- *    @Produces @ConversationScoped @UserDatabase
- *    public EntityManager create(EntityManagerFactory emf) {
- *       return emf.createEntityManager();
- *    }
- *    
- *    public void close(@Disposes @UserDatabase EntityManager em) {
- *       em.close();
- *    }
- *
- * }
- * 
- * - *

A disposer method allows the application to perform - * customized cleanup of an object returned by a - * {@linkplain javax.enterprise.inject.Produces producer method}.

- * - *

A disposer method must be a non-abstract method of a - * managed bean class or session bean class. A disposer - * method may be either static or non-static. If the bean is - * a session bean, the disposer method must be a business - * method of the EJB or a static method of the bean class.

- * - *

A bean may declare multiple disposer methods.

- * - *

Each disposer method must have exactly one disposed - * parameter, of the same type as the corresponding producer - * method return type. When searching for disposer methods - * for a producer method, the container considers the type - * and qualifiers of the disposed parameter. If a disposed - * parameter resolves to a producer method declared by the - * same bean class, the container must call this method when - * destroying any instance returned by that producer method.

- * - *

In addition to the disposed parameter, a disposer method - * may declare additional parameters, which may also specify - * qualifiers. These additional parameters are injection points.

- * - *
- * public void close(@Disposes @UserDatabase EntityManager em, Logger log) { ... }
- * 
- * - *

A disposer method may resolve to multiple producer - * methods declared by the bean class, in which case the - * container must call it when destroying any instance - * returned by any of these producer methods.

- * - *

Disposer methods are not inherited by bean subclasses.

- * - *

Interceptors and decorators may not declare disposer - * methods.

- * - * @see javax.enterprise.inject.Produces @Produces - * - * @author Gavin King - * @author Pete Muir - */ - -@Target(PARAMETER) -@Retention(RUNTIME) -@Documented -public @interface Disposes -{ - -} diff --git a/cdi/src/main/java/javax/enterprise/inject/IllegalProductException.java b/cdi/src/main/java/javax/enterprise/inject/IllegalProductException.java deleted file mode 100644 index 0df59b9d..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/IllegalProductException.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package javax.enterprise.inject; - - -/** - *

Indicates that a producer method returned a null value or a producer - * field contained a null value, and the scope of the producer method - * or field was not {@link javax.enterprise.context.Dependent}.

- */ -public class IllegalProductException extends InjectionException -{ - - private static final long serialVersionUID = -6280627846071966243L; - - public IllegalProductException() - { - super(); - } - - public IllegalProductException(String message, Throwable cause) - { - super(message, cause); - } - - public IllegalProductException(String message) - { - super(message); - } - - public IllegalProductException(Throwable cause) - { - super(cause); - } - -} diff --git a/cdi/src/main/java/javax/enterprise/inject/InjectionException.java b/cdi/src/main/java/javax/enterprise/inject/InjectionException.java deleted file mode 100644 index a98331e5..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/InjectionException.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.inject; - - -/** - * Indicates a problem relating to dependency injection. - * - * @author Pete Muir - */ -public class InjectionException extends RuntimeException -{ - - private static final long serialVersionUID = -2132733164534544788L; - - public InjectionException() - { - } - - public InjectionException(String message, Throwable throwable) - { - super(message, throwable); - } - - public InjectionException(String message) - { - super(message); - } - - public InjectionException(Throwable throwable) - { - super(throwable); - } - -} diff --git a/cdi/src/main/java/javax/enterprise/inject/Instance.java b/cdi/src/main/java/javax/enterprise/inject/Instance.java deleted file mode 100644 index 070b5909..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/Instance.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.inject; - -import java.lang.annotation.Annotation; - -import javax.enterprise.util.TypeLiteral; -import javax.inject.Provider; - - -/** - *

Allows the application to dynamically obtain instances of - * beans with a specified combination of required type and - * qualifiers.

- * - *

In certain situations, injection is not the most convenient - * way to obtain a contextual reference. For example, it may not - * be used when:

- * - *
    - *
  • the bean type or qualifiers vary dynamically at runtime, or
  • - *
  • depending upon the deployment, there may be no bean which - * satisfies the type and qualifiers, or
  • - *
  • we would like to iterate over all beans of a certain type.
  • - *
- * - *

In these situations, an instance of the Instance may - * be injected:

- * - *
- * @Inject Instance<PaymentProcessor> paymentProcessor;
- * 
- * - *

Any combination of qualifiers may be specified at the injection - * point:

- * - *
- * @Inject @PayBy(CHEQUE) Instance<PaymentProcessor> chequePaymentProcessor;
- * 
- * - *

Or, the {@link javax.enterprise.inject.Any @Any} qualifier may - * be used, allowing the application to specify qualifiers dynamically:

- * - *
- * @Inject @Any Instance<PaymentProcessor> anyPaymentProcessor;
- * 
- * - *

Finally, the {@link javax.enterprise.inject.New @New} qualifier - * may be used, allowing the application to obtain a - * {@link javax.enterprise.inject.New @New} qualified bean:

- * - *
- * @Inject @New(ChequePaymentProcessor.class) 
- * Instance<PaymentProcessor> chequePaymentProcessor;
- * 
- * - *

For an injected Instance:

- * - *
    - *
  • the required type is the type parameter specified at the - * injection point, and
  • - *
  • the required qualifiers are the qualifiers specified at - * the injection point.
  • - *
- * - *

The inherited {@link javax.inject.Provider#get()} method returns a - * contextual references for the unique bean that matches the required - * type and required qualifiers and is eligible for injection into the - * class into which the parent Instance was injected, or throws - * an {@link javax.enterprise.inject.UnsatisfiedResolutionException} or - * {@link javax.enterprise.inject.AmbiguousResolutionException}.

- * - *
PaymentProcessor pp = chequePaymentProcessor.get();
- * - *

The inherited {@link java.lang.Iterable#iterator()} method returns - * an iterator over contextual references for beans that match the required - * type and required qualifiers and are eligible for injection into the class - * into which the parent Instance was injected.

- * - *
for (PaymentProcessor pp: anyPaymentProcessor) pp.test();
- * - * @see javax.inject.Provider#get() - * @see java.lang.Iterable#iterator() - * @see javax.enterprise.util.AnnotationLiteral - * @see javax.enterprise.util.TypeLiteral - * - * @author Gavin King - * - * @param the required bean type - */ - -public interface Instance extends Iterable, Provider -{ - - /** - *

Obtains a child Instance for the given additional - * required qualifiers.

- * - * @param qualifiers the additional required qualifiers - * @return the child Instance - * @throws IllegalArgumentException if passed two instances of the - * same qualifier type, or an instance of an annotation that is not - * a qualifier type - */ - public Instance select(Annotation... qualifiers); - - /** - *

Obtains a child Instance for the given required type and - * additional required qualifiers.

- * - * @param the required type - * @param subtype a {@link java.lang.Class} representing the required type - * @param qualifiers the additional required qualifiers - * @return the child Instance - * @throws IllegalArgumentException if passed two instances of the - * same qualifier type, or an instance of an annotation that is not - * a qualifier type - */ - public Instance select(Class subtype, Annotation... qualifiers); - - /** - *

Obtains a child Instance for the given required type and - * additional required qualifiers.

- * - * @param the required type - * @param subtype a {@link javax.enterprise.util.TypeLiteral} representing the required type - * @param qualifiers the additional required qualifiers - * @return the child Instance - * @throws IllegalArgumentException if passed two instances of the - * same qualifier type, or an instance of an annotation that is not - * a qualifier type - */ - public Instance select(TypeLiteral subtype, Annotation... qualifiers); - - /** - *

Determines if there is no bean that matches the required type and - * qualifiers and is eligible for injection into the class into which the parent - * Instance was injected.

- * - * @return true if there is no bean that matches the required type and - * qualifiers and is eligible for injection into the class into which the parent - * Instance was injected, or false otherwise. - */ - public boolean isUnsatisfied(); - - /** - *

Determines if there is more than one bean that matches the required type and - * qualifiers and is eligible for injection into the class into which the parent - * Instance was injected.

- * - * @return true if there is more than one bean that matches the required - * type and qualifiers and is eligible for injection into the class into which the - * parent Instance was injected, or false otherwise. - */ - public boolean isAmbiguous(); - -} diff --git a/cdi/src/main/java/javax/enterprise/inject/Model.java b/cdi/src/main/java/javax/enterprise/inject/Model.java deleted file mode 100644 index 5328ad77..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/Model.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package javax.enterprise.inject; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import javax.enterprise.context.RequestScoped; -import javax.inject.Named; - -/** - *

The built-in stereotype intended for use with beans - * that define the model layer of an MVC web application - * architecture such as JSF.

- * - * @see javax.enterprise.inject.Stereotype - * @author Gavin King - */ - -@Named -@RequestScoped -@Documented -@Stereotype -@Target( { TYPE, METHOD, FIELD }) -@Retention(RUNTIME) -public @interface Model -{ -} \ No newline at end of file diff --git a/cdi/src/main/java/javax/enterprise/inject/New.java b/cdi/src/main/java/javax/enterprise/inject/New.java deleted file mode 100644 index 1aab47c2..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/New.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.inject; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import javax.inject.Qualifier; - -/** - *

The built-in qualifier type.

- * - *

The @New qualifier allows the application - * to obtain a new instance of a bean which is not bound to - * the declared scope, but has had dependency injection - * performed.

- * - *
- * @Produces @ConversationScoped 
- * @Special Order getSpecialOrder(@New(Order.class) Order order) {
- *    ...
- *    return order;
- * }
- * 
- * - *

When the @New qualifier is specified - * at an injection point and no - * {@link javax.enterprise.inject.New#value() value} - * member is explicitly specified, the container defaults - * the {@link javax.enterprise.inject.New#value() value} - * to the declared type of the injection point. So the - * following injection point has qualifier - * @New(Order.class):

- * - *
- * @Produces @ConversationScoped 
- * @Special Order getSpecialOrder(@New Order order) { ... }
- * 
- * - * @author Gavin King - * @author Pete Muir - */ - -@Target( { FIELD, PARAMETER, METHOD, TYPE }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface New -{ - /** - *

Specifies the bean class of the new instance. The class - * must be the bean class of an enabled or disabled bean. The - * bean class need not be deployed in a bean archive.

- * - *

Defaults to the declared type of the injection point if - * not specified.

- * - * @return the bean class of the new instance - */ - Class value() default New.class; - -} diff --git a/cdi/src/main/java/javax/enterprise/inject/Produces.java b/cdi/src/main/java/javax/enterprise/inject/Produces.java deleted file mode 100644 index 0e8c9e24..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/Produces.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.inject; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - * - *

Identifies a producer method or field. May be applied to - * a method or field of a bean class.

- * - *

A producer method must be a non-abstract method of a managed - * bean class or session bean class. A producer method may be - * either static or non-static. If the bean is a session bean, the - * producer method must be either a business method of the EJB or - * a static method of the bean class.

- * - *
- * public class Shop {
- *    @Produces @ApplicationScoped 
- *    @Catalog @Named("catalog") 
- *    List<Product> getProducts() { ... }
- *    ...
- * } 
- * 
- * - *

A producer field must be a field of a managed bean class - * or session bean class. A producer field may be either static or - * non-static. If the bean is a session bean, the producer field - * must be a static field of the bean class.

- * - *
- * public class Shop { 
- *    @Produces @ApplicationScoped 
- *    @Catalog @Named("catalog") 
- *    List<Product> products = ...;
- *    ...
- * } 
- * 
- * - *

If a producer method sometimes returns a null value, or if - * a producer field sometimes contains a null value when accessed, - * then the producer method or field must have scope - * {@link javax.enterprise.context.Dependent @Dependent}.

- * - *

A producer method return type or producer field type may not - * be a type variable.

- * - *

If the producer method return type or producer field type is - * a parameterized type, it must specify an actual type parameter - * or type variable for each type parameter.

- * - *

If the producer method return type or producer field type is - * a parameterized type with a type variable, it must have scope - * {@link javax.enterprise.context.Dependent @Dependent}.

- * - *

A producer method may have any number of parameters. All - * producer method parameters are injection points.

- * - *
public class OrderFactory {
- * 
- *    @Produces @ConversationScoped
- *    public Order createCurrentOrder(@New(Order.class) Order order, @Selected Product product) {
- *       order.setProduct(product);
- *       return order;
- *    }
- * 
- * }
- - *

A bean may declare multiple producer methods or fields.

- * - *

Producer methods and fields are not inherited by bean subclasses.

- * - *

Interceptors and decorators may not declare producer methods - * or fields.

- * - * @see javax.enterprise.inject.Disposes @Disposes - * - * @author Gavin King - * @author Pete Muir - */ - -@Target({METHOD, FIELD}) -@Retention(RUNTIME) -@Documented -public @interface Produces -{ -} diff --git a/cdi/src/main/java/javax/enterprise/inject/ResolutionException.java b/cdi/src/main/java/javax/enterprise/inject/ResolutionException.java deleted file mode 100644 index d903fe1e..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/ResolutionException.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package javax.enterprise.inject; - - -/** - * Indicates a problem relating to typesafe resolution. - * - * @author Gavin King - */ -public class ResolutionException extends InjectionException -{ - - private static final long serialVersionUID = -6280627846071966243L; - - public ResolutionException() - { - super(); - } - - public ResolutionException(String message, Throwable cause) - { - super(message, cause); - } - - public ResolutionException(String message) - { - super(message); - } - - public ResolutionException(Throwable cause) - { - super(cause); - } - -} diff --git a/cdi/src/main/java/javax/enterprise/inject/Specializes.java b/cdi/src/main/java/javax/enterprise/inject/Specializes.java deleted file mode 100644 index 61455aef..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/Specializes.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.inject; - -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - *

Indicates that a bean directly specializes another bean. - * May be applied to a bean class or producer method.

- * - *

If a bean directly specializes a second bean, it - * inherits:

- * - *
    - *
  • all qualifiers of the second bean, and
  • - *
  • the name, if any, of the second bean.
  • - *
- * - *

If the second bean has a name, the bean may not - * declare a name using - * {@link javax.inject.Named @Named}. Furthermore, - * the bean must have all the bean types of the second - * bean.

- * - *
    - *
  • If a bean class of a managed bean is annotated - * @Specializes, then the bean class must - * directly extend the bean class of a second managed bean. - * Then the first managed bean directly specializes the - * second managed bean.
  • - * - *
  • If a bean class of a session bean is annotated - * @Specializes, then the bean class must - * directly extend the bean class of a second session bean. - * Then the first session bean directly specializes the - * second session bean.
  • - * - *
  • If a producer method is annotated - * @Specializes, then it must be non-static - * and directly override another producer method. Then the - * first producer method directly specializes the second - * producer method.
  • - *
- * - *

If a bean is specialized by any enabled bean, the - * first bean is disabled.

- * - * @author Gavin King - * @author Pete Muir - */ - -@Target({TYPE, METHOD}) -@Retention(RUNTIME) -@Documented -public @interface Specializes -{ -} diff --git a/cdi/src/main/java/javax/enterprise/inject/Stereotype.java b/cdi/src/main/java/javax/enterprise/inject/Stereotype.java deleted file mode 100644 index cc4f3573..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/Stereotype.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.inject; - -import static java.lang.annotation.ElementType.ANNOTATION_TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - *

Specifies that an annotation type is a stereotype.

- * - *

In many systems, use of architectural patterns produces - * a set of recurring bean roles. A stereotype allows a framework - * developer to identify such a role and declare some common metadata - * for beans with that role in a central place.

- * - *

A bean may declare zero, one or multiple stereotypes, by - * applying the stereotype annotation to the bean class or producer - * method or field.

- * - *

A stereotype encapsulates any combination of:

- * - *
    - *
  • a default scope, and
  • - *
  • a set of interceptor bindings.
  • - *
- * - *

The default scope of a stereotype is defined by annotating the - * stereotype with a scope type. A stereotype may declare at most one - * scope. If a bean explicitly declares a scope, any default scopes - * declared by its stereotypes are ignored.

- * - *
- * @RequestScoped
- * @Stereotype 
- * @Target(TYPE) 
- * @Retention(RUNTIME) 
- * public @interface Action {}
- * 
- * - *

The interceptor bindings of a stereotype are defined by annotating - * the stereotype with the interceptor binding types. A stereotype may - * declare zero, one or multiple interceptor bindings. An interceptor binding - * declared by a stereotype is inherited by any bean that declares that - * stereotype.

- * - *
- * @RequestScoped 
- * @Secure 
- * @Transactional 
- * @Stereotype 
- * @Target(TYPE) 
- * @Retention(RUNTIME) 
- * public @interface Action {}
- * 
- * - *

A stereotype may also specify that:

- * - *
    - *
  • all beans with the stereotype have defaulted bean EL names, or - * that
  • - *
  • all beans with the stereotype are alternatives.
  • - *
- * - *

A stereotype may declare an empty - * {@link javax.inject.Named @Named} annotation, which specifies - * that every bean with the stereotype has a defaulted name when a - * name is not explicitly specified by the bean.

- * - *
- * @RequestScoped 
- * @Named 
- * @Secure 
- * @Transactional 
- * @Stereotype 
- * @Target(TYPE) 
- * @Retention(RUNTIME) 
- * public @interface Action {}
- * 
- * - *

A stereotype may declare an - * {@link javax.enterprise.inject.Alternative @Alternative} - * annotation, which specifies that every bean with the stereotype is - * an alternative.

- * - *
- * @Alternative 
- * @Stereotype 
- * @Target(TYPE) 
- * @Retention(RUNTIME) 
- * public @interface Mock {}
- * 
- * - *

A stereotype may declare other stereotypes. Stereotype - * declarations are transitive. A stereotype declared by a second - * stereotype is inherited by all beans and other stereotypes that - * declare the second stereotype.

- * - * @see javax.enterprise.inject.Model the built-in stereotype @Model - * - * @author Pete Muir - * @author Gavin King - */ - -@Retention(RUNTIME) -@Target(ANNOTATION_TYPE) -@Documented -public @interface Stereotype {} diff --git a/cdi/src/main/java/javax/enterprise/inject/Typed.java b/cdi/src/main/java/javax/enterprise/inject/Typed.java deleted file mode 100644 index 2c92a1be..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/Typed.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.inject; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - *

Restricts the bean types of a bean. May be applied to - * a bean class or producer method or field.

- * - *
- * @Typed(Shop.class)
- * public class BookShop
- *       extends Business
- *       implements Shop<Book> { 
- *    ... 
- * }
- * 
- * - *

When a @Typed annotation is specified, - * only the types whose classes are explicitly listed using - * the {@link javax.enterprise.inject.Typed#value() value} - * member, along with {@link java.lang.Object}, are bean - * types of the bean.

- * - * @author Pete Muir - * @author Gavin King - * - */ -@Target( { FIELD, METHOD, TYPE }) -@Retention(RUNTIME) -@Documented -public @interface Typed -{ - /** - *

Selects the bean types of the bean. Every class must - * correspond to a type in the unrestricted set of bean - * types of a bean.

- * - * @return the classes corresponding to the bean types of - * the bean - */ - Class[] value() default {}; - -} diff --git a/cdi/src/main/java/javax/enterprise/inject/UnproxyableResolutionException.java b/cdi/src/main/java/javax/enterprise/inject/UnproxyableResolutionException.java deleted file mode 100644 index b3ab3720..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/UnproxyableResolutionException.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package javax.enterprise.inject; - - -/** - *

Indicates that a contextual reference for a bean with a normal scope - * and a certain bean type cannot be obtained because the bean type cannot - * be proxied by the container.

- * - * @author Pete Muir - * @author Gavin King - */ -public class UnproxyableResolutionException extends ResolutionException -{ - - private static final long serialVersionUID = 1667539354548135465L; - - public UnproxyableResolutionException() - { - super(); - } - - public UnproxyableResolutionException(String message, Throwable throwable) - { - super(message, throwable); - } - - public UnproxyableResolutionException(String message) - { - super(message); - } - - public UnproxyableResolutionException(Throwable throwable) - { - super(throwable); - } - - - -} diff --git a/cdi/src/main/java/javax/enterprise/inject/UnsatisfiedResolutionException.java b/cdi/src/main/java/javax/enterprise/inject/UnsatisfiedResolutionException.java deleted file mode 100644 index 59b20de5..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/UnsatisfiedResolutionException.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package javax.enterprise.inject; - -/** - *

Indicates that no bean matches a certain combination of required - * type and required qualifiers and is eligible for injection into a - * certain class.

- * - * @author Pete Muir - * @author Gavin King - */ -public class UnsatisfiedResolutionException extends ResolutionException -{ - - private static final long serialVersionUID = 5350603312442756709L; - - public UnsatisfiedResolutionException() - { - super(); - } - - public UnsatisfiedResolutionException(String message, Throwable throwable) - { - super(message, throwable); - } - - public UnsatisfiedResolutionException(String message) - { - super(message); - } - - public UnsatisfiedResolutionException(Throwable throwable) - { - super(throwable); - } - - - -} diff --git a/cdi/src/main/java/javax/enterprise/inject/package-info.java b/cdi/src/main/java/javax/enterprise/inject/package-info.java deleted file mode 100644 index b7bbd187..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/package-info.java +++ /dev/null @@ -1,492 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - *

Annotations relating to bean and stereotype definition, - * built-in qualifiers, and interfaces and classes relating - * to programmatic lookup.

- * - *

A bean is a source of contextual objects which define application - * state and/or logic. These objects are called contextual instances of - * the bean. The container creates and destroys these instances and - * associates them with the appropriate - * {@linkplain javax.enterprise.context.spi.Context context}. Contextual - * instances of a bean may be injected into other objects (including - * other bean instances) that execute in the same context, and may be - * used in Unified EL expressions that are evaluated in the same - * context.

- * - *

The lifecycle of contextual instances is managed by the container - * according to the - * {@linkplain javax.enterprise.context lifecycle context model}. - * Annotations define the lifecycle of the bean and its interactions - * with other beans.

- * - *

A bean comprises the following attributes:

- * - *
    - *
  • A (nonempty) set of bean types
  • - *
  • A (nonempty) set of qualifiers
  • - *
  • A scope
  • - *
  • Optionally, a bean EL name
  • - *
  • A set of interceptor bindings
  • - *
  • A bean implementation
  • - *
- * - *

Bean types

- * - *

A bean type is a client-visible type of the bean. A - * bean may have multiple bean types. The following bean has - * bean types BookShop, Business, - * Shop<Book> and {@link java.lang.Object}.

- * - *
- * public class BookShop 
- *       extends Business 
- *       implements Shop<Book> { 
- *    ... 
- * } 
- * 
- * - *

Almost any Java type may be a bean type of a bean: - * - *

    - *
  • A bean type may be an interface, a concrete class or an - * abstract class, and may be declared final or have final methods.
  • - *
  • A bean type may be a parameterized type with actual type - * parameters and type variables.
  • - *
  • A bean type may be an array type. Two array types are - * considered identical only if the element type is identical.
  • - *
  • A bean type may be a primitive type. Primitive types are - * considered to be identical to their corresponding wrapper types - * in java.lang.
  • - *
  • A bean type may be a raw type.
  • - *
- * - *

A type variable is not a legal bean type. A parameterized type - * that contains a wildcard type parameter is not a legal bean type.

- * - *

The bean types of a bean are determined automatically. However, - * the set of bean types may be resticted using the - * {@link javax.enterprise.inject.Typed @Typed} annotation.

- * - *

Qualifiers

- * - *

A {@linkplain javax.inject.Qualifier qualifier} represents some - * client-visible semantic associated with a type that is satisfied - * by some implementations of the type (and not by others). Qualifiers - * are applied to injection points to distinguish which implementation - * is required by the client.

- * - *
- * @Inject @Synchronous PaymentProcessor paymentProcessor; 
- * 
- * - *

A qualifier type is a Java annotation annotated - * {@link javax.inject.Qualifier @Qualifier}. - * The qualifiers of a bean are declared by annotating the bean class - * or producer method or field with the qualifier types.

- * - *
- * @Synchronous @Reliable 
- * class SynchronousReliablePaymentProcessor 
- *       implements PaymentProcessor { 
- *    ... 
- * } 
- * 
- * - *

If a bean does not explicitly declare a qualifier other than - * {@link javax.inject.Named @Named}, the bean has the qualifier - * {@link javax.enterprise.inject.Default @Default}.

- * - *

Scope

- * - *

All beans have a {@linkplain javax.enterprise.context scope}. The - * scope of a bean determines the lifecycle of its instances, and which - * instances of the bean are visible to instances of other beans.

- * - *

A scope type is a Java annotation annotated - * {@link javax.inject.Scope @Scope} or - * {@link javax.enterprise.context.NormalScope @NormalScope}. - * The scope of a bean is defined by annotating the bean class or producer - * method or field with a scope type or with a stereotype that declares a - * default scope.

- * - *
- * @ConversationScoped 
- * public class Order { ... } 
- * 
- * - *

A bean class or producer method or field may specify at most one - * scope type annotation.

- * - *

If the bean does not explicitly declare a scope or a stereotype - * with a default scope, the scope defaults to - * {@link javax.enterprise.context.Dependent @Dependent}.

- * - *

Bean EL name

- * - *

A bean may have a bean EL name. A bean with an EL name may be referred - * to by its name in {@linkplain javax.el Unified EL} expressions. A valid - * bean EL name is a period-separated list of valid EL identifiers.

- * - *

To specify the EL name of a bean, the qualifier - * {@link javax.inject.Named @Named} is applied to the bean class or - * producer method or field. - * - *

- * @Named("currentOrder") 
- * public class Order { ... } 
- * 
- * - * If the @Named annotation does not specify the - * {@link javax.inject.Named#value() value} member, the EL name is defaulted. - * - *

Interceptor bindings

- * - *

{@linkplain javax.interceptor Interceptors} may be bound to any managed - * bean that is not itself an interceptor or decorator or to any EJB session - * or message-driven bean. An interceptor that is annotated - * {@link javax.interceptor.Interceptor @Interceptor} may be identified - * by its interceptor bindings.

- * - *
- * @Transactional @Interceptor
- * public class TransactionInterceptor {
- *    @AroundInvoke 
- *    public Object manageTransaction(InvocationContext ctx) { ... }
- * }
- * 
- * - *

An interceptor binding type is a Java annotation annotated - * {@link javax.interceptor.InterceptorBinding @InterceptorBinding}. - * An interceptor binding of a bean may be declared by annotating the bean - * class, or a method of the bean class, with an interceptor binding type - * or with a stereotype that declares the interceptor binding.

- * - *

In the following example, the TransactionInterceptor will be - * applied at the class level, and therefore applies to all business methods - * of the class: - * - *

- * @Transactional 
- * public class ShoppingCart { ... }
- * 
- * - *

In this example, the TransactionInterceptor will be applied at - * the method level:

- * - *
- * public class ShoppingCart { 
- *    @Transactional 
- *    public void placeOrder() { ... } 
- * } 
- * 
- * - *

If a managed bean class is declared final, it may not have any interceptor - * bindings. If a managed bean has a non-static, non-private, final method, it - * may not have any class-level interceptor bindings, and that method may not - * have any method-level interceptor bindings.

- * - *

Bean implementation

- * - *

The container provides built-in support for injection and contextual - * lifecycle management of the following kinds of bean:

- * - *
    - *
  • Managed beans
  • - *
  • Session beans
  • - *
  • Producer methods and fields
  • - *
  • Resources (Java EE resources, persistence contexts, persistence units, - * remote EJBs and web services)
  • - *
- * - *

Managed beans

- * - *

A managed bean is a bean that is implemented by a Java class. The basic - * lifecycle and semantics of managed beans are defined by the Managed Beans - * specification.

- * - *

A top-level Java class is a managed bean if it is defined to be a managed - * bean by any other Java EE specification, or if it meets all of the following - * conditions:

- * - *
    - *
  • It is not a non-static inner class.
  • - *
  • It is a concrete class, or is annotated - * {@link javax.decorator.Decorator @Decorator}.
  • - *
  • It is not annotated with an EJB component-defining annotation or declared - * as an EJB bean class in ejb-jar.xml.
  • - *
  • It does not implement {@link javax.enterprise.inject.spi.Extension}.
  • - *
  • It has an appropriate constructor; either the class has a constructor with - * no parameters, or the class declares a constructor annotated - * {@link javax.inject.Inject @Inject}.
  • - *
- * - *

All Java classes that meet these conditions are managed beans and thus no - * special declaration is required to define a managed bean. Optionally, a - * managed bean may be annotated {@link javax.annotation.ManagedBean}.

- * - *

If a managed bean has a public field, it must have scope - * {@link javax.enterprise.context.Dependent @Dependent}.

- * - *

If the managed bean class is a generic type, it must have scope - * {@link javax.enterprise.context.Dependent @Dependent}.

- * - *

Session beans

- * - *

The basic lifecycle and semantics of EJB session beans are defined by the - * EJB specification.

- * - *
    - *
  • A {@linkplain javax.ejb.Stateless stateless session bean} must belong to - * the {@link javax.enterprise.context.Dependent @Dependent} pseudo-scope.
  • - *
  • A {@linkplain javax.ejb.Singleton singleton bean} must belong to either the - * {@link javax.enterprise.context.ApplicationScoped @ApplicationScoped} - * scope or to the {@link javax.enterprise.context.Dependent @Dependent} - * pseudo-scope.
  • - *
  • A {@linkplain javax.ejb.Stateful stateful session bean} may have any scope.
  • - *
- * - *

If the session bean class is a generic type, it must have scope - * {@link javax.enterprise.context.Dependent @Dependent}.

- * - *

If a session bean is a stateful session bean:

- * - *
    - *
  • If the scope is {@link javax.enterprise.context.Dependent @Dependent}, - * the application may call any EJB remove method of a contextual instance of the - * session bean.
  • - *
  • Otherwise, the application may not directly call any EJB remove method of - * any contextual instance of the session bean.
  • - *
- * - *

Producer methods and fields

- * - *

A {@linkplain javax.enterprise.inject.Produces producer method or field} - * acts as a source of objects to be injected, where:

- * - *
    - *
  • the objects to be injected are not required to be instances of beans, or
  • - *
  • the concrete type of the objects to be injected may vary at runtime, or
  • - *
  • the objects require some custom initialization that is not performed by - * the bean constructor.
  • - *
- * - *

A producer method or field is a method or field of a bean class annotated - * {@link javax.enterprise.inject.Produces @Produces}.

- * - *

A common pattern in generic code is a producer method that injects an - * {@link javax.enterprise.inject.spi.InjectionPoint} object.

- * - *

Resources

- * - *

A resource is a bean that represents a reference to a resource, persistence - * context, persistence unit, remote EJB or web service in the Java EE component - * environment.

- * - *

A resource may be declared by specifying a Java EE component environment - * injection annotation as part of a producer field declaration.

- * - *
    - *
  • For a Java EE resource, @Resource must be specified.
  • - *
  • For a persistence context, @PersistenceContext must be specified. - *
  • For a persistence unit, @PersistenceUnit must be specified. - *
  • For a remote EJB, @EJB must be specified. - *
  • or a web service, @WebServiceRef must be specified. - *
- * - *

The injection annotation specifies the metadata needed to obtain the - * resources, entity manager, entity manager factory, remote EJB instance or - * web service reference from the component environment.

- * - *
- * @Produces @WebServiceRef(lookup="java:app/service/PaymentService")
- * PaymentService paymentService;
- * 
- * - *
- * @Produces @EJB(ejbLink="../their.jar#PaymentService")
- * PaymentService paymentService;
- * 
- * - *
- * @Produces @Resource(lookup="java:global/env/jdbc/CustomerDatasource")
- * @CustomerDatabase Datasource customerDatabase;
- * 
- * - *
- * @Produces @PersistenceContext(unitName="CustomerDatabase")
- * @CustomerDatabase EntityManager customerDatabasePersistenceContext;
- * 
- * - *
- * @Produces @PersistenceUnit(unitName="CustomerDatabase")
- * @CustomerDatabase EntityManagerFactory customerDatabasePersistenceUnit;
- * 
- * - *

A resource may not have an EL name.

- * - *

Enabled and disabled beans

- * - *

A bean is said to be enabled if:

- * - *
    - *
  • it is deployed in a bean archive, and
  • - *
  • it is not a - * {@linkplain javax.enterprise.inject.Produces producer method or field} - * of a disabled bean, and
  • - *
  • it is not {@linkplain javax.enterprise.inject.Specializes specialized} - * by any other enabled bean, and either
  • - *
  • it is not an {@linkplain javax.enterprise.inject.Alternative alternative}, - * or it is a selected alternative of at least one bean archive.
  • - *
- * - *

Otherwise, the bean is said to be disabled.

- * - *

Inter-module injection

- * - *

Beans and their clients may be deployed in modules in a module architecture - * such as the Java EE environment. In a module architecture, certain modules are - * considered bean archives. In the Java EE module architecture, any Java EE - * module or library is a module. The Java EE module or library is a bean archive - * if it contains a beans.xml file in the metadata directory. - * - *

A bean is available for injection in a certain module if:

- * - *
    - *
  • the bean is not an interceptor or decorator,
  • - *
  • the bean is enabled,
  • - *
  • the bean is either not an alternative, or the module is a bean archive and - * the bean is a selected alternative of the bean archive, and
  • - *
  • the bean class is required to be accessible to classes in the module, - * according to the class accessibility requirements of the module architecture.
  • - *
- * - *

Injection points

- * - *

The following kinds of injection point exist:

- * - *

    - *
  • When the container instantiates a bean class, it calls the bean constructor. - * The bean constructor is a constructor of the bean class. The bean constructor may - * be identified by annotating the constructor - * {@link javax.inject.Inject @javax.inject.Inject}. If a bean class does not - * explicitly declare a constructor using @Inject, the constructor that - * accepts no parameters is the bean constructor. A bean constructor may have any number - * of parameters. All parameters of a bean constructor are injection points.
  • - *
  • An injected field is a non-static, non-final field of a bean class, or of any - * Java EE component class supporting injection. An injected field may be declared by - * annotating the field {@link javax.inject.Inject @javax.inject.Inject}.
  • - *
  • An initializer method is a non-abstract, non-static, non-generic method of a - * bean class, or of any Java EE component class supporting injection. If the bean is - * a session bean, the initializer method is not required to be a business method of - * the session bean. An initializer method may be declared by annotating the method - * {@link javax.inject.Inject @javax.inject.Inject}. An initializer method may - * have any number of parameters. All initializer method parameters are injection - * points.
  • - *
  • Finally, parameters of {@linkplain javax.enterprise.inject.Produces producer methods}, - * {@linkplain javax.enterprise.inject.Disposes diposer methods} and - * {@linkplain javax.enterprise.event.Observes observer methods} are injection points.
  • - *
- * - *

Dependency injection

- * - *

A bean is assignable to a given injection point if:

- * - *
    - *
  • The bean has a bean type that matches the type of the injection point. For - * this purpose, primitive types are considered to match their corresponding wrapper - * types in {@link java.lang} and array types are considered to match only if their - * element types are identical.
  • - *
  • The bean has all the qualifiers of the injection point. If the injection point - * does not explicitly declare a qualifier, it has the default qualifier - * {@link javax.enterprise.inject.Default @Default}.
  • - *
  • The bean is eligible for injection into the class that declares the injection - * point.
  • - *
- * - *

A bean is eligible for injection into a given injection point if:

- * - *
    - *
  • it is available for injection in the module that contains the - * class that declares the injection point, and
  • - *
  • it is assignable to the injection point.
  • - *
- * - *

If more than one bean is eligible for injection to the injection point, the - * container attempts to resolve the ambiguity by eliminating all beans which are - * not alternatives, except for producer methods and fields of beans that are - * alternatives.

- * - *

Certain legal bean types cannot be proxied by the container:

- * - *
    - *
  • classes which don't have a non-private constructor with no parameters,
  • - *
  • classes which are declared final or have final methods,
  • - *
  • primitive types,
  • - *
  • and array types.
  • - *
- * - *

An injection point whose declared type cannot be proxied by the container must - * not resolve to a bean with a {@linkplain javax.enterprise.context normal scope}.

- * - *

EL name resolution

- * - *

EL names are resolved when Unified EL expressions are evaluated. An EL name - * resolves to a bean if:

- * - *
    - *
  • the bean has the given EL name, and
  • - *
  • the bean is available for injection in the war containing the JSP or JSF - * page with the EL expression.
  • - *
- * - *

If an EL name resolves to more than one bean, the container attempts to - * resolve the ambiguity by eliminating all beans which are not alternatives, - * except for producer methods and fields of beans that are alternatives.

- * - *

Enabled interceptors

- * - *

By default, a bean archive has no enabled interceptors. An interceptor - * must be explicitly enabled by listing its bean class under the - * <interceptors> element of the beans.xml file of the - * bean archive. The order of the interceptor declarations determines the - * interceptor ordering. Interceptors which occur earlier in the list are - * called first.

- * - *

An interceptor is bound to a bean if:

- * - *
    - *
  • The bean has all the interceptor bindings of the interceptor.
  • - *
  • The interceptor is enabled in the bean archive of the bean.
  • - *
- * - *

An interceptor instance is a - * {@linkplain javax.enterprise.context.Dependent dependent object} - * of the object it intercepts.

- * - * @see javax.enterprise.context - * @see javax.inject - * @see javax.interceptor - * @see javax.decorator - * @see javax.enterprise.event - * - * @see javax.enterprise.inject.Produces - * @see javax.enterprise.inject.Alternative - * - */ -package javax.enterprise.inject; diff --git a/cdi/src/main/java/javax/enterprise/inject/spi/AfterBeanDiscovery.java b/cdi/src/main/java/javax/enterprise/inject/spi/AfterBeanDiscovery.java deleted file mode 100644 index 22c23036..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/spi/AfterBeanDiscovery.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package javax.enterprise.inject.spi; - -import javax.enterprise.context.spi.Context; - -/** - *

- * The event type of the second event fired by the container when it has fully - * completed the bean discovery process, validated that there are no definition - * errors relating to the discovered beans, and registered - * {@link javax.enterprise.inject.spi.Bean} and - * {@link javax.enterprise.inject.spi.ObserverMethod} objects for the discovered - * beans, but before detecting deployment problems. - *

- *

- * A portable extension may take advantage of this event to register - * {@linkplain javax.enterprise.inject.spi.Bean beans}, - * {@linkplain javax.enterprise.inject.spi.Interceptor interceptors}, - * {@linkplain javax.decorator.Decorator decorators}, - * {@linkplain javax.enterprise.event.Observes observer methods} and - * {@linkplain javax.enterprise.context custom context} objects with the - * container. - *

- * - *
- *     void afterBeanDiscovery(@Observes AfterBeanDiscovery event, BeanManager manager) { ... }
- * 
- *

- * If any observer method of the {@code AfterBeanDiscovery} event throws an - * exception, the exception is treated as a definition error by the container. - *

- * - * @author David Allen - */ -public interface AfterBeanDiscovery -{ - /** - * Registers a definition error with the container, causing the container to - * abort deployment after all observers have been notified. - * - * @param t The definition error as a {@link java.lang.Throwable} - */ - public void addDefinitionError(Throwable t); - - /** - * Fires an event of type {@link javax.enterprise.inject.spi.ProcessBean} - * containing the given {@link javax.enterprise.inject.spi.Bean} and then - * registers the {@link javax.enterprise.inject.spi.Bean} with the container, - * thereby making it available for injection into other beans. The given - * {@link javax.enterprise.inject.spi.Bean} may implement - * {@link javax.enterprise.inject.spi.Interceptor} or - * {@link javax.decorator.Decorator}. - * - * @param bean The bean to add to the deployment - */ - public void addBean(Bean bean); - - /** - * Fires an event of type - * {@link javax.enterprise.inject.spi.ProcessObserverMethod} containing the - * given {@link javax.enterprise.inject.spi.ObserverMethod} and then - * registers the {@link javax.enterprise.inject.spi.ObserverMethod} with the - * container, thereby making it available for event notifications. - * - * @param observerMethod The custom observer method to add to the deployment - */ - public void addObserverMethod(ObserverMethod observerMethod); - - /** - * Registers a custom {@link javax.enterprise.context.spi.Context} object - * with the container. - * - * @param context The custom context to add to the deployment - */ - public void addContext(Context context); - -} diff --git a/cdi/src/main/java/javax/enterprise/inject/spi/AfterDeploymentValidation.java b/cdi/src/main/java/javax/enterprise/inject/spi/AfterDeploymentValidation.java deleted file mode 100644 index 346c3f78..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/spi/AfterDeploymentValidation.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package javax.enterprise.inject.spi; - -/** - *

- * The event type of the third event fired by the container after it has - * validated that there are no deployment problems and before creating contexts - * or processing requests. If any observer method of the {@code - * AfterDeploymentValidation} event throws an exception, the exception is - * treated as a deployment problem by the container. - *

- *

- * No requests will be processed by the deployment until all observers of this - * event return. - *

- * - * @author David Allen - */ -public interface AfterDeploymentValidation -{ - - /** - * Registers a deployment problem with the container, causing the container - * to abort deployment after all observers have been notified. - * - * @param t The deployment problem as a {@link java.lang.Throwable} - */ - public void addDeploymentProblem(Throwable t); - -} diff --git a/cdi/src/main/java/javax/enterprise/inject/spi/Annotated.java b/cdi/src/main/java/javax/enterprise/inject/spi/Annotated.java deleted file mode 100644 index 0c6783d0..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/spi/Annotated.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.inject.spi; - -import java.lang.annotation.Annotation; -import java.lang.reflect.Type; -import java.util.Set; - -/** - *

Represents a Java program element that can be annotated.

- * - * @see java.lang.reflect.AnnotatedElement - * - * @author Gavin King - * @author Pete Muir - * @author Clint Popetz - * - */ -public interface Annotated -{ - - /** - *

Get the type of the annotated program element.

- * - * @return the type of the annotated program element - */ - public Type getBaseType(); - - /** - *

Get all types to which the base type should be considered - * assignable.

- * - * @return a set of all types to which the base type should be considered - * assignable - */ - public Set getTypeClosure(); - - /** - *

Get program element annotation of a certain annotation type.

- * - * @param the type of the annotation - * @param annotationType the class of the annotation type - * @return the program element annotation of the given annotation type, - * or a null value - */ - public T getAnnotation(Class annotationType); - - /** - *

Get all annotations of the program element.

- * - * @return all annotations of the program element, or an empty set if no - * annotations are present - */ - public Set getAnnotations(); - - /** - *

Determine if the program element has an annotation of a - * certain annotation type.

- * - * @param annotationType the annotation type to check for - * @return true if the program element has an annotation of the - * given annotation type, or false otherwise - */ - public boolean isAnnotationPresent(Class annotationType); -} diff --git a/cdi/src/main/java/javax/enterprise/inject/spi/AnnotatedCallable.java b/cdi/src/main/java/javax/enterprise/inject/spi/AnnotatedCallable.java deleted file mode 100644 index c4639507..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/spi/AnnotatedCallable.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package javax.enterprise.inject.spi; - -import java.util.List; - -/** - *

Represents a callable member of a Java type.

- * - * @author Gavin King - * @author Pete Muir - * - * @param the declaring type - */ -public interface AnnotatedCallable extends AnnotatedMember -{ - - /** - *

Get the parameters of the callable member.

- * - * @return the parameters - */ - public List> getParameters(); - -} diff --git a/cdi/src/main/java/javax/enterprise/inject/spi/AnnotatedConstructor.java b/cdi/src/main/java/javax/enterprise/inject/spi/AnnotatedConstructor.java deleted file mode 100644 index 4e885f62..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/spi/AnnotatedConstructor.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.inject.spi; - -import java.lang.reflect.Constructor; - -/** - *

Represents a constructor of a Java class.

- * - * @author Gavin King - * @author Pete Muir - * - * @param the declaring class - * @see Constructor - */ -public interface AnnotatedConstructor extends AnnotatedCallable -{ - - /** - *

Get the underlying {@link Constructor}.

- * - * @return the constructor - */ - public Constructor getJavaMember(); - -} diff --git a/cdi/src/main/java/javax/enterprise/inject/spi/AnnotatedField.java b/cdi/src/main/java/javax/enterprise/inject/spi/AnnotatedField.java deleted file mode 100644 index 7f307899..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/spi/AnnotatedField.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package javax.enterprise.inject.spi; - -import java.lang.reflect.Field; - -/** - *

Represents a field of a Java class.

- * - * @author Gavin King - * @author Pete Muir - * - * @param the declaring type - * @see Field - */ -public interface AnnotatedField extends AnnotatedMember { - - /** - *

Get the underlying {@link Field}.

- * - * @return the {@link Field} - */ - public Field getJavaMember(); - -} diff --git a/cdi/src/main/java/javax/enterprise/inject/spi/AnnotatedMember.java b/cdi/src/main/java/javax/enterprise/inject/spi/AnnotatedMember.java deleted file mode 100644 index 266f446c..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/spi/AnnotatedMember.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.inject.spi; - -import java.lang.reflect.Member; - -/** - *

Represents a member of a Java type.

- * - * @author Gavin King - * @author Pete Muir - * - * @param the declaring type - * @see Member - */ -public interface AnnotatedMember extends Annotated -{ - /** - *

Get the underlying {@link Member}.

- * - * @return the {@link Member} - */ - public Member getJavaMember(); - - /** - *

Determines if the member is static.

- * - * @return true if the member is static - */ - public boolean isStatic(); - - /** - *

Get the {@linkplain AnnotatedType type} which declares this - * member.

- * - * @return the type which declares this member - */ - public AnnotatedType getDeclaringType(); -} diff --git a/cdi/src/main/java/javax/enterprise/inject/spi/AnnotatedMethod.java b/cdi/src/main/java/javax/enterprise/inject/spi/AnnotatedMethod.java deleted file mode 100644 index 4bdd8ab6..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/spi/AnnotatedMethod.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package javax.enterprise.inject.spi; - -import java.lang.reflect.Method; - -/** - *

Represents a method of a Java type.

- * - * @author Gavin King - * @author Pete Muir - * - * @param the declaring type - * @see Method - */ -public interface AnnotatedMethod extends AnnotatedCallable -{ - - /** - *

Get the underlying {@link Method}.

- * - * @return the {@link Method} - */ - public Method getJavaMember(); -} diff --git a/cdi/src/main/java/javax/enterprise/inject/spi/AnnotatedParameter.java b/cdi/src/main/java/javax/enterprise/inject/spi/AnnotatedParameter.java deleted file mode 100644 index b1265746..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/spi/AnnotatedParameter.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.inject.spi; - -/** - *

Represents a parameter of a method or constructor.

- * - * @author Gavin King - * @author Pete Muir - * - * @param the type that declares the method or constructor - */ -public interface AnnotatedParameter extends Annotated -{ - - /** - *

Get the position of the parameter in the method or - * constructor argument list.

- * - * @return the position of the parameter - */ - public int getPosition(); - - /** - *

Get the declaring {@linkplain AnnotatedCallable method or - * constructor}.

- * - * @return the declaring callable - */ - public AnnotatedCallable getDeclaringCallable(); - -} diff --git a/cdi/src/main/java/javax/enterprise/inject/spi/AnnotatedType.java b/cdi/src/main/java/javax/enterprise/inject/spi/AnnotatedType.java deleted file mode 100644 index ca5d044f..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/spi/AnnotatedType.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.inject.spi; - -import java.util.Set; - -/** - *

Represents a Java class or interface.

- * - * @author Gavin King - * @author Pete Muir - * - * @param the type - * @see java.lang.Class - */ -public interface AnnotatedType extends Annotated -{ - - /** - *

Get the underlying {@link java.lang.Class}.

- * - * @return the {@link java.lang.Class} - */ - public Class getJavaClass(); - - /** - *

Get the {@linkplain AnnotatedConstructor constructors} of the type. - * If an empty set is returned, a default constructor with no parameters - * will be assumed.

- * - * @return the constructors, or an empty set if none are defined - */ - public Set> getConstructors(); - - /** - *

Get the {@linkplain AnnotatedMethod methods} of the type.

- * - * @return the methods, or an empty set if none are defined - */ - public Set> getMethods(); - - /** - *

Get the {@linkplain AnnotatedField fields} of the type.

- * - * @return the fields, or an empty set if none are defined - */ - public Set> getFields(); -} diff --git a/cdi/src/main/java/javax/enterprise/inject/spi/Bean.java b/cdi/src/main/java/javax/enterprise/inject/spi/Bean.java deleted file mode 100644 index 6c3322c6..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/spi/Bean.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.inject.spi; - -import java.lang.annotation.Annotation; -import java.lang.reflect.Type; -import java.util.Set; - -import javax.enterprise.context.spi.Contextual; - -/** - *

Represents an {@linkplain javax.enterprise.inject enabled bean}. This - * interface defines everything the container needs to manage instances of - * the bean.

- * - * @author Gavin King - * @author David Allen - * @param the class of the bean instance - */ -public interface Bean extends Contextual -{ - - /** - * Obtains the {@linkplain javax.enterprise.inject bean types} of the bean. - * - * @return the {@linkplain javax.enterprise.inject bean types} - */ - public Set getTypes(); - - /** - * Obtains the {@linkplain javax.inject.Qualifier qualifiers} of the bean. - * - * @return the {@linkplain javax.inject.Qualifier qualifiers} - */ - public Set getQualifiers(); - - /** - * Obtains the {@linkplain javax.enterprise.context scope} of the bean. - * - * @return the {@linkplain javax.enterprise.context scope} - */ - public Class getScope(); - - /** - * Obtains the {@linkplain javax.enterprise.inject EL name} of a bean, if it has one. - * - * @return the {@linkplain javax.enterprise.inject EL name} - */ - public String getName(); - - /** - * Obtains the {@linkplain javax.enterprise.inject.Stereotype stereotypes} - * of the bean. - * - * @return the set of {@linkplain javax.enterprise.inject.Stereotype stereotypes} - */ - public Set> getStereotypes(); - - /** - * The bean {@linkplain Class class} of the managed bean or session bean or - * of the bean that declares the producer method or field. - * - * @return the bean {@linkplain Class class} - */ - public Class getBeanClass(); - - /** - * Determines if the bean is an - * {@linkplain javax.enterprise.inject.Alternative alternative}. - * - * @return true if the bean is an - * {@linkplain javax.enterprise.inject.Alternative alternative}, - * and false otherwise. - */ - public boolean isAlternative(); - - /** - * Determines if - * {@link javax.enterprise.context.spi.Contextual#create(CreationalContext)} - * sometimes return a null value. - * - * @return true if the {@code create()} method may return a null - * value, and false otherwise - */ - public boolean isNullable(); - - /** - * Obtains the {@link javax.enterprise.inject.spi.InjectionPoint} objects - * representing injection points of the bean, that will be validated by the - * container at initialization time. - * - * @return the set of {@linkplain javax.enterprise.inject.spi.InjectionPoint injection points} of the bean - */ - public Set getInjectionPoints(); - -} \ No newline at end of file diff --git a/cdi/src/main/java/javax/enterprise/inject/spi/BeanManager.java b/cdi/src/main/java/javax/enterprise/inject/spi/BeanManager.java deleted file mode 100644 index 448afe65..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/spi/BeanManager.java +++ /dev/null @@ -1,372 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.inject.spi; - -import java.lang.annotation.Annotation; -import java.lang.reflect.Type; -import java.util.List; -import java.util.Set; - -import javax.el.ELResolver; -import javax.el.ExpressionFactory; -import javax.enterprise.context.ContextNotActiveException; -import javax.enterprise.context.spi.Context; -import javax.enterprise.context.spi.Contextual; -import javax.enterprise.context.spi.CreationalContext; -import javax.enterprise.inject.AmbiguousResolutionException; -import javax.enterprise.inject.InjectionException; -import javax.enterprise.inject.UnsatisfiedResolutionException; - -/** - *

Allows a portable extension to interact directly with the container. - * Provides operations for obtaining contextual references for beans, along - * with many other operations of use to portable extensions.

- * - *

Any bean may obtain an instance of BeanManager by injecting - * it:

- * - *
- * @Inject BeanManager manager;
- * 
- * - *

Java EE components may obtain an instance of BeanManager from - * {@linkplain javax.naming JNDI} by looking up the name {@code - * java:comp/BeanManager}.

- * - *

Any operation of BeanManager may be called at any time during - * the execution of the application.

- * - * @author Gavin King - * @author Pete Muir - * @author Clint Popetz - * @author David Allen - */ -public interface BeanManager -{ - - /** - * Obtains a contextual reference for a certain {@linkplain Bean bean} and - * a certain bean type of the bean. - * - * @param bean the {@link Bean} object representing the bean - * @param beanType a bean type that must be implemented by any client proxy - * that is returned - * @param ctx a {@link javax.enterprise.context.spi.CreationalContext} that - * may be used to destroy any object with scope - * {javax.enterprise.context.Dependent} that is created - * @return a contextual reference representing the bean - * @throws IllegalArgumentException if the given type is not a bean type of - * the given bean - */ - public Object getReference(Bean bean, Type beanType, CreationalContext ctx); - - /** - * Obtains an injectable reference for a certain {@linkplain InjectionPoint - * injection point}. - * - * @param ij the target injection point - * @param ctx a {@link javax.enterprise.context.spi.CreationalContext} that - * may be used to destroy any object with scope - * {javax.enterprise.context.Dependent} that is created - * @return the injectable reference - * @throws UnsatisfiedResolutionException if typesafe resolution results in - * an unsatisfied dependency - * @throws AmbiguousResolutionException typesafe resolution results in an - * unresolvable ambiguous dependency - */ - public Object getInjectableReference(InjectionPoint ij, CreationalContext ctx); - - /** - * Obtain an instance of a {@link javax.enterprise.context.spi.CreationalContext} - * for the given {@linkplain javax.enterprise.context.spi.Contextual contextual type}, - * or for a non-contextual object. - * - * @param contextual the {@link javax.enterprise.context.spi.Contextual}, or - * a null value in the case of a non-contextual object - * @return the new {@link javax.enterprise.context.spi.CreationalContext} - */ - public CreationalContext createCreationalContext(Contextual contextual); - - /** - * Return the set of beans which have the given required type and qualifiers - * and are available for injection in the module or library containing the class - * into which the BeanManager was injected or the Java EE component from - * whose JNDI environment namespace the BeanManager was obtained, - * according to the rules of typesafe resolution. If no qualifiers are given, the - * {@linkplain javax.enterprise.inject.Default default qualifier} is assumed. - * - * @param beanType the required bean type - * @param qualifiers the required qualifiers - * @return the resulting set of {@linkplain Bean beans} - * @throws IllegalArgumentException if the given type represents a type - * variable - * @throws IllegalArgumentException if two instances of the same qualifier type - * are given - * @throws IllegalArgumentException if an instance of an annotation that is - * not a qualifier type is given - */ - public Set> getBeans(Type beanType, Annotation... qualifiers); - - /** - * Return the set of beans which have the given EL name and are available for - * injection in the module or library containing the class into which the - * BeanManager was injected or the Java EE component from whose JNDI - * environment namespace the BeanManager was obtained, according to - * the rules of EL name resolution. - * - * @param name the EL name - * @return the resulting set of {@linkplain Bean beans} - */ - public Set> getBeans(String name); - - /** - * Returns the {@link javax.enterprise.inject.spi.PassivationCapable} bean with - * the given identifier. - * - * @param id the identifier - * @return a {@link Bean} that implements - * {@link javax.enterprise.inject.spi.PassivationCapable} - * and has the given identifier, or a null value if there - * is no such bean - */ - public Bean getPassivationCapableBean(String id); - - /** - * Apply the ambiguous dependency resolution rules to a set of - * {@linkplain Bean beans}. - * - * @param a common type of the beans - * @param beans a set of {@linkplain Bean beans} of the given type - * @throws AmbiguousResolutionException if the ambiguous dependency - * resolution rules fail - */ - public Bean resolve(Set> beans); - - /** - * Validate a certain {@linkplain InjectionPoint injection point}. - * - * @param injectionPoint the {@linkplain InjectionPoint injection point} to - * validate - * @throws InjectionException if there is a deployment problem (for - * example, an unsatisfied or unresolvable ambiguous dependency) - * associated with the injection point - */ - public void validate(InjectionPoint injectionPoint); - - /** - * Fire an event and notify observers. - * - * @param event the event object - * @param qualifiers the event qualifiers - * @throws IllegalArgumentException if the runtime type of the event object - * contains a type variable - * @throws IllegalArgumentException if two instances of the same qualifier type - * are given - * @throws IllegalArgumentException if an instance of an annotation that is not - * a qualifier type is given - */ - public void fireEvent(Object event, Annotation... qualifiers); - - /** - * Return the set of observers for an event. - * - * @param the type of the event - * @param event the event object - * @param qualifiers the event qualifiers - * @throws IllegalArgumentException if the runtime type of the event object - * contains a type variable - * @throws IllegalArgumentException if two instances of the same qualifier type - * are given - * @throws IllegalArgumentException if an instance of an annotation that is not - * a qualifier type is given - */ - public Set> resolveObserverMethods(T event, Annotation... qualifiers); - - /** - * Return an ordered list of {@linkplain Decorator decorators} for a set of - * bean types and a set of qualifiers and which are enabled in the module or - * library containing the class into which the BeanManager was - * injected or the Java EE component from whose JNDI environment namespace - * the BeanManager was obtained. - * - * @param types the set of bean types of the decorated bean - * @param qualifiers the qualifiers declared by the decorated bean - * @return the resulting set of {@linkplain Decorator decorators} - * @throws IllegalArgumentException if the set of bean types is empty - * @throws IllegalArgumentException if an annotation which is not a binding - * type is passed - * @throws IllegalArgumentException if two instances of the same binding type - * are passed - */ - public List> resolveDecorators(Set types, Annotation... qualifiers); - - /** - * Return an ordered list of enabled {@linkplain Interceptor interceptors} for - * a set of interceptor bindings and a type of interception and which are enabled - * in the module or library containing the class into which the BeanManager - * was injected or the Java EE component from whose JNDI environment namespace - * the BeanManager was obtained. - * - * @param type the type of the interception - * @param interceptorBindings the interceptor bindings - * @return the resulting set of {@linkplain Interceptor interceptors} - * @throws IllegalArgumentException if no interceptor binding type is given - * @throws IllegalArgumentException if two instances of the same interceptor - * binding type are given - * @throws IllegalArgumentException if an instance of an annotation that is not - * an interceptor binding type is given - */ - public List> resolveInterceptors(InterceptionType type, Annotation... interceptorBindings); - - /** - * Test the given annotation type to determine if it is a - * {@linkplain javax.enterprise.context scope type}. - * - * @param annotationType the annotation type - * @return true if the annotation type is a - * {@linkplain javax.enterprise.context scope type} - */ - public boolean isScope(Class annotationType); - - /** - * Test the given annotation type to determine if it is a - * {@linkplain javax.enterprise.context normal scope type}. - * - * @param annotationType the annotation type - * @return true if the annotation type is a - * {@linkplain javax.enterprise.context normal scope type} - */ - public boolean isNormalScope(Class annotationType); - - /** - * Test the given annotation type to determine if it is a passivating - * {@linkplain javax.enterprise.context scope type}. - * - * @param annotationType the annotation type - * @return true if the annotation type is a passivating scope type - */ - public boolean isPassivatingScope(Class annotationType); - - /** - * Test the given annotation type to determine if it is a - * {@linkplain javax.inject.Qualifier qualifier type}. - * - * @param annotationType the annotation type - * @return true if the annotation type is a - * {@linkplain javax.inject.Qualifier qualifier type} - */ - public boolean isQualifier(Class annotationType); - - /** - * Test the given annotation type to determine if it is an - * {@linkplain javax.interceptor.InterceptorBinding interceptor binding type}. - * - * @param annotationType the annotation to test - * @return true if the annotation type is a {@linkplain - * javax.interceptor.InterceptorBinding interceptor binding type} - */ - public boolean isInterceptorBinding(Class annotationType); - - /** - * Test the given annotation type to determine if it is a - * {@linkplain javax.enterprise.inject.Stereotype stereotype}. - * - * @param annotationType the annotation type - * @return true if the annotation type is a - * {@linkplain javax.enterprise.inject.Stereotype stereotype} - */ - public boolean isStereotype(Class annotationType); - - /** - * Obtains the set of meta-annotations for a certain - * {@linkplain javax.interceptor.InterceptorBinding interceptor binding type}. - * - * @param bindingType the - * {@linkplain javax.interceptor.InterceptorBinding interceptor binding type} - * @return the set of meta-annotations - */ - public Set getInterceptorBindingDefinition(Class bindingType); - - /** - * Obtains meta-annotations for a certain - * {@linkplain javax.enterprise.inject.Stereotype stereotype}. - * - * @param stereotype the {@linkplain javax.enterprise.inject.Stereotype - * stereotype} - * @return the set of meta-annotations - */ - public Set getStereotypeDefinition(Class stereotype); - - /** - * Obtains an active {@linkplain javax.enterprise.context.spi.Context - * context object} for the given {@linkplain javax.enterprise.context scope}. - * - * @param scopeType the {@linkplain javax.enterprise.context scope} - * @return the {@linkplain javax.enterprise.context.spi.Context context object} - * @throws ContextNotActiveException if there is no active context object for the - * given scope - * @throws IllegalArgumentException if there is more than one active context object - * for the given scope - */ - public Context getContext(Class scopeType); - - /** - * Returns a {@link javax.el.ELResolver} that resolves beans by EL name. - */ - public ELResolver getELResolver(); - - /** - * Returns a wrapper {@link javax.el.ExpressionFactory} that delegates - * {@link javax.el.MethodExpression} and {@link javax.el.ValueExpression} - * creation to the given {@link javax.el.ExpressionFactory}. When a Unified - * EL expression is evaluated using a {@link javax.el.MethodExpression} or - * {@link javax.el.ValueExpression} returned by the wrapper - * {@link javax.el.ExpressionFactory}, the container handles destruction of - * objects with scope {@link javax.enterprise.context.Dependent}. - * - * - * @param expressionFactory the {@link javax.el.ExpressionFactory} to wrap - * @return the wrapped {@link javax.el.ExpressionFactory} - */ - public ExpressionFactory wrapExpressionFactory(ExpressionFactory expressionFactory); - - /** - * Obtain an {@link AnnotatedType} that may be used to read the annotations - * of the given class or interface. - * - * @param the class or interface - * @param type the {@link java.lang.Class} object - * @return the {@link AnnotatedType} - */ - public AnnotatedType createAnnotatedType(Class type); - - /** - * Obtains an {@link InjectionTarget} for the given {@link AnnotatedType}. - * The container ignores the annotations and types declared by the elements - * of the actual Java class and uses the metadata provided via the - * {@link Annotated} interface instead. - * - * @param the type - * @param type the {@link AnnotatedType} - * @returns a container provided implementation of {@link InjectionTarget} - * @throws IllegalArgumentException if there is a definition error associated - * with any injection point of the type - */ - public InjectionTarget createInjectionTarget(AnnotatedType type); - -} diff --git a/cdi/src/main/java/javax/enterprise/inject/spi/BeforeBeanDiscovery.java b/cdi/src/main/java/javax/enterprise/inject/spi/BeforeBeanDiscovery.java deleted file mode 100644 index fcca557a..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/spi/BeforeBeanDiscovery.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package javax.enterprise.inject.spi; - -import java.lang.annotation.Annotation; - -/** - *

- * This event type is thrown by the container before the bean discovery process - * begins. If any observer method of the {@code BeforeBeanDiscovery} event - * throws an exception, the exception is treated as a definition error by the - * container. - *

- * - * @author Pete Muir - * @author David Allen - */ -public interface BeforeBeanDiscovery -{ - /** - * Declares an annotation type as a {@linkplain javax.inject.Qualifier} - * qualifier type. - * - * @param qualifier The annotation to treat as a qualifier - */ - public void addQualifier(Class qualifier); - - /** - * Declares an annotation type as a {@linkplain javax.enterprise.context - * scope type}. - * - * @param scopeType The annotation type to treat as a - * {@linkplain javax.enterprise.context scope type} - * @param normal Indicates if the scope is normal - * @param passivating Indicates if the scope is - * {@linkplain javax.enterprise.inject.spi.PassivationCapable - * passivation capable} - */ - public void addScope(Class scopeType, boolean normal, boolean passivating); - - /** - * Declares an annotation type as a - * {@linkplain javax.enterprise.inject.Stereotype stereotype}, and specifies - * its meta-annotations. - * - * @param stereotype The annotation type to treat as a - * {@linkplain javax.enterprise.inject.Stereotype stereotype} - * @param stereotypeDef An optional list of annotations defining the - * {@linkplain javax.enterprise.inject.Stereotype stereotype} - */ - public void addStereotype(Class stereotype, Annotation... stereotypeDef); - - /** - * Declares an annotation type as an {@linkplain Interceptor interceptor} - * binding type, and specifies its meta-annotations. - * - * @param bindingType The annotation type to treat as an interceptor binding - * type - * @param bindingTypeDef An optional list of annotations defining the {@linkplain Interceptor interceptor} - */ - public void addInterceptorBinding(Class bindingType, Annotation... bindingTypeDef); - - /** - * Adds a given {@link javax.enterprise.inject.spi.AnnotatedType} to the set - * of types which will be scanned during bean discovery. - * - * @param type The {@link javax.enterprise.inject.spi.AnnotatedType} to add - * for later scanning - */ - public void addAnnotatedType(AnnotatedType type); -} diff --git a/cdi/src/main/java/javax/enterprise/inject/spi/BeforeShutdown.java b/cdi/src/main/java/javax/enterprise/inject/spi/BeforeShutdown.java deleted file mode 100644 index b599676d..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/spi/BeforeShutdown.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package javax.enterprise.inject.spi; - -/** - *

- * The type of the final event the container fires after it has finished processing - * requests and destroyed all contexts. If any observer method of the - * {@code BeforeShutdown} event throws an exception, the exception is ignored by the - * container. - *

- * - * @author David Allen - */ -public interface BeforeShutdown -{ -} diff --git a/cdi/src/main/java/javax/enterprise/inject/spi/Decorator.java b/cdi/src/main/java/javax/enterprise/inject/spi/Decorator.java deleted file mode 100644 index 640969e0..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/spi/Decorator.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.inject.spi; - -import java.lang.annotation.Annotation; -import java.lang.reflect.Type; -import java.util.Set; - -/** - *

Represents an enabled {@linkplain javax.decorator decorator}.

- * - * @author Gavin King - * @author Pete Muir - * - * @param the decorator bean class - */ -public interface Decorator extends Bean -{ - - /** - *

Obtains the {@linkplain Type type} of the - * {@linkplain javax.decorator.Delegate delegate injection point}.

- * - * @return the delegate {@linkplain Type type} - */ - public Type getDelegateType(); - - /** - *

Obtains the {@linkplain javax.inject.Qualifier qualifiers} of the - * {@linkplain javax.decorator.Delegate delegate injection point}.

- * - * @return the delegate {@linkplain javax.inject.Qualifier qualifiers} - */ - public Set getDelegateQualifiers(); - - /** - *

Obtains the {@linkplain javax.decorator decorated types}.

- * - * @return the set of decorated {@linkplain Type types} - */ - public Set getDecoratedTypes(); - -} \ No newline at end of file diff --git a/cdi/src/main/java/javax/enterprise/inject/spi/Extension.java b/cdi/src/main/java/javax/enterprise/inject/spi/Extension.java deleted file mode 100644 index 91dd9a83..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/spi/Extension.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.inject.spi; - -/** - *

Service interface implemented by extensions. An extension - * is a service provider declared in META-INF/services.

- * - *

Service providers may have - * {@linkplain javax.enterprise.event.Observes observer methods}, - * which may observe any event, including any - * {@linkplain javax.enterprise.inject.spi container lifecycle event}, - * and obtain an injected - * {@link javax.enterprise.inject.spi.BeanManager}.

- * - *

The container instantiates a single instance of each - * extension at the beginning of the application initialization - * process and maintains a reference to it until the application - * shuts down. The container delivers event notifications to this - * instance by calling its observer methods.

- * - *

Service providers are made available for injection as beans - * with the qualifier {@link javax.enterprise.inject.Default @Default}.

- * - * @author Gavin King - * @author Pete Muir - * - */ -public interface Extension {} \ No newline at end of file diff --git a/cdi/src/main/java/javax/enterprise/inject/spi/InjectionPoint.java b/cdi/src/main/java/javax/enterprise/inject/spi/InjectionPoint.java deleted file mode 100644 index fff53756..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/spi/InjectionPoint.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.inject.spi; - -import java.lang.annotation.Annotation; -import java.lang.reflect.Member; -import java.lang.reflect.Type; -import java.util.Set; - - -/** - *

Provides access to metadata about an injection point. May represent an - * {@linkplain javax.inject.Inject injected field} or a parameter of a - * {@linkplain javax.inject.Inject bean constructor}, - * {@linkplain javax.inject.Inject initializer method}, - * {@linkplain javax.enterprise.inject.Produces producer method}, - * {@linkplain javax.enterprise.inject.Disposes disposer method} or - * {@linkplain javax.enterprise.event.Observes observer method}.

- * - *

Occasionally, a bean with scope - * {@link javax.enterprise.context.Dependent @Dependent} needs to access - * metadata relating to the object to which it belongs. The bean may inject an - * {@code InjectionPoint} representing the injection point into which the bean - * was injected.

- * - *

For example, the following producer method creates injectable Loggers. - * The log category of a Logger depends upon the class of the object into - * which it is injected.

- * - *
- * @Produces 
- * Logger createLogger(InjectionPoint injectionPoint) { 
- *    return Logger.getLogger( injectionPoint.getMember().getDeclaringClass().getName() );
- * }
- * 
- * - *

Only {@linkplain javax.enterprise.context.Dependent dependent} objects, may - * obtain information about the injection point to which they belong.

- * - * @author Gavin King - * @author Pete Muir - */ -public interface InjectionPoint -{ - - /** - * Get the required type of injection point. - * - * @return the required type - */ - public Type getType(); - - /** - * Get the required qualifiers of the injection point. - * - * @return the required qualifiers - */ - public Set getQualifiers(); - - /** - * Get the {@link javax.enterprise.inject.spi.Bean} object representing the - * bean that defines the injection point. If the injection point does not - * belong to a bean, return a null value. - * - * @return the {@link javax.enterprise.inject.spi.Bean} object representing - * bean that defines the injection point, of null if the injection - * point does not belong to a bean - */ - public Bean getBean(); - - /** - * Get the {@link java.lang.reflect.Field} object in the case of field - * injection, the {@link java.lang.reflect.Method} object in - * the case of method parameter injection or the - * {@link java.lang.reflect.Constructor} object in the case of constructor - * parameter injection. - * - * @return the member - */ - public Member getMember(); - - /** - * Obtain an instance of {@link javax.enterprise.inject.spi.AnnotatedField} - * or {@link javax.enterprise.inject.spi.AnnotatedParameter}, depending upon - * whether the injection point is an injected field or a constructor/method parameter. - * - * @return an {@code AnnotatedField} or {@code AnnotatedParameter} - */ - public Annotated getAnnotated(); - - /** - * Determines if the injection point is a decorator delegate injection point. - * - * @return true if the injection point is a decorator delegate injection point, - * and false otherwise - */ - public boolean isDelegate(); - - /** - * Determines if the injection is a transient field. - * - * @return true if the injection point is a transient field, and false - * otherwise - */ - public boolean isTransient(); -} diff --git a/cdi/src/main/java/javax/enterprise/inject/spi/InjectionTarget.java b/cdi/src/main/java/javax/enterprise/inject/spi/InjectionTarget.java deleted file mode 100644 index 343a0054..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/spi/InjectionTarget.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package javax.enterprise.inject.spi; - -import javax.enterprise.context.spi.CreationalContext; - -/** - *

- * Provides operations for performing - * {@linkplain javax.enterprise.inject dependency injection} and - * lifecycle callbacks on an instance of a type. - *

- * - * @see javax.annotation.PostConstruct - * @see javax.annotation.PreDestroy - * - * @author Pete Muir - * @author David Allen - * @param The class of the instance - */ -public interface InjectionTarget extends Producer -{ - - /** - *

- * Performs dependency injection upon the given object. Performs Java EE - * component environment injection, sets the value of all injected fields, - * and calls all initializer methods. - *

- * - * @param instance The instance upon which to perform injection - * @param ctx The {@link javax.enterprise.context.spi.CreationalContext} to - * use for creating new instances - */ - public void inject(T instance, CreationalContext ctx); - - /** - *

- * Calls the {@link javax.annotation.PostConstruct} callback, if it exists, - * according to the semantics required by the Java EE platform specification. - *

- * - * @param instance The instance on which to invoke the - * {@link javax.annotation.PostConstruct} method - */ - public void postConstruct(T instance); - - /** - *

- * Calls the {@link javax.annotation.PreDestroy} callback, if it exists, - * according to the semantics required by the Java EE platform specification. - *

- * - * @param instance The instance on which to invoke the - * {@link javax.annotation.PreDestroy} method - */ - public void preDestroy(T instance); - -} diff --git a/cdi/src/main/java/javax/enterprise/inject/spi/InterceptionType.java b/cdi/src/main/java/javax/enterprise/inject/spi/InterceptionType.java deleted file mode 100644 index 784620ba..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/spi/InterceptionType.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.inject.spi; - -/** - *

Identifies the kind of lifecycle callback, EJB timeout method or - * business method interception.

- * - * @author Gavin King - * @author Pete Muir - * - */ -public enum InterceptionType -{ - - /** - * Intercepts method invocation - */ - AROUND_INVOKE, - - /** - * Intercepts a timeout - */ - AROUND_TIMEOUT, - - /** - * Intercepts bean construction - */ - POST_CONSTRUCT, - - /** - * Intercepts bean destruction - */ - PRE_DESTROY, - - /** - * Intercepts bean passivation - */ - PRE_PASSIVATE, - - /** - * Intercepts bean activation - */ - POST_ACTIVATE -} \ No newline at end of file diff --git a/cdi/src/main/java/javax/enterprise/inject/spi/Interceptor.java b/cdi/src/main/java/javax/enterprise/inject/spi/Interceptor.java deleted file mode 100644 index c3e0322b..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/spi/Interceptor.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.inject.spi; - -import java.lang.annotation.Annotation; -import java.util.Set; - -import javax.interceptor.InvocationContext; - -/** - *

Represents an enabled {@linkplain javax.interceptor interceptor}.

- * - * @author Gavin King - * @author Pete Muir - * @author David Allen - * - * @param the interceptor bean class - */ -public interface Interceptor extends Bean -{ - - /** - *

Obtains the {@linkplain javax.interceptor.InterceptorBinding interceptor bindings} - * of the interceptor.

- * - * @return the set of {@linkplain javax.interceptor.InterceptorBinding interceptor bindings} - */ - public Set getInterceptorBindings(); - - /** - *

Determines if the interceptor intercepts the specified - * {@linkplain InterceptionType kind of lifecycle callback or method invocation}.

- * - * @param type the {@linkplain InterceptionType kind of interception} - * @return returns true if the interceptor intercepts callbacks - * or business methods of the given type, and false otherwise. - */ - public boolean intercepts(InterceptionType type); - - /** - *

Invokes the specified {@linkplain InterceptionType kind of lifecycle - * callback or method invocation interception} upon the given interceptor instance.

- * - * @param type the {@linkplain InterceptionType kind of interception} - * @param instance the interceptor instance to invoke - * @param ctx the context for the invocation - * @return the invocation return value - */ - public Object intercept(InterceptionType type, T instance, InvocationContext ctx); - - -} \ No newline at end of file diff --git a/cdi/src/main/java/javax/enterprise/inject/spi/ObserverMethod.java b/cdi/src/main/java/javax/enterprise/inject/spi/ObserverMethod.java deleted file mode 100644 index 3b1ab665..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/spi/ObserverMethod.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package javax.enterprise.inject.spi; - -import java.lang.annotation.Annotation; -import java.lang.reflect.Type; -import java.util.Set; - -import javax.enterprise.event.Reception; -import javax.enterprise.event.TransactionPhase; - -/** - *

Represents an {@linkplain javax.enterprise.event.Observes observer method} - * of an {@linkplain javax.enterprise.inject enabled bean}. Defines everything - * the container needs to know about an observer method.

- * - * @author Gavin King - * @author David Allen - * @param the event type - */ -public interface ObserverMethod -{ - /** - * Obtains the bean {@linkplain Class class} of the bean that declares the - * observer method. - * - * @return the defining {@linkplain Class class} - */ - public Class getBeanClass(); - - /** - * Obtains the {@linkplain javax.enterprise.event observed event type}. - * - * @return the observed event {@linkplain Type type} - */ - public Type getObservedType(); - - /** - * Obtains the set of {@linkplain javax.enterprise.event observed event qualifiers}. - * - * @return the observed event {@linkplain javax.inject.Qualifier qualifiers} - */ - public Set getObservedQualifiers(); - - /** - * Obtains the specified {@link Reception} for the observer method. This - * indicates if the observer is conditional or not. - * - * @return the {@link Reception} - */ - public Reception getReception(); - - /** - * Obtains the specified {@link TransactionPhase} for the observer method. - * - * @return the {@link TransactionPhase} - */ - public TransactionPhase getTransactionPhase(); - - /** - * Calls the observer method, passing the given event object. - * - * @param event the event object - */ - public void notify(T event); -} diff --git a/cdi/src/main/java/javax/enterprise/inject/spi/PassivationCapable.java b/cdi/src/main/java/javax/enterprise/inject/spi/PassivationCapable.java deleted file mode 100644 index feec762a..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/spi/PassivationCapable.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.inject.spi; - -/** - * Indicates that a custom implementation of - * {@link javax.enterprise.inject.spi.Bean} or - * {@link javax.enterprise.context.spi.Contextual} - * is passivation capable. - * - * @author Gavin King - * @author David Allen - * - */ -public interface PassivationCapable -{ - /** - * A string that uniquely identifies the instance of - * {@link javax.enterprise.inject.spi.Bean} or - * {@link javax.enterprise.context.spi.Contextual}. It is - * recommended that the string contain the package name of - * the class that implements {@code Bean} or {@code Contextual}. - * - * @return a unique identifier for the - * {@link javax.enterprise.inject.spi.Bean} or - * {@link javax.enterprise.context.spi.Contextual} - */ - public String getId(); -} diff --git a/cdi/src/main/java/javax/enterprise/inject/spi/ProcessAnnotatedType.java b/cdi/src/main/java/javax/enterprise/inject/spi/ProcessAnnotatedType.java deleted file mode 100644 index af703178..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/spi/ProcessAnnotatedType.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package javax.enterprise.inject.spi; - -/** - *

- * The container fires an event of this type for each Java class or interface - * it discovers in a bean archive, before it reads the declared annotations. - *

- *

- * Any observer of this event is permitted to wrap and/or replace the - * {@link javax.enterprise.inject.spi.AnnotatedType}. The container must use the - * final value of this property, after all observers have been called, to - * discover the types and read the annotations of the program elements. - *

- *

- * For example, the following observer decorates the - * {@link javax.enterprise.inject.spi.AnnotatedType} for every class that is - * discovered by the container. - *

- * - *
- * public <T> void decorateAnnotatedType(@Observes ProcessAnnotatedType<T> pat)
- * {
- *    pat.setAnnotatedType(decorate(pat.getAnnotatedType()));
- * }
- * 
- *

- * If any observer method of a {@code ProcessAnnotatedType} event throws an - * exception, the exception is treated as a definition error by the container. - *

- * - * @author David Allen - * @see AnnotatedType - * @param The class being annotated - */ -public interface ProcessAnnotatedType -{ - /** - * Returns the {@link javax.enterprise.inject.spi.AnnotatedType} object that - * will be used by the container to read the declared annotations. - * - * @return the {@code AnnotatedType} object - */ - public AnnotatedType getAnnotatedType(); - - /** - * Replaces the {@link javax.enterprise.inject.spi.AnnotatedType}. - * - * @param type the new {@link javax.enterprise.inject.spi.AnnotatedType} - * object to use - */ - public void setAnnotatedType(AnnotatedType type); - - /** - * Forces the container to ignore this type. - */ - public void veto(); -} \ No newline at end of file diff --git a/cdi/src/main/java/javax/enterprise/inject/spi/ProcessBean.java b/cdi/src/main/java/javax/enterprise/inject/spi/ProcessBean.java deleted file mode 100644 index 332f8a53..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/spi/ProcessBean.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package javax.enterprise.inject.spi; - -/** - *

- * The container fires an event of this type for each enabled bean, interceptor - * or decorator deployed in a bean archive, before registering the - * {@link javax.enterprise.inject.spi.Bean} object. - *

- *

- * The event object type depends upon what kind of bean was discovered: - *

- *
    - *
  • For a managed bean with bean class X, the container must raise an event - * of type {@link javax.enterprise.inject.spi.ProcessManagedBean}.
  • - *
  • For a session bean with bean class X, the container must raise an event - * of type {@link javax.enterprise.inject.spi.ProcessSessionBean}.
  • - *
  • For a producer method with method return type X of a bean with bean class - * T, the container must raise an event of type - * {@link javax.enterprise.inject.spi.ProcessProducerMethod}.
  • - *
  • For a producer field with field type X of a bean with bean class T, the - * container must raise an event of type - * {@link javax.enterprise.inject.spi.ProcessProducerField}.
  • - *
- *

- * Resources are considered to be producer fields. - *

- *

- * If any observer method of a {@code ProcessBean} event throws an exception, - * the exception is treated as a definition error by the container. - *

- * - * @see Bean - * @author David Allen - * @param The class of the bean - */ -public interface ProcessBean -{ - /** - * Returns the {@link javax.enterprise.inject.spi.AnnotatedType} representing - * the bean class, the {@link javax.enterprise.inject.spi.AnnotatedMethod} - * representing the producer method, or the - * {@link javax.enterprise.inject.spi.AnnotatedField} representing the - * producer field. - * - * @return the {@link javax.enterprise.inject.spi.AnnotatedType} for the bean - * being registered - */ - public Annotated getAnnotated(); - - /** - * Returns the {@link javax.enterprise.inject.spi.Bean} object that is about - * to be registered. The {@link javax.enterprise.inject.spi.Bean} may - * implement {@link javax.enterprise.inject.spi.Interceptor} or - * {@link javax.decorator.Decorator}. - * - * @return the {@link javax.enterprise.inject.spi.Bean} object about to be - * registered - */ - public Bean getBean(); - - /** - * Registers a definition error with the container, causing the container to - * abort deployment after bean discovery is complete. - * - * @param t The definition error to register as a {@link java.lang.Throwable} - */ - public void addDefinitionError(Throwable t); -} diff --git a/cdi/src/main/java/javax/enterprise/inject/spi/ProcessInjectionTarget.java b/cdi/src/main/java/javax/enterprise/inject/spi/ProcessInjectionTarget.java deleted file mode 100644 index 931b53f8..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/spi/ProcessInjectionTarget.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package javax.enterprise.inject.spi; - -/** - *

- * The container fires an event of this type for every Java EE component class supporting - * injection that may be instantiated by the container at runtime, including every - * managed bean declared using {@code javax.annotation.ManagedBean}, EJB session - * or message-driven bean, enabled bean, enabled interceptor or enabled decorator. - *

- *

- * Any observer of this event is permitted to wrap and/or replace the - * {@link javax.enterprise.inject.spi.InjectionTarget}. 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. - *

- *

- * For example, this observer decorates the {@code InjectionTarget} for all - * servlets. - *

- * - *
- * public <T extends Servlet> void decorateServlet(@Observes ProcessInjectionTarget<T> pit)
- * {
- *    pit.setInjectionTarget(decorate(pit.getInjectionTarget()));
- * }
- * 
- *

- * If any observer method of a {@code ProcessInjectionTarget} event throws an exception, - * the exception is treated as a definition error by the container. - *

- * - * @see InjectionTarget - * @author David Allen - * @param The managed bean class, session bean class or Java EE component - * class supporting injection - */ -public interface ProcessInjectionTarget -{ - /** - * Returns the {@link javax.enterprise.inject.spi.AnnotatedType} representing - * the managed bean class, session bean class or other Java EE component - * class supporting injection. - * - * @return the {@link javax.enterprise.inject.spi.AnnotatedType} of the bean - * with an injection target - */ - public AnnotatedType getAnnotatedType(); - - /** - * Returns the {@link javax.enterprise.inject.spi.InjectionTarget} object - * that will be used by the container to perform injection. - * - * @return the {@link javax.enterprise.inject.spi.InjectionTarget} object - * which performs the injection - */ - public InjectionTarget getInjectionTarget(); - - /** - * Replaces the {@link javax.enterprise.inject.spi.InjectionTarget} which - * performs injection for this target. - * - * @param injectionTarget The new - * {@link javax.enterprise.inject.spi.InjectionTarget} to use - */ - public void setInjectionTarget(InjectionTarget injectionTarget); - - /** - * Registers a definition error with the container, causing the container to - * abort deployment after bean discovery is complete. - * - * @param t A {@link java.lang.Throwable} representing the definition error - */ - public void addDefinitionError(Throwable t); -} diff --git a/cdi/src/main/java/javax/enterprise/inject/spi/ProcessManagedBean.java b/cdi/src/main/java/javax/enterprise/inject/spi/ProcessManagedBean.java deleted file mode 100644 index 143273a5..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/spi/ProcessManagedBean.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package javax.enterprise.inject.spi; - -/** - *

- * The container fires an event of this type for each enabled managed bean, - * before registering the {@link javax.enterprise.inject.spi.Bean} object. - *

- *

- * If any observer method of a {@code ProcessManagedBean} event throws an - * exception, the exception is treated as a definition error by the container. - *

- * - * @author David Allen - * @param The class of the bean - */ -public interface ProcessManagedBean extends ProcessBean -{ - /** - * Returns the {@link javax.enterprise.inject.spi.AnnotatedType} representing - * the bean class. - * - * @return the {@link javax.enterprise.inject.spi.AnnotatedType} for the bean - * being registered - */ - public AnnotatedType getAnnotatedBeanClass(); -} diff --git a/cdi/src/main/java/javax/enterprise/inject/spi/ProcessObserverMethod.java b/cdi/src/main/java/javax/enterprise/inject/spi/ProcessObserverMethod.java deleted file mode 100644 index a2c4e6a1..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/spi/ProcessObserverMethod.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.inject.spi; - -/** - *

- * The container fires an event of this type for each - * {@linkplain javax.enterprise.event.Observes observer method} - * of each enabled bean, before registering the - * {@link javax.enterprise.inject.spi.ObserverMethod} object. - *

- *

- * If any observer method of a {@code ProcessObserverMethod} event throws an - * exception, the exception is treated as a definition error by the container. - *

- * - * @see ObserverMethod - * @author Gavin King - * @author David Allen - * @param The bean type containing the observer method - * @param The type of the event being observed - */ -public interface ProcessObserverMethod -{ - /** - * The {@link javax.enterprise.inject.spi.AnnotatedMethod} representing the - * observer method. - * - * @return the {@link javax.enterprise.inject.spi.AnnotatedMethod} - * representing the observer method - */ - public AnnotatedMethod getAnnotatedMethod(); - - /** - * The {@link javax.enterprise.inject.spi.ObserverMethod} object that will be - * used by the container to invoke the observer when a matching event is - * fired. - * - * @return the {@link javax.enterprise.inject.spi.ObserverMethod} object that - * will be used by the container to call the observer method - */ - public ObserverMethod getObserverMethod(); - - /** - * Registers a definition error with the container, causing the container to - * abort deployment after bean discovery is complete. - * - * @param t A {@link java.lang.Throwable} representing the definition error - */ - public void addDefinitionError(Throwable t); -} diff --git a/cdi/src/main/java/javax/enterprise/inject/spi/ProcessProducer.java b/cdi/src/main/java/javax/enterprise/inject/spi/ProcessProducer.java deleted file mode 100644 index 1b28ef4e..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/spi/ProcessProducer.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.inject.spi; - -/** - *

- * The container fires an event of this type for each - * {@linkplain javax.enterprise.inject.Produces producer method or field} - * of each enabled bean, including resources. - *

- *

- * Any observer of this event is permitted to wrap and/or replace the {@code - * Producer}. The container must use the final value of this property, after all - * observers have been called, whenever it calls the producer or disposer. - *

- *

- * For example, this observer decorates the {@code Producer} for the all producer - * methods and field of type {@code EntityManager}. - *

- * - *
- * void decorateEntityManager(@Observes ProcessProducer<?, EntityManager> pp)
- * {
- *    pit.setProducer(decorate(pp.getProducer()));
- * }
- * 
- *

- * If any observer method of a {@code ProcessProducer} event throws an exception, the - * exception is treated as a definition error by the container. - *

- * - * @see Producer - * @author David Allen - * @param The bean class of the bean that declares the producer method or - * field - * @param The return type of the producer method or the type of the producer - * field - */ -public interface ProcessProducer -{ - /** - * Returns the {@link javax.enterprise.inject.spi.AnnotatedField} - * representing the producer field or the - * {@link javax.enterprise.inject.spi.AnnotatedMethod} representing the - * producer method. - * - * @return the {@link javax.enterprise.inject.spi.AnnotatedMember} - * representing the producer - */ - public AnnotatedMember getAnnotatedMember(); - - /** - * Returns the {@link javax.enterprise.inject.spi.Producer} object that will - * be used by the container to call the producer method or read the producer - * field. - * - * @return the {@link javax.enterprise.inject.spi.Producer} invoker object - * used by the container - */ - public Producer getProducer(); - - /** - * Replaces the {@link javax.enterprise.inject.spi.Producer} object that will - * be used by the container to call the producer method or read the producer - * field. - * - * @param producer the new {@link javax.enterprise.inject.spi.Producer} - * object to use - */ - public void setProducer(Producer producer); - - /** - * Registers a definition error with the container, causing the container to - * abort deployment after bean discovery is complete. - * - * @param t The definition error to register as a {@link java.lang.Throwable} - */ - public void addDefinitionError(Throwable t); -} diff --git a/cdi/src/main/java/javax/enterprise/inject/spi/ProcessProducerField.java b/cdi/src/main/java/javax/enterprise/inject/spi/ProcessProducerField.java deleted file mode 100644 index f4eedbdb..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/spi/ProcessProducerField.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package javax.enterprise.inject.spi; - -/** - *

- * The container fires an event of this type for each enabled producer field, - * before registering the {@link javax.enterprise.inject.spi.Bean} object. - * Resources are considered to be producer fields. - *

- *

- * If any observer method of a {@code ProcessProducerField} event throws an - * exception, the exception is treated as a definition error by the container. - *

- * - * @author David Allen - * @param The class of the producer field - * @param The class of the bean representing the producer field - */ -public interface ProcessProducerField extends ProcessBean -{ - /** - * Returns the {@link javax.enterprise.inject.spi.AnnotatedField} - * representing the producer field. - * - * @return the {@link javax.enterprise.inject.spi.AnnotatedField} for the - * producer field being registered - */ - public AnnotatedField getAnnotatedProducerField(); -} \ No newline at end of file diff --git a/cdi/src/main/java/javax/enterprise/inject/spi/ProcessProducerMethod.java b/cdi/src/main/java/javax/enterprise/inject/spi/ProcessProducerMethod.java deleted file mode 100644 index a2c6fe95..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/spi/ProcessProducerMethod.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package javax.enterprise.inject.spi; - -/** - *

- * The container fires an event of this type for each enabled producer method, - * before registering the {@link javax.enterprise.inject.spi.Bean} object. - *

- *

- * If any observer method of a {@code ProcessProducerMethod} event throws an - * exception, the exception is treated as a definition error by the container. - *

- * - * @author David Allen - * @param The class of the return type of the producer method - * @param The class of the bean representing the producer method - */ -public interface ProcessProducerMethod extends ProcessBean -{ - /** - * Returns the {@link javax.enterprise.inject.spi.AnnotatedMethod} - * representing the producer method. - * - * @return the {@link javax.enterprise.inject.spi.AnnotatedMethod} for the - * producer method being registered - */ - public AnnotatedMethod getAnnotatedProducerMethod(); - - /** - * Returns the {@link javax.enterprise.inject.spi.AnnotatedParameter} for - * any matching injection point of the same type as the producer method - * return type found on a disposal method. - * - * @return the disposal method's {@link javax.enterprise.inject.spi.AnnotatedParameter} - */ - public AnnotatedParameter getAnnotatedDisposedParameter(); -} diff --git a/cdi/src/main/java/javax/enterprise/inject/spi/ProcessSessionBean.java b/cdi/src/main/java/javax/enterprise/inject/spi/ProcessSessionBean.java deleted file mode 100644 index 1ab73384..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/spi/ProcessSessionBean.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.inject.spi; - -/** - *

- * The container fires an event of this type for each enabled session bean, - * before registering the {@link javax.enterprise.inject.spi.Bean} object. - *

- *

- * If any observer method of a {@code ProcessSessionBean} event throws an - * exception, the exception is treated as a definition error by the container. - *

- * - * @author David Allen - * @param - */ -public interface ProcessSessionBean extends ProcessManagedBean -{ - /** - * Returns the EJB name of the session bean. - * - * @return the name of the EJB - */ - public String getEjbName(); - - /** - * Returns a {@link javax.enterprise.inject.spi.SessionBeanType} representing the - * kind of session bean. - * - * @return the {@link javax.enterprise.inject.spi.SessionBeanType} - */ - public SessionBeanType getSessionBeanType(); -} \ No newline at end of file diff --git a/cdi/src/main/java/javax/enterprise/inject/spi/Producer.java b/cdi/src/main/java/javax/enterprise/inject/spi/Producer.java deleted file mode 100644 index 5c5731a2..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/spi/Producer.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package javax.enterprise.inject.spi; - -import java.util.Set; - -import javax.enterprise.context.spi.CreationalContext; - -/** - *

- * Provides a generic operation for producing an instance of a type. - *

- * - * @author Pete Muir - * @author David Allen - * @param The class of object produced by the producer - */ -public interface Producer -{ - /** - *

- * Causes an instance to be produced via the {@code Producer}. - *

- *

- * If the {@code Producer} represents a class, this will invoke the - * constructor annotated {@link javax.inject.Inject} if it exists, or the - * constructor with no parameters otherwise. If the class has interceptors, - * produce() is responsible for building the interceptors and - * decorators of the instance. - *

- *

- * If the {@code Producer} represents a producer field or method, this will - * invoke the producer method on, or access the producer field of, a - * contextual instance of the bean that declares the producer. - *

- * - * @param ctx The {@link javax.enterprise.context.spi.CreationalContext} to - * use for the produced object - * @return the instance produced - */ - public T produce(CreationalContext ctx); - - /** - *

- * Destroys the instance. - *

- *

- * If the {@code Producer} represents a class, then this operation does - * nothing. - *

- *

- * If the {@code Producer} represents a producer field or method, this - * calls the disposer method, if any, on a contextual instance of the - * bean that declares the disposer method or performs any additional - * required cleanup, if any, to destroy state associated with a resource. - *

- * - * @param instance The instance to dispose - */ - public void dispose(T instance); - - /** - *

- * Returns the set of all {@code InjectionPoints}. If the - * {@code Producer} represents a class, then this returns returns the set of - * {@code InjectionPoint} objects representing all injected fields, bean - * constructor parameters and initializer method parameters. For a producer - * method, this returns the set of {@code InjectionPoint} objects - * representing all parameters of the producer method. - *

- * - * @return the set of all - * {@linkplain javax.enterprise.inject.spi.InjectionPoint injection - * points} for the producer - */ - public Set getInjectionPoints(); -} \ No newline at end of file diff --git a/cdi/src/main/java/javax/enterprise/inject/spi/SessionBeanType.java b/cdi/src/main/java/javax/enterprise/inject/spi/SessionBeanType.java deleted file mode 100644 index 65246e2f..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/spi/SessionBeanType.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package javax.enterprise.inject.spi; - -/** - * Identifies the kind of EJB session bean. - * - * @author Gavin King - * - */ -public enum SessionBeanType -{ - /** - * A {@linkplain javax.ejb.Stateless stateless} session bean - */ - STATELESS, - /** - * A {@linkplain javax.ejb.Stateful stateful} session bean - */ - STATEFUL, - /** - * A {@linkplain javax.ejb.Singleton singleton} session bean - */ - SINGLETON -} \ No newline at end of file diff --git a/cdi/src/main/java/javax/enterprise/inject/spi/package-info.java b/cdi/src/main/java/javax/enterprise/inject/spi/package-info.java deleted file mode 100644 index 947a2aa6..00000000 --- a/cdi/src/main/java/javax/enterprise/inject/spi/package-info.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - *

The portable extension integration SPI.

- * - *

A portable extension may integrate with the container by:

- * - *
    - *
  • Providing its own beans, interceptors and decorators to the - * container
  • - *
  • Injecting dependencies into its own objects using the - * dependency injection service
  • - *
  • Providing a context implementation for a custom scope
  • - *
  • Augmenting or overriding the annotation-based metadata with - * metadata from some other source
  • - *
- * - *

The BeanManager object

- * - *

Portable extensions sometimes interact directly with the container - * via programmatic API call. The interface - * {@link javax.enterprise.inject.spi.BeanManager} provides operations - * for obtaining contextual references for beans, along with many other - * operations of use to portable extensions.

- * - *

Container lifecycle events

- * - *

During the application initialization process, the container fires - * a series of {@linkplain javax.enterprise.event events}, allowing - * portable extensions to integrate with the container initialization - * process. Observer methods of these events must belong to - * {@linkplain javax.enterprise.inject.spi.Extension extensions} declared - * in META-INF/services.

- * - *

Lifecycle events include - * {@link javax.enterprise.inject.spi.BeforeBeanDiscovery}, - * {@link javax.enterprise.inject.spi.AfterBeanDiscovery}, - * {@link javax.enterprise.inject.spi.AfterDeploymentValidation} and - * {@link javax.enterprise.inject.spi.BeforeShutdown}.

- * - *

Interfaces representing enabled beans

- * - *

The interfaces - * {@link javax.enterprise.inject.spi.Bean}, - * {@link javax.enterprise.inject.spi.Decorator}, - * {@link javax.enterprise.inject.spi.Interceptor} and - * {@link javax.enterprise.inject.spi.ObserverMethod} - * define everything the container needs to manage instances of - * a bean, interceptor, decorator or observer method.

- * - *

An instance of Bean exists for every - * {@linkplain javax.enterprise.inject enabled bean}. A portable - * extension may add support for new kinds of beans by implementing - * Bean, observing the event - * {@link javax.enterprise.inject.spi.AfterBeanDiscovery} event - * {@linkplain javax.enterprise.inject.spi.AfterBeanDiscovery#addBean(Bean) - * registering beans} with the container. An instance of - * ObserverMethod exists for every - * {@linkplain javax.enterprise.event observer method} of every - * enabled bean. A portable extension may add observers by implementing - * ObserverMethod and - * {@linkplain javax.enterprise.inject.spi.AfterBeanDiscovery#addObserverMethod(ObserverMethod) - * registering an instance} with the container.

- * - *

A portable extension may be notified of the existence of an - * enabled bean by observing the container lifecycle event type - * {@link javax.enterprise.inject.spi.ProcessBean} or one of its - * {@linkplain javax.enterprise.inject.spi.ProcessBean subtypes}, - * or of the existence of an observer method of an enabled bean by - * observing the event type - * {@link javax.enterprise.inject.spi.ProcessObserverMethod}.

- * - *

Alternate metadata sources

- * - *

A portable extension may provide an alternative metadata - * source, such as configuration by XML.

- * - *

{@link javax.enterprise.inject.spi.Annotated} - * and its subtypes 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. The container must use the operations of - * Annotated and its subinterfaces to discover program - * element types and annotations, instead of directly calling the - * Java Reflection API.

- * - *

A portable extension provides its metadata to the - * container by observing the event - * {@link javax.enterprise.inject.spi.ProcessAnnotatedType} and - * {@linkplain javax.enterprise.inject.spi.ProcessAnnotatedType#setAnnotatedType(AnnotatedType) - * wrapping} the {@link javax.enterprise.inject.spi.AnnotatedType}.

- * - *

Producer and InjectionTarget

- * - * The interfaces {@link javax.enterprise.inject.spi.Producer} and - * {@link javax.enterprise.inject.spi.InjectionTarget} abstract the - * basic lifecycle of (contextual or non-contextual) container managed - * objects, including instantiation and destruction, dependency injection - * and lifecycle callbacks.

- * - *

An instance of {@link javax.enterprise.inject.spi.InjectionTarget} - * may be - * {@linkplain javax.enterprise.inject.spi.BeanManager#createInjectionTarget(AnnotatedType) - * obtained} from the {@link javax.enterprise.inject.spi.BeanManager}, - * allowing a portable extension to request these container services for - * objects under the control of the portable extension.

- * - *

Furthermore, a portable extension may replace the implementation - * of {@link javax.enterprise.inject.spi.InjectionTarget} or - * {@link javax.enterprise.inject.spi.Producer} used by the container - * with its own implementation by observing the events - * {@link javax.enterprise.inject.spi.ProcessInjectionTarget} or - * {@link javax.enterprise.inject.spi.ProcessProducer}.

- * - * @see javax.enterprise.inject - * @see javax.enterprise.context.spi - */ -package javax.enterprise.inject.spi; diff --git a/cdi/src/main/java/javax/enterprise/util/AnnotationLiteral.java b/cdi/src/main/java/javax/enterprise/util/AnnotationLiteral.java deleted file mode 100644 index d8268979..00000000 --- a/cdi/src/main/java/javax/enterprise/util/AnnotationLiteral.java +++ /dev/null @@ -1,361 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.util; - -import java.io.Serializable; -import java.lang.annotation.Annotation; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.lang.reflect.ParameterizedType; -import java.lang.reflect.Type; -import java.util.Arrays; - - -/** - *

Supports inline instantiation of annotation type instances.

- * - *

An instance of an annotation type may be obtained by subclassing - * AnnotationLiteral.

- * - *
- * public abstract class PayByQualifier 
- *       extends AnnotationLiteral<PayBy>
- *       implements PayBy {}
- * 
- * - *
- * PayBy paybyCheque = new PayByQualifier() { public PaymentMethod value() { return CHEQUE; } };
- * 
- * - * @author Pete Muir - * @author Gavin King - * - * @param the annotation type - * - * @see javax.enterprise.inject.Instance#select(Annotation...) - * @see javax.enterprise.event.Event#select(Annotation...) - * - */ -public abstract class AnnotationLiteral - implements Annotation, Serializable -{ - - private transient Class annotationType; - private transient Method[] members; - - protected AnnotationLiteral() {} - - private Method[] getMembers() - { - if (members==null) { - members = annotationType().getDeclaredMethods(); - if ( members.length>0 && !annotationType().isAssignableFrom(this.getClass()) ) - { - throw new RuntimeException(getClass() + " does not implement the annotation type with members " + annotationType().getName()); - } - } - return members; - } - - private static Class getAnnotationLiteralSubclass(Class clazz) - { - Class superclass = clazz.getSuperclass(); - if (superclass.equals(AnnotationLiteral.class)) - { - return clazz; - } - else if (superclass.equals(Object.class)) - { - return null; - } - else - { - return (getAnnotationLiteralSubclass(superclass)); - } - } - - @SuppressWarnings("unchecked") - private static Class getTypeParameter(Class annotationLiteralSuperclass) - { - Type type = annotationLiteralSuperclass.getGenericSuperclass(); - if (type instanceof ParameterizedType) - { - ParameterizedType parameterizedType = (ParameterizedType) type; - if (parameterizedType.getActualTypeArguments().length == 1) - { - return (Class) parameterizedType - .getActualTypeArguments()[0]; - } - } - return null; - } - - public Class annotationType() - { - if (annotationType==null) - { - Class annotationLiteralSubclass = getAnnotationLiteralSubclass(this.getClass()); - if (annotationLiteralSubclass == null) - { - throw new RuntimeException(getClass() + "is not a subclass of AnnotationLiteral"); - } - annotationType = getTypeParameter(annotationLiteralSubclass); - if (annotationType == null) - { - throw new RuntimeException(getClass() + " does not specify the type parameter T of AnnotationLiteral"); - } - } - return annotationType; - } - - @Override - public String toString() - { - StringBuilder string = new StringBuilder(); - string.append('@').append(annotationType().getName()).append('('); - for (int i = 0; i < getMembers().length; i++) - { - string.append(getMembers()[i].getName()).append('='); - Object value = invoke(getMembers()[i], this); - assertMemberValueNotNull(getMembers()[i], this, value); - if (value instanceof boolean[]) - { - appendInBraces(string, Arrays.toString((boolean[])value)); - } - else if (value instanceof byte[]) - { - appendInBraces(string, Arrays.toString((byte[])value)); - } - else if (value instanceof short[]) - { - appendInBraces(string, Arrays.toString((short[])value)); - } - else if (value instanceof int[]) - { - appendInBraces(string, Arrays.toString((int[])value)); - } - else if (value instanceof long[]) - { - appendInBraces(string, Arrays.toString((long[])value)); - } - else if (value instanceof float[]) - { - appendInBraces(string, Arrays.toString((float[])value)); - } - else if (value instanceof double[]) - { - appendInBraces(string, Arrays.toString((double[])value)); - } - else if (value instanceof char[]) - { - appendInBraces(string, Arrays.toString((char[])value)); - } - else if (value instanceof String[]) - { - String[] strings = (String[]) value; - String[] quoted = new String[strings.length]; - for(int j=0; j[]) - { - Class[] classes = (Class[]) value; - String[] names = new String[classes.length]; - for(int j=0; j) - { - string.append(((Class)value).getName()).append(".class"); - } - else - { - string.append(value); - } - if (i < getMembers().length - 1) - { - string.append(", "); - } - } - return string.append(')').toString(); - } - - private void appendInBraces(StringBuilder buf, String s) { - buf.append('{').append(s.substring(1,s.length()-1)).append('}'); - } - - @Override - public boolean equals(Object other) - { - if (other instanceof Annotation) - { - Annotation that = (Annotation) other; - if (this.annotationType().equals(that.annotationType())) - { - for (Method member : getMembers()) - { - Object thisValue = invoke(member, this); - assertMemberValueNotNull(member, this, thisValue); - Object thatValue = invoke(member, that); - assertMemberValueNotNull(member, this, thatValue); - if (thisValue instanceof byte[] && thatValue instanceof byte[]) - { - if ( !Arrays.equals((byte[])thisValue, (byte[])thatValue) ) return false; - } - else if (thisValue instanceof short[] && thatValue instanceof short[]) - { - if ( !Arrays.equals((short[])thisValue, (short[])thatValue) ) return false; - } - else if (thisValue instanceof int[] && thatValue instanceof int[]) - { - if ( !Arrays.equals((int[])thisValue, (int[])thatValue) ) return false; - } - else if (thisValue instanceof long[] && thatValue instanceof long[]) - { - if ( !Arrays.equals((long[])thisValue, (long[])thatValue) ) return false; - } - else if (thisValue instanceof float[] && thatValue instanceof float[]) - { - if ( !Arrays.equals((float[])thisValue, (float[])thatValue) ) return false; - } - else if (thisValue instanceof double[] && thatValue instanceof double[]) - { - if ( !Arrays.equals((double[])thisValue, (double[])thatValue) ) return false; - } - else if (thisValue instanceof char[] && thatValue instanceof char[]) - { - if ( !Arrays.equals((char[])thisValue, (char[])thatValue) ) return false; - } - else if (thisValue instanceof boolean[] && thatValue instanceof boolean[]) - { - if ( !Arrays.equals((boolean[])thisValue, (boolean[])thatValue) ) return false; - } - else if (thisValue instanceof Object[] && thatValue instanceof Object[]) - { - if ( !Arrays.equals((Object[])thisValue, (Object[])thatValue) ) return false; - } - else - { - if (!thisValue.equals(thatValue)) return false; - } - } - return true; - } - } - return false; - } - - @Override - public int hashCode() - { - int hashCode = 0; - for (Method member: getMembers()) - { - int memberNameHashCode = 127 * member.getName().hashCode(); - Object value = invoke(member, this); - assertMemberValueNotNull(member, this, value); - int memberValueHashCode; - if (value instanceof boolean[]) - { - memberValueHashCode = Arrays.hashCode((boolean[]) value); - } - else if (value instanceof short[]) - { - memberValueHashCode = Arrays.hashCode((short[]) value); - } - else if (value instanceof int[]) - { - memberValueHashCode = Arrays.hashCode((int[]) value); - } - else if (value instanceof long[]) - { - memberValueHashCode = Arrays.hashCode((long[]) value); - } - else if (value instanceof float[]) - { - memberValueHashCode = Arrays.hashCode((float[]) value); - } - else if (value instanceof double[]) - { - memberValueHashCode = Arrays.hashCode((double[]) value); - } - else if (value instanceof byte[]) - { - memberValueHashCode = Arrays.hashCode((byte[]) value); - } - else if (value instanceof char[]) - { - memberValueHashCode = Arrays.hashCode((char[]) value); - } - else if (value instanceof Object[]) - { - memberValueHashCode = Arrays.hashCode((Object[]) value); - } - else - { - memberValueHashCode = value.hashCode(); - } - hashCode += memberNameHashCode ^ memberValueHashCode; - } - return hashCode; - } - - private static Object invoke(Method method, Object instance) - { - try - { - if (!method.isAccessible()) method.setAccessible(true); - return method.invoke(instance); - } - catch (IllegalArgumentException e) - { - throw new RuntimeException("Error checking value of member method " + method.getName() + " on " + method.getDeclaringClass(), e); - } - catch (IllegalAccessException e) - { - throw new RuntimeException("Error checking value of member method " + method.getName() + " on " + method.getDeclaringClass(), e); - } - catch (InvocationTargetException e) - { - throw new RuntimeException("Error checking value of member method " + method.getName() + " on " + method.getDeclaringClass(), e); - } - } - - private static void assertMemberValueNotNull(Method member, Annotation instance, Object value) - { - if (value == null) - { - throw new IllegalArgumentException("Annotation member " + instance.getClass().getName() + "." + member.getName() + " must not be null"); - } - } - -} diff --git a/cdi/src/main/java/javax/enterprise/util/Nonbinding.java b/cdi/src/main/java/javax/enterprise/util/Nonbinding.java deleted file mode 100644 index c024198d..00000000 --- a/cdi/src/main/java/javax/enterprise/util/Nonbinding.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.util; - -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - *

Excludes a member of an annotation type (such as a - * {@linkplain javax.inject.Qualifier qualifier type} or - * {@linkplain javax.interceptor interceptor binding type}) - * from consideration when the container compares two - * annotation instances.

- * - *
- * @Qualifier
- * @Retention(RUNTIME)
- * @Target({METHOD, FIELD, PARAMETER, TYPE})
- * public @interface PayBy {
- *    PaymentMethod value();
- *    @Nonbinding String comment();
- * }
- * 
- * - * @author Gavin King - * - * @see javax.inject.Qualifier @Qualifier - * @see javax.interceptor.InterceptorBinding @InterceptorBinding - * - */ -@Retention(RUNTIME) -@Target(METHOD) -public @interface Nonbinding -{ -} diff --git a/cdi/src/main/java/javax/enterprise/util/TypeLiteral.java b/cdi/src/main/java/javax/enterprise/util/TypeLiteral.java deleted file mode 100644 index d7edea6b..00000000 --- a/cdi/src/main/java/javax/enterprise/util/TypeLiteral.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.enterprise.util; - -import java.io.Serializable; -import java.lang.reflect.GenericArrayType; -import java.lang.reflect.ParameterizedType; -import java.lang.reflect.Type; - -/** - *

Supports inline instantiation of objects that represent parameterized types - * with actual type parameters.

- * - *

An object that represents any parameterized type may be obtained by - * subclassing TypeLiteral.

- * - *
- * TypeLiteral<List<String>> stringListType = new TypeLiteral<List<String>>() {};
- * 
- * - * @author Gavin King - * @author Pete Muir - * - * @param the type, including all actual type parameters - * - * @see javax.enterprise.inject.Instance#select(TypeLiteral, Annotation...) - * @see javax.enterprise.event.Event#select(TypeLiteral, Annotation...) - * - */ -public abstract class TypeLiteral implements Serializable -{ - - private transient Type actualType; - - protected TypeLiteral() {} - - /** - * @return the actual type represented by this object - */ - public final Type getType() - { - if (actualType==null) - { - Class typeLiteralSubclass = getTypeLiteralSubclass(this.getClass()); - if (typeLiteralSubclass == null) - { - throw new RuntimeException(getClass() + " is not a subclass of TypeLiteral"); - } - actualType = getTypeParameter(typeLiteralSubclass); - if (actualType == null) - { - throw new RuntimeException(getClass() + " does not specify the type parameter T of TypeLiteral"); - } - } - return actualType; - } - - /** - * @return the raw type represented by this object - */ - @SuppressWarnings("unchecked") - public final Class getRawType() { - Type type = getType(); - if (type instanceof Class) - { - return (Class) type; - } - else if (type instanceof ParameterizedType) - { - return (Class) ((ParameterizedType) type).getRawType(); - } - else if (type instanceof GenericArrayType) - { - return (Class) Object[].class; - } - else - { - throw new RuntimeException("Illegal type"); - } - } - - private static Class getTypeLiteralSubclass(Class clazz) - { - Class superclass = clazz.getSuperclass(); - if (superclass.equals(TypeLiteral.class)) - { - return clazz; - } - else if (superclass.equals(Object.class)) - { - return null; - } - else - { - return (getTypeLiteralSubclass(superclass)); - } - } - - private static Type getTypeParameter(Class superclass) - { - Type type = superclass.getGenericSuperclass(); - if (type instanceof ParameterizedType) - { - ParameterizedType parameterizedType = (ParameterizedType) type; - if (parameterizedType.getActualTypeArguments().length == 1) - { - return parameterizedType.getActualTypeArguments()[0]; - } - } - return null; - } - - @Override - public boolean equals(Object obj) { - if (obj instanceof TypeLiteral) - { - TypeLiteral that = (TypeLiteral) obj; - return this.getType().equals(that.getType()); - } - return false; - } - - @Override - public int hashCode() { - return getType().hashCode(); - } - - @Override - public String toString() - { - return getType().toString(); - } - -} diff --git a/cdi/src/main/java/javax/enterprise/util/package-info.java b/cdi/src/main/java/javax/enterprise/util/package-info.java deleted file mode 100644 index 85548eea..00000000 --- a/cdi/src/main/java/javax/enterprise/util/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Contains shared, general-purpose helper classes and annotations. - */ -package javax.enterprise.util; \ No newline at end of file diff --git a/cdi/src/main/javadoc/overview.html b/cdi/src/main/javadoc/overview.html deleted file mode 100644 index cc04eda1..00000000 --- a/cdi/src/main/javadoc/overview.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - -

Contexts and Dependency Injection (CDI) defines a set of -complementary services that help improve the structure of application -code.

- -
    -
  • A well-defined lifecycle for stateful -{@linkplain javax.enterprise.inject beans} bound to well-defined -lifecycle {@linkplain javax.enterprise.context contexts}, where -the set of contexts is {@linkplain javax.enterprise.context.spi -extensible}
  • -
  • A sophisticated, typesafe {@linkplain javax.enterprise.inject -dependency injection mechanism}, including the ability to select -dependencies at either {@linkplain javax.inject.Qualifier development} -or {@linkplain javax.enterprise.inject.Alternative deployment} time, -without verbose configuration
  • -
  • Support for Java EE modularity and the Java EE component -architecture—the modular structure of a Java EE application is -taken into account when resolving dependencies between Java EE -components
  • -
  • {@linkplain javax.enterprise.inject Integration} with the -Unified Expression Language, allowing any bean to be used directly -within a JSF or JSP page
  • -
  • The ability to {@linkplain javax.decorator decorate} injected -beans
  • -
  • The ability to associate -{@linkplain javax.interceptor interceptors} with beans via typesafe -{@linkplain javax.enterprise.inject interceptor bindings}
  • -
  • An {@linkplain javax.enterprise.event event} notification model
  • -
  • A web {@linkplain javax.enterprise.context.ConversationScoped -conversation context} in addition to the three standard -web contexts defined by the Java Servlets specification
  • -
  • An {@linkplain javax.enterprise.inject.spi SPI} allowing portable -extensions to integrate cleanly with the container
  • -
- -

CDI allows objects to be bound to lifecycle contexts, to be -injected, to be associated with interceptors and decorators, and to -interact in a loosely coupled fashion by -{@linkplain javax.enterprise.event.Event firing} and -{@linkplain javax.enterprise.event.Observes observing} events. -{@linkplain javax.enterprise.inject Various kinds} of objects are -injectable, including EJB 3 session beans, managed beans, -{@linkplain javax.enterprise.inject.Produces producer methods} and -Java EE resources. We refer to these objects in general terms as beans -and to instances of beans that are bound to contexts as contextual -instances.

- - - - \ No newline at end of file diff --git a/cdi/src/main/resources/beans_1_0.xsd b/cdi/src/main/resources/beans_1_0.xsd deleted file mode 100644 index abe4d936..00000000 --- a/cdi/src/main/resources/beans_1_0.xsd +++ /dev/null @@ -1,181 +0,0 @@ - - - - - - - - - Contexts and Dependency Injection (CDI) defines - a set of complementary services that help improve the structure - of application code. beans.xml is used to enable CDI services - for the current bean archive as well as to enable named - interceptors, decorators and alternatives for the current bean - archive. - - - - - - - Bean classes of enabled beans must be - deployed in bean archives. A library jar, EJB jar, - application client jar or rar archive is a bean archive if - it has a file named beans.xml in the META-INF directory. The - WEB-INF/classes directory of a war is a bean archive if - there is a file named beans.xml in the WEB-INF directory of - the war. A directory in the JVM classpath is a bean archive - if it has a file named beans.xml in the META-INF directory. - - - - - - - - - - - - - - - - By default, a bean archive has no enabled - interceptors bound via interceptor bindings. An interceptor - must be explicitly enabled by listing its class under the - <interceptors> element of the beans.xml file of the - bean archive. The order of the interceptor declarations - determines the interceptor ordering. Interceptors which - occur earlier in the list are called first. If the same - class is listed twice under the <interceptors> - element, the container automatically detects the problem and - treats it as a deployment problem. - - - - - - - - Each child <class> element - must specify the name of an interceptor class. If - there is no class with the specified name, or if - the class with the specified name is not an - interceptor class, the container automatically - detects the problem and treats it as a deployment - problem. - - - - - - - - - - - By default, a bean archive has no enabled - decorators. A decorator must be explicitly enabled by - listing its bean class under the <decorators> element - of the beans.xml file of the bean archive. The order of the - decorator declarations determines the decorator ordering. - Decorators which occur earlier in the list are called first. - If the same class is listed twice under the - <decorators> element, the container automatically - detects the problem and treats it as a deployment problem. - - - - - - - - Each child <class> element - must specify the name of a decorator class. If - there is no class with the specified name, or if - the class with the specified name is not a - decorator class, the container automatically - detects the problem and treats it as a deployment - problem. - - - - - - - - - - - An alternative is a bean that must be - explicitly declared in the beans.xml file if it should be - available for lookup, injection or EL resolution. By - default, a bean archive has no selected alternatives. An - alternative must be explicitly declared using the - <alternatives> element of the beans.xml file of the - bean archive. The <alternatives> element contains a - list of bean classes and stereotypes. An alternative is - selected for the bean archive if either: the alternative is - a managed bean or session bean and the bean class of the - bean is listed, or the alternative is a producer method, - field or resource, and the bean class that declares the - method or field is listed, or any @Alternative stereotype of - the alternative is listed. - - - - - - - - Each child <class> element - must specify the name of an alternative bean class. - If there is no class with the specified name, or if - the class with the specified name is not an - alternative bean class, the container automatically - detects the problem and treats it as a deployment - problem. If the same class is listed twice under - the <alternatives> element, the container - automatically detects the problem and treats it as - a deployment problem. - - - - - - - - Each child <stereotype> - element must specify the name of an @Alternative - stereotype annotation. If there is no annotation - with the specified name, or the annotation is not - an @Alternative stereotype, the container - automatically detects the problem and treats it as - a deployment problem. If the same stereotype is - listed twice under the <alternatives> - element, the container automatically detects the - problem and treats it as a deployment problem. - - - - - - - - diff --git a/cdi/src/test/java/org/jboss/cdi/api/test/AnnotationLiteralTest.java b/cdi/src/test/java/org/jboss/cdi/api/test/AnnotationLiteralTest.java deleted file mode 100644 index 7a623718..00000000 --- a/cdi/src/test/java/org/jboss/cdi/api/test/AnnotationLiteralTest.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.jboss.cdi.api.test; - -import org.jboss.cdi.api.test.Foo.FooLiteral; -import org.testng.annotations.Test; - -@Foo(name="pete") -public class AnnotationLiteralTest -{ - - @Test(expectedExceptions=IllegalArgumentException.class) - public void testNullMemberValueOnHashCode() - { - new FooLiteral(null).hashCode(); - } - - @Test(expectedExceptions=IllegalArgumentException.class) - public void testNullMemberValueOnEquals1() - { - new FooLiteral(null).equals(AnnotationLiteralTest.class.getAnnotation(Foo.class)); - } - - @Test(expectedExceptions=IllegalArgumentException.class) - public void testNullMemberValueOnEquals2() - { - new FooLiteral(null).equals(new FooLiteral(null)); - } - - @Test(expectedExceptions=IllegalArgumentException.class) - public void testNullMemberValueOnToString() - { - new FooLiteral(null).hashCode(); - } - -} diff --git a/cdi/src/test/java/org/jboss/cdi/api/test/Foo.java b/cdi/src/test/java/org/jboss/cdi/api/test/Foo.java deleted file mode 100644 index d4abed78..00000000 --- a/cdi/src/test/java/org/jboss/cdi/api/test/Foo.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.jboss.cdi.api.test; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - -import javax.enterprise.util.AnnotationLiteral; - -@Retention(RetentionPolicy.RUNTIME) -public @interface Foo -{ - - public String name(); - - public class FooLiteral extends AnnotationLiteral implements Foo - { - - private final String name; - - public FooLiteral(String name) - { - this.name = name; - } - - public String name() - { - return name; - } - - } - -} diff --git a/parent/pom.xml b/parent/pom.xml index 3703779e..7a27256e 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -3,21 +3,21 @@ org.jboss.weld weld-api-bom - 1.0-SNAPSHOT + 1.1-SNAPSHOT ../bom/pom.xml org.jboss.weld weld-api-parent pom - Weld and CDI APIs Parent + Weld APIs Parent http://www.seamframework.org/Weld - APIs for CDI and Weld, the reference implementation of JSR 299: Contexts and Dependency Injection for Java EE + APIs for Weld, the reference implementation of JSR 299: Contexts and Dependency Injection for Java EE diff --git a/pom.xml b/pom.xml index 4cd2d4c0..22bef88c 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ org.jboss.weld weld-api-build-aggregator pom - 1.0-SNAPSHOT + 1.1-SNAPSHOT org.jboss.weld @@ -11,10 +11,10 @@ 12 - Weld and CDI APIs Build Aggregator + Weld APIs Build Aggregator - The build aggregator for Weld and the CDI APIs, which takes care of calling the modules which make up Weld and CDI APIs + The build aggregator for Weld APIs, which takes care of calling the modules which make up Weld APIs @@ -26,7 +26,6 @@ bom parent - cdi weld weld-spi diff --git a/weld-spi/pom.xml b/weld-spi/pom.xml index 6f62a24b..d2c6b844 100644 --- a/weld-spi/pom.xml +++ b/weld-spi/pom.xml @@ -2,7 +2,7 @@ weld-api-parent org.jboss.weld - 1.0-SNAPSHOT + 1.1-SNAPSHOT ../parent/pom.xml 4.0.0 diff --git a/weld/pom.xml b/weld/pom.xml index 730011bf..689acd44 100644 --- a/weld/pom.xml +++ b/weld/pom.xml @@ -2,7 +2,7 @@ weld-api-parent org.jboss.weld - 1.0-SNAPSHOT + 1.1-SNAPSHOT ../parent/pom.xml 4.0.0