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.
- * - *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:
- *A decorator may be an abstract class, and is not required to - * implement every method of every decorated type.
- * - *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.
- * - *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:
- * - *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:
- * - *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:
- * - *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 conversation is in one of two states: transient - * or long-running.
- * - *All long-running conversations have a string-valued unique - * identifier, which may be set by the application when the - * conversation is marked long-running, or generated by the container.
- * - *If the conversation associated with the current 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:
- * - *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:
- * - *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:
- * - *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.
- * - *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:
- * - *The request context is destroyed:
- * - *Specifies that a bean is session scoped.
- * - *The session scope is active:
- * - *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:
- * - *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.
- * - *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.
- * - *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:
- * - *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:
- * - *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 extends Annotation> 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. - * - * @paramDefines 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 ContextualProvides 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 CreationalContextThe 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:
- * - *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 EventObtains 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:
- * - *The {@link javax.enterprise.event.Event} interface is used to - * fire events.
- * - *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.
- * - *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}.
- * - *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:
- * - *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:
- * - *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:
- * - *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; - - -/** - *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:
- * - *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 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
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 InstanceObtains 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 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:
- * - *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 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:
- * - *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:
- * - *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 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 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.
- * - *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}.
- * - *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}.
- * - *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. - * - *
{@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.
- * - *The container provides built-in support for injection and contextual - * lifecycle management of the following kinds of bean:
- * - *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:
- * - *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}.
- * - *The basic lifecycle and semantics of EJB session beans are defined by the - * EJB specification.
- * - *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:
- * - *A {@linkplain javax.enterprise.inject.Produces producer method or field} - * acts as a source of objects to be injected, where:
- * - *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.
- * - *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.
- * - *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.
- * - *A bean is said to be enabled if:
- * - *Otherwise, the bean is said to be disabled.
- * - *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 following kinds of injection point exist:
- * - *
A bean is assignable to a given injection point if:
- * - *A bean is eligible for injection into a given injection point if:
- * - *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:
- * - *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 names are resolved when Unified EL expressions are evaluated. An EL name - * resolves to a bean if:
- * - *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.
- * - *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:
- * - *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 SetGet program element annotation of a certain annotation type.
- * - * @paramGet all annotations of the program element.
- * - * @return all annotations of the program element, or an empty set if no - * annotations are present - */ - public SetDetermine 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 extends Annotation> 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 - * - * @paramGet the parameters of the callable member.
- * - * @return the parameters - */ - public ListRepresents a constructor of a Java class.
- * - * @author Gavin King - * @author Pete Muir - * - * @paramGet the underlying {@link Constructor}.
- * - * @return the constructor - */ - public ConstructorRepresents a field of a Java class.
- * - * @author Gavin King - * @author Pete Muir - * - * @paramGet 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 - * - * @paramGet 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 AnnotatedTypeRepresents a method of a Java type.
- * - * @author Gavin King - * @author Pete Muir - * - * @paramGet 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 - * - * @paramGet 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 AnnotatedCallableRepresents a Java class or interface.
- * - * @author Gavin King - * @author Pete Muir - * - * @paramGet the underlying {@link java.lang.Class}.
- * - * @return the {@link java.lang.Class} - */ - public ClassGet 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 SetGet the {@linkplain AnnotatedMethod methods} of the type.
- * - * @return the methods, or an empty set if none are defined - */ - public SetGet the {@linkplain AnnotatedField fields} of the type.
- *
- * @return the fields, or an empty set if none are defined
- */
- public Set Represents an {@linkplain javax.enterprise.inject enabled bean}. This
- * interface defines everything the container needs to manage instances of
- * the bean. 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: 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.
- * 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.
- *
- * 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.
- * Represents an enabled {@linkplain javax.decorator decorator}. Obtains the {@linkplain Type type} of the
- * {@linkplain javax.decorator.Delegate delegate injection point}. Obtains the {@linkplain javax.inject.Qualifier qualifiers} of the
- * {@linkplain javax.decorator.Delegate delegate injection point}. Obtains the {@linkplain javax.decorator decorated types}. 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}. 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. Only {@linkplain javax.enterprise.context.Dependent dependent} objects, may
- * obtain information about the injection point to which they belong.
- * Provides operations for performing
- * {@linkplain javax.enterprise.inject dependency injection} and
- * lifecycle callbacks on an instance of a type.
- *
- * 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.
- *
- * Calls the {@link javax.annotation.PostConstruct} callback, if it exists,
- * according to the semantics required by the Java EE platform specification.
- *
- * Calls the {@link javax.annotation.PreDestroy} callback, if it exists,
- * according to the semantics required by the Java EE platform specification.
- * Identifies the kind of lifecycle callback, EJB timeout method or
- * business method interception. Represents an enabled {@linkplain javax.interceptor interceptor}. Obtains the {@linkplain javax.interceptor.InterceptorBinding interceptor bindings}
- * of the interceptor. Determines if the interceptor intercepts the specified
- * {@linkplain InterceptionType kind of lifecycle callback or method invocation}. Invokes the specified {@linkplain InterceptionType kind of lifecycle
- * callback or method invocation interception} upon the given interceptor instance. 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.
- * 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.
- *
- * If any observer method of a {@code ProcessAnnotatedType} event throws an
- * exception, the exception is treated as a definition error by the container.
- *
- * 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:
- *
- * 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.
- *
- * 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.
- *
- * If any observer method of a {@code ProcessInjectionTarget} event throws an exception,
- * the exception is treated as a definition error by the container.
- *
- * 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.
- *
- * 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.
- *
- * 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}.
- *
- * If any observer method of a {@code ProcessProducer} event throws an exception, the
- * exception is treated as a definition error by the container.
- *
- * 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.
- *
- * 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.
- *
- * 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.
- *
- * @Inject BeanManager manager;
- *
- *
- *
- * @Produces
- * Logger createLogger(InjectionPoint injectionPoint) {
- * return Logger.getLogger( injectionPoint.getMember().getDeclaringClass().getName() );
- * }
- *
- *
- *
- * public <T> void decorateAnnotatedType(@Observes ProcessAnnotatedType<T> pat)
- * {
- * pat.setAnnotatedType(decorate(pat.getAnnotatedType()));
- * }
- *
- *
- *
- *
- * public <T extends Servlet> void decorateServlet(@Observes ProcessInjectionTarget<T> pit)
- * {
- * pit.setInjectionTarget(decorate(pit.getInjectionTarget()));
- * }
- *
- *
- * void decorateEntityManager(@Observes ProcessProducer<?, EntityManager> pp)
- * {
- * pit.setProducer(decorate(pp.getProducer()));
- * }
- *
- *
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
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
Contexts and Dependency Injection (CDI) defines a set of -complementary services that help improve the structure of application -code.
- -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 @@ - - - - -