* 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.
*
*
- *
CDI Lite implementations are not required to provide support for decorators.
+ *
+ * CDI Lite implementations are not required to provide support for decorators.
+ *
*
* @see Delegate @Delegate identifies the delegate injection point of a decorator.
*
diff --git a/api/src/main/java/jakarta/decorator/Delegate.java b/api/src/main/java/jakarta/decorator/Delegate.java
index e6cc48c82..84b989f74 100644
--- a/api/src/main/java/jakarta/decorator/Delegate.java
+++ b/api/src/main/java/jakarta/decorator/Delegate.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -30,45 +27,45 @@
* 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.
*
* 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}.
*
CDI Lite implementations are not required to provide support for decorators.
+ *
+ * CDI Lite implementations are not required to provide support for decorators.
+ *
*
* @see Decorator @Decorator specifies that a class is a decorator.
- *
+ *
* @author Gavin King
* @author Pete Muir
*/
diff --git a/api/src/main/java/jakarta/decorator/package-info.java b/api/src/main/java/jakarta/decorator/package-info.java
index 5b1d54560..82a4fa5db 100644
--- a/api/src/main/java/jakarta/decorator/package-info.java
+++ b/api/src/main/java/jakarta/decorator/package-info.java
@@ -1,97 +1,119 @@
/*
- * 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,
+ * 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 jakarta.enterprise.inject beans} which
- * implement those bean types. These bean types are called
- * decorated types.
- *
- *
A decorator is a managed bean annotated {@link
- * jakarta.decorator.Decorator @Decorator}.
- *
- *
Decorators are superficially similar to interceptors,
- * but because they directly implement operations with business
- * semantics, they are able to implement business logic and,
- * conversely, unable to implement the cross-cutting concerns
- * for which interceptors are optimized. Decorators are called
- * after interceptors.
- *
- *
Decorated types
- *
- *
The set of decorated types of a decorator includes all
- * bean types of the managed bean that are Java interfaces,
- * except for {@link java.io.Serializable}. The decorator bean
- * class and its superclasses are not decorated types of the
- * decorator. The decorator class may be abstract.
- *
- *
A decorator intercepts every method:
+ *
+ * Annotations relating to decorators.
+ *
+ *
+ *
+ * A decorator implements one or more bean types and
+ * intercepts business method invocations of
+ * {@linkplain jakarta.enterprise.inject beans} which
+ * implement those bean types. These bean types are called
+ * decorated types.
+ *
+ *
+ *
+ * A decorator is a managed bean annotated {@link
+ * jakarta.decorator.Decorator @Decorator}.
+ *
+ *
+ *
+ * Decorators are superficially similar to interceptors,
+ * but because they directly implement operations with business
+ * semantics, they are able to implement business logic and,
+ * conversely, unable to implement the cross-cutting concerns
+ * for which interceptors are optimized. Decorators are called
+ * after interceptors.
+ *
+ *
+ *
Decorated types
+ *
+ *
+ * The set of decorated types of a decorator includes all
+ * bean types of the managed bean that are Java interfaces,
+ * except for {@link java.io.Serializable}. The decorator bean
+ * class and its superclasses are not decorated types of the
+ * decorator. The decorator class may be abstract.
+ *
+ *
+ *
+ * A decorator intercepts every method:
+ *
*
*
declared by a decorated type of the decorator
*
that is implemented by the bean class of the decorator.
*
- *
- *
A decorator may be an abstract class, and is not required to
- * implement every method of every decorated type.
- *
- *
Delegate injection points
- *
- *
All decorators have a
- * {@linkplain jakarta.decorator.Delegate delegate injection point}.
- * A delegate injection point is an injection point of the bean
- * class annotated {@link jakarta.decorator.Delegate @Delegate}.
- *
- *
The type of the delegate injection point must implement or
- * extend every decorated type. A decorator is not required to
- * implement the type of the delegate injection point.
- *
- *
Enabled decorators
- *
- *
By default, a bean archive has no enabled decorators. A
- * decorator must be explicitly enabled by listing its bean class
+ *
+ *
+ * A decorator may be an abstract class, and is not required to
+ * implement every method of every decorated type.
+ *
+ *
+ *
Delegate injection points
+ *
+ *
+ * All decorators have a
+ * {@linkplain jakarta.decorator.Delegate delegate injection point}.
+ * A delegate injection point is an injection point of the bean
+ * class annotated {@link jakarta.decorator.Delegate @Delegate}.
+ *
+ *
+ *
+ * The type of the delegate injection point must implement or
+ * extend every decorated type. A decorator is not required to
+ * implement the type of the delegate injection point.
+ *
+ *
+ *
Enabled decorators
+ *
+ *
+ * By default, a bean archive has no enabled decorators. A
+ * decorator must be explicitly enabled by listing its bean class
* under the <decorators> element of the
* beans.xml file of the bean archive. The order of the
- * decorator declarations determines the decorator ordering.
- * Decorators which occur earlier in the list are called first.
- *
- *
A decorator is bound to a bean if:
- *
+ * decorator declarations determines the decorator ordering.
+ * Decorators which occur earlier in the list are called first.
+ *
+ *
+ *
+ * A decorator is bound to a bean if:
+ *
+ *
*
- *
The bean is {@linkplain jakarta.enterprise.inject eligible for injection}
+ *
The bean is {@linkplain jakarta.enterprise.inject eligible for injection}
* to the delegate injection point of the decorator.
*
The decorator is enabled in the bean archive of the bean.
*
- *
- *
If a managed bean class is declared final, it may not have
- * decorators. If a managed bean has a non-static, non-private,
+ *
+ *
+ * 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 jakarta.enterprise.context.Dependent dependent object}
- * of the object it decorates.
- *
+ * that method.
+ *
+ *
+ *
+ * A decorator instance is a
+ * {@linkplain jakarta.enterprise.context.Dependent dependent object}
+ * of the object it decorates.
+ *
+ *
* @see jakarta.enterprise.inject
- *
+ *
* @see jakarta.decorator.Decorator
* @see jakarta.decorator.Delegate
- *
+ *
*/
package jakarta.decorator;
-
diff --git a/api/src/main/java/jakarta/enterprise/context/ApplicationScoped.java b/api/src/main/java/jakarta/enterprise/context/ApplicationScoped.java
index df4b0a0ba..19c47b9b2 100644
--- a/api/src/main/java/jakarta/enterprise/context/ApplicationScoped.java
+++ b/api/src/main/java/jakarta/enterprise/context/ApplicationScoped.java
@@ -1,8 +1,5 @@
/*
- * 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.
@@ -35,8 +32,8 @@
*
*
* While ApplicationScoped must be associated with the built-in application context required by the specification,
- * third-party extensions are
- * allowed to also associate it with their own context. Behavior described below is only related to the built-in application context.
+ * third-party extensions are allowed to also associate it with their own context. Behavior described below is only related to
+ * the built-in application context.
*
*
*
@@ -44,8 +41,8 @@
*
*
*
- *
during the service() method of any servlet in the web application, during the doFilter() method of any
- * servlet filter and when the container calls any ServletContextListener, HttpSessionListener,
+ *
during the service() method of any servlet in the web application, during the doFilter() method
+ * of any servlet filter and when the container calls any ServletContextListener, HttpSessionListener,
* AsyncListener or ServletRequestListener,
*
during any Java EE web service invocation,
*
during any remote method invocation of any EJB, during any asynchronous method invocation of any EJB, during any call to
@@ -65,15 +62,15 @@
*
*
*
- * An event with qualifier @Initialized(ApplicationScoped.class) is fired when the application context is initialized
- * and an event with qualifier @Destroyed(ApplicationScoped.class) when the application context is destroyed.
- * The event payload is:
- *
- *
- *
- *
the ServletContext if the application is a web application deployed to a Servlet container, or
- *
any java.lang.Object for other types of application.
- *
+ * An event with qualifier @Initialized(ApplicationScoped.class) is fired when the application context is
+ * initialized and an event with qualifier @Destroyed(ApplicationScoped.class) when the application context is
+ * destroyed. The event payload is:
+ *
+ *
+ *
+ *
the ServletContext if the application is a web application deployed to a Servlet container, or
+ *
any java.lang.Object for other types of application.
+ *
*
* @author Gavin King
* @author Pete Muir
@@ -94,7 +91,7 @@
* @since 2.0
*/
public final static class Literal extends AnnotationLiteral implements ApplicationScoped {
-
+ /** Default ApplicationScoped literal */
public static final Literal INSTANCE = new Literal();
private static final long serialVersionUID = 1L;
diff --git a/api/src/main/java/jakarta/enterprise/context/BeforeDestroyed.java b/api/src/main/java/jakarta/enterprise/context/BeforeDestroyed.java
index 6d1175a15..36614d6aa 100644
--- a/api/src/main/java/jakarta/enterprise/context/BeforeDestroyed.java
+++ b/api/src/main/java/jakarta/enterprise/context/BeforeDestroyed.java
@@ -1,8 +1,5 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2016, 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.
@@ -32,7 +29,7 @@
import jakarta.inject.Qualifier;
/**
- * An event with this qualifier is fired when a context is about to be destroyed, i.e. before the actual destruction.
+ * An event with this qualifier is fired when a context is about to be destroyed, i.e. before the actual destruction.
*
* @author Pete Muir
* @author Martin Kouba
@@ -48,6 +45,7 @@
/**
* The scope for which to observe destruction
+ *
* @return the scope type class
*/
Class extends Annotation> value();
@@ -56,19 +54,29 @@
* Supports inline instantiation of the {@link BeforeDestroyed} qualifier.
*/
public final static class Literal extends AnnotationLiteral implements BeforeDestroyed {
+ /** Default BeforeDestroyed literal for the RequestScoped scope */
+ public static final Literal REQUEST = of(RequestScoped.class);
- public static final Literal REQUEST = of(RequestScoped.class);
-
+ /** Default BeforeDestroyed literal for the ConversationScoped scope */
public static final Literal CONVERSATION = of(ConversationScoped.class);
-
+
+ /** Default BeforeDestroyed literal for the SessionScoped scope */
public static final Literal SESSION = of(SessionScoped.class);
-
+
+ /** Default BeforeDestroyed literal for the ApplicationScoped scope */
public static final Literal APPLICATION = of(ApplicationScoped.class);
-
+
private static final long serialVersionUID = 1L;
+ /** The scope annotation */
private final Class extends Annotation> value;
+ /**
+ * Obtain the literal for the provided scope annotation
+ *
+ * @param value the scope annotation
+ * @return a new literal value for the provided scope annotation
+ */
public static Literal of(Class extends Annotation> value) {
return new Literal(value);
}
diff --git a/api/src/main/java/jakarta/enterprise/context/BusyConversationException.java b/api/src/main/java/jakarta/enterprise/context/BusyConversationException.java
index 21f3b0bbc..eafa12df2 100644
--- a/api/src/main/java/jakarta/enterprise/context/BusyConversationException.java
+++ b/api/src/main/java/jakarta/enterprise/context/BusyConversationException.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -22,7 +19,7 @@
* 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
@@ -30,10 +27,12 @@
* lifecycle.
*
*
- *
CDI Lite implementations are not required to provide support for conversations.
- *
+ *
+ * CDI Lite implementations are not required to provide support for conversations.
+ *
+ *
* @see ConversationScoped
- *
+ *
* @author Pete Muir
* @author Gavin King
*/
@@ -42,18 +41,37 @@ public class BusyConversationException extends ContextException {
private static final long serialVersionUID = -3599813072560026919L;
+ /**
+ * Creates the exception with no detail message or cause.
+ */
public BusyConversationException() {
super();
}
+ /**
+ * Creates the exception with given detail message.
+ *
+ * @param message the detail message
+ */
public BusyConversationException(String message) {
super(message);
}
+ /**
+ * Creates the exception with given cause.
+ *
+ * @param cause the cause
+ */
public BusyConversationException(Throwable cause) {
super(cause);
}
+ /**
+ * Creates the exception with given detail message and cause.
+ *
+ * @param message the detail message
+ * @param cause the cause
+ */
public BusyConversationException(String message, Throwable cause) {
super(message, cause);
}
diff --git a/api/src/main/java/jakarta/enterprise/context/ContextException.java b/api/src/main/java/jakarta/enterprise/context/ContextException.java
index 4c371893a..cd921ad5f 100644
--- a/api/src/main/java/jakarta/enterprise/context/ContextException.java
+++ b/api/src/main/java/jakarta/enterprise/context/ContextException.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -21,7 +18,7 @@
*
* Indicates a problem relating to context management.
*
- *
+ *
* @author Pete Muir
* @author Shane Bryzak
*/
@@ -29,18 +26,37 @@ public class ContextException extends RuntimeException {
private static final long serialVersionUID = -3599813072560026919L;
+ /**
+ * Creates the exception with no detail message or cause.
+ */
public ContextException() {
super();
}
+ /**
+ * Creates the exception with given detail message.
+ *
+ * @param message the detail message
+ */
public ContextException(String message) {
super(message);
}
+ /**
+ * Creates the exception with given cause.
+ *
+ * @param cause the cause
+ */
public ContextException(Throwable cause) {
super(cause);
}
+ /**
+ * Creates the exception with given detail message and cause.
+ *
+ * @param message the detail message
+ * @param cause the cause
+ */
public ContextException(String message, Throwable cause) {
super(message, cause);
}
diff --git a/api/src/main/java/jakarta/enterprise/context/ContextNotActiveException.java b/api/src/main/java/jakarta/enterprise/context/ContextNotActiveException.java
index 05426576a..9ae4e5b1a 100644
--- a/api/src/main/java/jakarta/enterprise/context/ContextNotActiveException.java
+++ b/api/src/main/java/jakarta/enterprise/context/ContextNotActiveException.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -23,9 +20,9 @@
*
* Indicates that a context is not active.
*
- *
+ *
* @see Context
- *
+ *
* @author Pete Muir
* @author Shane Bryzak
* @author Gavin King
@@ -35,18 +32,37 @@ public class ContextNotActiveException extends ContextException {
private static final long serialVersionUID = -3599813072560026919L;
+ /**
+ * Creates the exception with no detail message or cause.
+ */
public ContextNotActiveException() {
super();
}
+ /**
+ * Creates the exception with given detail message.
+ *
+ * @param message the detail message
+ */
public ContextNotActiveException(String message) {
super(message);
}
+ /**
+ * Creates the exception with given cause.
+ *
+ * @param cause the cause
+ */
public ContextNotActiveException(Throwable cause) {
super(cause);
}
+ /**
+ * Creates the exception with given detail message and cause.
+ *
+ * @param message the detail message
+ * @param cause the cause
+ */
public ContextNotActiveException(String message, Throwable cause) {
super(message, cause);
}
diff --git a/api/src/main/java/jakarta/enterprise/context/Conversation.java b/api/src/main/java/jakarta/enterprise/context/Conversation.java
index 4bd3fccf0..c30a7d65e 100644
--- a/api/src/main/java/jakarta/enterprise/context/Conversation.java
+++ b/api/src/main/java/jakarta/enterprise/context/Conversation.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -22,28 +19,30 @@
* 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.
*
*
- *
CDI Lite implementations are not required to provide support for conversations.
- *
+ *
+ * CDI Lite implementations are not required to provide support for conversations.
+ *
+ *
* @see ConversationScoped @ConversationScoped
- *
+ *
* @author Pete Muir
* @author Gavin King
- *
+ *
*/
public interface Conversation {
@@ -51,7 +50,7 @@ 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();
@@ -60,7 +59,7 @@ public interface Conversation {
*
* Mark the current transient conversation long-running, with a specified identifier.
*
- *
+ *
* @param id conversation id
* @throws IllegalStateException if the current conversation is already marked long-running.
* @throws IllegalArgumentException if a conversation with the specified identifier already exists.
@@ -71,7 +70,7 @@ public interface Conversation {
*
* Marks the current long-running conversation transient.
*
- *
+ *
* @throws IllegalStateException if the current conversation is already marked transient.
*/
public void end();
@@ -80,7 +79,7 @@ public interface Conversation {
*
* 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.
*/
@@ -90,7 +89,7 @@ public interface Conversation {
*
* Get the timeout of the current conversation.
*
- *
+ *
* @return the current timeout in milliseconds.
*/
public long getTimeout();
@@ -99,7 +98,7 @@ public interface Conversation {
*
* Set the timeout of the current conversation.
*
- *
+ *
* @param milliseconds the new timeout in milliseconds.
*/
public void setTimeout(long milliseconds);
@@ -108,7 +107,7 @@ public interface Conversation {
*
* 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();
diff --git a/api/src/main/java/jakarta/enterprise/context/ConversationScoped.java b/api/src/main/java/jakarta/enterprise/context/ConversationScoped.java
index 8eaaa2624..fce2cac44 100644
--- a/api/src/main/java/jakarta/enterprise/context/ConversationScoped.java
+++ b/api/src/main/java/jakarta/enterprise/context/ConversationScoped.java
@@ -1,8 +1,5 @@
/*
- * 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.
@@ -33,10 +30,10 @@
*
* Specifies that a bean is conversation scoped.
*
- *
- * While ConversationScoped must be associated with the built-in conversation context required by the specification,
- * third-party extensions are
- * allowed to also associate it with their own context. Behavior described below is only related to the built-in conversation context.
+ *
+ * While ConversationScoped must be associated with the built-in conversation context required by the
+ * specification, third-party extensions are allowed to also associate it with their own context. Behavior described below is
+ * only related to the built-in conversation context.
*
*
* The conversation scope is active:
@@ -45,12 +42,13 @@
*
during all Servlet requests.
*
*
- * An event with qualifier @Initialized(ConversationScoped.class) is fired when the conversation context is initialized
- * and an event with qualifier @Destroyed(ConversationScoped.class) is fired when the conversation is destroyed.
- * The event payload is:
+ * An event with qualifier @Initialized(ConversationScoped.class) is fired when the conversation context is
+ * initialized and an event with qualifier @Destroyed(ConversationScoped.class) is fired when the conversation is
+ * destroyed. The event payload is:
*
*
- *
the conversation id if the conversation context is destroyed and is not associated with a current Servlet request, or
+ *
the conversation id if the conversation context is destroyed and is not associated with a current Servlet request,
+ * or
*
the ServletRequest if the application is a web application deployed to a Servlet container, or
*
any java.lang.Object for other types of application.
*
@@ -64,10 +62,10 @@
*
Any Servlet request has exactly one associated conversation.
*
The container provides a filter with the name "CDI Conversation Filter", which may be mapped in web.xml,
* allowing the user alter when the conversation is associated with the servlet request. If this filter is not mapped in any
- * web.xml in the application, the conversation associated with a Servlet request is determined at the beginning of the
- * request before calling any service() method of any servlet in the web application, calling the doFilter()
- * method of any servlet filter in the web application and before the container calls any ServletRequestListener or
- * AsyncListener in the web application.
+ * web.xml in the application, the conversation associated with a Servlet request is determined at the beginning of
+ * the request before calling any service() method of any servlet in the web application, calling the
+ * doFilter() method of any servlet filter in the web application and before the container calls any
+ * ServletRequestListener or AsyncListener in the web application.
*
*
*
@@ -107,14 +105,14 @@
*
The long-running conversation context associated with a request that renders a JSF view is automatically propagated to
* any faces request (JSF form submission) that originates from that rendered page.
*
The long-running conversation context associated with a request that results in a JSF redirect (a redirect resulting from
- * a navigation rule or JSF NavigationHandler) is automatically propagated to the resulting non-faces request, and to any other
- * subsequent request to the same URL. This is accomplished via use of a request parameter named cid containing the
- * unique identifier of the conversation.
+ * a navigation rule or JSF NavigationHandler) is automatically propagated to the resulting non-faces request, and
+ * to any other subsequent request to the same URL. This is accomplished via use of a request parameter named cid
+ * containing the unique identifier of the conversation.
*
*
*
- * When no conversation is propagated to a Servlet request, or if a request parameter named conversationPropagation has
- * the value none the request is associated with a new transient conversation.
+ * When no conversation is propagated to a Servlet request, or if a request parameter named conversationPropagation
+ * has the value none the request is associated with a new transient conversation.
* All long-running conversations are scoped to a particular HTTP servlet session and may not cross session boundaries.
* In the following cases, a propagated long-running conversation cannot be restored and re-associated with the request:
*
@@ -126,7 +124,9 @@
* Servlet request, in order to conserve resources.
*
*
- *
CDI Lite implementations are not required to provide support for conversations.
+ *
+ * CDI Lite implementations are not required to provide support for conversations.
+ *
*
* @see Conversation
* @see NonexistentConversationException
@@ -151,7 +151,7 @@
* @since 2.0
*/
public final static class Literal extends AnnotationLiteral implements ConversationScoped {
-
+ /** Default ConversationScoped literal */
public static final Literal INSTANCE = new Literal();
private static final long serialVersionUID = 1L;
diff --git a/api/src/main/java/jakarta/enterprise/context/Dependent.java b/api/src/main/java/jakarta/enterprise/context/Dependent.java
index 2ca83d336..22147ab1a 100644
--- a/api/src/main/java/jakarta/enterprise/context/Dependent.java
+++ b/api/src/main/java/jakarta/enterprise/context/Dependent.java
@@ -1,8 +1,5 @@
/*
- * 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.
@@ -27,14 +24,13 @@
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
+import jakarta.enterprise.context.spi.Context;
import jakarta.enterprise.context.spi.Contextual;
import jakarta.enterprise.context.spi.CreationalContext;
+import jakarta.enterprise.inject.Instance;
import jakarta.enterprise.util.AnnotationLiteral;
import jakarta.inject.Scope;
-import jakarta.enterprise.context.spi.Context;
-import jakarta.enterprise.inject.Instance;
-
/**
*
* Specifies that a bean belongs to the dependent pseudo-scope.
@@ -60,13 +56,13 @@
*
*
*
- * Every invocation of the {@link 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 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 Context#get(Contextual)} operation of the context object for the
- * @Dependent scope returns a null value.
+ * Every invocation of the {@link Context#get(Contextual)} operation of the context object for the @Dependent scope
+ * returns a null value.
*
*
*
@@ -74,18 +70,18 @@
*
*
*
- * Many instances of beans with scope @Dependent belong to some other bean or Java EE component class instance and are
- * called dependent objects.
+ * Many instances of beans with scope @Dependent belong to some other bean or Java EE component class instance and
+ * are called dependent objects.
*
*
*
*
Instances of decorators and interceptors are dependent objects of the bean instance they decorate.
- *
An instance of a bean with scope @Dependent injected into a field, bean constructor or initializer method is a
- * dependent object of the bean or Java EE component class instance into which it was injected.
+ *
An instance of a bean with scope @Dependent injected into a field, bean constructor or initializer method is
+ * a dependent object of the bean or Java EE component class instance into which it was injected.
*
An instance of a bean with scope @Dependent injected into a producer method is a dependent object of the
* producer method bean instance that is being produced.
- *
An instance of a bean with scope @Dependent obtained by direct invocation of an
- * {@link Instance} is a dependent object of the instance of {@link Instance}.
+ *
An instance of a bean with scope @Dependent obtained by direct invocation of an {@link Instance} is a
+ * dependent object of the instance of {@link Instance}.
*
*
*
@@ -112,7 +108,7 @@
* @since 2.0
*/
public final static class Literal extends AnnotationLiteral implements Dependent {
-
+ /** Default Dependent literal */
public static final Literal INSTANCE = new Literal();
private static final long serialVersionUID = 1L;
diff --git a/api/src/main/java/jakarta/enterprise/context/Destroyed.java b/api/src/main/java/jakarta/enterprise/context/Destroyed.java
index 5596e6c24..28e528444 100644
--- a/api/src/main/java/jakarta/enterprise/context/Destroyed.java
+++ b/api/src/main/java/jakarta/enterprise/context/Destroyed.java
@@ -1,8 +1,5 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2013, 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.
@@ -47,6 +44,7 @@
/**
* The scope for which to observe destruction
+ *
* @return the scope type class
*/
Class extends Annotation> value();
@@ -57,19 +55,29 @@
* @author Martin Kouba
*/
public final static class Literal extends AnnotationLiteral implements Destroyed {
-
+ /** Default Destroyed literal for the RequestScoped scope */
public static final Literal REQUEST = of(RequestScoped.class);
+ /** Default Destroyed literal for the ConversationScoped scope */
public static final Literal CONVERSATION = of(ConversationScoped.class);
+ /** Default Destroyed literal for the SessionScoped scope */
public static final Literal SESSION = of(SessionScoped.class);
+ /** Default Destroyed literal for the ApplicationScoped scope */
public static final Literal APPLICATION = of(ApplicationScoped.class);
private static final long serialVersionUID = 1L;
+ /** The scope annotation */
private final Class extends Annotation> value;
+ /**
+ * Obtain the literal of the provided scope annotation
+ *
+ * @param value the scope annotation
+ * @return a new Literal value for the provided scope annotation
+ */
public static Literal of(Class extends Annotation> value) {
return new Literal(value);
}
diff --git a/api/src/main/java/jakarta/enterprise/context/Initialized.java b/api/src/main/java/jakarta/enterprise/context/Initialized.java
index fbd89899c..7f78d3e79 100644
--- a/api/src/main/java/jakarta/enterprise/context/Initialized.java
+++ b/api/src/main/java/jakarta/enterprise/context/Initialized.java
@@ -1,8 +1,5 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2013, 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.
@@ -47,6 +44,7 @@
/**
* The scope for which to observe initialization
+ *
* @return the scope type class
*/
Class extends Annotation> value();
@@ -57,19 +55,29 @@
* @author Martin Kouba
*/
public final static class Literal extends AnnotationLiteral implements Initialized {
-
- public static final Literal REQUEST = of(RequestScoped.class);
-
+ /** Default Initialized literal for the RequestScoped scope */
+ public static final Literal REQUEST = of(RequestScoped.class);
+
+ /** Default Initialized literal for the ConversationScoped scope */
public static final Literal CONVERSATION = of(ConversationScoped.class);
-
+
+ /** Default Initialized literal for the SessionScoped scope */
public static final Literal SESSION = of(SessionScoped.class);
-
+
+ /** Default Initialized literal for the ApplicationScoped scope */
public static final Literal APPLICATION = of(ApplicationScoped.class);
private static final long serialVersionUID = 1L;
+ /** The scope annotation */
private final Class extends Annotation> value;
+ /**
+ * Obtain the literal of the provided scope annotation
+ *
+ * @param value the scope annotation
+ * @return a new Literal value for the provided scope annotation
+ */
public static Literal of(Class extends Annotation> value) {
return new Literal(value);
}
diff --git a/api/src/main/java/jakarta/enterprise/context/NonexistentConversationException.java b/api/src/main/java/jakarta/enterprise/context/NonexistentConversationException.java
index d50496388..e7d12ce99 100644
--- a/api/src/main/java/jakarta/enterprise/context/NonexistentConversationException.java
+++ b/api/src/main/java/jakarta/enterprise/context/NonexistentConversationException.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -21,16 +18,18 @@
*
* 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.
*
*
- *
CDI Lite implementations are not required to provide support for conversations.
- *
+ *
+ * CDI Lite implementations are not required to provide support for conversations.
+ *
+ *
* @see ConversationScoped
- *
+ *
* @author Pete Muir
* @author Gavin King
*/
@@ -39,18 +38,37 @@ public class NonexistentConversationException extends ContextException {
private static final long serialVersionUID = -3599813072560026919L;
+ /**
+ * Creates the exception with no detail message or cause.
+ */
public NonexistentConversationException() {
super();
}
+ /**
+ * Creates the exception with given detail message.
+ *
+ * @param message the detail message
+ */
public NonexistentConversationException(String message) {
super(message);
}
+ /**
+ * Creates the exception with given cause.
+ *
+ * @param cause the cause
+ */
public NonexistentConversationException(Throwable cause) {
super(cause);
}
+ /**
+ * Creates the exception with given detail message and cause.
+ *
+ * @param message the detail message
+ * @param cause the cause
+ */
public NonexistentConversationException(String message, Throwable cause) {
super(message, cause);
}
diff --git a/api/src/main/java/jakarta/enterprise/context/NormalScope.java b/api/src/main/java/jakarta/enterprise/context/NormalScope.java
index b684c7909..793bd3bc7 100644
--- a/api/src/main/java/jakarta/enterprise/context/NormalScope.java
+++ b/api/src/main/java/jakarta/enterprise/context/NormalScope.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -28,10 +25,10 @@
*
* Specifies that an annotation type is a normal scope type.
*
- *
+ *
* @author Gavin King
* @author Pete Muir
- *
+ *
* @see jakarta.inject.Scope @Scope is used to declare pseudo-scopes.
*/
@Target(ANNOTATION_TYPE)
@@ -43,12 +40,12 @@
*
* 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/api/src/main/java/jakarta/enterprise/context/RequestScoped.java b/api/src/main/java/jakarta/enterprise/context/RequestScoped.java
index 9c49307e7..38505418b 100644
--- a/api/src/main/java/jakarta/enterprise/context/RequestScoped.java
+++ b/api/src/main/java/jakarta/enterprise/context/RequestScoped.java
@@ -1,8 +1,5 @@
/*
- * 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.
@@ -35,8 +32,8 @@
*
*
* While RequestScoped must be associated with the built-in request context required by the specification,
- * third-party extensions are
- * allowed to also associate it with their own context. Behavior described below is only related to the built-in request context.
+ * third-party extensions are allowed to also associate it with their own context. Behavior described below is only related to
+ * the built-in request context.
*
*
*
@@ -44,8 +41,9 @@
*
*
*
- *
during the service() method of any servlet in the web application, during the doFilter() method of any
- * servlet filter and when the container calls any ServletRequestListener or AsyncListener,
+ *
during the service() method of any servlet in the web application, during the doFilter() method
+ * of any servlet filter and when the container calls any ServletRequestListener or
+ * AsyncListener,
*
during any Java EE web service invocation,
*
during any remote method invocation of any EJB, during any asynchronous method invocation of any EJB, during any call to
* an EJB timeout method and during message delivery to any EJB message-driven bean, and
@@ -60,16 +58,16 @@
*
at the end of the servlet request, after the service() method, all doFilter() methods, and all
* requestDestroyed() and onComplete() notifications return,
*
after the web service invocation completes,
- *
after the EJB remote method invocation, asynchronous method invocation, timeout or message delivery completes if it
- * did not already exist when the invocation occurred, or
- *
after the @PostConstruct callback completes, if it did not already exist when the @PostConstruct
- * callback occurred.
+ *
after the EJB remote method invocation, asynchronous method invocation, timeout or message delivery completes if it did
+ * not already exist when the invocation occurred, or
+ *
after the @PostConstruct callback completes, if it did not already exist when the
+ * @PostConstruct callback occurred.
*
*
*
- * An event with qualifier @Initialized(RequestScoped.class) is fired when the request context is initialized and an
- * event
- * with qualifier @Destroyed(RequestScoped.class) when the request context is destroyed. The event payload is:
+ * An event with qualifier @Initialized(RequestScoped.class) is fired when the request context is initialized and
+ * an event with qualifier @Destroyed(RequestScoped.class) when the request context is destroyed. The event payload
+ * is:
*
*
*
@@ -97,7 +95,7 @@
* @since 2.0
*/
public final static class Literal extends AnnotationLiteral implements RequestScoped {
-
+ /** Default RequestScoped literal */
public static final Literal INSTANCE = new Literal();
private static final long serialVersionUID = 1L;
diff --git a/api/src/main/java/jakarta/enterprise/context/SessionScoped.java b/api/src/main/java/jakarta/enterprise/context/SessionScoped.java
index ccf3acff8..e2bea927b 100644
--- a/api/src/main/java/jakarta/enterprise/context/SessionScoped.java
+++ b/api/src/main/java/jakarta/enterprise/context/SessionScoped.java
@@ -1,8 +1,5 @@
/*
- * 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.
@@ -35,8 +32,8 @@
*
*
* While SessionScoped must be associated with the built-in session context required by the specification,
- * third-party extensions are
- * allowed to also associate it with their own context. Behavior described below is only related to the built-in session context.
+ * third-party extensions are allowed to also associate it with their own context. Behavior described below is only related to
+ * the built-in session context.
*
*
* The session scope is active:
@@ -58,18 +55,18 @@
*
*
*
when the HTTPSession times out, after all HttpSessionListeners have been called, or
- *
at the very end of
- * any request in which invalidate() was called, after all filters and ServletRequestListeners have been
- * called.
+ *
at the very end of any request in which invalidate() was called, after all filters and
+ * ServletRequestListeners have been called.
*
*
*
- * An event with qualifier @Initialized(SessionScoped.class) is fired when the session context is initialized and an
- * event
- * with qualifier @Destroyed(SessionScoped.class) when the session context is destroyed. The event payload is
- * the HttpSession
+ * An event with qualifier @Initialized(SessionScoped.class) is fired when the session context is initialized and
+ * an event with qualifier @Destroyed(SessionScoped.class) when the session context is destroyed. The event payload
+ * is the HttpSession
*
- *
CDI Lite implementations are not required to provide support for the session scope.
+ *
+ * CDI Lite implementations are not required to provide support for the session scope.
+ *
*
* @author Gavin King
* @author Pete Muir
@@ -90,7 +87,7 @@
* @since 2.0
*/
public final static class Literal extends AnnotationLiteral implements SessionScoped {
-
+ /** Default SessionScoped literal */
public static final Literal INSTANCE = new Literal();
private static final long serialVersionUID = 1L;
diff --git a/api/src/main/java/jakarta/enterprise/context/control/ActivateRequestContext.java b/api/src/main/java/jakarta/enterprise/context/control/ActivateRequestContext.java
index cbd9bce57..6b473435a 100644
--- a/api/src/main/java/jakarta/enterprise/context/control/ActivateRequestContext.java
+++ b/api/src/main/java/jakarta/enterprise/context/control/ActivateRequestContext.java
@@ -1,8 +1,5 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2016, 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.
@@ -17,28 +14,29 @@
package jakarta.enterprise.context.control;
-import jakarta.interceptor.InterceptorBinding;
+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 static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import jakarta.interceptor.InterceptorBinding;
/**
* The container provides a built in interceptor that may be used to annotate classes and methods to indicate
* that a request context should be activated when this method is invoked.
*
* The request context will be activated before the method is called, and deactivated when the method invocation is
- * complete (regardless of any exceptions being thrown). If the context is already active, it is ignored, neither
+ * complete (regardless of any exceptions being thrown). If the context is already active, it is ignored, neither
* activated nor deactivated.
*
* @since 2.0
* @author John D. Ament
*/
@InterceptorBinding
-@Target({METHOD, TYPE})
+@Target({ METHOD, TYPE })
@Retention(RUNTIME)
@Documented
public @interface ActivateRequestContext {
diff --git a/api/src/main/java/jakarta/enterprise/context/control/RequestContextController.java b/api/src/main/java/jakarta/enterprise/context/control/RequestContextController.java
index e142f0e6f..1bf0067b4 100644
--- a/api/src/main/java/jakarta/enterprise/context/control/RequestContextController.java
+++ b/api/src/main/java/jakarta/enterprise/context/control/RequestContextController.java
@@ -1,8 +1,5 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2016, 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.
@@ -21,21 +18,21 @@
/**
* The CDI container provides a built in instance of RequestContextController that is dependent scoped for the purposes
- * of activating and deactivating. For example:
+ * of activating and deactivating. For example:
*
*
- * @Inject
- * private RequestContextController requestContextController;
+ * @Inject
+ * private RequestContextController requestContextController;
*
- * public void doRequest(String body) {
- * // activate request context
- * requestContextController.activate();
+ * public void doRequest(String body) {
+ * // activate request context
+ * requestContextController.activate();
*
- * // do work in a request context.
+ * // do work in a request context.
*
- * // deactivate the request context
- * requestContextController.deactivate();
- * }
+ * // deactivate the request context
+ * requestContextController.deactivate();
+ * }
*
*
* Once the request context has been deactivated, you may activate it once again, creating a brand new request context.
@@ -47,20 +44,21 @@
*/
public interface RequestContextController {
- /**
- * Activates a RequestContext for the current thread if one is not already active.
- * @return true if the context was activated by this invocation, false if not.
- */
- boolean activate();
+ /**
+ * Activates a RequestContext for the current thread if one is not already active.
+ *
+ * @return true if the context was activated by this invocation, false if not.
+ */
+ boolean activate();
- /**
- * Deactivates the current Request Context if it was activated by this context controller. If the context is active
- * but was not activated by this controller, then it may not be deactivated by this controller,
- * meaning this method will do nothing.
- *
- * If the context is not active, a {@linkplain ContextNotActiveException} is thrown.
- *
- * @throws ContextNotActiveException if the context is not active
- */
- void deactivate() throws ContextNotActiveException;
+ /**
+ * Deactivates the current Request Context if it was activated by this context controller. If the context is active
+ * but was not activated by this controller, then it may not be deactivated by this controller,
+ * meaning this method will do nothing.
+ *
+ * If the context is not active, a {@linkplain ContextNotActiveException} is thrown.
+ *
+ * @throws ContextNotActiveException if the context is not active
+ */
+ void deactivate() throws ContextNotActiveException;
}
diff --git a/api/src/main/java/jakarta/enterprise/context/package-info.java b/api/src/main/java/jakarta/enterprise/context/package-info.java
index 8ec91454b..c0e0793af 100644
--- a/api/src/main/java/jakarta/enterprise/context/package-info.java
+++ b/api/src/main/java/jakarta/enterprise/context/package-info.java
@@ -1,130 +1,152 @@
/*
- * 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,
+ * 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 jakarta.inject.Scope @Scope} or
+ *
+ * Annotations and interfaces relating to scopes and contexts.
+ *
+ *
+ *
+ * A scope type is a Java annotation annotated
+ * {@link jakarta.inject.Scope @Scope} or
* {@link jakarta.enterprise.context.NormalScope @NormalScope}.
* The scope of a bean determines the lifecycle and visibility of
- * its instances. In particular, the scope determines:
- *
+ * its instances. In particular, the scope determines:
+ *
+ *
*
*
When a new instance of the bean is created
*
When an existing instance of the bean is destroyed
*
Which injected references refer to any instance of the
* bean
*
- *
- *
Built-in scopes
- *
- *
The following built-in scopes are provided:
+ *
+ *
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
+ * {@link jakarta.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 jakarta.enterprise.context.spi.Context context object}
- * for any or all of the built-in scopes. For example, a third-party web
- * application framework might provide a conversation context object for
- * the built-in conversation scope.
- *
- *
The context associated with a built-in scope propagates across
- * local, synchronous Java method calls, including invocation of EJB
- * local business methods. The context does not propagate across remote
- * method invocations or to asynchronous processes such as JMS message
- * listeners or EJB timer service timeouts.
- *
- *
Normal scopes and pseudo-scopes
- *
- *
Most scopes are normal scopes. Normal scopes are declared
- * using {@link jakarta.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
+ * JSF requests.
+ *
+ *
+ *
+ * For other kinds of invocations, a portable extension may define a
+ * custom {@linkplain jakarta.enterprise.context.spi.Context context object}
+ * for any or all of the built-in scopes. For example, a third-party web
+ * application framework might provide a conversation context object for
+ * the built-in conversation scope.
+ *
+ *
+ *
+ * The context associated with a built-in scope propagates across
+ * local, synchronous Java method calls, including invocation of EJB
+ * local business methods. The context does not propagate across remote
+ * method invocations or to asynchronous processes such as JMS message
+ * listeners or EJB timer service timeouts.
+ *
+ *
+ *
Normal scopes and pseudo-scopes
+ *
+ *
+ * Most scopes are normal scopes. Normal scopes are declared
+ * using {@link jakarta.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 jakarta.enterprise.context.spi.Context#get(Contextual)} of the
- * context object for a normal scope type always returns the current
- * instance of the given bean.
+ * 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 jakarta.inject.Scope @Scope}.
- * The concept of a current instance is not well-defined in the case of
+ *
+ * Any scope that is not a normal scope is called a pseudo-scope.
+ * Pseudo-scopes are declared using {@link jakarta.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 jakarta.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
+ * every client has its own private instance of the bean.
+ *
+ *
+ *
+ * All built-in scopes are normal scopes, except for the
* {@link jakarta.enterprise.context.Dependent @Dependent} and
- * {@link jakarta.inject.Singleton @Singleton} pseudo-scopes.
- *
- *
Contextual and injected reference validity
- *
- *
A reference to a bean obtained from the container via {@linkplain
- * jakarta.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
+ * jakarta.enterprise.inject.Instance programmatic lookup} is called a
+ * contextual reference. A contextual reference for a bean with a normal
+ * scope refers to the current instance of the bean. A contextual
+ * reference for a bean are valid only for a certain period of time. The
+ * application should not invoke a method of an invalid reference.
+ *
+ *
+ *
+ * The validity of a contextual reference for a bean depends upon
+ * whether the scope of the bean is a normal scope or a pseudo-scope:
+ *
+ *
*
- *
Any reference to a bean with a normal scope is valid as long as
- * the application maintains a hard reference to it. However, it may
- * only be invoked when the context associated with the normal scope is
- * active. If it is invoked when the context is inactive, a
- * {@link jakarta.enterprise.context.ContextNotActiveException} is thrown
+ *
Any reference to a bean with a normal scope is valid as long as
+ * the application maintains a hard reference to it. However, it may
+ * only be invoked when the context associated with the normal scope is
+ * active. If it is invoked when the context is inactive, a
+ * {@link jakarta.enterprise.context.ContextNotActiveException} is thrown
* by the container.
- *
Any reference to a bean with a pseudo-scope is valid until the
- * bean instance to which it refers is destroyed. It may be invoked
- * even if the context associated with the pseudo-scope is not active.
- * If the application invokes a method of a reference to an instance
+ *
Any reference to a bean with a pseudo-scope is valid until the
+ * bean instance to which it refers is destroyed. It may be invoked
+ * even if the context associated with the pseudo-scope is not active.
+ * If the application invokes a method of a reference to an instance
* that has already been destroyed, the behavior is undefined.
*
- *
- *
A reference to a bean obtained from the container via {@linkplain
+ *
+ *
+ * A reference to a bean obtained from the container via {@linkplain
* jakarta.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:
- *
+ * restrictions apply to the validity of an injected reference:
+ *
+ *
*
- *
A reference to a bean injected into a field, bean constructor or
- * initializer method is only valid until the object into which it was
+ *
A reference to a bean injected into a field, bean constructor or
+ * initializer method is only valid until the object into which it was
* injected is destroyed.
- *
A reference to a bean injected into a producer method is only
- * valid until the producer method bean instance that is being produced
- * is destroyed.
- *
A reference to a bean injected into a disposer method or observer
+ *
A reference to a bean injected into a producer method is only
+ * valid until the producer method bean instance that is being produced
+ * is destroyed.
+ *
+ *
A reference to a bean injected into a disposer method or observer
* method is only valid until the invocation of the method completes.
*
- *
+ *
* @see jakarta.enterprise.inject
- *
+ *
*/
package jakarta.enterprise.context;
diff --git a/api/src/main/java/jakarta/enterprise/context/spi/AlterableContext.java b/api/src/main/java/jakarta/enterprise/context/spi/AlterableContext.java
index 4089598bc..21c02360f 100644
--- a/api/src/main/java/jakarta/enterprise/context/spi/AlterableContext.java
+++ b/api/src/main/java/jakarta/enterprise/context/spi/AlterableContext.java
@@ -1,15 +1,12 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2013, 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,
+ * 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.
@@ -25,12 +22,12 @@
* Provides an operation for obtaining and destroying contextual instances with a particular scope of any contextual type. Any
* instance of {@code Context} is called a context object.
*
- *
+ *
*
* {@link AlterableContext} was introduced in CDI 1.1 to allow bean instances to be destroyed by the application. Extensions
* should implement {@link AlterableContext} instead of {@link Context}.
*
- *
+ *
*
* The context object is responsible for creating and destroying contextual instances by calling operations of
* {@link Contextual}. In particular, the context object is responsible for destroying any
@@ -40,12 +37,12 @@
* {@link 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 AfterBeanDiscovery#addContext(Context)}.
*
* Destroy the existing contextual instance. If there is no existing instance, no action is taken.
*
- *
+ *
* @param contextual the contextual type
* @throws ContextNotActiveException if the context is not active
*/
diff --git a/api/src/main/java/jakarta/enterprise/context/spi/Context.java b/api/src/main/java/jakarta/enterprise/context/spi/Context.java
index 93a2adb27..992bbe723 100644
--- a/api/src/main/java/jakarta/enterprise/context/spi/Context.java
+++ b/api/src/main/java/jakarta/enterprise/context/spi/Context.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -27,12 +24,12 @@
* 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.
*
- *
+ *
*
* {@link AlterableContext} was introduced in CDI 1.1 to allow bean instances to be destroyed by the application. Extensions
* should implement {@link AlterableContext} instead of {@link Context}.
*
- *
+ *
*
* The context object is responsible for creating and destroying contextual instances by calling operations of
* {@link Contextual}. In particular, the context object is responsible for destroying any
@@ -42,12 +39,12 @@
* {@link 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 AfterBeanDiscovery#addContext(Context)}.
*
- *
+ *
* @author Gavin King
* @author Pete Muir
*/
@@ -56,7 +53,7 @@ public interface Context {
/**
* Get the scope type of the context object.
- *
+ *
* @return the scope
*/
public Class extends Annotation> getScope();
@@ -64,30 +61,30 @@ public interface Context {
/**
* Return an existing instance of certain contextual type or create a new instance by calling
* {@link Contextual#create(CreationalContext)} and return the new instance.
- *
+ *
* @param the type of contextual type
* @param contextual the contextual type
* @param creationalContext the context in which the new instance will be created
* @return the contextual instance
- *
+ *
* @throws ContextNotActiveException if the context is not active
*/
public T get(Contextual contextual, CreationalContext creationalContext);
/**
* Return an existing instance of a certain contextual type or a null value.
- *
+ *
* @param the type of the contextual type
* @param contextual the contextual type
* @return the contextual instance, or a null value
- *
+ *
* @throws ContextNotActiveException if the context is not active
*/
public T get(Contextual contextual);
/**
* Determines if the context object is active.
- *
+ *
* @return true if the context is active, or false otherwise.
*/
public boolean isActive();
diff --git a/api/src/main/java/jakarta/enterprise/context/spi/Contextual.java b/api/src/main/java/jakarta/enterprise/context/spi/Contextual.java
index fddb15132..11c9703f9 100644
--- a/api/src/main/java/jakarta/enterprise/context/spi/Contextual.java
+++ b/api/src/main/java/jakarta/enterprise/context/spi/Contextual.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -25,9 +22,9 @@
* Defines operations to create and destroy contextual instances of a certain type. Any implementation of {@code Contextual} is
* called a contextual type. In particular, all beans are contextual types.
*
- *
+ *
* @see Bean
- *
+ *
* @author Gavin King
* @author Nicklas Karlsson
* @author Pete Muir
@@ -40,7 +37,7 @@ public interface Contextual {
* that any dependent objects are associated with the contextual instance that is being created. An implementation may call
* {@link CreationalContext#push(Object)} between instantiation and injection to help the
* container minimize the use of client proxy objects.
- *
+ *
* @param creationalContext the context in which this instance is being created
* @return the contextual instance
* @throws CreationException if a checked exception occurs while creating the instance
@@ -51,7 +48,7 @@ public interface Contextual {
* Destroy an instance of the contextual type. Implementations should call
* {@link CreationalContext#release()} to allow the container to destroy dependent objects of
* the contextual instance.
- *
+ *
* @param instance the contextual instance to destroy
* @param creationalContext the context in which this instance was created
*/
diff --git a/api/src/main/java/jakarta/enterprise/context/spi/CreationalContext.java b/api/src/main/java/jakarta/enterprise/context/spi/CreationalContext.java
index 3ef46399f..0f64404e1 100644
--- a/api/src/main/java/jakarta/enterprise/context/spi/CreationalContext.java
+++ b/api/src/main/java/jakarta/enterprise/context/spi/CreationalContext.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -21,7 +18,7 @@
* Provides operations that are used by the {@link Contextual} implementation during instance
* creation and destruction.
*
- *
+ *
* @author Gavin King
* @author Pete Muir
*
@@ -33,7 +30,7 @@ public interface CreationalContext {
* Registers an incompletely initialized contextual instance the with the container. A contextual instance is considered
* incompletely initialized until it is returned by
* {@link Contextual#create(CreationalContext)} .
- *
+ *
* @param incompleteInstance the incompletely initialized instance
*/
public void push(T incompleteInstance);
diff --git a/api/src/main/java/jakarta/enterprise/context/spi/package-info.java b/api/src/main/java/jakarta/enterprise/context/spi/package-info.java
index 5d6f313e0..4b99d3831 100644
--- a/api/src/main/java/jakarta/enterprise/context/spi/package-info.java
+++ b/api/src/main/java/jakarta/enterprise/context/spi/package-info.java
@@ -1,34 +1,36 @@
/*
- * 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,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
- *
The custom context SPI.
- *
- *
Associated with every
- * {@linkplain jakarta.enterprise.context scope type} is a
+ *
+ * The custom context SPI.
+ *
+ *
+ *
+ * Associated with every
+ * {@linkplain jakarta.enterprise.context scope type} is a
* {@linkplain jakarta.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 jakarta.enterprise.context.spi.Context Context} and
- * {@link jakarta.enterprise.context.spi.Contextual Contextual}
- * interfaces to create and destroy contextual instances.
- *
+ * The context object implements the semantics of the scope type.
+ *
+ *
+ *
+ * The context implementation collaborates with the container via
+ * the {@link jakarta.enterprise.context.spi.Context Context} and
+ * {@link jakarta.enterprise.context.spi.Contextual Contextual}
+ * interfaces to create and destroy contextual instances.
+ *
+ *
* @see jakarta.enterprise.context
* @see jakarta.enterprise.inject.spi
*/
package jakarta.enterprise.context.spi;
-
diff --git a/api/src/main/java/jakarta/enterprise/event/Event.java b/api/src/main/java/jakarta/enterprise/event/Event.java
index bdad8b638..d692dbbff 100644
--- a/api/src/main/java/jakarta/enterprise/event/Event.java
+++ b/api/src/main/java/jakarta/enterprise/event/Event.java
@@ -1,15 +1,12 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2010, 2015, 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,
+ * 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.
@@ -21,74 +18,75 @@
import java.util.concurrent.CompletionStage;
import java.util.concurrent.Executor;
-import jakarta.enterprise.util.TypeLiteral;
import jakarta.enterprise.inject.Any;
+import jakarta.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:
*
the specified type is the type parameter specified at the injection point, and
*
the specified qualifiers are the qualifiers specified at the injection point.
*
- *
+ *
*
- * Events may also be fired asynchronously with {@link #fireAsync(Object)} and {@link #fireAsync(Object, NotificationOptions)} methods
+ * Events may also be fired asynchronously with {@link #fireAsync(Object)} and {@link #fireAsync(Object, NotificationOptions)}
+ * methods
*
- *
+ *
* @author Gavin King
* @author Pete Muir
* @author David Allen
* @author Antoine Sabot-Durand
- *
+ *
* @param the type of the event object
*/
@@ -98,7 +96,7 @@ public interface Event {
*
* Fires an event with the specified qualifiers and notifies observers.
*
- *
+ *
* @param event the event object
* @throws IllegalArgumentException if the runtime type of the event object contains a type variable
* @throws ObserverException if a notified observer throws a checked exception, it will be wrapped and rethrown as an
@@ -116,9 +114,11 @@ public interface Event {
* @return a {@link CompletionStage} allowing further pipeline composition on the asynchronous operation.
* Default asynchronous execution facility is container specific.
* If any observer notified by this event throws an exception
- * then the resulting CompletionStage is completed exceptionally with {@link java.util.concurrent.CompletionException}
+ * then the resulting CompletionStage is completed exceptionally with
+ * {@link java.util.concurrent.CompletionException}
* that wraps all the exceptions raised by observers as suppressed exception.
- * If no exception is thrown by observers then the resulting CompletionStage is completed normally with the event payload.
+ * If no exception is thrown by observers then the resulting CompletionStage is completed normally with the event
+ * payload.
* @throws IllegalArgumentException if the runtime type of the event object contains a type variable
*
* @since 2.0
@@ -128,7 +128,7 @@ public interface Event {
/**
*
* Fires an event asynchronously with the specified qualifiers and notifies asynchronous observers.
- * A custom {@link Executor} will be used to make asynchronous calls
+ * A custom {@link Executor} will be used to make asynchronous calls
*
*
* @param event type
@@ -137,23 +137,26 @@ public interface Event {
* @return a {@link CompletionStage} allowing further pipeline composition on the asynchronous operation.
* Default asynchronous execution facility is container specific.
* If any observer notified by this event throws an exception
- * then the resulting CompletionStage is completed exceptionally with {@link java.util.concurrent.CompletionException}
+ * then the resulting CompletionStage is completed exceptionally with
+ * {@link java.util.concurrent.CompletionException}
* that wraps all the exceptions raised by observers as suppressed exception.
- * If no exception is thrown by observers then the resulting CompletionStage is completed normally with the event payload.
+ * If no exception is thrown by observers then the resulting CompletionStage is completed normally with the event
+ * payload.
* @throws IllegalArgumentException if the runtime type of the event object contains a type variable
*
* @since 2.0
*/
- public CompletionStage fireAsync(U event, NotificationOptions options);
+ public CompletionStage fireAsync(U event, NotificationOptions options);
/**
*
* 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 non repeating qualifier type, or an instance of an annotation that
+ * @throws IllegalArgumentException if passed two instances of the same non repeating qualifier type, or an instance of an
+ * annotation that
* is not a qualifier type
*/
public Event select(Annotation... qualifiers);
@@ -162,12 +165,13 @@ public interface Event {
*
* Obtains a child Event for the given required type and additional required qualifiers.
*
- *
+ *
* @param the specified type
* @param subtype a {@link java.lang.Class} representing the specified type
* @param qualifiers the additional specified qualifiers
* @return the child Event
- * @throws IllegalArgumentException if passed two instances of the same non repeating qualifier type, or an instance of an annotation that
+ * @throws IllegalArgumentException if passed two instances of the same non repeating qualifier type, or an instance of an
+ * annotation that
* is not a qualifier type
*/
public Event select(Class subtype, Annotation... qualifiers);
@@ -176,12 +180,13 @@ public interface Event {
*
* Obtains a child Event for the given required type and additional required qualifiers.
*
- *
+ *
* @param the specified type
* @param subtype a {@link TypeLiteral} representing the specified type
* @param qualifiers the additional specified qualifiers
* @return the child Event
- * @throws IllegalArgumentException if passed two instances of the same non repeating qualifier type, or an instance of an annotation that
+ * @throws IllegalArgumentException if passed two instances of the same non repeating qualifier type, or an instance of an
+ * annotation that
* is not a qualifier type
*/
public Event select(TypeLiteral subtype, Annotation... qualifiers);
diff --git a/api/src/main/java/jakarta/enterprise/event/ImmutableNotificationOptions.java b/api/src/main/java/jakarta/enterprise/event/ImmutableNotificationOptions.java
index 54b91f3f4..6baab418a 100644
--- a/api/src/main/java/jakarta/enterprise/event/ImmutableNotificationOptions.java
+++ b/api/src/main/java/jakarta/enterprise/event/ImmutableNotificationOptions.java
@@ -1,15 +1,12 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2016, 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,
+ * 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.
@@ -22,7 +19,7 @@
/**
* The immutable implementation of {@link NotificationOptions}.
- *
+ *
* @author Martin Kouba
*
*/
diff --git a/api/src/main/java/jakarta/enterprise/event/NotificationOptions.java b/api/src/main/java/jakarta/enterprise/event/NotificationOptions.java
index 769b96dd7..60b735e8f 100644
--- a/api/src/main/java/jakarta/enterprise/event/NotificationOptions.java
+++ b/api/src/main/java/jakarta/enterprise/event/NotificationOptions.java
@@ -1,15 +1,12 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2016, 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,
+ * 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.
@@ -20,7 +17,7 @@
/**
* Notification options are used to configure observer notification.
- *
+ *
* @author Martin Kouba
* @see Event#fireAsync(Object, NotificationOptions)
* @since 2.0
@@ -28,20 +25,20 @@
public interface NotificationOptions {
/**
- *
+ *
* @return the executor used to execute an asynchronous event
*/
Executor getExecutor();
/**
- *
+ *
* @param optionName name of the option to get value of
* @return the value of an option or null if no option for the given name exists
*/
Object get(String optionName);
/**
- *
+ *
* @param executor a specific {@link Executor} to handle observer notification
* @return an immutable holder of an executor
*/
@@ -50,7 +47,7 @@ static NotificationOptions ofExecutor(Executor executor) {
}
/**
- *
+ *
* @param optionName name of the option to set
* @param optionValue value for the option
* @return an immutable holder of a single option
@@ -60,7 +57,7 @@ static NotificationOptions of(String optionName, Object optionValue) {
}
/**
- *
+ *
* @return the options builder
*/
static Builder builder() {
@@ -69,16 +66,34 @@ static Builder builder() {
/**
* Notification options builder.
- *
+ *
* @author Martin Kouba
* @since 2.0
*/
interface Builder {
+ /**
+ * Set the notification executor
+ *
+ * @param executor the {@linkplain Executor}
+ * @return this
+ */
Builder setExecutor(Executor executor);
+ /**
+ * Set an option value
+ *
+ * @param optionName option name
+ * @param optionValue option value
+ * @return this
+ */
Builder set(String optionName, Object optionValue);
+ /**
+ * Build the notification options
+ *
+ * @return NotificationOptions
+ */
NotificationOptions build();
}
diff --git a/api/src/main/java/jakarta/enterprise/event/ObserverException.java b/api/src/main/java/jakarta/enterprise/event/ObserverException.java
index 34f5646b0..36c575fe3 100644
--- a/api/src/main/java/jakarta/enterprise/event/ObserverException.java
+++ b/api/src/main/java/jakarta/enterprise/event/ObserverException.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -21,7 +18,7 @@
*
* Indicates that a checked exception was thrown by an observer method during event notification.
*
- *
+ *
* @author Pete Muir
* @author Gavin King
*/
@@ -29,18 +26,37 @@ public class ObserverException extends RuntimeException {
private static final long serialVersionUID = -801836224808304381L;
+ /**
+ * Creates the exception with no detail message or cause.
+ */
public ObserverException() {
}
+ /**
+ * Creates the exception with given detail message.
+ *
+ * @param message the detail message
+ */
public ObserverException(String message) {
super(message);
}
+ /**
+ * Creates the exception with given cause.
+ *
+ * @param cause the cause
+ */
public ObserverException(Throwable cause) {
super(cause);
}
+ /**
+ * Creates the exception with given detail message and cause.
+ *
+ * @param message the detail message
+ * @param cause the cause
+ */
public ObserverException(String message, Throwable cause) {
super(message, cause);
}
diff --git a/api/src/main/java/jakarta/enterprise/event/Observes.java b/api/src/main/java/jakarta/enterprise/event/Observes.java
index d24bf0309..2f729ceb9 100644
--- a/api/src/main/java/jakarta/enterprise/event/Observes.java
+++ b/api/src/main/java/jakarta/enterprise/event/Observes.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -31,52 +28,52 @@
* Identifies the event parameter of an observer method. May be applied to a parameter of a method of a bean class or
* {@linkplain 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
@@ -90,11 +87,12 @@
*
* Specifies {@linkplain 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.
*
+ *
* @return conditional observer type
*/
public Reception notifyObserver() default Reception.ALWAYS;
@@ -103,11 +101,12 @@
*
* Specifies {@linkplain Reception at what time the observer method is notified}.
*
- *
+ *
*
* By default, the observer method is notified when the event is fired.
- * @return phase of the transaction
*
+ *
+ * @return phase of the transaction
*/
public TransactionPhase during() default TransactionPhase.IN_PROGRESS;
}
diff --git a/api/src/main/java/jakarta/enterprise/event/ObservesAsync.java b/api/src/main/java/jakarta/enterprise/event/ObservesAsync.java
index a32505643..d9fc04f24 100644
--- a/api/src/main/java/jakarta/enterprise/event/ObservesAsync.java
+++ b/api/src/main/java/jakarta/enterprise/event/ObservesAsync.java
@@ -1,15 +1,12 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2015, 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,
+ * 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.
@@ -26,54 +23,54 @@
/**
*
- * Identifies the event parameter of an asynchronous observer method. May be applied to a parameter of a method of a bean class
+ * Identifies the event parameter of an asynchronous observer method. May be applied to a parameter of a method of a bean class
*
- *
+ *
*
* public void afterLogin(@ObservesAsync 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(@ObservesAsync 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
@@ -87,14 +84,14 @@
*
* Specifies {@linkplain 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.
*
+ *
* @return conditional observer type
*/
public Reception notifyObserver() default Reception.ALWAYS;
-
}
diff --git a/api/src/main/java/jakarta/enterprise/event/Reception.java b/api/src/main/java/jakarta/enterprise/event/Reception.java
index 5ae79b68e..c3807281c 100644
--- a/api/src/main/java/jakarta/enterprise/event/Reception.java
+++ b/api/src/main/java/jakarta/enterprise/event/Reception.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -23,16 +20,16 @@
* Distinguishes conditional {@linkplain 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 Dependent @Dependent} may not have conditional observer methods.
*
- *
+ *
* @author Gavin King
* @author Dan Allen
* @author David Allen
diff --git a/api/src/main/java/jakarta/enterprise/event/Shutdown.java b/api/src/main/java/jakarta/enterprise/event/Shutdown.java
index 74e963cbb..edcabf30d 100644
--- a/api/src/main/java/jakarta/enterprise/event/Shutdown.java
+++ b/api/src/main/java/jakarta/enterprise/event/Shutdown.java
@@ -1,3 +1,16 @@
+/*
+ * Copyright 2021, Red Hat, Inc., and 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 jakarta.enterprise.event;
/**
diff --git a/api/src/main/java/jakarta/enterprise/event/Startup.java b/api/src/main/java/jakarta/enterprise/event/Startup.java
index 412afe473..d9e739966 100644
--- a/api/src/main/java/jakarta/enterprise/event/Startup.java
+++ b/api/src/main/java/jakarta/enterprise/event/Startup.java
@@ -1,3 +1,16 @@
+/*
+ * Copyright 2021, Red Hat, Inc., and 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 jakarta.enterprise.event;
/**
diff --git a/api/src/main/java/jakarta/enterprise/event/TransactionPhase.java b/api/src/main/java/jakarta/enterprise/event/TransactionPhase.java
index a9cc05ac1..e6a8ff3cc 100644
--- a/api/src/main/java/jakarta/enterprise/event/TransactionPhase.java
+++ b/api/src/main/java/jakarta/enterprise/event/TransactionPhase.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -25,15 +22,17 @@
* 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.
- * If the transaction is in progress, but {@code jakarta.transaction.Synchronization} callback cannot be registered due to the transaction being already
- * marked for rollback or in state where {@code jakarta.transaction.Synchronization} callbacks cannot be registered, the {@link #BEFORE_COMPLETION},
+ * If the transaction is in progress, but {@code jakarta.transaction.Synchronization} callback cannot be registered due to the
+ * transaction being already
+ * marked for rollback or in state where {@code jakarta.transaction.Synchronization} callbacks cannot be registered, the
+ * {@link #BEFORE_COMPLETION},
* {@link #AFTER_COMPLETION} and {@link #AFTER_FAILURE} observer methods are notified at the same time as other observers,
* but {@link #AFTER_SUCCESS} observer methods get skipped.
*
*
* @author Pete Muir
* @author Gavin King
- *
+ *
*/
@SuppressWarnings("ALL")
public enum TransactionPhase {
@@ -75,9 +74,10 @@ public enum TransactionPhase {
* transaction fails.
*
*
- * Transactional observer will be notified will also get invoked if there is no transaction in progress, or the transaction is in progress,
- * but {@code jakarta.transaction.Synchronization} callback cannot be registered due to the transaction being already
- * marked for rollback or in state where {@code jakarta.transaction.Synchronization} callbacks cannot be registered.
+ * Transactional observer will be notified will also get invoked if there is no transaction in progress, or the transaction
+ * is in progress, but {@code jakarta.transaction.Synchronization} callback cannot be registered due to the transaction
+ * being already marked for rollback or in state where {@code jakarta.transaction.Synchronization} callbacks cannot be
+ * registered.
*
*/
AFTER_FAILURE,
diff --git a/api/src/main/java/jakarta/enterprise/event/package-info.java b/api/src/main/java/jakarta/enterprise/event/package-info.java
index 316e48505..f174883a0 100644
--- a/api/src/main/java/jakarta/enterprise/event/package-info.java
+++ b/api/src/main/java/jakarta/enterprise/event/package-info.java
@@ -1,118 +1,146 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2010, 2015, 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,
+ * 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 jakarta.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.
- *
- *
Events may be fired synchronously or asynchronously.
- *
- *
An event comprises:
- *
+ *
+ * Annotations and interfaces relating to events.
+ *
+ *
+ *
+ * {@linkplain jakarta.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.
+ *
+ *
+ *
+ * Events may be fired synchronously or asynchronously.
+ *
+ *
+ *
+ * An event comprises:
+ *
+ *
*
*
A Java object, called the event object
- *
A (possibly empty) set of instances of qualifier types, called
+ *
A (possibly empty) set of instances of qualifier types, called
* the event qualifiers
*
- *
- *
The {@link jakarta.enterprise.event.Event} interface is used to
- * fire events.
- *
- *
Event objects and event types
- *
- *
The event object acts as a payload, to propagate state from
- * producer to consumer. An event object is an instance of a concrete
- * Java class with no type variables.
- *
- *
The event types of the event include all superclasses and
- * interfaces of the runtime class of the event object. An event type
- * may not contain a type variable.
- *
- *
Event qualifiers
- *
- *
The event qualifiers act as topic selectors, allowing the consumer
+ *
+ *
+ * The {@link jakarta.enterprise.event.Event} interface is used to
+ * fire events.
+ *
+ *
+ *
Event objects and event types
+ *
+ *
+ * The event object acts as a payload, to propagate state from
+ * producer to consumer. An event object is an instance of a concrete
+ * Java class with no type variables.
+ *
+ *
+ *
+ * The event types of the event include all superclasses and
+ * interfaces of the runtime class of the event object. An event type
+ * may not contain a type variable.
+ *
+ *
+ *
Event qualifiers
+ *
+ *
+ * The event qualifiers act as topic selectors, allowing the consumer
* to narrow the set of events it observes. An event qualifier may be an
- * instance of any {@linkplain jakarta.inject.Qualifier qualifier type}.
- *
- *
Observer methods
- *
- *
An {@linkplain jakarta.enterprise.event.Observes observer method}
+ * instance of any {@linkplain jakarta.inject.Qualifier qualifier type}.
+ *
+ *
+ *
Observer methods
+ *
+ *
+ * An {@linkplain jakarta.enterprise.event.Observes observer method}
* allows the application to receive and respond synchronously to event notifications.
- * And an {@linkplain jakarta.enterprise.event.ObservesAsync async observer method}
+ * And an {@linkplain jakarta.enterprise.event.ObservesAsync async observer method}
* allows the application to receive and respond asynchronously to event notifications.
* they both act as event consumers, 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 jakarta.enterprise.inject.spi.Extension extension} 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 jakarta.enterprise.inject.spi.Extension extension} with a
* parameter annotated {@link jakarta.enterprise.event.Observes @Observes}
- * or {@link jakarta.enterprise.event.ObservesAsync @ObservesAsync}.
- *
- *
An observer method will be notified of an event if:
+ * An observer method will be notified of an event if:
+ *
+ *
*
- *
the event object is assignable to the type observed by the observer
+ *
the event object is assignable to the type observed by the observer
* method,
*
the observer method has all the event qualifiers of the event, and
- *
either the event is not a
- * {@linkplain jakarta.enterprise.inject.spi container lifecycle event}, or
- * the observer method belongs to an
+ *
either the event is not a
+ * {@linkplain jakarta.enterprise.inject.spi container lifecycle event}, or
+ * the observer method belongs to an
* {@linkplain jakarta.enterprise.inject.spi.Extension extension}.
*
- *
- *
If a synchronous observer method is a
- * {@linkplain jakarta.enterprise.event.TransactionPhase transactional
+ *
+ *
+ * If a synchronous observer method is a
+ * {@linkplain jakarta.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 depends on the value of
- * the @{@linkplain jakarta.annotation.Priority Priority} applied to the observer.
- *
If no priority is defined on a observer, its priority is jakarta.interceptor.Interceptor.Priority.APPLICATION+500.
- *
If two observer have the same priority their relative order is undefined.
- *
- *
Observer methods may throw exceptions:
- *
+ * 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 depends on the value of
+ * the @{@linkplain jakarta.annotation.Priority Priority} applied to the observer.
+ *
+ *
+ * If no priority is defined on a observer, its priority is jakarta.interceptor.Interceptor.Priority.APPLICATION+500.
+ *
+ *
+ * If two observer have the same priority their relative order is undefined.
+ *
+ *
+ *
+ * Observer methods may throw exceptions:
+ *
+ *
*
- *
If the observer method is a
- * {@linkplain jakarta.enterprise.event.TransactionPhase transactional
+ *
If the observer method is a
+ * {@linkplain jakarta.enterprise.event.TransactionPhase transactional
* observer method}, any exception is caught and logged by the container.
*
If the observer method is asynchronous, any exception is caught by the container and added as a suppressed exception
* to a {@link java.util.concurrent.CompletionException} that could be handle by the application
*
Otherwise, the exception aborts processing of the event.
- * No other observer methods of that event will be called. The
- * exception is rethrown. If the exception is a checked exception,
- * it is wrapped and rethrown as an (unchecked)
+ * No other observer methods of that event will be called. The
+ * exception is rethrown. If the exception is a checked exception,
+ * it is wrapped and rethrown as an (unchecked)
* {@link jakarta.enterprise.event.ObserverException}.
*
- *
+ *
* @see jakarta.enterprise.inject
- *
+ *
* @see jakarta.enterprise.event.Observes
* @see jakarta.enterprise.event.Event
* @see jakarta.inject.Qualifier
*/
package jakarta.enterprise.event;
-
diff --git a/api/src/main/java/jakarta/enterprise/inject/Alternative.java b/api/src/main/java/jakarta/enterprise/inject/Alternative.java
index ecbe6a81c..184eab069 100644
--- a/api/src/main/java/jakarta/enterprise/inject/Alternative.java
+++ b/api/src/main/java/jakarta/enterprise/inject/Alternative.java
@@ -1,8 +1,5 @@
/*
- * 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.
@@ -47,8 +44,9 @@
*
*
* 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:
+ * <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:
*
*
*
@@ -73,7 +71,7 @@
* @since 2.0
*/
public final static class Literal extends AnnotationLiteral implements Alternative {
-
+ /** Default Alternative literal */
public static final Literal INSTANCE = new Literal();
private static final long serialVersionUID = 1L;
diff --git a/api/src/main/java/jakarta/enterprise/inject/AmbiguousResolutionException.java b/api/src/main/java/jakarta/enterprise/inject/AmbiguousResolutionException.java
index 30a7c0e33..5add09f3c 100644
--- a/api/src/main/java/jakarta/enterprise/inject/AmbiguousResolutionException.java
+++ b/api/src/main/java/jakarta/enterprise/inject/AmbiguousResolutionException.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -21,7 +18,7 @@
* 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
*/
@@ -29,19 +26,38 @@ public class AmbiguousResolutionException extends ResolutionException {
private static final long serialVersionUID = -2132733164534544788L;
+ /**
+ * Creates the exception with no detail message or cause.
+ */
public AmbiguousResolutionException() {
}
- public AmbiguousResolutionException(String message, Throwable throwable) {
- super(message, throwable);
+ /**
+ * Creates the exception with given detail message and cause.
+ *
+ * @param message the detail message
+ * @param cause the cause
+ */
+ public AmbiguousResolutionException(String message, Throwable cause) {
+ super(message, cause);
}
+ /**
+ * Creates the exception with given detail message.
+ *
+ * @param message the detail message
+ */
public AmbiguousResolutionException(String message) {
super(message);
}
- public AmbiguousResolutionException(Throwable throwable) {
- super(throwable);
+ /**
+ * Creates the exception with given cause.
+ *
+ * @param cause the cause
+ */
+ public AmbiguousResolutionException(Throwable cause) {
+ super(cause);
}
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/Any.java b/api/src/main/java/jakarta/enterprise/inject/Any.java
index 887e97275..313a7a1a7 100644
--- a/api/src/main/java/jakarta/enterprise/inject/Any.java
+++ b/api/src/main/java/jakarta/enterprise/inject/Any.java
@@ -1,8 +1,5 @@
/*
- * 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.
@@ -86,7 +83,7 @@
* @see Event
*/
public static final class Literal extends AnnotationLiteral implements Any {
-
+ /** Default Any literal */
public static final Literal INSTANCE = new Literal();
private static final long serialVersionUID = 1L;
diff --git a/api/src/main/java/jakarta/enterprise/inject/CreationException.java b/api/src/main/java/jakarta/enterprise/inject/CreationException.java
index 0cb3af907..b20edcfeb 100644
--- a/api/src/main/java/jakarta/enterprise/inject/CreationException.java
+++ b/api/src/main/java/jakarta/enterprise/inject/CreationException.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -21,7 +18,7 @@
*
* Indicates that a checked exception was thrown during creation of a bean.
*
- *
+ *
* @author Pete Muir
* @author Gavin King
*/
@@ -29,18 +26,37 @@ public class CreationException extends InjectionException {
private static final long serialVersionUID = 1002854668862145298L;
+ /**
+ * Creates the exception with no detail message or cause.
+ */
public CreationException() {
}
+ /**
+ * Creates the exception with given detail message.
+ *
+ * @param message the detail message
+ */
public CreationException(String message) {
super(message);
}
+ /**
+ * Creates the exception with given cause.
+ *
+ * @param cause the cause
+ */
public CreationException(Throwable cause) {
super(cause);
}
+ /**
+ * Creates the exception with given detail message and cause.
+ *
+ * @param message the detail message
+ * @param cause the cause
+ */
public CreationException(String message, Throwable cause) {
super(message, cause);
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/Decorated.java b/api/src/main/java/jakarta/enterprise/inject/Decorated.java
index 34c4d86e9..f3c2f3fd1 100644
--- a/api/src/main/java/jakarta/enterprise/inject/Decorated.java
+++ b/api/src/main/java/jakarta/enterprise/inject/Decorated.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -31,7 +28,7 @@
*
* A decorator may inject metadata about the bean it is decorating
*
CDI Lite implementations are not required to provide support for decorators.
- *
+ *
+ * CDI Lite implementations are not required to provide support for decorators.
+ *
+ *
* @author Pete Muir
* @since 1.1
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/Default.java b/api/src/main/java/jakarta/enterprise/inject/Default.java
index f1e0daeeb..f61f1e794 100644
--- a/api/src/main/java/jakarta/enterprise/inject/Default.java
+++ b/api/src/main/java/jakarta/enterprise/inject/Default.java
@@ -1,8 +1,5 @@
/*
- * 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.
@@ -102,7 +99,7 @@
* @see Event
*/
public static final class Literal extends AnnotationLiteral implements Default {
-
+ /** The default Default literal */
public static final Literal INSTANCE = new Literal();
private static final long serialVersionUID = 1L;
diff --git a/api/src/main/java/jakarta/enterprise/inject/Disposes.java b/api/src/main/java/jakarta/enterprise/inject/Disposes.java
index 326b18820..f5b445a2e 100644
--- a/api/src/main/java/jakarta/enterprise/inject/Disposes.java
+++ b/api/src/main/java/jakarta/enterprise/inject/Disposes.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -28,54 +25,54 @@
*
* Identifies the disposed parameter of a disposer method. May be applied to a parameter of a method of a bean class.
*
* A disposer method allows the application to perform customized cleanup of an object returned by a
* {@linkplain Produces producer method or producer field}.
*
- *
+ *
*
* 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 or
* producer field return type. When searching for disposer methods for a producer method or producer field, the container
@@ -83,31 +80,31 @@
* producer field declared by the same bean class, the container must call this method when destroying any instance returned by
* that producer method or producer field.
*
- *
+ *
*
* In addition to the disposed parameter, a disposer method may declare additional parameters, which may also specify
* qualifiers. These additional parameters are injection points.
*
* A disposer method may resolve to multiple producer methods or producer fields declared by the bean class, in which case the
* container must call it when destroying any instance returned by any of these producer methods or producer fields.
*
- *
+ *
*
* Disposer methods are not inherited by bean subclasses.
*
- *
+ *
*
* Interceptors and decorators may not declare disposer methods.
*
- *
+ *
* @see Produces @Produces
- *
+ *
* @author Gavin King
* @author Pete Muir
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/IllegalProductException.java b/api/src/main/java/jakarta/enterprise/inject/IllegalProductException.java
index 474a8212e..562236817 100644
--- a/api/src/main/java/jakarta/enterprise/inject/IllegalProductException.java
+++ b/api/src/main/java/jakarta/enterprise/inject/IllegalProductException.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -28,18 +25,37 @@ public class IllegalProductException extends InjectionException {
private static final long serialVersionUID = -6280627846071966243L;
+ /**
+ * Creates the exception with no detail message or cause.
+ */
public IllegalProductException() {
super();
}
+ /**
+ * Creates the exception with given detail message and cause.
+ *
+ * @param message the detail message
+ * @param cause the cause
+ */
public IllegalProductException(String message, Throwable cause) {
super(message, cause);
}
+ /**
+ * Creates the exception with given detail message.
+ *
+ * @param message the detail message
+ */
public IllegalProductException(String message) {
super(message);
}
+ /**
+ * Creates the exception with given cause.
+ *
+ * @param cause the cause
+ */
public IllegalProductException(Throwable cause) {
super(cause);
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/InjectionException.java b/api/src/main/java/jakarta/enterprise/inject/InjectionException.java
index 2ce6e534f..cf453358c 100644
--- a/api/src/main/java/jakarta/enterprise/inject/InjectionException.java
+++ b/api/src/main/java/jakarta/enterprise/inject/InjectionException.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -19,26 +16,45 @@
/**
* Indicates a problem relating to dependency injection.
- *
+ *
* @author Pete Muir
*/
public class InjectionException extends RuntimeException {
private static final long serialVersionUID = -2132733164534544788L;
+ /**
+ * Creates the exception with no detail message or cause.
+ */
public InjectionException() {
}
- public InjectionException(String message, Throwable throwable) {
- super(message, throwable);
+ /**
+ * Creates the exception with given detail message and cause.
+ *
+ * @param message the detail message
+ * @param cause the cause
+ */
+ public InjectionException(String message, Throwable cause) {
+ super(message, cause);
}
+ /**
+ * Creates the exception with given detail message.
+ *
+ * @param message the detail message
+ */
public InjectionException(String message) {
super(message);
}
- public InjectionException(Throwable throwable) {
- super(throwable);
+ /**
+ * Creates the exception with given cause.
+ *
+ * @param cause the cause
+ */
+ public InjectionException(Throwable cause) {
+ super(cause);
}
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/Instance.java b/api/src/main/java/jakarta/enterprise/inject/Instance.java
index 7739d83d2..8a047361d 100644
--- a/api/src/main/java/jakarta/enterprise/inject/Instance.java
+++ b/api/src/main/java/jakarta/enterprise/inject/Instance.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -30,88 +27,87 @@
*
* Allows the application to dynamically obtain instances of beans with a specified combination of required type and qualifiers.
*
- *
+ *
*
* In certain situations, injection is not the most convenient way to obtain a contextual reference. For example, it may not be
* used when:
*
- *
+ *
*
*
the bean type or qualifiers vary dynamically at runtime, or
*
depending upon the deployment, there may be no bean which satisfies the type and qualifiers, or
*
we would like to iterate over all beans of a certain type.
*
- *
+ *
*
* In these situations, an instance of the Instance may be injected:
*
- * Or, the {@link Any @Any} qualifier may be used, allowing the application to specify qualifiers
- * dynamically:
+ * Or, the {@link Any @Any} qualifier may be used, allowing the application to specify qualifiers dynamically:
*
the required type is the type parameter specified at the injection point, and
*
the required qualifiers are the qualifiers specified at the injection point.
*
- *
+ *
*
- * The inherited {@link jakarta.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 UnsatisfiedResolutionException} or
+ * The inherited {@link jakarta.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 UnsatisfiedResolutionException} or
* {@link AmbiguousResolutionException}.
*
* 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 jakarta.inject.Provider#get()
* @see java.lang.Iterable#iterator()
* @see AnnotationLiteral
* @see TypeLiteral
- *
+ *
* @author Gavin King
* @author John Ament
* @author Martin Kouba
- *
+ *
* @param the required bean type
*/
@@ -121,11 +117,11 @@ public interface Instance extends Iterable, Provider {
*
* Obtains a child Instance for the given additional required qualifiers.
*
- *
+ *
* @param qualifiers the additional required qualifiers
* @return the child Instance
- * @throws IllegalArgumentException if passed two instances of the same non repeating qualifier type, or an instance of an annotation that
- * is not a qualifier type
+ * @throws IllegalArgumentException if passed two instances of the same non repeating qualifier type, or an instance of an
+ * annotation that is not a qualifier type
* @throws IllegalStateException if the container is already shutdown
*/
Instance select(Annotation... qualifiers);
@@ -134,13 +130,13 @@ public interface Instance extends Iterable, Provider {
*
* Obtains a child Instance for the given required type and additional required qualifiers.
*
- *
+ *
* @param the required type
* @param subtype a {@link java.lang.Class} representing the required type
* @param qualifiers the additional required qualifiers
* @return the child Instance
- * @throws IllegalArgumentException if passed two instances of the same non repeating qualifier type, or an instance of an annotation that
- * is not a qualifier type
+ * @throws IllegalArgumentException if passed two instances of the same non repeating qualifier type, or an instance of an
+ * annotation that is not a qualifier type
* @throws IllegalStateException if the container is already shutdown
*/
Instance select(Class subtype, Annotation... qualifiers);
@@ -149,13 +145,13 @@ public interface Instance extends Iterable, Provider {
*
* Obtains a child Instance for the given required type and additional required qualifiers.
*
- *
+ *
* @param the required type
* @param subtype a {@link TypeLiteral} representing the required type
* @param qualifiers the additional required qualifiers
* @return the child Instance
- * @throws IllegalArgumentException if passed two instances of the same non repeating qualifier type, or an instance of an annotation that
- * is not a qualifier type
+ * @throws IllegalArgumentException if passed two instances of the same non repeating qualifier type, or an instance of an
+ * annotation that is not a qualifier type
* @throws IllegalStateException if the container is already shutdown
*/
Instance select(TypeLiteral subtype, Annotation... qualifiers);
@@ -178,7 +174,7 @@ default Stream stream() {
* 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.
*/
@@ -189,21 +185,23 @@ default Stream stream() {
* 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.
+ *
+ * @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.
*/
boolean isAmbiguous();
/**
*
- * Determines if there is exactly one bean that matches the required type and qualifiers and is eligible for injection
- * into the class into which the parent Instance was injected.
+ * Determines if there is exactly one bean that matches the required type and qualifiers and is eligible for injection into
+ * the class into which the parent Instance was injected.
*
*
* @since 2.0
* @return true if there is exactly 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.
+ * injection into the class into which the parent Instance was injected, or false
+ * otherwise.
*/
default boolean isResolvable() {
return !isUnsatisfied() && !isAmbiguous();
@@ -214,13 +212,13 @@ default boolean isResolvable() {
* When called, the container destroys the instance if the active context object for the scope type of the bean supports
* destroying bean instances. All normal scoped built-in contexts support destroying bean instances.
*
- *
+ *
*
* The instance passed should either be a dependent scoped bean instance obtained from the same {@link Instance} object, or
* the client proxy for a normal scoped bean instance.
*
- *
- *
+ *
+ *
* @since 1.1
* @param instance the instance to destroy
* @throws UnsupportedOperationException if the active context object for the scope type of the bean does not support
@@ -229,8 +227,8 @@ default boolean isResolvable() {
void destroy(T instance);
/**
- * Obtains an initialized contextual reference handle for a bean that has the required type and qualifiers and is
- * eligible for injection. Throws exceptions if there is no such bean or more than one.
+ * Obtains an initialized contextual reference handle for a bean that has the required type and qualifiers and is eligible
+ * for injection. Throws exceptions if there is no such bean or more than one.
*
*
* The contextual reference is obtained lazily, i.e. when first needed.
@@ -243,11 +241,12 @@ default boolean isResolvable() {
Handle getHandle();
/**
- * Allows iterating over contextual reference handles for all beans that have the required type and required qualifiers and are eligible
- * for injection.
+ * Allows iterating over contextual reference handles for all beans that have the required type and required qualifiers and
+ * are eligible for injection.
*
*
- * Note that the returned {@link Iterable} is stateless. Therefore, each {@link Iterable#iterator()} produces a new set of handles.
+ * Note that the returned {@link Iterable} is stateless. Therefore, each {@link Iterable#iterator()} produces a new set of
+ * handles.
*
*
* @return a new iterable
@@ -255,7 +254,7 @@ default boolean isResolvable() {
Iterable extends Handle> handles();
/**
- * Returns stream of {@link Handle} objects.
+ * Returns stream of {@link Handle} objects.
*
* @return a new stream of contextual reference handles
*/
@@ -266,8 +265,8 @@ default Stream extends Handle> handlesStream() {
/**
* This interface represents a contextual reference handle.
*
- * Allows to inspect the metadata of the relevant bean before resolving its contextual reference and also to destroy
- * the underlying contextual instance.
+ * Allows to inspect the metadata of the relevant bean before resolving its contextual reference and also to destroy the
+ * underlying contextual instance.
*
*
* @author Matej Novotny
@@ -281,8 +280,8 @@ interface Handle extends AutoCloseable {
* @return the contextual reference
* @see Instance#get()
* @throws IllegalStateException If the producing {@link Instance} does not exist
- * @throws IllegalStateException If invoked on {@link Handle} that previously successfully destroyed its
- * underlying contextual reference
+ * @throws IllegalStateException If invoked on {@link Handle} that previously successfully destroyed its underlying
+ * contextual reference
*/
T get();
diff --git a/api/src/main/java/jakarta/enterprise/inject/Intercepted.java b/api/src/main/java/jakarta/enterprise/inject/Intercepted.java
index 41b411a92..8b47bd2ea 100644
--- a/api/src/main/java/jakarta/enterprise/inject/Intercepted.java
+++ b/api/src/main/java/jakarta/enterprise/inject/Intercepted.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -31,19 +28,19 @@
*
* An interceptor may inject metadata about the bean it is intercepting.
*
- *
+ *
* @author Pete Muir
* @since 1.1
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/Model.java b/api/src/main/java/jakarta/enterprise/inject/Model.java
index 89007c85d..b4d3dc919 100644
--- a/api/src/main/java/jakarta/enterprise/inject/Model.java
+++ b/api/src/main/java/jakarta/enterprise/inject/Model.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -33,7 +30,7 @@
* The built-in stereotype intended for use with beans that define the model layer of an MVC web application architecture such
* as JSF.
*
- *
+ *
* @see Stereotype
* @author Gavin King
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/Produces.java b/api/src/main/java/jakarta/enterprise/inject/Produces.java
index 9bfbdce4d..7b911a720 100644
--- a/api/src/main/java/jakarta/enterprise/inject/Produces.java
+++ b/api/src/main/java/jakarta/enterprise/inject/Produces.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -28,90 +25,90 @@
import jakarta.enterprise.context.Dependent;
/**
- *
+ *
*
* 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.
*
* 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")
+ * 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 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 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(Shop shop, @Selected Product product) {
* Order order = new Order(product, shop);
* 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 Disposes @Disposes
- *
+ *
* @author Gavin King
* @author Pete Muir
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/ResolutionException.java b/api/src/main/java/jakarta/enterprise/inject/ResolutionException.java
index 9ae5fe547..8bc7312e1 100644
--- a/api/src/main/java/jakarta/enterprise/inject/ResolutionException.java
+++ b/api/src/main/java/jakarta/enterprise/inject/ResolutionException.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -18,25 +15,44 @@
/**
* Indicates a problem relating to typesafe resolution.
- *
+ *
* @author Gavin King
*/
public class ResolutionException extends InjectionException {
private static final long serialVersionUID = -6280627846071966243L;
+ /**
+ * Creates the exception with no detail message or cause.
+ */
public ResolutionException() {
super();
}
+ /**
+ * Creates the exception with given detail message and cause.
+ *
+ * @param message the detail message
+ * @param cause the cause
+ */
public ResolutionException(String message, Throwable cause) {
super(message, cause);
}
+ /**
+ * Creates the exception with given detail message.
+ *
+ * @param message the detail message
+ */
public ResolutionException(String message) {
super(message);
}
+ /**
+ * Creates the exception with given cause.
+ *
+ * @param cause the cause
+ */
public ResolutionException(Throwable cause) {
super(cause);
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/Specializes.java b/api/src/main/java/jakarta/enterprise/inject/Specializes.java
index 8b58ab004..10cd24f29 100644
--- a/api/src/main/java/jakarta/enterprise/inject/Specializes.java
+++ b/api/src/main/java/jakarta/enterprise/inject/Specializes.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -32,38 +29,40 @@
*
* Indicates that a bean directly specializes another bean. May be applied to a bean class or producer method.
*
- *
+ *
*
* If a bean directly specializes a second bean, it inherits:
*
- *
+ *
*
*
all qualifiers of the second bean, and
*
the name, if any, of the second bean.
*
- *
+ *
*
- * If the second bean has a name, the bean may not declare a name using {@link jakarta.inject.Named @Named}. Furthermore, the
- * bean must have all the bean types of the second bean.
+ * If the second bean has a name, the bean may not declare a name using {@link jakarta.inject.Named @Named}. Furthermore,
+ * the bean must have all the bean types of the second bean.
*
- *
+ *
*
- *
If a bean class of a managed bean is annotated @Specializes , then the bean class must directly extend the
- * bean class of a second managed bean. Then the first managed bean directly specializes the second managed bean.
- *
- *
If a bean class of a session bean is annotated @Specializes , then the bean class must directly extend the
- * bean class of a second session bean. Then the first session bean directly specializes the second session bean.
- *
- *
If a producer method is annotated @Specializes, then it must be non-static and directly override another
- * producer method. Then the first producer method directly specializes the second producer method.
+ *
If a bean class of a managed bean is annotated @Specializes , then the bean class must directly extend
+ * the bean class of a second managed bean. Then the first managed bean directly specializes the second managed bean.
+ *
+ *
If a bean class of a session bean is annotated @Specializes , then the bean class must directly extend
+ * the bean class of a second session bean. Then the first session bean directly specializes the second session bean.
+ *
+ *
If a producer method is annotated @Specializes, then it must be non-static and directly override
+ * another producer method. Then the first producer method directly specializes the second producer method.
*
- *
+ *
*
* If a bean is specialized by any enabled bean, the first bean is disabled.
*
*
- *
CDI Lite implementations are not required to provide support for specialization.
- *
+ *
+ * CDI Lite implementations are not required to provide support for specialization.
+ *
+ *
* @author Gavin King
* @author Pete Muir
*/
@@ -72,7 +71,7 @@
@Retention(RUNTIME)
@Documented
public @interface Specializes {
-
+
/**
* Supports inline instantiation of the {@link Specializes} annotation.
*
@@ -84,7 +83,7 @@
public static final class Literal extends AnnotationLiteral implements Specializes {
private static final long serialVersionUID = 1L;
-
+ /** Default Specializes literal */
public static final Literal INSTANCE = new Literal();
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/Stereotype.java b/api/src/main/java/jakarta/enterprise/inject/Stereotype.java
index 803077330..4fbc9fb80 100644
--- a/api/src/main/java/jakarta/enterprise/inject/Stereotype.java
+++ b/api/src/main/java/jakarta/enterprise/inject/Stereotype.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -28,31 +25,31 @@
*
* Specifies that an annotation type is a stereotype.
*
- *
+ *
*
* In many systems, use of architectural patterns produces a set of recurring bean roles. A stereotype allows a framework
* developer to identify such a role and declare some common metadata for beans with that role in a central place.
*
- *
+ *
*
* A bean may declare zero, one or multiple stereotypes, by applying the stereotype annotation to the bean class or producer
* method or field.
*
- *
+ *
*
* A stereotype encapsulates any combination of:
*
- *
+ *
*
*
a default scope, and
*
a set of interceptor bindings.
*
- *
+ *
*
* The default scope of a stereotype is defined by annotating the stereotype with a scope type. A stereotype may declare at most
* one scope. If a bean explicitly declares a scope, any default scopes declared by its stereotypes are ignored.
*
* 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.
*
all beans with the stereotype have defaulted bean EL names, or that
*
all beans with the stereotype are alternatives, or that
*
all beans with the stereotype have predefined {@code @Priority}.
*
- *
+ *
*
- * A stereotype may declare an empty {@link jakarta.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.
+ * A stereotype may declare an empty {@link jakarta.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.
*
- * A stereotype may declare an {@link Alternative @Alternative} annotation, which specifies that
- * every bean with the stereotype is an alternative.
+ * A stereotype may declare an {@link Alternative @Alternative} annotation, which specifies that every bean with the
+ * stereotype is an alternative.
*
- * A stereotype may declare a {@link jakarta.annotation.Priority @Priority} annotation, which specifies that
- * every bean with the stereotype is enabled and has given priority.
+ * A stereotype may declare a {@link jakarta.annotation.Priority @Priority} annotation, which specifies that every bean
+ * with the stereotype is enabled and has given priority.
*
*
*
@@ -139,9 +136,9 @@
* 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 Model the built-in stereotype @Model
- *
+ *
* @author Pete Muir
* @author Gavin King
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/TransientReference.java b/api/src/main/java/jakarta/enterprise/inject/TransientReference.java
index cc5213b91..f87a2a085 100644
--- a/api/src/main/java/jakarta/enterprise/inject/TransientReference.java
+++ b/api/src/main/java/jakarta/enterprise/inject/TransientReference.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -29,21 +26,22 @@
/**
*
- * If a parameter annotated with @TransientReference resolves to a dependent scoped bean, then the bean will be
+ * If a parameter annotated with @TransientReference resolves to a dependent scoped bean, then the bean will
+ * be
* destroyed after the invocation completes.
*
- *
+ *
*
* public class OrderManager {
- *
- * @Inject
+ *
+ * @Inject
* public OrderManager(@TransientReference Order order) {
* ...
- *
+ *
* }
* }
*
- *
+ *
* @author Pete Muir
* @since 1.1
*/
@@ -52,7 +50,7 @@
@Retention(RUNTIME)
@Documented
public @interface TransientReference {
-
+
/**
* Supports inline instantiation of the {@link TransientReference} annotation.
*
@@ -64,7 +62,7 @@
public static final class Literal extends AnnotationLiteral implements TransientReference {
private static final long serialVersionUID = 1L;
-
+ /** Default TransientReference literal */
public static final Literal INSTANCE = new Literal();
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/Typed.java b/api/src/main/java/jakarta/enterprise/inject/Typed.java
index d7241d197..f1386222b 100644
--- a/api/src/main/java/jakarta/enterprise/inject/Typed.java
+++ b/api/src/main/java/jakarta/enterprise/inject/Typed.java
@@ -1,8 +1,5 @@
/*
- * 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.
@@ -57,8 +54,8 @@
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.
+ * 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
@@ -72,13 +69,20 @@
* @since 2.0
*/
public final static class Literal extends AnnotationLiteral implements Typed {
-
- public static final Literal INSTANCE = of(new Class>[]{});
+ /** Default Typed literal */
+ public static final Literal INSTANCE = of(new Class>[] {});
private static final long serialVersionUID = 1L;
+ /** The classes corresponding to the bean types of the bean */
private final Class>[] value;
+ /**
+ * Obtain the Typed literal for the provided bean types
+ *
+ * @param value the classes corresponding to the bean types of the bean
+ * @return a new Literal value for the provided classes
+ */
public static Literal of(Class>[] value) {
return new Literal(value);
}
@@ -87,6 +91,9 @@ private Literal(Class>[] value) {
this.value = value;
}
+ /**
+ * @return the classes corresponding to the bean types of the bean
+ */
public Class>[] value() {
return value;
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/UnproxyableResolutionException.java b/api/src/main/java/jakarta/enterprise/inject/UnproxyableResolutionException.java
index 7ffb0f1db..0020620a5 100644
--- a/api/src/main/java/jakarta/enterprise/inject/UnproxyableResolutionException.java
+++ b/api/src/main/java/jakarta/enterprise/inject/UnproxyableResolutionException.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -22,7 +19,7 @@
* 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
*/
@@ -30,20 +27,39 @@ public class UnproxyableResolutionException extends ResolutionException {
private static final long serialVersionUID = 1667539354548135465L;
+ /**
+ * Creates the exception with no detail message or cause.
+ */
public UnproxyableResolutionException() {
super();
}
- public UnproxyableResolutionException(String message, Throwable throwable) {
- super(message, throwable);
+ /**
+ * Creates the exception with given detail message and cause.
+ *
+ * @param message the detail message
+ * @param cause the cause
+ */
+ public UnproxyableResolutionException(String message, Throwable cause) {
+ super(message, cause);
}
+ /**
+ * Creates the exception with given detail message.
+ *
+ * @param message the detail message
+ */
public UnproxyableResolutionException(String message) {
super(message);
}
- public UnproxyableResolutionException(Throwable throwable) {
- super(throwable);
+ /**
+ * Creates the exception with given cause.
+ *
+ * @param cause the cause
+ */
+ public UnproxyableResolutionException(Throwable cause) {
+ super(cause);
}
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/UnsatisfiedResolutionException.java b/api/src/main/java/jakarta/enterprise/inject/UnsatisfiedResolutionException.java
index b32a09648..5f5be3169 100644
--- a/api/src/main/java/jakarta/enterprise/inject/UnsatisfiedResolutionException.java
+++ b/api/src/main/java/jakarta/enterprise/inject/UnsatisfiedResolutionException.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -21,7 +18,7 @@
* 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
*/
@@ -29,20 +26,39 @@ public class UnsatisfiedResolutionException extends ResolutionException {
private static final long serialVersionUID = 5350603312442756709L;
+ /**
+ * Creates the exception with no detail message or cause.
+ */
public UnsatisfiedResolutionException() {
super();
}
- public UnsatisfiedResolutionException(String message, Throwable throwable) {
- super(message, throwable);
+ /**
+ * Creates the exception with given detail message and cause.
+ *
+ * @param message the detail message
+ * @param cause the cause
+ */
+ public UnsatisfiedResolutionException(String message, Throwable cause) {
+ super(message, cause);
}
+ /**
+ * Creates the exception with given detail message.
+ *
+ * @param message the detail message
+ */
public UnsatisfiedResolutionException(String message) {
super(message);
}
- public UnsatisfiedResolutionException(Throwable throwable) {
- super(throwable);
+ /**
+ * Creates the exception with given cause.
+ *
+ * @param cause the cause
+ */
+ public UnsatisfiedResolutionException(Throwable cause) {
+ super(cause);
}
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/Vetoed.java b/api/src/main/java/jakarta/enterprise/inject/Vetoed.java
index 15677518c..5ad2a76c4 100644
--- a/api/src/main/java/jakarta/enterprise/inject/Vetoed.java
+++ b/api/src/main/java/jakarta/enterprise/inject/Vetoed.java
@@ -1,15 +1,12 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2013, 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,
+ * 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.
@@ -30,20 +27,20 @@
*
* Veto the processing of the class. Any beans or observer methods defined by this class will not be installed.
*
- *
+ *
*
* When placed on package, all beans in the package are prevented from being installed. If packages are split across jars,
* non-portable behavior results. An application can prevent packages being split across jars by sealing the package.
*
- *
+ *
*
* No container lifecycle events are fired for classes annotated {@link Vetoed}.
*
- *
+ *
* @author Stuart Douglas
* @since 1.1
* @see JAR File Specification
- *
+ *
*/
@Target({ ElementType.TYPE, ElementType.PACKAGE })
@Retention(RetentionPolicy.RUNTIME)
@@ -61,7 +58,7 @@
public static final class Literal extends AnnotationLiteral implements Vetoed {
private static final long serialVersionUID = 1L;
-
+ /** Default Vetoed literal */
public static final Literal INSTANCE = new Literal();
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/AnnotationBuilder.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/AnnotationBuilder.java
index a89ec8520..a7c3d174d 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/AnnotationBuilder.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/AnnotationBuilder.java
@@ -10,13 +10,13 @@
package jakarta.enterprise.inject.build.compatible.spi;
+import java.lang.annotation.Annotation;
+
import jakarta.enterprise.lang.model.AnnotationInfo;
import jakarta.enterprise.lang.model.AnnotationMember;
import jakarta.enterprise.lang.model.declarations.ClassInfo;
import jakarta.enterprise.lang.model.types.Type;
-import java.lang.annotation.Annotation;
-
/**
* Builder for annotations of given type.
* Expected usage is:
@@ -780,7 +780,7 @@ default AnnotationBuilder value(Annotation[] values) {
*
* @return the built {@link AnnotationInfo}, never {@code null}
* @throws IllegalStateException if a value of some annotation member was not set, and that member
- * does not declare a default value
+ * does not declare a default value
*/
AnnotationInfo build();
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/AnnotationBuilderFactory.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/AnnotationBuilderFactory.java
index 36258e3c6..51f9e60b2 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/AnnotationBuilderFactory.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/AnnotationBuilderFactory.java
@@ -10,10 +10,10 @@
package jakarta.enterprise.inject.build.compatible.spi;
-import jakarta.enterprise.lang.model.declarations.ClassInfo;
-
import java.lang.annotation.Annotation;
+import jakarta.enterprise.lang.model.declarations.ClassInfo;
+
/**
* Supports instantiating {@link AnnotationBuilder}.
* Should not be called directly by users; the static methods on {@link AnnotationBuilder} are preferred.
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BeanInfo.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BeanInfo.java
index 2aeb0a495..9b14eb3f7 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BeanInfo.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BeanInfo.java
@@ -10,12 +10,13 @@
package jakarta.enterprise.inject.build.compatible.spi;
+import java.util.Collection;
+
import jakarta.enterprise.lang.model.AnnotationInfo;
import jakarta.enterprise.lang.model.declarations.ClassInfo;
import jakarta.enterprise.lang.model.declarations.FieldInfo;
import jakarta.enterprise.lang.model.declarations.MethodInfo;
import jakarta.enterprise.lang.model.types.Type;
-import java.util.Collection;
/**
* Beans are:
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BuildCompatibleExtension.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BuildCompatibleExtension.java
index 2b5e58592..452b5436b 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BuildCompatibleExtension.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BuildCompatibleExtension.java
@@ -49,9 +49,10 @@
* Build compatible extensions may be annotated {@link SkipIfPortableExtensionPresent @SkipIfPortableExtensionPresent}
* when they are supposed to be ignored in presence of a given portable extension.
*
- * CDI implementations are not required to accept custom implementations of any {@code jakarta.enterprise.lang.model}
- * or {@code jakarta.enterprise.inject.build.compatible.spi} interface. In other words, users may only use instances
- * of these interfaces that they previously obtained from the corresponding API. If not, non-portable behavior results.
+ * CDI implementations are not required to accept custom implementations of any {@code jakarta.enterprise.lang.model},
+ * {@code jakarta.enterprise.invoke} or {@code jakarta.enterprise.inject.build.compatible.spi} interface
+ * on the API boundary of build compatible extensions. In other words, users may only use instances of these
+ * interfaces that they previously obtained from the corresponding API. If not, non-portable behavior results.
*
* In build compatible extensions, implementations of {@link jakarta.enterprise.lang.model.AnnotationTarget}
* only return annotations with the {@linkplain java.lang.annotation.RetentionPolicy#RUNTIME runtime} retention policy.
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BuildServicesResolver.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BuildServicesResolver.java
index e5178faac..c8cda6297 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BuildServicesResolver.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BuildServicesResolver.java
@@ -17,7 +17,13 @@
import java.util.Set;
import java.util.TreeSet;
-final class BuildServicesResolver {
+/**
+ * An internal helper to resolve {@link BuildServices} implementations.
+ * This class is public only for integrators and should not be used by applications.
+ *
+ * @since 4.0
+ */
+public final class BuildServicesResolver {
private static final Object lock = new Object();
private static volatile Set discoveredBuildServices;
private static volatile BuildServices configuredBuildServices;
@@ -48,7 +54,7 @@ private static void discoverFactories() {
BuildServices.class, BuildServicesResolver.class.getClassLoader());
if (!loader.iterator().hasNext()) {
- throw new IllegalStateException("Unable to locate AnnotationBuilderFactory implementation");
+ throw new IllegalStateException("Unable to locate BuildServices implementation");
}
try {
@@ -61,4 +67,20 @@ private static void discoverFactories() {
BuildServicesResolver.discoveredBuildServices = Collections.unmodifiableSet(factories);
}
+
+ /**
+ * This method should not be used by applications. It is only exposed for integrators
+ * with complex classloading architectures, where service loader lookup doesn't work out of the box.
+ * With this method, an integrator may manually provide an instance of {@link BuildServices} and
+ * this class will no longer attempt to look it up using service loader.
+ *
+ * @param instance a {@link BuildServices} instance that should be used, must not be {@code null}
+ * @throws IllegalArgumentException if the provided argument is null
+ */
+ public static void setBuildServices(BuildServices instance) {
+ if (instance == null) {
+ throw new IllegalArgumentException("BuildServices instance must not be null");
+ }
+ configuredBuildServices = instance;
+ }
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/ClassConfig.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/ClassConfig.java
index a3dd06625..dfc7cca82 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/ClassConfig.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/ClassConfig.java
@@ -10,13 +10,13 @@
package jakarta.enterprise.inject.build.compatible.spi;
-import jakarta.enterprise.lang.model.AnnotationInfo;
-import jakarta.enterprise.lang.model.declarations.ClassInfo;
-
import java.lang.annotation.Annotation;
import java.util.Collection;
import java.util.function.Predicate;
+import jakarta.enterprise.lang.model.AnnotationInfo;
+import jakarta.enterprise.lang.model.declarations.ClassInfo;
+
/**
* Allows adding annotations to and removing annotations from a class.
* Note that the class is not physically altered, the modifications
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/DeclarationConfig.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/DeclarationConfig.java
index ec6027afc..7877dae1c 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/DeclarationConfig.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/DeclarationConfig.java
@@ -10,12 +10,12 @@
package jakarta.enterprise.inject.build.compatible.spi;
-import jakarta.enterprise.lang.model.AnnotationInfo;
-import jakarta.enterprise.lang.model.declarations.DeclarationInfo;
-
import java.lang.annotation.Annotation;
import java.util.function.Predicate;
+import jakarta.enterprise.lang.model.AnnotationInfo;
+import jakarta.enterprise.lang.model.declarations.DeclarationInfo;
+
/**
* Allows adding annotations to and removing annotations from a declaration.
* Note that the declaration is not physically altered, the modifications
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/FieldConfig.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/FieldConfig.java
index 445b37b65..41809f346 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/FieldConfig.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/FieldConfig.java
@@ -10,12 +10,12 @@
package jakarta.enterprise.inject.build.compatible.spi;
-import jakarta.enterprise.lang.model.AnnotationInfo;
-import jakarta.enterprise.lang.model.declarations.FieldInfo;
-
import java.lang.annotation.Annotation;
import java.util.function.Predicate;
+import jakarta.enterprise.lang.model.AnnotationInfo;
+import jakarta.enterprise.lang.model.declarations.FieldInfo;
+
/**
* Allows adding annotations to and removing annotations from a field.
* Note that the field is not physically altered, the modifications
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/InjectionPointInfo.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/InjectionPointInfo.java
index 9f45d90ef..6d4a73430 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/InjectionPointInfo.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/InjectionPointInfo.java
@@ -10,10 +10,11 @@
package jakarta.enterprise.inject.build.compatible.spi;
+import java.util.Collection;
+
import jakarta.enterprise.lang.model.AnnotationInfo;
import jakarta.enterprise.lang.model.declarations.DeclarationInfo;
import jakarta.enterprise.lang.model.types.Type;
-import java.util.Collection;
/**
* An injection point defined on some bean. Injection points may be fields
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/InterceptorInfo.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/InterceptorInfo.java
index 63647af47..438238168 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/InterceptorInfo.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/InterceptorInfo.java
@@ -10,11 +10,11 @@
package jakarta.enterprise.inject.build.compatible.spi;
+import java.util.Collection;
+
import jakarta.enterprise.inject.spi.InterceptionType;
import jakarta.enterprise.lang.model.AnnotationInfo;
-import java.util.Collection;
-
/**
* Interceptors are managed beans annotated {@link jakarta.interceptor.Interceptor @Interceptor}.
* An interceptor declares a set of {@linkplain jakarta.interceptor.InterceptorBinding interceptor binding annotations},
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/InvokerFactory.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/InvokerFactory.java
new file mode 100644
index 000000000..4af852535
--- /dev/null
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/InvokerFactory.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2024 Red Hat and others
+ *
+ * This program and the accompanying materials are made available under the
+ * Apache Software License 2.0 which is available at:
+ * https://www.apache.org/licenses/LICENSE-2.0.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+package jakarta.enterprise.inject.build.compatible.spi;
+
+import jakarta.enterprise.invoke.InvokerBuilder;
+import jakarta.enterprise.lang.model.declarations.MethodInfo;
+
+/**
+ * Factory for {@link InvokerBuilder}s.
+ *
+ * @since 4.1
+ */
+public interface InvokerFactory {
+ /**
+ * Returns a new {@link InvokerBuilder} for given method of given bean. The builder
+ * eventually produces an opaque representation of the generated invoker.
+ *
+ * If an invoker may not be built for given {@code bean} or for given {@code method},
+ * an exception is thrown.
+ *
+ * @param bean target bean of the invoker, must not be {@code null}
+ * @param method target method of the invoker, must not be {@code null}
+ * @return the invoker builder, never {@code null}
+ */
+ InvokerBuilder createInvoker(BeanInfo bean, MethodInfo method);
+}
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/InvokerInfo.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/InvokerInfo.java
new file mode 100644
index 000000000..5f4f28bf3
--- /dev/null
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/InvokerInfo.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2022 Red Hat and others
+ *
+ * This program and the accompanying materials are made available under the
+ * Apache Software License 2.0 which is available at:
+ * https://www.apache.org/licenses/LICENSE-2.0.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+package jakarta.enterprise.inject.build.compatible.spi;
+
+import jakarta.enterprise.invoke.Invoker;
+import jakarta.enterprise.invoke.InvokerBuilder;
+import jakarta.enterprise.lang.model.declarations.MethodInfo;
+
+/**
+ * Opaque token that stands in for an invoker registered using {@link InvokerFactory#createInvoker(BeanInfo, MethodInfo)}
+ * and {@link InvokerBuilder#build()}. It can only be used to materialize an {@link Invoker} in a synthetic component;
+ * see {@link SyntheticBeanBuilder#withParam(String, InvokerInfo) SyntheticBeanBuilder.withParam()} or
+ * {@link SyntheticObserverBuilder#withParam(String, InvokerInfo) SyntheticObserverBuilder.withParam()}.
+ *
+ * @since 4.1
+ */
+public interface InvokerInfo {
+}
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/MetaAnnotations.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/MetaAnnotations.java
index ce1d2c96e..35f982b46 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/MetaAnnotations.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/MetaAnnotations.java
@@ -10,10 +10,9 @@
package jakarta.enterprise.inject.build.compatible.spi;
-import jakarta.enterprise.context.spi.AlterableContext;
-
import java.lang.annotation.Annotation;
-import java.util.function.Consumer;
+
+import jakarta.enterprise.context.spi.AlterableContext;
/**
* Allows registering custom CDI meta-annotations: qualifiers, interceptor bindings,
@@ -72,7 +71,7 @@ public interface MetaAnnotations {
* @param scopeAnnotation the scope annotation type, must not be {@code null}
* @param contextClass the context class, must not be {@code null}
* @throws IllegalArgumentException if the {@code scopeAnnotation} is not meta-annotated {@code @NormalScope}
- * or {@code @Scope}
+ * or {@code @Scope}
*/
void addContext(Class extends Annotation> scopeAnnotation, Class extends AlterableContext> contextClass);
@@ -88,5 +87,6 @@ public interface MetaAnnotations {
* @param isNormal whether the scope is normal
* @param contextClass the context class, must not be {@code null}
*/
- void addContext(Class extends Annotation> scopeAnnotation, boolean isNormal, Class extends AlterableContext> contextClass);
+ void addContext(Class extends Annotation> scopeAnnotation, boolean isNormal,
+ Class extends AlterableContext> contextClass);
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/MethodConfig.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/MethodConfig.java
index 7ece8a60f..aee868a1e 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/MethodConfig.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/MethodConfig.java
@@ -10,13 +10,13 @@
package jakarta.enterprise.inject.build.compatible.spi;
-import jakarta.enterprise.lang.model.AnnotationInfo;
-import jakarta.enterprise.lang.model.declarations.MethodInfo;
-
import java.lang.annotation.Annotation;
import java.util.List;
import java.util.function.Predicate;
+import jakarta.enterprise.lang.model.AnnotationInfo;
+import jakarta.enterprise.lang.model.declarations.MethodInfo;
+
/**
* Allows adding annotations to and removing annotations from a method.
* Note that the method is not physically altered, the modifications
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/ObserverInfo.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/ObserverInfo.java
index 52f66eac5..215105508 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/ObserverInfo.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/ObserverInfo.java
@@ -10,14 +10,15 @@
package jakarta.enterprise.inject.build.compatible.spi;
+import java.util.Collection;
+
+import jakarta.enterprise.event.Reception;
+import jakarta.enterprise.event.TransactionPhase;
import jakarta.enterprise.lang.model.AnnotationInfo;
import jakarta.enterprise.lang.model.declarations.ClassInfo;
import jakarta.enterprise.lang.model.declarations.MethodInfo;
import jakarta.enterprise.lang.model.declarations.ParameterInfo;
import jakarta.enterprise.lang.model.types.Type;
-import java.util.Collection;
-import jakarta.enterprise.event.Reception;
-import jakarta.enterprise.event.TransactionPhase;
/**
* Observers are:
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/ParameterConfig.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/ParameterConfig.java
index 05407decf..17e14ac93 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/ParameterConfig.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/ParameterConfig.java
@@ -10,12 +10,12 @@
package jakarta.enterprise.inject.build.compatible.spi;
-import jakarta.enterprise.lang.model.AnnotationInfo;
-import jakarta.enterprise.lang.model.declarations.ParameterInfo;
-
import java.lang.annotation.Annotation;
import java.util.function.Predicate;
+import jakarta.enterprise.lang.model.AnnotationInfo;
+import jakarta.enterprise.lang.model.declarations.ParameterInfo;
+
/**
* Allows adding annotations to and removing annotations from a method parameter.
* Note that the method parameter is not physically altered, the modifications
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/Parameters.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/Parameters.java
index 54ad368dc..6cef3a40a 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/Parameters.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/Parameters.java
@@ -10,6 +10,8 @@
package jakarta.enterprise.inject.build.compatible.spi;
+import jakarta.enterprise.invoke.Invoker;
+
/**
* A {@code String}-keyed parameter map. The parameter mappings are defined
* by a synthetic component builder. The CDI container passes the parameter map
@@ -18,10 +20,10 @@
*
*
*
a synthetic bean {@linkplain SyntheticBeanCreator creation} and
- * {@linkplain SyntheticBeanDisposer destruction} function, defined by
- * {@link SyntheticBeanBuilder};
+ * {@linkplain SyntheticBeanDisposer destruction} function, defined by
+ * {@link SyntheticBeanBuilder};
*
a synthetic observer {@linkplain SyntheticObserver notification}
- * function, defined by {@link SyntheticObserverBuilder}.
+ * function, defined by {@link SyntheticObserverBuilder}.
*
*
* Parameter values are transferred from the builder to the {@code Parameters}-accepting
@@ -40,13 +42,16 @@
*
* Annotation-typed parameters are available as instances of the annotation type,
* even if an instance of {@code AnnotationInfo} was passed to the builder.
+ *
+ * Invoker-typed parameters are available as instances of {@link Invoker}, even though
+ * an instance of {@code InvokerInfo} was passed to the builder.
*/
public interface Parameters {
/**
* Returns the value of a parameter with given {@code key}. The value is expected to be of given {@code type}.
*
- * @param key the parameter key; must not be {@code null}
- * @param type the parameter type; must not be {@code null}
+ * @param key the parameter key, must not be {@code null}
+ * @param type the parameter type, must not be {@code null}
* @param the parameter type
* @return the parameter value, or {@code null} if parameter with given {@code key} does not exist
* @throws ClassCastException if the parameter exists, but is of a different type
@@ -57,8 +62,8 @@ public interface Parameters {
* Returns the value of a parameter with given {@code key}. The value is expected to be of given {@code type}.
* If the parameter does not exist, returns {@code defaultValue}.
*
- * @param key the parameter key; must not be {@code null}
- * @param type the parameter type; must not be {@code null}
+ * @param key the parameter key, must not be {@code null}
+ * @param type the parameter type, must not be {@code null}
* @param defaultValue the value to return if parameter with given {@code key} does not exist
* @param the parameter type
* @return the parameter value, or {@code defaultValue} if parameter with given {@code key} does not exist
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/Registration.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/Registration.java
index 219f33d1a..2f128d70e 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/Registration.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/Registration.java
@@ -41,14 +41,15 @@
* If the {@code @Registration} method has a parameter of type {@code ObserverInfo}, the method is called once
* for each observer whose observed event type is assignable to at least one expected type.
*
- * Note that interceptors are beans, and {@code InterceptorInfo} is a subtype of {@code BeanInfo}, so if the method
- * has a parameter of type {@code BeanInfo}, it will be called for interceptors as well.
+ * Note that {@code InterceptorInfo} is a subtype of {@code BeanInfo}, so if the method has a parameter
+ * of type {@code BeanInfo}, it will be called for interceptors as well.
*
* If the {@code @Registration} method doesn't declare any parameter of one of these types,
* or if it declares more than one, the container treats it as a definition error.
*
* Additionally, methods annotated {@code @Registration} may declare parameters of these types:
*
+ *
{@link InvokerFactory}
*
{@link Messages}
*
{@link Types}
*
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/ScannedClasses.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/ScannedClasses.java
index fcf769594..3c44069e8 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/ScannedClasses.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/ScannedClasses.java
@@ -26,7 +26,7 @@ public interface ScannedClasses {
* by the container, leads to non-portable behavior.
*
* @param className binary name of the class, as defined by The Java™ Language Specification;
- * in other words, the class name as returned by {@link Class#getName()}
+ * in other words, the class name as returned by {@link Class#getName()}
*/
void add(String className);
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SkipIfPortableExtensionPresent.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SkipIfPortableExtensionPresent.java
index e3207071b..10ad684fd 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SkipIfPortableExtensionPresent.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SkipIfPortableExtensionPresent.java
@@ -10,13 +10,13 @@
package jakarta.enterprise.inject.build.compatible.spi;
-import jakarta.enterprise.inject.spi.Extension;
-
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+import jakarta.enterprise.inject.spi.Extension;
+
/**
* If a {@linkplain BuildCompatibleExtension build compatible extension} is annotated
* {@code @SkipIfPortableExtensionPresent}, it is ignored when the CDI container
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/StereotypeInfo.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/StereotypeInfo.java
index f6c7d2166..8f923d5c1 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/StereotypeInfo.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/StereotypeInfo.java
@@ -10,9 +10,10 @@
package jakarta.enterprise.inject.build.compatible.spi;
-import jakarta.enterprise.lang.model.AnnotationInfo;
import java.util.Collection;
+import jakarta.enterprise.lang.model.AnnotationInfo;
+
/**
* A stereotype. May define {@linkplain #defaultScope() default scope},
* a set of {@linkplain #interceptorBindings() interceptor bindings},
@@ -55,7 +56,7 @@ public interface StereotypeInfo {
* Returns {@code null} if this stereotype is not meta-annotated {@code @Priority}.
*
* @return the {@link jakarta.annotation.Priority @Priority} value declared by this stereotype, or {@code null}
- * if this stereotype is not meta-annotated {@code @Priority}
+ * if this stereotype is not meta-annotated {@code @Priority}
*/
Integer priority();
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticBeanBuilder.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticBeanBuilder.java
index 2f2b8f1ea..74d768813 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticBeanBuilder.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticBeanBuilder.java
@@ -10,12 +10,12 @@
package jakarta.enterprise.inject.build.compatible.spi;
+import java.lang.annotation.Annotation;
+
import jakarta.enterprise.lang.model.AnnotationInfo;
import jakarta.enterprise.lang.model.declarations.ClassInfo;
import jakarta.enterprise.lang.model.types.Type;
-import java.lang.annotation.Annotation;
-
/**
* Builder for synthetic beans.
* Instances are not reusable. For each synthetic bean, new instance
@@ -100,7 +100,8 @@ public interface SyntheticBeanBuilder {
/**
* Sets the scope of this synthetic bean to given scope type.
*
- * If not called, this synthetic bean will be {@code @Dependent}.
+ * If not called, and if no stereotype is added that defines a scope,
+ * this synthetic bean will be {@code @Dependent}.
*
* @param scopeAnnotation the scope type, must not be {@code null}
* @return this {@code SyntheticBeanBuilder}
@@ -131,7 +132,6 @@ public interface SyntheticBeanBuilder {
* that it is not enabled, which is equivalent to not registering it at all.
*
* If not called, this synthetic bean will not have a priority.
- * If this synthetic bean is not an alternative, the priority is ignored.
*
* @param priority the priority of this synthetic bean
* @return this {@code SyntheticBeanBuilder}
@@ -405,6 +405,36 @@ public interface SyntheticBeanBuilder {
*/
SyntheticBeanBuilder withParam(String key, Annotation[] value);
+ /**
+ * Adds an invoker-valued parameter to the parameter map. The parameter map is passed
+ * to the {@linkplain SyntheticBeanCreator creation} and {@linkplain SyntheticBeanDisposer destruction}
+ * functions when a bean instance is created/destroyed.
+ *
+ * When looked up from the parameter map in the creation/destruction function, the value will be
+ * an instance of {@link jakarta.enterprise.invoke.Invoker Invoker}, not an {@code InvokerInfo}.
+ *
+ * @param key the parameter key, must not be {@code null}
+ * @param value the parameter value
+ * @return this {@code SyntheticBeanBuilder}
+ * @since 4.1
+ */
+ SyntheticBeanBuilder withParam(String key, InvokerInfo value);
+
+ /**
+ * Adds an invoker array-valued parameter to the parameter map. The parameter map is passed
+ * to the {@linkplain SyntheticBeanCreator creation} and {@linkplain SyntheticBeanDisposer destruction}
+ * functions when a bean instance is created/destroyed.
+ *
+ * When looked up from the parameter map in the creation/destruction function, the values will be
+ * instances of {@link jakarta.enterprise.invoke.Invoker Invoker}, not {@code InvokerInfo}.
+ *
+ * @param key the parameter key, must not be {@code null}
+ * @param value the parameter value
+ * @return this {@code SyntheticBeanBuilder}
+ * @since 4.1
+ */
+ SyntheticBeanBuilder withParam(String key, InvokerInfo[] value);
+
/**
* Sets the class of the synthetic bean {@linkplain SyntheticBeanCreator creation} function.
* CDI container will create an instance of the creation function every time when it needs
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticComponents.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticComponents.java
index 949d17af8..3e83ab0d4 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticComponents.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticComponents.java
@@ -20,14 +20,14 @@
public interface SyntheticComponents {
/**
* Creates a {@link SyntheticBeanBuilder} that allows configuring a new synthetic bean
- * of given {@code beanClass}. The synthetic bean will be registered at the end of
+ * of given {@code implementationClass}. The synthetic bean will be registered at the end of
* the {@link Synthesis @Synthesis} method.
*
- * @param beanClass the bean class of the new synthetic bean, must not be {@code null}
- * @param the bean class of the new synthetic bean
+ * @param implementationClass the implementation class of the new synthetic bean, must not be {@code null}
+ * @param the implementation class of the new synthetic bean
* @return a new {@link SyntheticBeanBuilder}, never {@code null}
*/
- SyntheticBeanBuilder addBean(Class beanClass);
+ SyntheticBeanBuilder addBean(Class implementationClass);
/**
* Creates a {@link SyntheticObserverBuilder} that allows configuring a new synthetic observer
@@ -47,6 +47,7 @@ public interface SyntheticComponents {
*
* This method is supposed to be called with explicitly provided type arguments. For example,
* to define a synthetic observer of event type {@code List}, one would call:
+ *
*
{@code
* // types is of type Types
* // syntheticComponents is of type SyntheticComponents
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticObserverBuilder.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticObserverBuilder.java
index 25fffcb7b..dc7b9ce32 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticObserverBuilder.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticObserverBuilder.java
@@ -10,13 +10,13 @@
package jakarta.enterprise.inject.build.compatible.spi;
+import java.lang.annotation.Annotation;
+
import jakarta.enterprise.event.TransactionPhase;
import jakarta.enterprise.lang.model.AnnotationInfo;
import jakarta.enterprise.lang.model.declarations.ClassInfo;
import jakarta.enterprise.lang.model.types.Type;
-import java.lang.annotation.Annotation;
-
/**
* Builder for synthetic observers.
* Instances are not reusable. For each synthetic observer, new instance
@@ -334,6 +334,34 @@ public interface SyntheticObserverBuilder {
*/
SyntheticObserverBuilder withParam(String key, Annotation[] value);
+ /**
+ * Adds an invoker-valued parameter to the parameter map. The parameter map is passed
+ * to the {@linkplain SyntheticObserver event notification} function when the event is fired.
+ *
+ * When looked up from the parameter map in the event notification function, the value will be
+ * an instance of {@link jakarta.enterprise.invoke.Invoker Invoker}, not an {@code InvokerInfo}.
+ *
+ * @param key the parameter key, must not be {@code null}
+ * @param value the parameter value
+ * @return this {@code SyntheticBeanBuilder}
+ * @since 4.1
+ */
+ SyntheticObserverBuilder withParam(String key, InvokerInfo value);
+
+ /**
+ * Adds an invoker array-valued parameter to the parameter map. The parameter map is passed
+ * to the {@linkplain SyntheticObserver event notification} function when the event is fired.
+ *
+ * When looked up from the parameter map in the event notification function, the values will be
+ * instances of {@link jakarta.enterprise.invoke.Invoker Invoker}, not {@code InvokerInfo}.
+ *
+ * @param key the parameter key, must not be {@code null}
+ * @param value the parameter value
+ * @return this {@code SyntheticBeanBuilder}
+ * @since 4.1
+ */
+ SyntheticObserverBuilder withParam(String key, InvokerInfo[] value);
+
/**
* Sets the class of the synthetic observer {@linkplain SyntheticObserver event notification} function.
* CDI container will create an instance of the event notification function every time when it needs
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/Types.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/Types.java
index c7fa26490..c497fe016 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/Types.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/Types.java
@@ -31,7 +31,8 @@ public interface Types {
* For example:
*
*
{@code of(void.class)}: same as {@link #ofVoid() ofVoid}{@code ()}
- *
{@code of(int.class)}: same as {@link #ofPrimitive(PrimitiveType.PrimitiveKind) ofPrimitive}{@code (PrimitiveKind.INT)}
+ *
{@code of(int.class)}: same as {@link #ofPrimitive(PrimitiveType.PrimitiveKind)
+ * ofPrimitive}{@code (PrimitiveKind.INT)}
*
{@code of(String.class)}: same as {@link #ofClass(ClassInfo) ofClass}{@code (... ClassInfo for String ...)}
*
{@code of(int[].class)}: same as {@link #ofArray(Type, int) ofArray}{@code (ofPrimitive(PrimitiveKind.INT), 1)}
*
{@code of(String[][].class)}: same as {@code ofArray(ofClass(... ClassInfo for String ...), 2)}
@@ -100,7 +101,7 @@ public interface Types {
* @param typeArguments one or more type arguments
* @return the parameterized type, never {@code null}
* @throws IllegalArgumentException if given {@code genericType} is not generic or if the number of type arguments
- * does not match the number of type parameters declared by {@code genericType}
+ * does not match the number of type parameters declared by {@code genericType}
*/
ParameterizedType parameterized(Class> genericType, Class>... typeArguments);
@@ -113,12 +114,12 @@ public interface Types {
* @param typeArguments one or more type arguments
* @return the parameterized type, never {@code null}
* @throws IllegalArgumentException if given {@code genericType} is not generic or if the number of type arguments
- * does not match the number of type parameters declared by {@code genericType}
+ * does not match the number of type parameters declared by {@code genericType}
*/
ParameterizedType parameterized(Class> genericType, Type... typeArguments);
/**
- * Returns a {@link ParameterizedType} for the given generic type and type arguments.
+ * Returns a {@link ParameterizedType} for the given generic type and type arguments.
* The array of type arguments must have the same shape as the generic type's
* list of type parameters.
*
@@ -126,7 +127,7 @@ public interface Types {
* @param typeArguments one or more type arguments
* @return the parameterized type, never {@code null}
* @throws IllegalArgumentException if given {@code genericType} is not generic or if the number of type arguments
- * does not match the number of type parameters declared by {@code genericType}
+ * does not match the number of type parameters declared by {@code genericType}
*/
ParameterizedType parameterized(ClassType genericType, Type... typeArguments);
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/package-info.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/package-info.java
index e6222925a..852da0990 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/package-info.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/package-info.java
@@ -9,7 +9,9 @@
*/
/**
- *
diff --git a/api/src/main/java/jakarta/enterprise/inject/literal/InjectLiteral.java b/api/src/main/java/jakarta/enterprise/inject/literal/InjectLiteral.java
index 8667d894c..3a94bfbe1 100644
--- a/api/src/main/java/jakarta/enterprise/inject/literal/InjectLiteral.java
+++ b/api/src/main/java/jakarta/enterprise/inject/literal/InjectLiteral.java
@@ -1,8 +1,5 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2008, 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.
@@ -26,7 +23,7 @@
* @since 2.0
*/
public final class InjectLiteral extends AnnotationLiteral implements Inject {
-
+ /** Default Inject literal */
public static final InjectLiteral INSTANCE = new InjectLiteral();
private static final long serialVersionUID = 1L;
diff --git a/api/src/main/java/jakarta/enterprise/inject/literal/NamedLiteral.java b/api/src/main/java/jakarta/enterprise/inject/literal/NamedLiteral.java
index f622f63b3..2d355ab64 100644
--- a/api/src/main/java/jakarta/enterprise/inject/literal/NamedLiteral.java
+++ b/api/src/main/java/jakarta/enterprise/inject/literal/NamedLiteral.java
@@ -1,8 +1,5 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2008, 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.
@@ -27,13 +24,20 @@
* @since 2.0
*/
public final class NamedLiteral extends AnnotationLiteral implements Named {
-
+ /** Default Named literal */
public static final Named INSTANCE = of("");
private static final long serialVersionUID = 1L;
+ /** The name */
private final String value;
+ /**
+ * Create a new NamedLiteral for the given name value
+ *
+ * @param value the name
+ * @return new NamedLiteral
+ */
public static NamedLiteral of(String value) {
return new NamedLiteral(value);
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/literal/QualifierLiteral.java b/api/src/main/java/jakarta/enterprise/inject/literal/QualifierLiteral.java
index 30cffd7e9..7b43962fe 100644
--- a/api/src/main/java/jakarta/enterprise/inject/literal/QualifierLiteral.java
+++ b/api/src/main/java/jakarta/enterprise/inject/literal/QualifierLiteral.java
@@ -1,8 +1,5 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2008, 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.
@@ -26,7 +23,7 @@
* @since 2.0
*/
public final class QualifierLiteral extends AnnotationLiteral implements Qualifier {
-
+ /** Default Qualifier literal */
public static final QualifierLiteral INSTANCE = new QualifierLiteral();
private static final long serialVersionUID = 1L;
diff --git a/api/src/main/java/jakarta/enterprise/inject/literal/SingletonLiteral.java b/api/src/main/java/jakarta/enterprise/inject/literal/SingletonLiteral.java
index 83ab126a2..e188ddd63 100644
--- a/api/src/main/java/jakarta/enterprise/inject/literal/SingletonLiteral.java
+++ b/api/src/main/java/jakarta/enterprise/inject/literal/SingletonLiteral.java
@@ -1,8 +1,5 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2008, 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.
@@ -26,7 +23,7 @@
* @since 2.0
*/
public final class SingletonLiteral extends AnnotationLiteral implements Singleton {
-
+ /** Default Singleton literal */
public static final SingletonLiteral INSTANCE = new SingletonLiteral();
private static final long serialVersionUID = 1L;
diff --git a/api/src/main/java/jakarta/enterprise/inject/se/SeContainer.java b/api/src/main/java/jakarta/enterprise/inject/se/SeContainer.java
index 9c003aa24..e31975d51 100644
--- a/api/src/main/java/jakarta/enterprise/inject/se/SeContainer.java
+++ b/api/src/main/java/jakarta/enterprise/inject/se/SeContainer.java
@@ -1,8 +1,5 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2016, 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.
@@ -29,20 +26,22 @@
* If no qualifier is passed to {@link #select} method, the @Default qualifier is assumed.
*
*
- *
CDI Lite implementations are not required to provide support for CDI in Java SE.
+ *
+ * CDI Lite implementations are not required to provide support for CDI in Java SE.
+ *
*
* @author Antoine Sabot-Durand
* @author John D. Ament
* @author Graeme Rocher
* @since 2.0
*/
-public interface SeContainer extends Instance
CDI Lite implementations are not required to provide support for Portable Extensions.
- *
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ *
* @author David Allen
* @author Antoine Sabot-Durand
*/
@@ -53,7 +52,7 @@ 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}
* @throws IllegalStateException if called outside of the observer method invocation
*/
@@ -91,14 +90,15 @@ public interface AfterBeanDiscovery {
* {@link ObserverMethod} and then registers the
* {@link ObserverMethod} with the container, thereby making it available for event
* notifications.
- *
+ *
* @param observerMethod The custom observer method to add to the deployment
* @throws IllegalStateException if called outside of the observer method invocation
*/
public void addObserverMethod(ObserverMethod> observerMethod);
/**
- * obtains a new {@link ObserverMethodConfigurator} to configure a new {@link ObserverMethod} and add it at the end of the observer invocation.
+ * obtains a new {@link ObserverMethodConfigurator} to configure a new {@link ObserverMethod} and add it at the end of the
+ * observer invocation.
* It will then fire an event of type {@link ProcessObserverMethod} containing the built
* {@link ObserverMethod} from this configuration and then registers the
* {@link ObserverMethod} with the container, thereby making it available for event
@@ -115,16 +115,16 @@ public interface AfterBeanDiscovery {
/**
* Registers a custom {@link Context} object with the container.
- *
+ *
* @param context The custom context to add to the deployment
- * @throws IllegalStateException if called outside of the observer method invocation
+ * @throws IllegalStateException if called outside of the observer method invocation
*/
public void addContext(Context context);
/**
* Obtain the {@link AnnotatedType} that may be used to read the annotations of the given class or interface as defined
* during container initialization.
- *
+ *
* @param the class or interface
* @param type the {@link java.lang.Class} object
* @param id the type identifier. If null, the fully qualifier class name of type is used
@@ -137,7 +137,7 @@ public interface AfterBeanDiscovery {
/**
* Obtain the {@link AnnotatedType}s that may be used to read the annotations of the given class or interface as defined
* during container initialization.
- *
+ *
* @param the class or interface
* @param type the {@link java.lang.Class} object
* @return the {@link AnnotatedType}s
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/AfterDeploymentValidation.java b/api/src/main/java/jakarta/enterprise/inject/spi/AfterDeploymentValidation.java
index 16c2bcb2f..b86380b0c 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/AfterDeploymentValidation.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/AfterDeploymentValidation.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -26,7 +23,9 @@
* No requests will be processed by the deployment until all observers of this event return.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @author David Allen
*/
@@ -35,7 +34,7 @@ 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}
* @throws IllegalStateException if called outside of the observer method invocation
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/AfterTypeDiscovery.java b/api/src/main/java/jakarta/enterprise/inject/spi/AfterTypeDiscovery.java
index 64a0dfd53..a65c335bd 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/AfterTypeDiscovery.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/AfterTypeDiscovery.java
@@ -1,15 +1,12 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2013, 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,
+ * 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.
@@ -17,9 +14,10 @@
package jakarta.enterprise.inject.spi;
-import jakarta.enterprise.inject.spi.configurator.AnnotatedTypeConfigurator;
import java.util.List;
+import jakarta.enterprise.inject.spi.configurator.AnnotatedTypeConfigurator;
+
/**
*
* This event type is thrown by the container after type discovery is complete. If any observer method of the
@@ -32,7 +30,9 @@
* Changes made to these lists after the invocation of the last observer method of the {@code AfterTypeDiscovery} are ignored.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @author Pete Muir
* @author Antoine Sabot-Durand
@@ -41,33 +41,35 @@
public interface AfterTypeDiscovery {
/**
- * @return the list of enabled alternatives for the application, sorted by priority in ascending order. Alternatives enabled for a bean archive are not included.
+ * @return the list of enabled alternatives for the application, sorted by priority in ascending order. Alternatives enabled
+ * for a bean archive are not included.
* @throws IllegalStateException if called outside of the observer method invocation
*/
public List> getAlternatives();
/**
- * @return the list of enabled interceptors for the application, sorted by priority in ascending order. Interceptors enabled for a bean archive are not included.
+ * @return the list of enabled interceptors for the application, sorted by priority in ascending order. Interceptors enabled
+ * for a bean archive are not included.
* @throws IllegalStateException if called outside of the observer method invocation
*/
public List> getInterceptors();
/**
- * @return the list of enabled decorators for the application, sorted by priority in ascending order. Decorators enabled for a bean archive are not included.
+ * @return the list of enabled decorators for the application, sorted by priority in ascending order. Decorators enabled for
+ * a bean archive are not included.
* @throws IllegalStateException if called outside of the observer method invocation
*/
public List> getDecorators();
/**
*
- * Adds a given {@link AnnotatedType} to the set of types which will be scanned during bean
- * discovery.
+ * Adds a given {@link AnnotatedType} to the set of types which will be scanned during bean discovery.
*
*
*
- * Thanks to the id parameter, this method allows multiple annotated types, based on the same underlying type, to be defined. {@link AnnotatedType}s
- * discovered by the container use the fully qualified class name of {@link AnnotatedType#getJavaClass()} to identify the
- * type.
+ * Thanks to the id parameter, this method allows multiple annotated types, based on the same underlying type, to be
+ * defined. {@link AnnotatedType}s discovered by the container use the fully qualified class name of
+ * {@link AnnotatedType#getJavaClass()} to identify the type.
*
*
*
@@ -83,15 +85,15 @@ public interface AfterTypeDiscovery {
/**
*
- * Obtains a new {@link AnnotatedTypeConfigurator} to configure a new {@link AnnotatedType} and
- * add it to the set of types which will be scanned during bean discovery at the end of the observer invocation.
- * Calling this method multiple times will return a new AnnotatedTypeConfigurator.
+ * Obtains a new {@link AnnotatedTypeConfigurator} to configure a new {@link AnnotatedType} and add it to the set of types
+ * which will be scanned during bean discovery at the end of the observer invocation. Calling this method multiple times
+ * will return a new AnnotatedTypeConfigurator.
*
*
*
- * Thanks to the id parameter, this method allows multiple annotated types, based on the same underlying type, to be defined. {@link AnnotatedType}s
- * discovered by the container use the fully qualified class name of {@link AnnotatedType#getJavaClass()} to identify the
- * type.
+ * Thanks to the id parameter, this method allows multiple annotated types, based on the same underlying type, to be
+ * defined. {@link AnnotatedType}s discovered by the container use the fully qualified class name of
+ * {@link AnnotatedType#getJavaClass()} to identify the type.
*
*
*
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/Annotated.java b/api/src/main/java/jakarta/enterprise/inject/spi/Annotated.java
index 3f96a5634..d6d6cd363 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/Annotated.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/Annotated.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -25,15 +22,15 @@
/**
*
* Represents a Java program element that can be annotated.
- *
- *
+ *
+ *
* @see java.lang.reflect.AnnotatedElement
- *
+ *
* @author Gavin King
* @author Pete Muir
* @author Clint Popetz
* @author John D. Ament
- *
+ *
*/
public interface Annotated {
@@ -41,7 +38,7 @@ public interface Annotated {
*
* Get the type of the annotated program element.
*
- *
+ *
* @return the type of the annotated program element
*/
Type getBaseType();
@@ -50,7 +47,7 @@ public interface Annotated {
*
* 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
*/
Set getTypeClosure();
@@ -61,7 +58,7 @@ public interface Annotated {
*
* The behavior of this method is intended to be the same behavior as {@link AnnotatedElement#getAnnotation(Class)},
* where repeatable annotations are not supported.
- *
+ *
*
* @param the type of the annotation
* @param annotationType the class of the annotation type
@@ -79,7 +76,7 @@ public interface Annotated {
* where repeatable annotations are supported.
*
*
- * @param the type of the annotation
+ * @param the type of the annotation
* @param annotationType the class of the annotation type
* @return the program element annotations of the given annotation type, or an empty collection
*/
@@ -89,7 +86,7 @@ public interface Annotated {
*
* Get all annotations of the program element.
*
- *
+ *
* @return all annotations of the program element, or an empty set if no annotations are present
*/
Set getAnnotations();
@@ -102,7 +99,8 @@ public interface Annotated {
* program element.
*
* @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
+ * @return true if the program element has an annotation of the given annotation type, or false
+ * otherwise
*/
boolean isAnnotationPresent(Class extends Annotation> annotationType);
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedCallable.java b/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedCallable.java
index 1d02a9b8d..7dec4d726 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedCallable.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedCallable.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -22,10 +19,10 @@
*
* Represents a callable member of a Java type.
*
- *
+ *
* @author Gavin King
* @author Pete Muir
- *
+ *
* @param the declaring type
*/
public interface AnnotatedCallable extends AnnotatedMember {
@@ -34,7 +31,7 @@ public interface AnnotatedCallable extends AnnotatedMember {
*
* Get the parameters of the callable member.
*
- *
+ *
* @return the parameters
*/
public List> getParameters();
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedConstructor.java b/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedConstructor.java
index f02315734..52f1555c8 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedConstructor.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedConstructor.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -17,21 +14,21 @@
package jakarta.enterprise.inject.spi;
+import static java.util.Arrays.asList;
+
import java.lang.annotation.Annotation;
import java.lang.reflect.Constructor;
import java.util.LinkedHashSet;
import java.util.Set;
-import static java.util.Arrays.asList;
-
/**
*
* Represents a constructor of a Java class.
*
- *
+ *
* @author Gavin King
* @author Pete Muir
- *
+ *
* @param the declaring class
* @see Constructor
*/
@@ -41,12 +38,13 @@ public interface AnnotatedConstructor extends AnnotatedCallable {
*
* Get the underlying {@link Constructor}.
*
- *
+ *
* @return the constructor
*/
public Constructor getJavaMember();
- @Override default Set getAnnotations(Class annotationType) {
+ @Override
+ default Set getAnnotations(Class annotationType) {
T[] annotationsByType = getJavaMember().getAnnotationsByType(annotationType);
return new LinkedHashSet<>(asList(annotationsByType));
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedField.java b/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedField.java
index 6ec363710..ec4da00c4 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedField.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedField.java
@@ -1,36 +1,33 @@
/*
- * 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,
+ * 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 jakarta.enterprise.inject.spi;
+import static java.util.Arrays.asList;
+
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.util.LinkedHashSet;
import java.util.Set;
-import static java.util.Arrays.asList;
-
/**
*
* Represents a field of a Java class.
*
- *
+ *
* @author Gavin King
* @author Pete Muir
- *
+ *
* @param the declaring type
* @see Field
*/
@@ -40,12 +37,13 @@ public interface AnnotatedField extends AnnotatedMember {
*
* Get the underlying {@link Field}.
*
- *
+ *
* @return the {@link Field}
*/
public Field getJavaMember();
- @Override default Set getAnnotations(Class annotationType) {
+ @Override
+ default Set getAnnotations(Class annotationType) {
T[] annotationsByType = getJavaMember().getAnnotationsByType(annotationType);
return new LinkedHashSet<>(asList(annotationsByType));
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedMember.java b/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedMember.java
index 575c0d603..84016820e 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedMember.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedMember.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -23,10 +20,10 @@
*
* Represents a member of a Java type.
*
- *
+ *
* @author Gavin King
* @author Pete Muir
- *
+ *
* @param the declaring type
* @see Member
*/
@@ -35,7 +32,7 @@ public interface AnnotatedMember extends Annotated {
*
* Get the underlying {@link Member}.
*
- *
+ *
* @return the {@link Member}
*/
public Member getJavaMember();
@@ -44,7 +41,7 @@ public interface AnnotatedMember extends Annotated {
*
* Determines if the member is static.
*
- *
+ *
* @return true if the member is static
*/
public boolean isStatic();
@@ -53,7 +50,7 @@ public interface AnnotatedMember extends Annotated {
*
* Get the {@linkplain AnnotatedType type} which defines this member.
*
- *
+ *
* @return the type which defines this member
*/
public AnnotatedType getDeclaringType();
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedMethod.java b/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedMethod.java
index c865c4f49..f89e81485 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedMethod.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedMethod.java
@@ -1,36 +1,33 @@
/*
- * 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,
+ * 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 jakarta.enterprise.inject.spi;
+import static java.util.Arrays.asList;
+
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.util.LinkedHashSet;
import java.util.Set;
-import static java.util.Arrays.asList;
-
/**
*
* Represents a method of a Java type.
*
- *
+ *
* @author Gavin King
* @author Pete Muir
- *
+ *
* @param the declaring type
* @see Method
*/
@@ -40,12 +37,13 @@ public interface AnnotatedMethod extends AnnotatedCallable {
*
* Get the underlying {@link Method}.
*
- *
+ *
* @return the {@link Method}
*/
public Method getJavaMember();
- @Override default Set getAnnotations(Class annotationType) {
+ @Override
+ default Set getAnnotations(Class annotationType) {
T[] annotationsByType = getJavaMember().getAnnotationsByType(annotationType);
return new LinkedHashSet<>(asList(annotationsByType));
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedParameter.java b/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedParameter.java
index a0f9b1f6a..bddc512b8 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedParameter.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedParameter.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -17,6 +14,8 @@
package jakarta.enterprise.inject.spi;
+import static java.util.Arrays.asList;
+
import java.lang.annotation.Annotation;
import java.lang.reflect.Executable;
import java.lang.reflect.Member;
@@ -24,17 +23,15 @@
import java.util.LinkedHashSet;
import java.util.Set;
-import static java.util.Arrays.asList;
-
/**
*
* Represents a parameter of a method or constructor.
*
- *
+ *
* @author Gavin King
* @author Pete Muir
* @author Jozef Hartinger
- *
+ *
* @param the type that declares the method or constructor
*/
public interface AnnotatedParameter extends Annotated {
@@ -43,7 +40,7 @@ public interface AnnotatedParameter extends Annotated {
*
* Get the position of the parameter in the method or constructor argument list.
*
- *
+ *
* @return the position of the parameter
*/
public int getPosition();
@@ -52,7 +49,7 @@ public interface AnnotatedParameter extends Annotated {
*
* Get the declaring {@linkplain AnnotatedCallable method or constructor}.
*
- *
+ *
* @return the declaring callable
*/
public AnnotatedCallable getDeclaringCallable();
@@ -71,7 +68,8 @@ default Parameter getJavaParameter() {
return executable.getParameters()[getPosition()];
}
- @Override default Set getAnnotations(Class annotationType) {
+ @Override
+ default Set getAnnotations(Class annotationType) {
T[] annotationsByType = getJavaParameter().getAnnotationsByType(annotationType);
return new LinkedHashSet<>(asList(annotationsByType));
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedType.java b/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedType.java
index bc4ab0c42..ab17b40dd 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedType.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedType.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -17,20 +14,20 @@
package jakarta.enterprise.inject.spi;
+import static java.util.Arrays.asList;
+
import java.lang.annotation.Annotation;
import java.util.LinkedHashSet;
import java.util.Set;
-import static java.util.Arrays.asList;
-
/**
*
* Represents a Java class or interface.
*
- *
+ *
* @author Gavin King
* @author Pete Muir
- *
+ *
* @param the type
* @see java.lang.Class
*/
@@ -40,7 +37,7 @@ public interface AnnotatedType extends Annotated {
*
* Get the underlying {@link java.lang.Class}.
*
- *
+ *
* @return the {@link java.lang.Class}
*/
public Class getJavaClass();
@@ -50,7 +47,7 @@ public interface AnnotatedType extends Annotated {
* Get the {@linkplain AnnotatedConstructor constructors} of the type. If an empty set is returned, a default constructor
* with no parameters will be assumed.
*
- *
+ *
* @return the constructors, or an empty set if none are defined
*/
public Set> getConstructors();
@@ -59,7 +56,7 @@ public interface AnnotatedType extends Annotated {
*
* Get the {@linkplain AnnotatedMethod methods} of the type.
*
- *
+ *
* @return the methods, or an empty set if none are defined
*/
public Set> getMethods();
@@ -67,13 +64,14 @@ public interface AnnotatedType extends Annotated {
/**
*
* Get the {@linkplain AnnotatedField fields} of the type.
- *
- *
+ *
+ *
* @return the fields, or an empty set if none are defined
*/
public Set> getFields();
- @Override default Set getAnnotations(Class annotationType) {
+ @Override
+ default Set getAnnotations(Class annotationType) {
T[] annotationsByType = getJavaClass().getAnnotationsByType(annotationType);
return new LinkedHashSet<>(asList(annotationsByType));
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/Bean.java b/api/src/main/java/jakarta/enterprise/inject/spi/Bean.java
index 433659234..2c23f4bc0 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/Bean.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/Bean.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -20,14 +17,13 @@
import java.util.Set;
import jakarta.enterprise.context.spi.Contextual;
-import jakarta.enterprise.context.spi.CreationalContext;
/**
*
* Represents an {@linkplain jakarta.enterprise.inject enabled bean}. This interface defines everything the container needs to
* manage instances of the bean.
*
- *
+ *
* @author Gavin King
* @author David Allen
* @param the class of the bean instance
@@ -37,7 +33,7 @@ public interface Bean extends Contextual, BeanAttributes {
/**
* The bean {@linkplain Class class} of the managed bean or session bean or of the bean that declares the producer method or
* field.
- *
+ *
* @return the bean {@linkplain Class class}
*/
public Class> getBeanClass();
@@ -45,7 +41,7 @@ public interface Bean extends Contextual, BeanAttributes {
/**
* Obtains the {@link InjectionPoint} objects representing injection points of the bean, that
* will be validated by the container at initialization time.
- *
+ *
* @return the set of {@linkplain InjectionPoint injection points} of the bean
*/
public Set getInjectionPoints();
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/BeanAttributes.java b/api/src/main/java/jakarta/enterprise/inject/spi/BeanAttributes.java
index 9782b30f2..3005132ee 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/BeanAttributes.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/BeanAttributes.java
@@ -1,15 +1,12 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2013, 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,
+ * 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.
@@ -26,7 +23,7 @@
/**
* The BeanAttributes interface exposes the basic attributes of a bean.
- *
+ *
* @author Pete Muir
* @since 1.1
* @param the class of the bean instance
@@ -35,35 +32,35 @@ public interface BeanAttributes {
/**
* Obtains the {@linkplain jakarta.enterprise.inject bean types} of the bean.
- *
+ *
* @return the {@linkplain jakarta.enterprise.inject bean types}
*/
public Set getTypes();
/**
* Obtains the {@linkplain jakarta.inject.Qualifier qualifiers} of the bean.
- *
+ *
* @return the {@linkplain jakarta.inject.Qualifier qualifiers}
*/
public Set getQualifiers();
/**
* Obtains the {@linkplain jakarta.enterprise.context scope} of the bean.
- *
+ *
* @return the {@linkplain jakarta.enterprise.context scope}
*/
public Class extends Annotation> getScope();
/**
* Obtains the {@linkplain jakarta.enterprise.inject EL name} of a bean, if it has one.
- *
+ *
* @return the {@linkplain jakarta.enterprise.inject EL name}
*/
public String getName();
/**
* Obtains the {@linkplain Stereotype stereotypes} of the bean.
- *
+ *
* @return the set of {@linkplain Stereotype stereotypes}
*/
public Set> getStereotypes();
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/BeanContainer.java b/api/src/main/java/jakarta/enterprise/inject/spi/BeanContainer.java
index cccc6ddc8..e4d47428f 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/BeanContainer.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/BeanContainer.java
@@ -1,5 +1,24 @@
+/*
+ * Copyright 2021, Red Hat, Inc., and 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 jakarta.enterprise.inject.spi;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
+
import jakarta.enterprise.context.ContextNotActiveException;
import jakarta.enterprise.context.Dependent;
import jakarta.enterprise.context.spi.Context;
@@ -11,11 +30,6 @@
import jakarta.enterprise.inject.Instance;
import jakarta.enterprise.inject.Stereotype;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.List;
-import java.util.Set;
-
/**
*
* {@code BeanContainer} is a superclass of {@link BeanManager} containing capabilities that are portable across
@@ -37,6 +51,7 @@
*
*
* @author Matej Novotny
+ * @since 4.0
*/
public interface BeanContainer {
@@ -45,14 +60,14 @@ public interface BeanContainer {
* Obtains a contextual reference for a certain {@linkplain Bean bean} and a certain bean type of the bean.
*
*
- * @param bean the {@link Bean} object representing the bean
+ * @param bean the {@link Bean} object representing the bean
* @param beanType a bean type that must be implemented by any client proxy that is returned
- * @param ctx a {@link CreationalContext} that may be used to destroy any object with scope
- * {@link Dependent} that is created
+ * @param ctx a {@link CreationalContext} that may be used to destroy any object with scope
+ * {@link Dependent} that is created
* @return a contextual reference representing the bean
* @throws IllegalArgumentException if the given type is not a bean type of the given bean
- * @throws IllegalStateException if called during application initialization, before the {@link AfterDeploymentValidation}
- * event is fired.
+ * @throws IllegalStateException if called during application initialization, before the {@link AfterDeploymentValidation}
+ * event is fired.
*/
Object getReference(Bean> bean, Type beanType, CreationalContext> ctx);
@@ -60,9 +75,9 @@ public interface BeanContainer {
* Obtain an instance of a {@link CreationalContext} for the given
* {@linkplain Contextual contextual type}, or for a non-contextual object.
*
- * @param type of the instance
+ * @param type of the instance
* @param contextual the {@link Contextual}, or a null value in the case of a non-contextual
- * object
+ * object
* @return the new {@link CreationalContext}
*/
CreationalContext createCreationalContext(Contextual contextual);
@@ -77,14 +92,14 @@ public interface BeanContainer {
* Note that when called during invocation of an {@link AfterBeanDiscovery} event observer,
* this method will only return beans discovered by the container before the {@link AfterBeanDiscovery} event is fired.
*
- * @param beanType the required bean type
+ * @param beanType the required bean type
* @param qualifiers the required qualifiers
* @return the resulting set of {@linkplain Bean beans}
* @throws IllegalArgumentException if the given type represents a type variable
* @throws IllegalArgumentException if two instances of the same non repeating qualifier type are given
* @throws IllegalArgumentException if an instance of an annotation that is not a qualifier type is given
- * @throws IllegalStateException if called during application initialization, before the {@link AfterBeanDiscovery}
- * event is fired.
+ * @throws IllegalStateException if called during application initialization, before the {@link AfterBeanDiscovery}
+ * event is fired.
*/
Set> getBeans(Type beanType, Annotation... qualifiers);
@@ -100,7 +115,7 @@ public interface BeanContainer {
* @param name the EL name
* @return the resulting set of {@linkplain Bean beans}
* @throws IllegalStateException if called during application initialization, before the {@link AfterBeanDiscovery}
- * event is fired.
+ * event is fired.
*/
Set> getBeans(String name);
@@ -110,12 +125,12 @@ public interface BeanContainer {
* Note that when called during invocation of an {@link AfterBeanDiscovery} event observer,
* this method will only return beans discovered by the container before the {@link AfterBeanDiscovery} event is fired.
*
- * @param a common type of the beans
+ * @param a common type of the beans
* @param beans a set of {@linkplain Bean beans} of the given type
* @return the resolved bean, or null if null or an empty set is passed
* @throws AmbiguousResolutionException if the ambiguous dependency resolution rules fail
- * @throws IllegalStateException if called during application initialization, before the {@link AfterBeanDiscovery}
- * event is fired.
+ * @throws IllegalStateException if called during application initialization, before the {@link AfterBeanDiscovery}
+ * event is fired.
*/
Bean extends X> resolve(Set> beans);
@@ -125,15 +140,15 @@ public interface BeanContainer {
* Note that when called during invocation of an {@link AfterBeanDiscovery} event observer,
* this method will only return observers discovered by the container before the {@link AfterBeanDiscovery} event is fired.
*
- * @param the type of the event
- * @param event the event object
+ * @param the type of the event
+ * @param event the event object
* @param qualifiers the event qualifiers
* @return the resulting set of {@linkplain ObserverMethod observer methods}
* @throws IllegalArgumentException if the runtime type of the event object contains a type variable
* @throws IllegalArgumentException if two instances of the same non repeating qualifier type are given
* @throws IllegalArgumentException if an instance of an annotation that is not a qualifier type is given
- * @throws IllegalStateException if called during application initialization, before the {@link AfterBeanDiscovery}
- * event is fired.
+ * @throws IllegalStateException if called during application initialization, before the {@link AfterBeanDiscovery}
+ * event is fired.
*/
Set> resolveObserverMethods(T event, Annotation... qualifiers);
@@ -148,14 +163,14 @@ public interface BeanContainer {
* this method will only return interceptors discovered by the container before the {@link AfterBeanDiscovery} event is
* fired.
*
- * @param type the type of the interception
+ * @param type the type of the interception
* @param interceptorBindings the interceptor bindings
* @return the resulting set of {@linkplain Interceptor interceptors}
* @throws IllegalArgumentException if no interceptor binding type is given
* @throws IllegalArgumentException if two instances of the same interceptor binding type are given
* @throws IllegalArgumentException if an instance of an annotation that is not an interceptor binding type is given
- * @throws IllegalStateException if called during application initialization, before the {@link AfterBeanDiscovery}
- * event is fired.
+ * @throws IllegalStateException if called during application initialization, before the {@link AfterBeanDiscovery}
+ * event is fired.
*/
List> resolveInterceptors(InterceptionType type, Annotation... interceptorBindings);
@@ -196,8 +211,9 @@ public interface BeanContainer {
* binding type} .
*
* @param annotationType the annotation to test
- * @return true if the annotation type is a {@linkplain jakarta.interceptor.InterceptorBinding interceptor binding
- * type}
+ * @return true if the annotation type is a {@linkplain jakarta.interceptor.InterceptorBinding interceptor
+ * binding
+ * type}
*/
boolean isInterceptorBinding(Class extends Annotation> annotationType);
@@ -208,12 +224,22 @@ public interface BeanContainer {
* @param scopeType the {@linkplain jakarta.enterprise.context scope}
* @return the {@linkplain Context context object}
* @throws ContextNotActiveException if there is no active context object for the given scope
- * @throws IllegalArgumentException if there is more than one active context object for the given scope
+ * @throws IllegalArgumentException if there is more than one active context object for the given scope
*/
Context getContext(Class extends Annotation> scopeType);
/**
- * Returns an instance of Event with specified type java.lang.Object and specified qualifier @Default
+ * Obtains all {@linkplain Context context objects}, active and inactive, for the given
+ * {@linkplain jakarta.enterprise.context scope}.
+ *
+ * @param scopeType the {@linkplain jakarta.enterprise.context scope}; must not be {@code null}
+ * @return immutable collection of {@linkplain Context context objects}; never {@code null}, but may be empty
+ */
+ Collection getContexts(Class extends Annotation> scopeType);
+
+ /**
+ * Returns an instance of Event with specified type java.lang.Object and specified qualifier
+ * @Default
* It allows typesafe synchronous or asynchronous event firing without injection of {@link Event} built-in bean requirement.
*
* @return a new {@link Event} object whose event type is Object and qualifier @Default
@@ -221,27 +247,75 @@ public interface BeanContainer {
*/
Event getEvent();
-
/**
* Obtains an {@link Instance} object to access to beans instances.
*
- * The returned Instance object can only access instances of beans that are available for injection in the module
- * or library containing the class into which the BeanManager/BeanContainer was injected
+ * The returned Instance object can only access instances of beans that are available for injection in the
+ * module or library containing the class into which the BeanManager/BeanContainer was injected
* or, in the Jakarta EE environment, the Jakarta EE component from whose JNDI environment namespace the
* BeanContainer was obtained, according to the rules of typesafe resolution.
*
- * Note that when called during invocation of an {@link AfterBeanDiscovery} event observer,
- * the Instance returned by this method will only give access to instances of beans discovered by the container
- * before the {@link AfterBeanDiscovery} event is fired.
- *
- * Instances of dependent scoped beans obtained with this Instance must be explicitly destroyed by calling {@link Instance#destroy(Object)}
+ * Instances of dependent scoped beans obtained with this Instance must be explicitly destroyed by calling
+ * {@link Instance#destroy(Object)}
*
* If no qualifier is passed to {@link Instance#select} method, the @Default qualifier is assumed.
*
* @return an {@link Instance} object to request beans instances
* @throws IllegalStateException if called during application initialization, before the {@link AfterDeploymentValidation}
- * event is fired.
+ * event is fired.
* @since 2.0
*/
Instance createInstance();
+
+ /**
+ * Returns {@code true} if a bean with given bean types and qualifiers would be assignable
+ * to an injection point with given required type and required qualifiers, {@code false} otherwise.
+ *
+ * In line with the specification for beans and typesafe resolution, the set of
+ * {@code beanTypes} is considered to always include {@code java.lang.Object}.
+ * Types in {@code beanTypes} that are not legal bean types are ignored.
+ * The set of {@code beanQualifiers} is considered to always include {@code @Any} and
+ * also include {@code @Default} when it contains no other qualifier but {@code @Any}
+ * and {@code @Named}. The set of {@code requiredQualifiers} is considered to include
+ * {@code @Default} when it is empty.
+ *
+ * Throws {@link IllegalArgumentException} if any of the arguments is {@code null}
+ * or if any of the {@code beanQualifiers} or {@code requiredQualifiers} is not
+ * a qualifier annotation.
+ *
+ * @param beanTypes bean types of a bean; must not be {@code null}
+ * @param beanQualifiers qualifiers of a bean; must not be {@code null}
+ * @param requiredType required type of an injection point; must not be {@code null}
+ * @param requiredQualifiers required qualifiers of an injection point; must not be {@code null}
+ * @return {@code true} if a bean with given bean types and qualifiers would be assignable
+ * to an injection point with given required type and required qualifiers, {@code false} otherwise
+ */
+ boolean isMatchingBean(Set beanTypes, Set beanQualifiers, Type requiredType,
+ Set requiredQualifiers);
+
+ /**
+ * Returns {@code true} if an event with given specified type and specified qualifiers would
+ * match an observer method with given observed event type and observed event qualifiers,
+ * {@code false} otherwise.
+ *
+ * For the purpose of observer resolution, the {@code specifiedType} is used as the event type
+ * directly (because there is no event object in this API) and {@code specifiedQualifiers} are
+ * used as event qualifiers. In line with the specification for events and observer resolution,
+ * the set of event qualifiers is considered to always include {@code @Any}. Further, an empty
+ * set of {@code specifiedQualifiers} is considered to match the set of {@code observedEventQualifiers}
+ * which contains {@code @Default}.
+ *
+ * Throws {@link IllegalArgumentException} if any of the arguments is {@code null},
+ * if the {@code specifiedType} contains a type variable, or if any of the {@code specifiedQualifiers}
+ * or {@code observedEventQualifiers} is not a qualifier annotation.
+ *
+ * @param specifiedType specified type of an event; must not be {@code null}
+ * @param specifiedQualifiers specified qualifiers of an event; must not be {@code null}
+ * @param observedEventType observed event type of an observer method; must not be {@code null}
+ * @param observedEventQualifiers observed event qualifiers on an observer method; must not be {@code null}
+ * @return {@code true} if an event object with given type and qualifiers would result in notifying
+ * an observer method with given observed event type and observed event qualifiers, {@code false} otherwise
+ */
+ boolean isMatchingEvent(Type specifiedType, Set specifiedQualifiers, Type observedEventType,
+ Set observedEventQualifiers);
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/BeanManager.java b/api/src/main/java/jakarta/enterprise/inject/spi/BeanManager.java
index e260bc84f..f0367017f 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/BeanManager.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/BeanManager.java
@@ -1,15 +1,12 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2010, 2013 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,
+ * 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.
@@ -17,20 +14,20 @@
package jakarta.enterprise.inject.spi;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.List;
+import java.util.Set;
+
import jakarta.el.ELResolver;
import jakarta.el.ExpressionFactory;
import jakarta.enterprise.context.Dependent;
import jakarta.enterprise.context.spi.CreationalContext;
import jakarta.enterprise.inject.AmbiguousResolutionException;
import jakarta.enterprise.inject.InjectionException;
+import jakarta.enterprise.inject.Stereotype;
import jakarta.enterprise.inject.UnsatisfiedResolutionException;
import jakarta.enterprise.util.Nonbinding;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.List;
-import java.util.Set;
-
-import jakarta.enterprise.inject.Stereotype;
/**
*
@@ -39,52 +36,52 @@
*
*
*
- * In CDI Lite environment, applications may obtain a {@code BeanManager}, but invoking methods that are not inherited
- * from {@link BeanContainer} results in non-portable behavior.
+ * In CDI Lite environment, applications may obtain a {@code BeanManager}, but invoking methods that are not inherited from
+ * {@link BeanContainer} results in non-portable behavior.
*
- *
+ *
*
* Any bean may obtain an instance of BeanManager by injecting it:
*
- *
+ *
*
* @Inject
* BeanManager manager;
*
- *
+ *
*
- * Java EE components may obtain an instance of BeanManager from {@linkplain javax.naming JNDI} by looking up the name
- * {@code java:comp/BeanManager}.
+ * Java EE components may obtain an instance of BeanManager from {@linkplain javax.naming JNDI} by looking up the
+ * name {@code java:comp/BeanManager}.
*
- *
+ *
*
* Most operations of BeanManager may be called at any time during the execution of the application.
*
- *
- * However, the following operations must not be called before the {@link AfterBeanDiscovery} event is fired:
+ *
+ * However, the following operations must not be called before the {@link AfterBeanDiscovery} event is fired:
*
+ * Obtains an injectable reference for a certain {@linkplain InjectionPoint injection point}.
+ *
+ *
+ * @param ij the target injection point
+ * @param ctx a {@link CreationalContext} that may be used to destroy any object with scope
+ * {@link Dependent} that is created
+ * @return the injectable reference
+ * @throws UnsatisfiedResolutionException if typesafe resolution results in an unsatisfied dependency
+ * @throws AmbiguousResolutionException typesafe resolution results in an unresolvable ambiguous dependency
+ * @throws IllegalStateException if called during application initialization, before the {@link AfterDeploymentValidation}
+ * event is fired.
+ */
+ Object getInjectableReference(InjectionPoint ij, CreationalContext> ctx);
+
/**
* Returns the {@link PassivationCapable} bean with the given identifier.
*
- * Note that when called during invocation of an {@link AfterBeanDiscovery} event observer,
+ * Note that when called during invocation of an {@link AfterBeanDiscovery} event observer,
* this method will only return beans discovered by the container before the {@link AfterBeanDiscovery} event is fired.
- *
+ *
* @param id the identifier
* @return a {@link Bean} that implements {@link PassivationCapable} and has the given
* identifier, or a null value if there is no such bean
@@ -111,9 +124,9 @@ public interface BeanManager extends BeanContainer {
* Validate a certain {@linkplain InjectionPoint injection point}.
*
* Note that when called during invocation of an {@link AfterBeanDiscovery} event observer,
- * this method will only validate injection points discovered by the container before the {@link AfterBeanDiscovery}
+ * this method will only validate injection points discovered by the container before the {@link AfterBeanDiscovery}
* event is fired.
- *
+ *
* @param injectionPoint the {@linkplain InjectionPoint injection point} to validate
* @throws InjectionException if there is a deployment problem (for example, an unsatisfied or unresolvable ambiguous
* dependency) associated with the injection point
@@ -122,24 +135,6 @@ public interface BeanManager extends BeanContainer {
*/
public void validate(InjectionPoint injectionPoint);
- /**
- * Return an ordered set of {@linkplain ObserverMethod observer methods} for an event.
- *
- * Note that when called during invocation of an {@link AfterBeanDiscovery} event observer,
- * this method will only return observers discovered by the container before the {@link AfterBeanDiscovery} event is fired.
- *
- * @param the type of the event
- * @param event the event object
- * @param qualifiers the event qualifiers
- * @return the resulting set of {@linkplain ObserverMethod observer methods}
- * @throws IllegalArgumentException if the runtime type of the event object contains a type variable
- * @throws IllegalArgumentException if two instances of the same non repeating qualifier type are given
- * @throws IllegalArgumentException if an instance of an annotation that is not a qualifier type is given
- * @throws IllegalStateException if called during application initialization, before the {@link AfterBeanDiscovery}
- * event is fired.
- */
- public Set> resolveObserverMethods(T event, Annotation... qualifiers);
-
/**
* Return an ordered list of {@linkplain Decorator decorators} for a set of bean types and a set of qualifiers and which are
* enabled in the module or library containing the class into which the BeanManager was injected or the Java EE
@@ -147,7 +142,7 @@ public interface BeanManager extends BeanContainer {
*
* Note that when called during invocation of an {@link AfterBeanDiscovery} event observer,
* this method will only return decorators discovered by the container before the {@link AfterBeanDiscovery} event is fired.
- *
+ *
* @param types the set of bean types of the decorated bean
* @param qualifiers the qualifiers declared by the decorated bean
* @return the resulting set of {@linkplain Decorator decorators}
@@ -161,7 +156,7 @@ public interface BeanManager extends BeanContainer {
/**
* Test the given annotation type to determine if it is a passivating {@linkplain jakarta.enterprise.context scope type}.
- *
+ *
* @param annotationType the annotation type
* @return true if the annotation type is a passivating scope type
*/
@@ -170,7 +165,7 @@ public interface BeanManager extends BeanContainer {
/**
* Obtains the set of meta-annotations for a certain {@linkplain jakarta.interceptor.InterceptorBinding interceptor binding
* type} .
- *
+ *
* @param bindingType the {@linkplain jakarta.interceptor.InterceptorBinding interceptor binding type}
* @return the set of meta-annotations
*/
@@ -178,7 +173,7 @@ public interface BeanManager extends BeanContainer {
/**
* Obtains meta-annotations for a certain {@linkplain Stereotype stereotype}.
- *
+ *
* @param stereotype the {@linkplain Stereotype stereotype}
* @return the set of meta-annotations
*/
@@ -187,7 +182,7 @@ public interface BeanManager extends BeanContainer {
/**
* Determine if two qualifiers are considered equivalent for the purposes of typesafe resolution, taking into account any
* members annotated with {@link Nonbinding}.
- *
+ *
* @param qualifier1 a qualifier to check
* @param qualifier2 a qualifier to check
* @return true if the two qualifiers are equivalent, otherwise false
@@ -198,7 +193,7 @@ public interface BeanManager extends BeanContainer {
/**
* Determine if two interceptor bindings are considered equivalent for the purposes of typesafe resolution, taking into
* account any members annotated with {@link Nonbinding}.
- *
+ *
* @param interceptorBinding1 an interceptor binding to check
* @param interceptorBinding2 an interceptor binding to check
* @return true if the two interceptor bindings are equivalent, otherwise false
@@ -209,7 +204,7 @@ public interface BeanManager extends BeanContainer {
/**
* Determine the hash code of a qualifier, using the JDK algorithm for determining an annotation hash code, ignoring any
* members annotated with {@link Nonbinding}.
- *
+ *
* @param qualifier the qualifier to consider
* @return the hashCode for the qualifier
* @since 1.1
@@ -219,7 +214,7 @@ public interface BeanManager extends BeanContainer {
/**
* Determine the hash code of an interceptor binding, using the JDK algorithm for determining an annotation hash code,
* ignoring any members annotated with {@link Nonbinding}.
- *
+ *
* @param interceptorBinding the interceptor binding to consider
* @return the hashCode for the interceptor binding
* @since 1.1
@@ -228,27 +223,29 @@ public interface BeanManager extends BeanContainer {
/**
* Returns a {@link jakarta.el.ELResolver} that resolves beans by EL name.
- *
+ *
+ * @deprecated use {@code ELAwareBeanManager}, this method will be removed in CDI 5.0
* @return the {@link jakarta.el.ELResolver}
*/
+ @Deprecated(since = "4.1", forRemoval = true)
public ELResolver getELResolver();
/**
* Returns a wrapper {@link jakarta.el.ExpressionFactory} that delegates {@link jakarta.el.MethodExpression} and
- * {@link jakarta.el.ValueExpression} creation to the given {@link jakarta.el.ExpressionFactory}. When a Unified EL expression
- * is evaluated using a {@link jakarta.el.MethodExpression} or {@link jakarta.el.ValueExpression} returned by the wrapper
- * {@link jakarta.el.ExpressionFactory}, the container handles destruction of objects with scope
- * {@link Dependent}.
- *
- *
+ * {@link jakarta.el.ValueExpression} creation to the given {@link jakarta.el.ExpressionFactory}. When a Unified EL
+ * expression is evaluated using a {@link jakarta.el.MethodExpression} or {@link jakarta.el.ValueExpression} returned by the
+ * wrapper {@link jakarta.el.ExpressionFactory}, the container handles destruction of objects with scope {@link Dependent}.
+ *
+ * @deprecated use {@code ELAwareBeanManager}, this method will be removed in CDI 5.0
* @param expressionFactory the {@link jakarta.el.ExpressionFactory} to wrap
* @return the wrapped {@link jakarta.el.ExpressionFactory}
*/
+ @Deprecated(since = "4.1", forRemoval = true)
public ExpressionFactory wrapExpressionFactory(ExpressionFactory expressionFactory);
/**
* Obtain an {@link AnnotatedType} that may be used to read the annotations of the given class or interface.
- *
+ *
* @param the class or interface
* @param type the {@link java.lang.Class} object
* @return the {@link AnnotatedType}
@@ -259,7 +256,7 @@ public interface BeanManager extends BeanContainer {
*
* An implementation of {@link InjectionTargetFactory} that provides container created {@link InjectionTarget} instances.
*
- *
+ *
*
* This factory can be wrapped to add behavior to container created injection targets.
*
@@ -276,7 +273,7 @@ public interface BeanManager extends BeanContainer {
* An implementation of {@link ProducerFactory} that provides container created {@link Producer} instances for the given
* field.
*
- *
+ *
*
* This factory can be wrapped to add behavior to container created producers.
*
@@ -295,7 +292,7 @@ public interface BeanManager extends BeanContainer {
* An implementation of {@link ProducerFactory} that provides container created {@link Producer} instances for the given
* method.
*
- *
+ *
*
* This factory can be wrapped to add behavior to container created producers.
*
@@ -313,7 +310,7 @@ public interface BeanManager extends BeanContainer {
* Obtains a {@link BeanAttributes} for the given {@link AnnotatedType}. The container ignores the annotations and types
* declared by the elements of the actual Java class and uses the metadata provided via the {@link Annotated} interface
* instead.
- *
+ *
* @param the type
* @param type the {@link AnnotatedType}
* @return a container provided implementation of {@link InjectionTarget}
@@ -325,7 +322,7 @@ public interface BeanManager extends BeanContainer {
* Obtains a {@link BeanAttributes} for the given {@link AnnotatedType}. The container ignores the annotations and types
* declared by the elements of the actual Java class and uses the metadata provided via the {@link Annotated} interface
* instead.
- *
+ *
* @param type the {@link AnnotatedType}
* @return a container provided implementation of {@link InjectionTarget}
* @since 1.1
@@ -336,14 +333,14 @@ public interface BeanManager extends BeanContainer {
*
* Obtains a {@link Bean} for the given {@link BeanAttributes}, bean class and {@link InjectionTarget}.
*
- *
+ *
*
* The {@link InjectionTarget} creates and destroys instances of the bean, performs dependency injection and lifecycle
* callbacks, and determines the return value of {@link Bean#getInjectionPoints()}. The {@link InjectionTarget} is obtained
- * from the {@link InjectionTargetFactory}. {@link #getInjectionTargetFactory(AnnotatedType)} allows use of a container created
- * {@link InjectionTarget}.
+ * from the {@link InjectionTargetFactory}. {@link #getInjectionTargetFactory(AnnotatedType)} allows use of a container
+ * created {@link InjectionTarget}.
*
- *
+ *
* @param the type
* @param attributes a {@link BeanAttributes} which determines the bean types, qualifiers, scope, name and stereotypes of
* the returned {@link Bean}, and the return value of {@link Bean#isAlternative()}
@@ -359,14 +356,14 @@ public Bean createBean(BeanAttributes attributes, Class beanClass,
*
* Obtains a {@link Bean} for the given {@link BeanAttributes}, bean class and {@link Producer}.
*
- *
+ *
*
* The {@link Producer} creates and destroys instances of the decorator, and determines the return value of
* {@link Bean#getInjectionPoints()}. The {@link Producer} is obtained from the {@link ProducerFactory}.
- * {@link #getProducerFactory(AnnotatedMethod, Bean)} or {@link #getProducerFactory(AnnotatedField, Bean)} allows use of a
+ * {@link #getProducerFactory(AnnotatedMethod, Bean)} or {@link #getProducerFactory(AnnotatedField, Bean)} allows use of a
* container created {@link Producer}.
*
- *
+ *
* @param the type
* @param the type of the declaring bean
* @param attributes a {@link BeanAttributes} which determines the bean types, qualifiers, scope, name and stereotypes of
@@ -380,7 +377,7 @@ public Bean createBean(BeanAttributes attributes, Class beanClass,
/**
* Obtains a container provided implementation of {@link InjectionPoint} for the given {@link AnnotatedField}.
- *
+ *
* @param field the {@link AnnotatedField} defining the injection point
* @return the container provided {@link InjectionPoint}
* @throws IllegalArgumentException if there is a definition error associated with the injection point
@@ -390,7 +387,7 @@ public Bean createBean(BeanAttributes attributes, Class beanClass,
/**
* Obtains a container provided implementation of {@link InjectionPoint} for the given {@link AnnotatedParameter}.
- *
+ *
* @param parameter the {@link AnnotatedParameter} defining the injection point
* @return the container provided {@link InjectionPoint}
* @throws IllegalArgumentException if there is a definition error associated with the injection point
@@ -400,7 +397,7 @@ public Bean createBean(BeanAttributes attributes, Class beanClass,
/**
* Obtains the container's instance of an Extension class declared in META-INF/services.
- *
+ *
* @param the type of the extension
* @param extensionClass the type of the extension class
* @return the extension instance
@@ -421,19 +418,4 @@ public Bean createBean(BeanAttributes attributes, Class beanClass,
*/
InterceptionFactory createInterceptionFactory(CreationalContext ctx, Class clazz);
- /**
- *
- * Obtains an injectable reference for a certain {@linkplain InjectionPoint injection point}.
- *
- *
- * @param ij the target injection point
- * @param ctx a {@link CreationalContext} that may be used to destroy any object with scope
- * {@link Dependent} that is created
- * @return the injectable reference
- * @throws UnsatisfiedResolutionException if typesafe resolution results in an unsatisfied dependency
- * @throws AmbiguousResolutionException typesafe resolution results in an unresolvable ambiguous dependency
- * @throws IllegalStateException if called during application initialization, before the {@link AfterDeploymentValidation}
- * event is fired.
- */
- Object getInjectableReference(InjectionPoint ij, CreationalContext> ctx);
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/BeforeBeanDiscovery.java b/api/src/main/java/jakarta/enterprise/inject/spi/BeforeBeanDiscovery.java
index 7b3454845..60e1bea71 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/BeforeBeanDiscovery.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/BeforeBeanDiscovery.java
@@ -1,31 +1,28 @@
/*
- * 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,
+ * 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 jakarta.enterprise.inject.spi;
+import java.lang.annotation.Annotation;
+
import jakarta.enterprise.context.NormalScope;
+import jakarta.enterprise.context.spi.Context;
import jakarta.enterprise.inject.Stereotype;
import jakarta.enterprise.inject.spi.configurator.AnnotatedTypeConfigurator;
+import jakarta.enterprise.util.Nonbinding;
import jakarta.inject.Qualifier;
import jakarta.inject.Scope;
import jakarta.interceptor.InterceptorBinding;
-import java.lang.annotation.Annotation;
-
-import jakarta.enterprise.context.spi.Context;
-import jakarta.enterprise.util.Nonbinding;
/**
*
@@ -33,7 +30,9 @@
* {@code BeforeBeanDiscovery} event throws an exception, the exception is treated as a definition error by the container.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @author Pete Muir
* @author David Allen
@@ -44,11 +43,11 @@ public interface BeforeBeanDiscovery {
*
* Declares an annotation type as a {@linkplain jakarta.inject.Qualifier} qualifier type.
*
- *
+ *
*
* This is only required if you wish to make an annotation a qualifier without adding {@link Qualifier} to it.
*
- *
+ *
* @param qualifier The annotation to treat as a qualifier
* @throws IllegalStateException if called outside of the observer method invocation
*/
@@ -58,11 +57,11 @@ public interface BeforeBeanDiscovery {
*
* Declares an annotation type as a {@linkplain jakarta.inject.Qualifier} qualifier type.
*
- *
+ *
*
* This is only required if you wish to make an annotation a qualifier without adding {@link Qualifier} to it.
*
- *
+ *
* @param qualifier The annotation to treat as a qualifier
* @throws IllegalStateException if called outside of the observer method invocation
* @since 1.1
@@ -73,14 +72,14 @@ public interface BeforeBeanDiscovery {
*
* Declares an annotation type as a {@linkplain jakarta.enterprise.context scope type}.
*
- *
+ *
*
* This is only required if you wish to make an annotation a scope type without adding the {@link NormalScope} or
* {@link Scope} annotations to it. You can also use this method to override an existing normal scope definition.
*
- *
+ *
* @see AfterBeanDiscovery#addContext(Context)
- *
+ *
* @param scopeType The annotation type to treat as a {@linkplain jakarta.enterprise.context scope type}
* @param normal Indicates if the scope is normal
* @param passivating Indicates if the scope is {@linkplain PassivationCapable passivation
@@ -94,12 +93,12 @@ public interface BeforeBeanDiscovery {
* Declares an annotation type as a {@linkplain Stereotype stereotype}, and specifies its
* meta-annotations.
*
- *
+ *
*
* This is only required if you wish to make an annotation a stereotype without adding {@link Stereotype} to it. You can
* also use this method to override an existing stereotype definition.
*
- *
+ *
* @param stereotype The annotation type to treat as a {@linkplain Stereotype stereotype}
* @param stereotypeDef An optional list of annotations defining the {@linkplain Stereotype
* stereotype}
@@ -111,12 +110,12 @@ public interface BeforeBeanDiscovery {
*
* Declares an annotation type as an {@linkplain Interceptor interceptor} binding type.
*
- *
+ *
*
* This is only required if you wish to make an annotation an interceptor binding type without adding
* {@link InterceptorBinding} to it.
*
- *
+ *
* @param bindingType The annotation type to treat as an interceptor binding type
* @throws IllegalStateException if called outside of the observer method invocation
*/
@@ -126,12 +125,12 @@ public interface BeforeBeanDiscovery {
*
* Declares an annotation type as an {@linkplain Interceptor interceptor} binding type, and specifies its meta-annotations.
*
- *
+ *
*
* This is only required if you wish to make an annotation an interceptor binding type without adding
* {@link InterceptorBinding} to it.
*
- *
+ *
* @param bindingType The annotation type to treat as an interceptor binding type
* @param bindingTypeDef An optional list of annotations defining the {@linkplain Interceptor interceptor}
* @throws IllegalStateException if called outside of the observer method invocation
@@ -141,21 +140,20 @@ public interface BeforeBeanDiscovery {
/**
*
- * Adds a given {@link AnnotatedType} to the set of types which will be scanned during bean
- * discovery.
+ * Adds a given {@link AnnotatedType} to the set of types which will be scanned during bean discovery.
*
- *
+ *
*
- * Thanks to the id parameter, this method allows multiple annotated types, based on the same underlying type, to be defined. {@link AnnotatedType}s
- * discovered by the container use the fully qualified class name of {@link AnnotatedType#getJavaClass()} to identify the
- * type.
+ * Thanks to the id parameter, this method allows multiple annotated types, based on the same underlying type, to be
+ * defined. {@link AnnotatedType}s discovered by the container use the fully qualified class name of
+ * {@link AnnotatedType#getJavaClass()} to identify the type.
*
- *
+ *
*
* {@link AfterBeanDiscovery#getAnnotatedType(Class, String)} and {@link AfterBeanDiscovery#getAnnotatedTypes(Class)} allows
* annotated types to be obtained by identifier.
*
- *
+ *
* @param type The {@link AnnotatedType} to add for later scanning
* @param id the identifier used to distinguish this AnnotatedType from an other one based on the same underlying type
* @throws IllegalStateException if called outside of the observer method invocation
@@ -170,7 +168,8 @@ public interface BeforeBeanDiscovery {
*
*
*
- * Thanks to the id parameter, this method allows multiple annotated types, based on the same underlying type, to be defined with a builder.
+ * Thanks to the id parameter, this method allows multiple annotated types, based on the same underlying type, to be defined
+ * with a builder.
* {@link AnnotatedType}s discovered by the container use the fully qualified class name of
* {@link AnnotatedType#getJavaClass()} to identify the type.
*
@@ -192,7 +191,6 @@ public interface BeforeBeanDiscovery {
*/
public AnnotatedTypeConfigurator addAnnotatedType(Class type, String id);
-
/**
*
*
@@ -211,8 +209,7 @@ public interface BeforeBeanDiscovery {
* @return a non reusable {@link AnnotatedTypeConfigurator} to configure the qualifier
* @since 2.0
*/
- AnnotatedTypeConfigurator configureQualifier(Class qualifier);
-
+ AnnotatedTypeConfigurator configureQualifier(Class qualifier);
/**
*
@@ -233,7 +230,6 @@ public interface BeforeBeanDiscovery {
* @return a non reusable {@link AnnotatedTypeConfigurator} to configure the interceptor binding
* @since 2.0
*/
- AnnotatedTypeConfigurator configureInterceptorBinding(Class bindingType);
-
+ AnnotatedTypeConfigurator configureInterceptorBinding(Class bindingType);
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/BeforeShutdown.java b/api/src/main/java/jakarta/enterprise/inject/spi/BeforeShutdown.java
index 0488c1134..70a3b973d 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/BeforeShutdown.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/BeforeShutdown.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -22,7 +19,9 @@
* observer method of the {@code BeforeShutdown} event throws an exception, the exception is ignored by the container.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @author David Allen
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/CDI.java b/api/src/main/java/jakarta/enterprise/inject/spi/CDI.java
index b50f192df..ffa9a4868 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/CDI.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/CDI.java
@@ -1,15 +1,12 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2013, 2015, 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,
+ * 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.
@@ -17,8 +14,6 @@
package jakarta.enterprise.inject.spi;
-import jakarta.enterprise.inject.Instance;
-
import java.util.Collections;
import java.util.Comparator;
import java.util.ServiceConfigurationError;
@@ -26,6 +21,8 @@
import java.util.Set;
import java.util.TreeSet;
+import jakarta.enterprise.inject.Instance;
+
/**
* Provides access to the current container.
*
@@ -45,19 +42,21 @@ public abstract class CDI implements Instance {
private static final Object lock = new Object();
private static volatile boolean providerSetManually = false;
+ /** The set of discovered CDIProviders */
protected static volatile Set discoveredProviders = null;
+ /** {@link CDIProvider} set by user or retrieved by service loader */
protected static volatile CDIProvider configuredProvider = null;
/**
*
* Get the CDI instance that provides access to the current container.
*
- *
+ *
*
* If there are no providers available, an {@link IllegalStateException} is thrown, otherwise the first provider which can
* access the container is used.
*
- *
+ *
* @throws IllegalStateException if no {@link CDIProvider} is available
* @return the CDI instance
*/
@@ -68,7 +67,7 @@ public static CDI current() {
/**
*
* Obtain the {@link CDIProvider} the user set with {@link #setCDIProvider(CDIProvider)} or the last returned
- * {@link CDIProvider} if it returns valid CDI container. Otherwise use the serviceloader to retrieve the
+ * {@link CDIProvider} if it returns valid CDI container. Otherwise, use service loader mechanism to retrieve the
* {@link CDIProvider} with the highest priority.
*
* @return the {@link CDIProvider} set by user or retrieved by serviceloader
@@ -117,15 +116,14 @@ private static boolean checkProvider(CDIProvider c) {
*
*
* @param provider the provider to use
- * @throws IllegalStateException if the {@link CDIProvider} is already set
+ * @throws IllegalArgumentException if the provided argument is null
*/
public static void setCDIProvider(CDIProvider provider) {
- if (provider != null) {
- providerSetManually = true;
- configuredProvider = provider;
- } else {
- throw new IllegalStateException("CDIProvider must not be null");
+ if (provider == null) {
+ throw new IllegalArgumentException("CDIProvider must not be null");
}
+ providerSetManually = true;
+ configuredProvider = provider;
}
private static void findAllProviders() {
@@ -135,7 +133,7 @@ private static void findAllProviders() {
providerLoader = SecurityActions.loadService(CDIProvider.class, CDI.class.getClassLoader());
- if(! providerLoader.iterator().hasNext()) {
+ if (!providerLoader.iterator().hasNext()) {
throw new IllegalStateException("Unable to locate CDIProvider");
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/CDIProvider.java b/api/src/main/java/jakarta/enterprise/inject/spi/CDIProvider.java
index 1b5683e38..4811fc519 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/CDIProvider.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/CDIProvider.java
@@ -1,15 +1,12 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2013, 2015 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,
+ * 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.
@@ -19,23 +16,23 @@
/**
* Interface implemented by a CDI provider to provide access to the current container
- *
+ *
* @author Pete Muir
* @since 1.1
*/
public interface CDIProvider extends Prioritized {
+ /** The default value for {@linkplain #getPriority()} */
public static final int DEFAULT_CDI_PROVIDER_PRIORITY = 0;
/**
* Provides access to the current container
- *
+ *
* @return the CDI instance for the current container
* @throws IllegalStateException if no CDI container is available
*/
CDI getCDI();
-
@Override
default int getPriority() {
return DEFAULT_CDI_PROVIDER_PRIORITY;
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/Decorator.java b/api/src/main/java/jakarta/enterprise/inject/spi/Decorator.java
index e8025c9f6..7304f3283 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/Decorator.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/Decorator.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -32,11 +29,13 @@
* given priority value for entire application.
*
*
- *
CDI Lite implementations are not required to provide support for decorators.
+ *
+ * CDI Lite implementations are not required to provide support for decorators.
+ *
*
* @author Gavin King
* @author Pete Muir
- *
+ *
* @param the decorator bean class
*/
public interface Decorator extends Bean {
@@ -45,7 +44,7 @@ public interface Decorator extends Bean {
*
* Obtains the {@linkplain Type type} of the {@linkplain Delegate delegate injection point}.
*
- *
+ *
* @return the delegate {@linkplain Type type}
*/
public Type getDelegateType();
@@ -55,7 +54,7 @@ public interface Decorator extends Bean {
* Obtains the {@linkplain jakarta.inject.Qualifier qualifiers} of the {@linkplain Delegate delegate injection
* point}.
*
- *
+ *
* @return the delegate {@linkplain jakarta.inject.Qualifier qualifiers}
*/
public Set getDelegateQualifiers();
@@ -64,7 +63,7 @@ public interface Decorator extends Bean {
*
* Obtains the {@linkplain jakarta.decorator decorated types}.
*
- *
+ *
* @return the set of decorated {@linkplain Type types}
*/
public Set getDecoratedTypes();
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/DefinitionException.java b/api/src/main/java/jakarta/enterprise/inject/spi/DefinitionException.java
index bee83dbcb..455db37c1 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/DefinitionException.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/DefinitionException.java
@@ -1,15 +1,12 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2013, 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,
+ * 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.
@@ -21,22 +18,22 @@
*
* Thrown when a definition error occurs.
*
- *
+ *
*
* Definition errors are developer errors. They may be detected by tooling at development time, and are also detected by the
* container at initialization time. If a definition error exists in a deployment, initialization will be aborted by the
* container.
*
- *
+ *
*
* The container is permitted to define a non-portable mode, for use at development time, in which some definition errors do not
* cause application initialization to abort.
*
- *
+ *
*
* An implementation is permitted to throw a subclass of {@link DefinitionException} for any definition error which exists.
*
- *
+ *
* @author Pete Muir
* @since 1.1
*/
@@ -44,16 +41,32 @@ public class DefinitionException extends RuntimeException {
private static final long serialVersionUID = -2699170549782567339L;
- public DefinitionException(String message, Throwable t) {
- super(message, t);
+ /**
+ * Creates the exception with given detail message and cause.
+ *
+ * @param message the detail message
+ * @param cause the cause
+ */
+ public DefinitionException(String message, Throwable cause) {
+ super(message, cause);
}
+ /**
+ * Creates the exception with given detail message.
+ *
+ * @param message the detail message
+ */
public DefinitionException(String message) {
super(message);
}
- public DefinitionException(Throwable t) {
- super(t);
+ /**
+ * Creates the exception with given cause.
+ *
+ * @param cause the cause
+ */
+ public DefinitionException(Throwable cause) {
+ super(cause);
}
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/DeploymentException.java b/api/src/main/java/jakarta/enterprise/inject/spi/DeploymentException.java
index 597b26128..0970d5179 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/DeploymentException.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/DeploymentException.java
@@ -1,15 +1,12 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2013, 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,
+ * 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.
@@ -21,39 +18,55 @@
*
* Thrown when a deployment problem occurs.
*
- *
+ *
*
* Deployment problems are detected by the container at initialization time. If a deployment problem exists in a deployment,
* initialization will be aborted by the container.
*
- *
+ *
*
* The container is permitted to define a non-portable mode, for use at development time, in which some deployment problems do
* not cause application initialization to abort.
*
- *
+ *
*
* An implementation is permitted to throw a subclass of {@link DeploymentException} for any deployment problem.
*
- *
+ *
* @author Pete Muir
* @since 1.1
- *
+ *
*/
public class DeploymentException extends RuntimeException {
private static final long serialVersionUID = 2604707587772339984L;
- public DeploymentException(String message, Throwable t) {
- super(message, t);
+ /**
+ * Creates the exception with given detail message and cause.
+ *
+ * @param message the detail message
+ * @param cause the cause
+ */
+ public DeploymentException(String message, Throwable cause) {
+ super(message, cause);
}
+ /**
+ * Creates the exception with given detail message.
+ *
+ * @param message the detail message
+ */
public DeploymentException(String message) {
super(message);
}
- public DeploymentException(Throwable t) {
- super(t);
+ /**
+ * Creates the exception with given cause.
+ *
+ * @param cause the cause
+ */
+ public DeploymentException(Throwable cause) {
+ super(cause);
}
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/EventContext.java b/api/src/main/java/jakarta/enterprise/inject/spi/EventContext.java
index 264bd61db..94ad23b9e 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/EventContext.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/EventContext.java
@@ -1,15 +1,12 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2016 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,
+ * 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.
@@ -19,7 +16,7 @@
/**
* Represents a context of a fired event. Provides access to an event object and corresponding metadata.
- *
+ *
* @author Martin Kouba
* @see ObserverMethod#notify(EventContext)
* @see EventMetadata
@@ -29,13 +26,13 @@
public interface EventContext {
/**
- *
+ *
* @return the event object, aka the payload
*/
T getEvent();
/**
- *
+ *
* @return the event metadata
*/
EventMetadata getMetadata();
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/EventMetadata.java b/api/src/main/java/jakarta/enterprise/inject/spi/EventMetadata.java
index 07fe229f4..801daddbb 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/EventMetadata.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/EventMetadata.java
@@ -1,15 +1,12 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2013, 2015 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,
+ * 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.
@@ -26,19 +23,18 @@
/**
*
- * Provides access to metadata about an observed event payload. The metadata may be for events fired with either of
- * {@link Event} or {@link BeanManager#getEvent()}
+ * Provides access to metadata about an observed event payload.
*
*
* {@link EventMetadata} may only be injected into an observer method. For example:
*
- *
+ *
* @see Observes
- *
+ *
* @author Lincoln Baxter, III
* @author Pete Muir
* @author Antoine Sabot-Durand
@@ -64,5 +60,5 @@ public interface EventMetadata {
* @return the runtime type of the event object
*/
public Type getType();
-
+
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/Extension.java b/api/src/main/java/jakarta/enterprise/inject/spi/Extension.java
index 8081b2e48..acc593d69 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/Extension.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/Extension.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -24,29 +21,31 @@
*
* Service interface implemented by extensions. An extension is a service provider declared in META-INF/services.
*
- *
+ *
*
* Service providers may have {@linkplain Observes observer methods}, which may observe any event,
* including any {@linkplain jakarta.enterprise.inject.spi container lifecycle event}, and obtain an injected
* {@link 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 Default
* @Default}.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
- *
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ *
* @author Gavin King
* @author Pete Muir
- *
+ *
*/
public interface Extension {
}
\ No newline at end of file
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/InjectionPoint.java b/api/src/main/java/jakarta/enterprise/inject/spi/InjectionPoint.java
index 5c988c317..aca952360 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/InjectionPoint.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/InjectionPoint.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -22,49 +19,46 @@
import java.lang.reflect.Type;
import java.util.Set;
+import jakarta.enterprise.context.Dependent;
import jakarta.enterprise.event.Observes;
import jakarta.enterprise.inject.Disposes;
import jakarta.enterprise.inject.Instance;
-import jakarta.enterprise.context.Dependent;
import jakarta.enterprise.inject.Produces;
/**
*
* Provides access to metadata about an injection point. May represent an {@linkplain jakarta.inject.Inject injected field} or a
* parameter of a {@linkplain jakarta.inject.Inject bean constructor}, {@linkplain jakarta.inject.Inject initializer method},
- * {@linkplain Produces producer method}, {@linkplain Disposes disposer method}
- * or {@linkplain Observes observer method}.
+ * {@linkplain Produces producer method}, {@linkplain Disposes disposer method} or {@linkplain Observes observer method}.
*
- *
+ *
*
* If the injection point is a dynamically selected reference obtained then the metadata obtain reflects the injection point of
* the {@link Instance}, with the required type and any additional required qualifiers defined by {@linkplain Instance
* Instance.select()}.
*
- *
+ *
*
- * Occasionally, a bean with scope {@link 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.
+ * Occasionally, a bean with scope {@link 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 Logger s. The log category of a Logger
- * depends upon the class of the object into which it is injected.
+ * For example, the following producer method creates injectable Logger s. The log category of a
+ * Logger depends upon the class of the object into which it is injected.
*
- * Only {@linkplain Dependent dependent} objects, may obtain information about the injection point to
- * which they belong.
+ * Only {@linkplain Dependent dependent} objects, may obtain information about the injection point to which they belong.
*
- *
+ *
* @author Gavin King
* @author Pete Muir
*/
@@ -72,14 +66,14 @@ public interface InjectionPoint {
/**
* Get the required type of injection point.
- *
+ *
* @return the required type
*/
public Type getType();
/**
* Get the required qualifiers of the injection point.
- *
+ *
* @return the required qualifiers
*/
public Set getQualifiers();
@@ -87,7 +81,7 @@ public interface InjectionPoint {
/**
* Get the {@link Bean} object representing the bean that defines the injection point. If the
* injection point does not belong to a bean, return a null value.
- *
+ *
* @return the {@link Bean} object representing bean that defines the injection point, of null
* if the injection point does not belong to a bean
*/
@@ -97,7 +91,7 @@ public interface InjectionPoint {
* Get the {@link java.lang.reflect.Field} object in the case of field injection, the {@link java.lang.reflect.Method}
* object in the case of method parameter injection or the {@link java.lang.reflect.Constructor} object in the case of
* constructor parameter injection.
- *
+ *
* @return the member
*/
public Member getMember();
@@ -106,21 +100,22 @@ public interface InjectionPoint {
* Obtain an instance of {@link AnnotatedField} or
* {@link AnnotatedParameter}, depending upon whether the injection point is an injected field
* or a constructor/method parameter.
- *
+ *
* @return an {@code AnnotatedField} or {@code AnnotatedParameter}
*/
public Annotated getAnnotated();
/**
* Determines if the injection point is a decorator delegate injection point.
- *
- * @return true if the injection point is a decorator delegate injection point, and false otherwise
+ *
+ * @return true if the injection point is a decorator delegate injection point, and false
+ * otherwise
*/
public boolean isDelegate();
/**
* Determines if the injection is a transient field.
- *
+ *
* @return true if the injection point is a transient field, and false otherwise
*/
public boolean isTransient();
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/InjectionTarget.java b/api/src/main/java/jakarta/enterprise/inject/spi/InjectionTarget.java
index 647e68499..75688b3dc 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/InjectionTarget.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/InjectionTarget.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -24,11 +21,13 @@
* instance of a type.
*
*
- *
CDI Lite implementations are not required to provide support for {@code InjectionTarget}.
- *
+ *
+ * CDI Lite implementations are not required to provide support for {@code InjectionTarget}.
+ *
+ *
* @see jakarta.annotation.PostConstruct
* @see jakarta.annotation.PreDestroy
- *
+ *
* @author Pete Muir
* @author David Allen
* @param The class of the instance
@@ -40,7 +39,7 @@ public interface InjectionTarget extends Producer {
* Performs dependency injection upon the given object. Performs Java EE component environment injection, sets the value of
* all injected fields, and calls all initializer methods.
*
- *
+ *
* @param instance The instance upon which to perform injection
* @param ctx The {@link CreationalContext} to use for creating new instances
*/
@@ -48,20 +47,20 @@ public interface InjectionTarget extends Producer {
/**
*
- * Calls the {@link jakarta.annotation.PostConstruct} callback, if it exists, according to the semantics required by the Java
- * EE platform specification.
+ * Calls the {@link jakarta.annotation.PostConstruct} callback, if it exists, according to the semantics required by the
+ * Java EE platform specification.
*
- *
+ *
* @param instance The instance on which to invoke the {@link jakarta.annotation.PostConstruct} method
*/
public void postConstruct(T instance);
/**
*
- * Calls the {@link jakarta.annotation.PreDestroy} callback, if it exists, according to the semantics required by the Java EE
- * platform specification.
+ * Calls the {@link jakarta.annotation.PreDestroy} callback, if it exists, according to the semantics required by the Java
+ * EE platform specification.
*
- *
+ *
* @param instance The instance on which to invoke the {@link jakarta.annotation.PreDestroy} method
*/
public void preDestroy(T instance);
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/InjectionTargetFactory.java b/api/src/main/java/jakarta/enterprise/inject/spi/InjectionTargetFactory.java
index 047ac1c4e..e59d15556 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/InjectionTargetFactory.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/InjectionTargetFactory.java
@@ -1,15 +1,12 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2013, 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,
+ * 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.
@@ -23,29 +20,33 @@
*
* An {@link InjectionTargetFactory} can create an {@link InjectionTarget} for a given bean.
*
- *
+ *
*
- * The {@link InjectionTargetFactory} obtained from {@link BeanManager#getInjectionTargetFactory(AnnotatedType)} is capable of providing
- * container created injection targets. This factory can be wrapped to add behavior to container created injection targets.
+ * The {@link InjectionTargetFactory} obtained from {@link BeanManager#getInjectionTargetFactory(AnnotatedType)} is capable of
+ * providing container created injection targets. This factory can be wrapped to add behavior to container created injection
+ * targets.
*
CDI Lite implementations are not required to provide support for {@code InjectionTargetFactory}.
- *
+ *
+ * CDI Lite implementations are not required to provide support for {@code InjectionTargetFactory}.
+ *
+ *
* @author Pete Muir
* @author Antoine Sabot-Durand
* @since 1.1
@@ -56,7 +57,7 @@ public interface InjectionTargetFactory {
/**
* Create a new injection target for a bean.
- *
+ *
* @param bean the bean to create the injection target for, or null if creating a non-contextual object
* @return the injection target
*/
@@ -64,7 +65,8 @@ public interface InjectionTargetFactory {
/**
*
- * Returns an {@link AnnotatedTypeConfigurator} to to configure the {@link AnnotatedType} used to create the {@link InjectionTarget}.
+ * Returns an {@link AnnotatedTypeConfigurator} to to configure the {@link AnnotatedType} used to create the
+ * {@link InjectionTarget}.
*
* Each call returns the same AnnotatedTypeConfigurator.
*
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/InterceptionFactory.java b/api/src/main/java/jakarta/enterprise/inject/spi/InterceptionFactory.java
index a40173442..47a8c73bb 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/InterceptionFactory.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/InterceptionFactory.java
@@ -1,8 +1,5 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2016, 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.
@@ -38,8 +35,8 @@
*
* BeanManager bm;
*
- * public MyBean(BeanManager bm) {
- * this.bm = bm;
+ * public MyCustomBean(BeanManager bm) {
+ * this.bm = bm;
* }
*
* public MyClass create(CreationalContext<MyClass> creationalContext) {
@@ -74,7 +71,9 @@
* Instances of this class are neither reusable nor suitable for sharing between threads.
*
*
- *
CDI Lite implementations are not required to provide support for {@code InterceptionFactory}.
+ *
+ * CDI Lite implementations are not required to provide support for {@code InterceptionFactory}.
+ *
*
* @author Antoine Sabot-Durand
* @since 2.0
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/InterceptionType.java b/api/src/main/java/jakarta/enterprise/inject/spi/InterceptionType.java
index ff84e97ba..d273871ec 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/InterceptionType.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/InterceptionType.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -21,10 +18,10 @@
*
* Identifies the kind of lifecycle callback, EJB timeout method or business method interception.
*
- *
+ *
* @author Gavin King
* @author Pete Muir
- *
+ *
*/
public enum InterceptionType {
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/Interceptor.java b/api/src/main/java/jakarta/enterprise/inject/spi/Interceptor.java
index f11b3a141..7c5a141e2 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/Interceptor.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/Interceptor.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -30,11 +27,11 @@
* Since CDI 2.0, an implementation of this interface may implement {@link Prioritized} in order to enable the interceptor with
* given priority value for entire application.
*
- *
+ *
* @author Gavin King
* @author Pete Muir
* @author David Allen
- *
+ *
* @param the interceptor bean class
*/
public interface Interceptor extends Bean {
@@ -43,7 +40,7 @@ public interface Interceptor extends Bean {
*
* Obtains the {@linkplain jakarta.interceptor.InterceptorBinding interceptor bindings} of the interceptor.
*
- *
+ *
* @return the set of {@linkplain jakarta.interceptor.InterceptorBinding interceptor bindings}
*/
public Set getInterceptorBindings();
@@ -53,7 +50,7 @@ public interface Interceptor extends Bean {
* Determines if the interceptor intercepts the specified {@linkplain InterceptionType kind of lifecycle callback or method
* invocation}.
*
- *
+ *
* @param type the {@linkplain InterceptionType kind of interception}
* @return returns true if the interceptor intercepts callbacks or business methods of the given type, and
* false otherwise.
@@ -65,7 +62,7 @@ public interface Interceptor extends Bean {
* Invokes the specified {@linkplain InterceptionType kind of lifecycle callback or method invocation interception} upon the
* given interceptor instance.
*
- *
+ *
* @param type the {@linkplain InterceptionType kind of interception}
* @param instance the interceptor instance to invoke
* @param ctx the context for the invocation
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/ObserverMethod.java b/api/src/main/java/jakarta/enterprise/inject/spi/ObserverMethod.java
index 56e92f94b..f224dfb51 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/ObserverMethod.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/ObserverMethod.java
@@ -1,15 +1,12 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2010, 2015 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,
+ * 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.
@@ -20,22 +17,22 @@
import java.lang.reflect.Type;
import java.util.Set;
+import jakarta.enterprise.event.Observes;
import jakarta.enterprise.event.ObservesAsync;
import jakarta.enterprise.event.Reception;
import jakarta.enterprise.event.TransactionPhase;
-import jakarta.enterprise.event.Observes;
/**
*
* Represents an {@linkplain Observes observer method} of an {@linkplain jakarta.enterprise.inject enabled
* bean}. Defines everything the container needs to know about an observer method.
*
- *
+ *
*
* If a custom implementation of this interface does not override either {@link #notify(Object)} or
* {@link #notify(EventContext)}, the container automatically detects the problem and treats it as a definition error.
*
- *
+ *
* @author Gavin King
* @author David Allen
* @author Mark Paluch
@@ -43,14 +40,14 @@
* @param the event type
*/
public interface ObserverMethod extends Prioritized {
-
+ /** The default observer priority */
public static final int DEFAULT_PRIORITY = jakarta.interceptor.Interceptor.Priority.APPLICATION + 500;
-
+
/**
*
* Obtains the {@linkplain Class class} of the type that declares the observer method.
*
- *
+ *
* @return the defining {@linkplain Class class}
*/
public Class> getBeanClass();
@@ -67,6 +64,7 @@ public interface ObserverMethod extends Prioritized {
*
*
* @return the declaring {@linkplain Bean bean}
+ * @since 4.0
*/
default Bean> getDeclaringBean() {
return null;
@@ -74,28 +72,28 @@ default Bean> getDeclaringBean() {
/**
* Obtains the {@linkplain jakarta.enterprise.event observed event type}.
- *
+ *
* @return the observed event {@linkplain Type type}
*/
public Type getObservedType();
/**
* Obtains the set of {@linkplain jakarta.enterprise.event observed event qualifiers}.
- *
+ *
* @return the observed event {@linkplain jakarta.inject.Qualifier qualifiers}
*/
public Set getObservedQualifiers();
/**
* Obtains the specified {@link Reception} for the observer method. This indicates if the observer is conditional or not.
- *
+ *
* @return the {@link Reception}
*/
public Reception getReception();
/**
* Obtains the specified {@link TransactionPhase} for the observer method.
- *
+ *
* @return the {@link TransactionPhase}
*/
public TransactionPhase getTransactionPhase();
@@ -117,17 +115,17 @@ public default int getPriority() {
*
* Calls the observer method, passing the given event object.
*
- *
+ *
*
* The implementation of this method for a custom observer method is responsible for deciding whether to call
* the method if the {@link #getReception()} returns {@link Reception#IF_EXISTS}.
*
- *
+ *
* @param event the event object
*/
public default void notify(T event) {
}
-
+
/**
* Calls the observer method, passing the given event context.
*
* The implementation of this method for a custom observer method is responsible for deciding whether to call the method if
* the {@link #getReception()} returns {@link Reception#IF_EXISTS}.
- *
+ *
* @param eventContext {@link EventContext} used to notify observers
*/
public default void notify(EventContext eventContext) {
@@ -144,12 +142,12 @@ public default void notify(EventContext eventContext) {
/**
*
- * Determines if this observer method is asynchronous
+ * Determines if this observer method is asynchronous
*
- *
- * @return returns true if the method is an asynchronous observer method (i.e. defined with {@link ObservesAsync}),
- * otherwise returns false
- *
+ *
+ * @return returns true if the method is an asynchronous observer method (i.e. defined with
+ * {@link ObservesAsync}), otherwise returns false
+ *
*/
public default boolean isAsync() {
return false;
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/PassivationCapable.java b/api/src/main/java/jakarta/enterprise/inject/spi/PassivationCapable.java
index 7f00edc24..bade3477c 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/PassivationCapable.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/PassivationCapable.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -23,18 +20,20 @@
* Indicates that a custom implementation of {@link Bean} or
* {@link Contextual} is passivation capable.
*
- *
CDI Lite implementations are not required to provide support for passivation.
- *
+ *
+ * CDI Lite implementations are not required to provide support for passivation.
+ *
+ *
* @author Gavin King
* @author David Allen
- *
+ *
*/
public interface PassivationCapable {
/**
* A string that uniquely identifies the instance of {@link Bean} or
* {@link Contextual}. It is recommended that the string contain the package name of the class
* that implements {@code Bean} or {@code Contextual}.
- *
+ *
* @return a unique identifier for the {@link Bean} or
* {@link Contextual}
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/Prioritized.java b/api/src/main/java/jakarta/enterprise/inject/spi/Prioritized.java
index 744ddff4e..f4158d41a 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/Prioritized.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/Prioritized.java
@@ -1,15 +1,12 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2015, 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,
+ * 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.
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessAnnotatedType.java b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessAnnotatedType.java
index 3598e9729..1c6d2f525 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessAnnotatedType.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessAnnotatedType.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -24,15 +21,17 @@
* the declared annotations.
*
*
- * Any observer of this event is permitted to wrap and/or replace the {@link AnnotatedType} by calling either {@link #setAnnotatedType(AnnotatedType)} or {@link #configureAnnotatedType()}.
+ * Any observer of this event is permitted to wrap and/or replace the {@link AnnotatedType} by calling either
+ * {@link #setAnnotatedType(AnnotatedType)} or {@link #configureAnnotatedType()}.
* If both methods are called within an observer notification an {@link IllegalStateException} is thrown.
- * 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.
+ * 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 AnnotatedType} for every class that is
* discovered by the container.
*
- *
+ *
*
* public <T> void decorateAnnotatedType(@Observes ProcessAnnotatedType<T> pat) {
* pat.setAnnotatedType(decorate(pat.getAnnotatedType()));
@@ -43,7 +42,9 @@
* error by the container.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @author David Allen
* @author Antoine Sabot-Durand
@@ -54,7 +55,7 @@ public interface ProcessAnnotatedType {
/**
* Returns the {@link AnnotatedType} object that will be used by the container to read the
* declared annotations.
- *
+ *
* @return the {@code AnnotatedType} object
* @throws IllegalStateException if called outside of the observer method invocation
*/
@@ -62,7 +63,7 @@ public interface ProcessAnnotatedType {
/**
* Replaces the {@link AnnotatedType}.
- *
+ *
* @param type the new {@link AnnotatedType} object to use
* @throws IllegalStateException if called outside of the observer method invocation
*/
@@ -82,6 +83,7 @@ public interface ProcessAnnotatedType {
/**
* Forces the container to ignore this type.
+ *
* @throws IllegalStateException if called outside of the observer method invocation
*/
public void veto();
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessBean.java b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessBean.java
index eaabc6a7b..527c5b35d 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessBean.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessBean.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -45,7 +42,9 @@
* the container.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @see Bean
* @author David Allen
@@ -57,11 +56,12 @@ public interface ProcessBean {
* Returns the {@link AnnotatedType} representing the bean class, the
* {@link AnnotatedMethod} representing the producer method, or the
* {@link AnnotatedField} representing the producer field.
- *
+ *
*
- * If invoked upon a {@link ProcessSyntheticBean} event, non-portable behavior results and the returned value should be ignored.
+ * If invoked upon a {@link ProcessSyntheticBean} event, non-portable behavior results and the returned value should be
+ * ignored.
*
- *
+ *
* @return the {@link Annotated} for the bean being registered
* @throws IllegalStateException if called outside of the observer method invocation
*/
@@ -71,16 +71,16 @@ public interface ProcessBean {
* Returns the {@link Bean} object that is about to be registered. The
* {@link Bean} may implement {@link Interceptor} or
* {@link Decorator}.
- *
+ *
* @return the {@link Bean} object about to be registered
- * @throws IllegalStateException if called outside of the observer method invocation
+ * @throws IllegalStateException if called outside of the observer method invocation
*/
public Bean getBean();
/**
* Registers a definition error with the container, causing the container to abort deployment after bean discovery is
* complete.
- *
+ *
* @param t The definition error to register as a {@link java.lang.Throwable}
* @throws IllegalStateException if called outside of the observer method invocation
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessBeanAttributes.java b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessBeanAttributes.java
index 91cf75475..511918c42 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessBeanAttributes.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessBeanAttributes.java
@@ -1,15 +1,12 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2013, 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,
+ * 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.
@@ -25,16 +22,20 @@
* registering the {@link Bean} object.
*
*
- * Any observer of this event is permitted to wrap and/or replace the {@link BeanAttributes} by calling either {@link #setBeanAttributes(BeanAttributes)} or {@link #configureBeanAttributes()}.
+ * Any observer of this event is permitted to wrap and/or replace the {@link BeanAttributes} by calling either
+ * {@link #setBeanAttributes(BeanAttributes)} or {@link #configureBeanAttributes()}.
* If both methods are called within an observer notification an {@link IllegalStateException} is thrown.
- * The container must use the final value of this property, after all observers have been called, to manage instances of the bean.
+ * The container must use the final value of this property, after all observers have been called, to manage instances of the
+ * bean.
*
*
* If any observer method of a {@code ProcessBeanAttributes} event throws an exception, the exception is treated as a definition
* error by the container.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @author Pete Muir
* @author Antoine Sabot-Durand
@@ -58,7 +59,7 @@ public interface ProcessBeanAttributes {
/**
* Replaces the {@link BeanAttributes}.
- *
+ *
* @param beanAttributes the new {@link BeanAttributes} to use
* @throws IllegalStateException if called outside of the observer method invocation
*/
@@ -79,7 +80,7 @@ public interface ProcessBeanAttributes {
/**
* Registers a definition error with the container, causing the container to abort deployment after bean discovery is
* complete.
- *
+ *
* @param t the error to add
* @throws IllegalStateException if called outside of the observer method invocation
*/
@@ -87,16 +88,20 @@ public interface ProcessBeanAttributes {
/**
* Forces the container to ignore the bean.
+ *
* @throws IllegalStateException if called outside of the observer method invocation
*/
public void veto();
-
/**
- *
Instructs the container to ignore all non-static, final methods with public, protected or default visibility
- * declared on any bean type of the specific bean during validation of injection points that require proxyable bean type.
+ *
+ * Instructs the container to ignore all non-static, final methods with public, protected or default visibility
+ * declared on any bean type of the specific bean during validation of injection points that require proxyable bean type.
+ *
*
- *
These method should never be invoked upon bean instances. Otherwise, unpredictable behavior results.
+ *
+ * These method should never be invoked upon bean instances. Otherwise, unpredictable behavior results.
+ *
*
*
* @throws IllegalStateException if called outside of the observer method invocation
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessInjectionPoint.java b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessInjectionPoint.java
index 5fc00bfed..cfa0fbbca 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessInjectionPoint.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessInjectionPoint.java
@@ -1,15 +1,12 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2013, 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,
+ * 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.
@@ -22,22 +19,24 @@
/**
*
* The container fires an event of this type for every injection point of every Java EE component class supporting injection
- * that may be instantiated by the container at runtime, including every managed bean declared using
- * {@code jakarta.annotation.ManagedBean}, EJB session or message-driven bean, enabled bean, enabled interceptor or enabled
- * decorator.
+ * that may be instantiated by the container at runtime, including every 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 InjectionPoint} by calling either {@link #setInjectionPoint(InjectionPoint)} or {@link #configureInjectionPoint()}.
+ * Any observer of this event is permitted to wrap and/or replace the {@link InjectionPoint} by calling either
+ * {@link #setInjectionPoint(InjectionPoint)} or {@link #configureInjectionPoint()}.
* If both methods are called within an observer notification an {@link IllegalStateException} is thrown.
- * The container must use the final value of this property, after all observers have been called, he container must use the final
- * value of this property, after all observers have been called, whenever it performs injection upon the injection point.
+ * The container must use the final value of this property, after all observers have been called, he container must use the
+ * final value of this property, after all observers have been called, whenever it performs injection upon the injection point.
*
*
* If any observer method of a {@code ProcessInjectionPoint} event throws an exception, the exception is treated as a definition
* error by the container.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @see InjectionPoint
* @author Pete Muir
@@ -55,7 +54,7 @@ public interface ProcessInjectionPoint {
/**
* Replaces the InjectionPoint.
- *
+ *
* @param injectionPoint the new injection point
* @throws IllegalStateException if called outside of the observer method invocation
*/
@@ -76,7 +75,7 @@ public interface ProcessInjectionPoint {
/**
* Registers a definition error with the container, causing the container to abort deployment after bean discovery is
* complete.
- *
+ *
* @param t the definition error
* @throws IllegalStateException if called outside of the observer method invocation
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessInjectionTarget.java b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessInjectionTarget.java
index f42352760..26dbdf4f5 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessInjectionTarget.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessInjectionTarget.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -19,8 +16,8 @@
/**
*
* 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 jakarta.annotation.ManagedBean}, EJB session or
- * message-driven bean, enabled bean, enabled interceptor or enabled decorator.
+ * the container at runtime, including 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 InjectionTarget}. The
@@ -30,7 +27,7 @@
*
* For example, this observer decorates the {@code InjectionTarget} for all servlets.
*
- *
+ *
*
* public <T extends Servlet> void decorateServlet(@Observes ProcessInjectionTarget<T> pit) {
* pit.setInjectionTarget(decorate(pit.getInjectionTarget()));
@@ -41,7 +38,9 @@
* definition error by the container.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @see InjectionTarget
* @author David Allen
@@ -51,7 +50,7 @@ public interface ProcessInjectionTarget {
/**
* Returns the {@link AnnotatedType} representing the managed bean class, session bean class or
* other Java EE component class supporting injection.
- *
+ *
* @return the {@link AnnotatedType} of the bean with an injection target
* @throws IllegalStateException if called outside of the observer method invocation
*/
@@ -60,7 +59,7 @@ public interface ProcessInjectionTarget {
/**
* Returns the {@link InjectionTarget} object that will be used by the container to perform
* injection.
- *
+ *
* @return the {@link InjectionTarget} object which performs the injection
* @throws IllegalStateException if called outside of the observer method invocation
*/
@@ -68,7 +67,7 @@ public interface ProcessInjectionTarget {
/**
* Replaces the {@link InjectionTarget} which performs injection for this target.
- *
+ *
* @param injectionTarget The new {@link InjectionTarget} to use
* @throws IllegalStateException if called outside of the observer method invocation
*/
@@ -77,7 +76,7 @@ public interface ProcessInjectionTarget {
/**
* Registers a definition error with the container, causing the container to abort deployment after bean discovery is
* complete.
- *
+ *
* @param t A {@link java.lang.Throwable} representing the definition error
* @throws IllegalStateException if called outside of the observer method invocation
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessManagedBean.java b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessManagedBean.java
index e1cfa67d2..cff55e219 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessManagedBean.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessManagedBean.java
@@ -1,21 +1,21 @@
/*
- * 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,
+ * 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 jakarta.enterprise.inject.spi;
+import jakarta.enterprise.invoke.Invoker;
+import jakarta.enterprise.invoke.InvokerBuilder;
+
/**
*
* The container fires an event of this type for each enabled managed bean, before registering the
@@ -26,7 +26,9 @@
* error by the container.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @author David Allen
* @param The class of the bean
@@ -34,9 +36,22 @@
public interface ProcessManagedBean extends ProcessBean {
/**
* Returns the {@link AnnotatedType} representing the bean class.
- *
+ *
* @return the {@link AnnotatedType} for the bean being registered
* @throws IllegalStateException if called outside of the observer method invocation
*/
public AnnotatedType getAnnotatedBeanClass();
+
+ /**
+ * Returns a new {@link InvokerBuilder} for given method. The builder eventually produces an invoker
+ * for the given method.
+ *
+ * The {@code method} must be declared on the bean class or inherited from a supertype
+ * of the bean class of the bean being registered, otherwise an exception is thrown.
+ *
+ * @param method method of the bean being registered, must not be {@code null}
+ * @return the invoker builder, never {@code null}
+ * @since 4.1
+ */
+ public InvokerBuilder> createInvoker(AnnotatedMethod super X> method);
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessObserverMethod.java b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessObserverMethod.java
index 1a80fc754..9aaa5fdff 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessObserverMethod.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessObserverMethod.java
@@ -1,15 +1,12 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2010, 2015, 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,
+ * 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.
@@ -26,35 +23,40 @@
* enabled bean, before registering the {@link ObserverMethod} object.
*
*
- * For a custom implementation of {@link ObserverMethod}, the container must raise an event of type {@link ProcessSyntheticObserverMethod}.
+ * For a custom implementation of {@link ObserverMethod}, the container must raise an event of type
+ * {@link ProcessSyntheticObserverMethod}.
*
*
- * Any observer of this event is permitted to wrap and/or replace the {@link ObserverMethod} by calling either {@link #setObserverMethod(ObserverMethod)} or {@link #configureObserverMethod()}.
+ * Any observer of this event is permitted to wrap and/or replace the {@link ObserverMethod} by calling either
+ * {@link #setObserverMethod(ObserverMethod)} or {@link #configureObserverMethod()}.
* If both methods are called within an observer notification an {@link IllegalStateException} is thrown.
- * The container must use the final value of this property, after all observers have been called, he container must use the final
- * value of this property, after all observers have been called, whenever it performs observer resolution.
+ * The container must use the final value of this property, after all observers have been called, he container must use the
+ * final value of this property, after all observers have been called, whenever it performs observer resolution.
*
*
* If any observer method of a {@code ProcessObserverMethod} event throws an exception, the exception is treated as a definition
* error by the container.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @see ObserverMethod
* @author Gavin King
* @author David Allen
- * @author Antoine Sabot-Durand
+ * @author Antoine Sabot-Durand
* @param The type of the event being observed
* @param The bean type containing the observer method
*/
public interface ProcessObserverMethod {
-
+
/**
* The {@link AnnotatedMethod} representing the observer method.
- *
+ *
*
- * If invoked upon a {@link ProcessSyntheticObserverMethod} event, non-portable behavior results and the returned value should be ignored.
+ * If invoked upon a {@link ProcessSyntheticObserverMethod} event, non-portable behavior results and the returned value
+ * should be ignored.
*
*
* @return the {@link AnnotatedMethod} representing the observer method
@@ -75,7 +77,7 @@ public interface ProcessObserverMethod {
/**
* Registers a definition error with the container, causing the container to abort deployment after bean discovery is
* complete.
- *
+ *
* @param t A {@link java.lang.Throwable} representing the definition error
* @throws IllegalStateException if called outside of the observer method invocation
*/
@@ -105,7 +107,7 @@ public interface ProcessObserverMethod {
/**
* Forces the container to ignore the observer method.
- *
+ *
* @throws IllegalStateException if called outside of the observer method invocation
* @since 2.0
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessProducer.java b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessProducer.java
index e7dc24333..e38104a96 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessProducer.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessProducer.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -35,7 +32,7 @@
* For example, this observer decorates the {@code Producer} for the all producer methods and field of type
* {@code EntityManager}.
*
- *
+ *
*
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @see Producer
* @author David Allen
@@ -57,7 +56,7 @@ public interface ProcessProducer {
/**
* Returns the {@link AnnotatedField} representing the producer field or the
* {@link AnnotatedMethod} representing the producer method.
- *
+ *
* @return the {@link AnnotatedMember} representing the producer
* @throws IllegalStateException if called outside of the observer method invocation
*/
@@ -66,7 +65,7 @@ public interface ProcessProducer {
/**
* Returns the {@link Producer} object that will be used by the container to call the producer
* method or read the producer field.
- *
+ *
* @return the {@link Producer} invoker object used by the container
* @throws IllegalStateException if called outside of the observer method invocation
*/
@@ -75,20 +74,20 @@ public interface ProcessProducer {
/**
* Replaces the {@link Producer} object that will be used by the container to call the producer
* method or read the producer field.
- *
+ *
* @param producer the new {@link Producer} object to use
* @throws IllegalStateException if called outside of the observer method invocation
*/
public void setProducer(Producer producer);
-
+
/**
* Returns a {@link ProducerConfigurator} initialized with the {@link Producer} processed by this event, to configure a new
* {@link Producer} that will replace the original one at the end of the observer invocation.
- *
+ *
*
* Each call returns the same configurator instance within an observer notification.
*
- *
+ *
* @return a non reusable {@link ProducerConfigurator} to configure the original
* {@link Producer}.
* @throws IllegalStateException if called outside of the observer method invocation
@@ -99,7 +98,7 @@ public interface ProcessProducer {
/**
* Registers a definition error with the container, causing the container to abort deployment after bean discovery is
* complete.
- *
+ *
* @param t The definition error to register as a {@link java.lang.Throwable}
* @throws IllegalStateException if called outside of the observer method invocation
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessProducerField.java b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessProducerField.java
index c794dcd0d..8c23c5c36 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessProducerField.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessProducerField.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -26,17 +23,19 @@
* error by the container.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @author David Allen
* @param The type of the producer field
* @param The class of the bean declaring the producer field
- *
+ *
*/
public interface ProcessProducerField extends ProcessBean {
/**
* Returns the {@link AnnotatedField} representing the producer field.
- *
+ *
* @return the {@link AnnotatedField} for the producer field being registered
* @throws IllegalStateException if called outside of the observer method invocation
*/
@@ -45,7 +44,7 @@ public interface ProcessProducerField extends ProcessBean {
/**
* Returns the {@link AnnotatedParameter} for any matching injection point of the same type as
* the producer field return type found on a disposal method.
- *
+ *
* @return the disposal method's {@link AnnotatedParameter}
* @throws IllegalStateException if called outside of the observer method invocation
* @since 1.1
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessProducerMethod.java b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessProducerMethod.java
index f7e9b9287..5ee23d487 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessProducerMethod.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessProducerMethod.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -26,7 +23,9 @@
* error by the container.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @author David Allen
* @param The return type of the producer method
@@ -35,7 +34,7 @@
public interface ProcessProducerMethod extends ProcessBean {
/**
* Returns the {@link AnnotatedMethod} representing the producer method.
- *
+ *
* @return the {@link AnnotatedMethod} for the producer method being registered
* @throws IllegalStateException if called outside of the observer method invocation
*/
@@ -44,7 +43,7 @@ public interface ProcessProducerMethod extends ProcessBean {
/**
* Returns the {@link AnnotatedParameter} for any matching injection point of the same type as
* the producer method return type found on a disposal method.
- *
+ *
* @return the disposal method's {@link AnnotatedParameter}
* @throws IllegalStateException if called outside of the observer method invocation
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessSessionBean.java b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessSessionBean.java
index 83cbee0cb..9e90b87ca 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessSessionBean.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessSessionBean.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -22,27 +19,29 @@
* The container fires an event of this type for each enabled session bean, before registering the
* {@link 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.
*
- *
+ *
*
* Note that the type parameter of the super-interface of {@link ProcessSessionBean} is {@link Object} as {@link ProcessBean}
* allows you access to the {@link Bean}, which in turn allows you to instantiate an instance, which, for interface-view EJBs
* will not be an instance of X.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
- *
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ *
* @author David Allen
* @param session bean type
*/
public interface ProcessSessionBean extends ProcessManagedBean {
/**
* Returns the EJB name of the session bean.
- *
+ *
* @return the name of the EJB
* @throws IllegalStateException if called outside of the observer method invocation
*/
@@ -50,7 +49,7 @@ public interface ProcessSessionBean extends ProcessManagedBean {
/**
* Returns a {@link SessionBeanType} representing the kind of session bean.
- *
+ *
* @return the {@link SessionBeanType}
* @throws IllegalStateException if called outside of the observer method invocation
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessSyntheticAnnotatedType.java b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessSyntheticAnnotatedType.java
index 872b13fda..2b09b51a6 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessSyntheticAnnotatedType.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessSyntheticAnnotatedType.java
@@ -1,15 +1,12 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2013, 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,
+ * 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.
@@ -32,7 +29,7 @@
* For example, the following observer decorates the {@link AnnotatedType} for every class that is
* added by {@link BeforeBeanDiscovery#addAnnotatedType(AnnotatedType, String)}.
*
- *
+ *
*
* public <T> void decorateAnnotatedType(@Observes ProcessSyntheticAnnotatedType<T> pat) {
* pat.setAnnotatedType(decorate(pat.getAnnotatedType()));
@@ -43,7 +40,9 @@
* definition error by the container.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @author David Allen
* @author Pete Muir
@@ -55,7 +54,7 @@
public interface ProcessSyntheticAnnotatedType extends ProcessAnnotatedType {
/**
* Get the extension instance which added the {@link AnnotatedType} for which this event is being fired.
- *
+ *
* @return the extension instance
* @throws IllegalStateException if called outside of the observer method invocation
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessSyntheticBean.java b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessSyntheticBean.java
index afc924421..94c3d42e1 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessSyntheticBean.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessSyntheticBean.java
@@ -1,15 +1,12 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2016, 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,
+ * 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.
@@ -27,7 +24,9 @@
* error by the container.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @author Martin Kouba
* @param The class of the bean
@@ -37,7 +36,7 @@ public interface ProcessSyntheticBean extends ProcessBean {
/**
* Get the extension instance which added the {@link Bean} for which this event is being fired.
- *
+ *
* @return the extension instance
* @throws IllegalStateException if called outside of the observer method invocation
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessSyntheticObserverMethod.java b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessSyntheticObserverMethod.java
index 4ec81f130..a15d823df 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessSyntheticObserverMethod.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessSyntheticObserverMethod.java
@@ -1,15 +1,12 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2010, 2016, 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,
+ * 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.
@@ -24,11 +21,13 @@
* registering the {@link ObserverMethod} object.
*
*
- * If any observer method of a {@code ProcessSyntheticObserverMethod} event throws an exception, the exception is treated as a definition
- * error by the container.
+ * If any observer method of a {@code ProcessSyntheticObserverMethod} event throws an exception, the exception is treated as a
+ * definition error by the container.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @see ObserverMethod
* @author Martin Kouba
@@ -40,7 +39,7 @@ public interface ProcessSyntheticObserverMethod extends ProcessObserverMet
/**
* Get the extension instance which added the {@link ObserverMethod} for which this event is being fired.
- *
+ *
* @return the extension instance
* @throws IllegalStateException if called outside of the observer method invocation
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/Producer.java b/api/src/main/java/jakarta/enterprise/inject/spi/Producer.java
index 9c5fd24dc..a3fe76ac1 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/Producer.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/Producer.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -25,8 +22,10 @@
* Provides a generic operation for producing an instance of a type.
*
*
- *
CDI Lite implementations are not required to provide support for {@code Producer}.
- *
+ *
+ * CDI Lite implementations are not required to provide support for {@code Producer}.
+ *
+ *
* @author Pete Muir
* @author David Allen
* @param The class of object produced by the producer
@@ -37,15 +36,15 @@ public interface Producer {
* Causes an instance to be produced via the {@code Producer}.
*
*
- * If the {@code Producer} represents a class, this will invoke the constructor annotated {@link jakarta.inject.Inject} if it
- * exists, or the constructor with no parameters otherwise. If the class has interceptors, produce() is responsible
- * for building the interceptors and decorators of the instance.
+ * If the {@code Producer} represents a class, this will invoke the constructor annotated {@link jakarta.inject.Inject} if
+ * it exists, or the constructor with no parameters otherwise. If the class has interceptors, produce() is
+ * responsible for building the interceptors and decorators of the instance.
*
*
* If the {@code Producer} represents a producer field or method, this will invoke the producer method on, or access the
* producer field of, a contextual instance of the bean that declares the producer.
*
- *
+ *
* @param ctx The {@link CreationalContext} to use for the produced object
* @return the instance produced
*/
@@ -63,7 +62,7 @@ public interface Producer {
* instance of the bean that declares the disposer method or performs any additional required cleanup, if any, to destroy
* state associated with a resource.
*
- *
+ *
* @param instance The instance to dispose
*/
public void dispose(T instance);
@@ -75,7 +74,7 @@ public interface Producer {
* method parameters. For a producer method, this returns the set of {@code InjectionPoint} objects representing all
* parameters of the producer method.
*
- *
+ *
* @return the set of all {@linkplain InjectionPoint injection points} for the producer
*/
public Set getInjectionPoints();
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/ProducerFactory.java b/api/src/main/java/jakarta/enterprise/inject/spi/ProducerFactory.java
index c73fd4321..64c0222fa 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/ProducerFactory.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/ProducerFactory.java
@@ -1,15 +1,12 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2013, 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,
+ * 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.
@@ -21,29 +18,31 @@
*
* An {@link ProducerFactory} can create an {@link Producer} for a given bean.
*
- *
+ *
*
* The {@link ProducerFactory} obtained from {@link BeanManager#getProducerFactory(AnnotatedMethod, Bean)} or
* {@link BeanManager#getProducerFactory(AnnotatedField, Bean)} is capable of providing container created
* producers. This factory can be wrapped to add behavior to container created producers.
*
CDI Lite implementations are not required to provide support for {@code ProducerFactory}.
- *
+ *
+ * CDI Lite implementations are not required to provide support for {@code ProducerFactory}.
+ *
+ *
* @author Pete Muir
* @since 1.1
* @param type of the bean containing the producer
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/SecurityActions.java b/api/src/main/java/jakarta/enterprise/inject/spi/SecurityActions.java
index e84ce5d7c..4c7983c1f 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/SecurityActions.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/SecurityActions.java
@@ -1,8 +1,18 @@
/*
- * JBoss, Home of Professional Open Source
+ * Copyright 2019, Red Hat, Inc., and 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.
+ */
+/*
* Copyright 2018, 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.1-SNAPSHOT (the "License");
* you may not use this file except in compliance with the License.
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/SessionBeanType.java b/api/src/main/java/jakarta/enterprise/inject/spi/SessionBeanType.java
index 3b694a936..c0c32015b 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/SessionBeanType.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/SessionBeanType.java
@@ -1,15 +1,12 @@
/*
- * 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,
+ * 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.
@@ -18,9 +15,9 @@
/**
* Identifies the kind of EJB session bean.
- *
+ *
* @author Gavin King
- *
+ *
*/
public enum SessionBeanType {
/**
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/Unmanaged.java b/api/src/main/java/jakarta/enterprise/inject/spi/Unmanaged.java
index c161c959b..d74362413 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/Unmanaged.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/Unmanaged.java
@@ -1,15 +1,12 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2013, 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,
+ * 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.
@@ -23,7 +20,7 @@
*
* Helper class for injecting and calling lifecycle callbacks unmanaged instances for use by framework and library integrators.
*
- *
+ *
*
* Unmanaged<Foo> unmanagedFoo = new Unmanaged<Foo>(Foo.class);
* UnmanagedInstance<Foo> fooInstance = unmanagedFoo.newInstance();
@@ -31,16 +28,18 @@
* ... // Use the foo instance
* fooInstance.preDestroy().dispose();
*
- *
+ *
*
* An instance of this class can be safely held for the lifetime of the application.
*
- *
+ *
*
* {@link UnmanagedInstance}s created by this class are not suitable for sharing between threads.
*
*
- *
CDI Lite implementations are not required to provide support for {@code Unmanaged}.
+ *
+ * CDI Lite implementations are not required to provide support for {@code Unmanaged}.
+ *
*
* @author Pete Muir
* @since 1.1
@@ -53,6 +52,7 @@ public class Unmanaged {
/**
* Create an injector for the given class
+ *
* @param manager the {@link BeanManager}
* @param clazz class of the unmanaged instances
*/
@@ -64,6 +64,7 @@ public Unmanaged(BeanManager manager, Class clazz) {
/**
* Create an injector for the given class, using the current bean manager
+ *
* @param clazz class of the unmanaged instances
*/
public Unmanaged(Class clazz) {
@@ -81,7 +82,7 @@ public UnmanagedInstance newInstance() {
/**
* Represents a non-contextual instance.
- *
+ *
* @see Unmanaged
*/
public static class UnmanagedInstance {
@@ -98,6 +99,7 @@ private UnmanagedInstance(BeanManager beanManager, InjectionTarget injectionT
/**
* Get the instance
+ *
* @return the instance
*/
public T get() {
@@ -106,7 +108,7 @@ public T get() {
/**
* Create the instance
- *
+ *
* @throws IllegalStateException if produce() is called on an already produced instance
* @throws IllegalStateException if produce() is called on an instance that has already been disposed
* @return self
@@ -124,7 +126,7 @@ public UnmanagedInstance produce() {
/**
* Inject the instance
- *
+ *
* @throws IllegalStateException if inject() is called before produce() is called
* @throws IllegalStateException if inject() is called on an instance that has already been disposed
* @return self
@@ -142,7 +144,7 @@ public UnmanagedInstance inject() {
/**
* Call the @PostConstruct callback
- *
+ *
* @throws IllegalStateException if postConstruct() is called before produce() is called
* @throws IllegalStateException if postConstruct() is called on an instance that has already been disposed
* @return self
@@ -160,7 +162,7 @@ public UnmanagedInstance postConstruct() {
/**
* Call the @PreDestroy callback
- *
+ *
* @throws IllegalStateException if preDestroy() is called before produce() is called
* @throws IllegalStateException if preDestroy() is called on an instance that has already been disposed
* @return self
@@ -178,7 +180,7 @@ public UnmanagedInstance preDestroy() {
/**
* Dispose of the instance, doing any necessary cleanup
- *
+ *
* @throws IllegalStateException if dispose() is called before produce() is called
* @throws IllegalStateException if dispose() is called on an instance that has already been disposed
* @return self
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/WithAnnotations.java b/api/src/main/java/jakarta/enterprise/inject/spi/WithAnnotations.java
index f0d1a2aa8..9f223ba77 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/WithAnnotations.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/WithAnnotations.java
@@ -1,15 +1,12 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2013, 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,
+ * 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.
@@ -29,15 +26,17 @@
* {@link WithAnnotations} may be applied to any portable extension observer method with an event parameter type of
* {@link ProcessAnnotatedType} to filter the events delivered.
*
- *
+ *
*
* If the {@link WithAnnotations} annotation is applied to a portable extension observer method, then only
* {@link ProcessAnnotatedType} events for types which have at least one of the annotations specified are observed. The
- * annotation can appear on the annotated type, or on any member, or any parameter of any member of the annotated type, as defined
- * in section 11.4 Alternative metadata sources.
- * The annotation may be applied as a meta-annotation on any annotation considered.
+ * annotation can appear on the annotated type, or on any member, or any parameter of any member of the annotated type, as
+ * defined in section 11.4 Alternative
+ * metadata sources. The annotation may be applied as a meta-annotation on any annotation considered.
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @author Pete Muir
* @since 1.1
@@ -45,7 +44,12 @@
@Retention(RUNTIME)
@Target(PARAMETER)
public @interface WithAnnotations {
-
+ /**
+ * The annotation types that must be present on the {@link AnnotatedType}
+ * for the {@code ProcessAnnotatedType} observer to be notified.
+ *
+ * @return required annotation types
+ */
Class extends Annotation>[] value();
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/configurator/AnnotatedConstructorConfigurator.java b/api/src/main/java/jakarta/enterprise/inject/spi/configurator/AnnotatedConstructorConfigurator.java
index 6df1b4bac..3f895a305 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/configurator/AnnotatedConstructorConfigurator.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/configurator/AnnotatedConstructorConfigurator.java
@@ -1,8 +1,5 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2016, 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.
@@ -28,7 +25,9 @@
*
* This interface is part of the {@link AnnotatedTypeConfigurator} SPI and helps defining an {@link AnnotatedConstructor}
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @author Martin Kouba
* @author Antoine Sabot-Durand
@@ -38,14 +37,14 @@
public interface AnnotatedConstructorConfigurator {
/**
- *
+ *
* @return the original {@link AnnotatedConstructor}
*/
AnnotatedConstructor getAnnotated();
/**
* Add an annotation to the constructor.
- *
+ *
* @param annotation the annotation to add
* @return self
*/
@@ -57,32 +56,32 @@ public interface AnnotatedConstructorConfigurator {
*
* Example predicates:
*
- *
+ *
*
* {@code
* // To remove all the annotations:
* (a) -> true
- *
+ *
* // To remove annotations with a concrete annotation type:
* (a) -> a.annotationType().equals(Foo.class)
- *
+ *
* // To remove annotation equal to a specified object:
* (a) -> a.equals(fooAnnotation)
- *
+ *
* // To remove annotations that are considered equivalent for the purposes of typesafe resolution:
* (a) -> beanManager.areQualifiersEquivalent(a, fooQualifier)
* (a) -> beanManager.areInterceptorBindingsEquivalent(a, fooInterceptorBinding)
* }
*
- *
+ *
* @param predicate {@link Predicate} used to filter annotations to remove
* @return self
*/
AnnotatedConstructorConfigurator remove(Predicate predicate);
-
+
/**
* Remove all the annotations.
- *
+ *
* @return self
*/
default AnnotatedConstructorConfigurator removeAll() {
@@ -90,14 +89,14 @@ default AnnotatedConstructorConfigurator removeAll() {
}
/**
- *
+ *
* @return an immutable list of {@link AnnotatedParameterConfigurator}s reflecting the
* {@link AnnotatedConstructor#getParameters()}
*/
List> params();
/**
- *
+ *
* @param predicate Testing the original {@link AnnotatedParameter}
* @return a sequence of {@link AnnotatedParameterConfigurator}s matching the given predicate
* @see AnnotatedParameterConfigurator#getAnnotated()
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/configurator/AnnotatedFieldConfigurator.java b/api/src/main/java/jakarta/enterprise/inject/spi/configurator/AnnotatedFieldConfigurator.java
index 6f4488fba..00efbed1b 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/configurator/AnnotatedFieldConfigurator.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/configurator/AnnotatedFieldConfigurator.java
@@ -1,8 +1,5 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2016, 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.
@@ -24,7 +21,9 @@
/**
* This interface is part of the {@link AnnotatedTypeConfigurator} SPI and helps defining an {@link AnnotatedField}
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @author Martin Kouba
* @author Antoine Sabot-Durand
@@ -32,16 +31,16 @@
* @param the class declaring the field
*/
public interface AnnotatedFieldConfigurator {
-
+
/**
- *
+ *
* @return the original {@link AnnotatedField}
*/
AnnotatedField getAnnotated();
-
+
/**
* Add an annotation to the field.
- *
+ *
* @param annotation the annotation to add
* @return self
*/
@@ -53,32 +52,32 @@ public interface AnnotatedFieldConfigurator {
*
* Example predicates:
*
- *
+ *
*
* {@code
* // To remove all the annotations:
* (a) -> true
- *
+ *
* // To remove annotations with a concrete annotation type:
* (a) -> a.annotationType().equals(Foo.class)
- *
+ *
* // To remove annotation equal to a specified object:
* (a) -> a.equals(fooAnnotation)
- *
+ *
* // To remove annotations that are considered equivalent for the purposes of typesafe resolution:
* (a) -> beanManager.areQualifiersEquivalent(a, fooQualifier)
* (a) -> beanManager.areInterceptorBindingsEquivalent(a, fooInterceptorBinding)
* }
*
- *
+ *
* @param predicate {@link Predicate} used to filter annotations to remove
* @return self
*/
AnnotatedFieldConfigurator remove(Predicate predicate);
-
+
/**
* Remove all the annotations.
- *
+ *
* @return self
*/
default AnnotatedFieldConfigurator removeAll() {
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/configurator/AnnotatedMethodConfigurator.java b/api/src/main/java/jakarta/enterprise/inject/spi/configurator/AnnotatedMethodConfigurator.java
index 85d2baa2d..8aa0618e3 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/configurator/AnnotatedMethodConfigurator.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/configurator/AnnotatedMethodConfigurator.java
@@ -1,8 +1,5 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2016, 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.
@@ -27,7 +24,9 @@
/**
* This interface is part of the {@link AnnotatedTypeConfigurator} SPI and helps defining an {@link AnnotatedMethod}
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @author Martin Kouba
* @author Antoine Sabot-Durand
@@ -37,7 +36,7 @@
public interface AnnotatedMethodConfigurator {
/**
- *
+ *
* @return the original {@link AnnotatedMethod}
*/
AnnotatedMethod getAnnotated();
@@ -56,24 +55,24 @@ public interface AnnotatedMethodConfigurator {
*
* Example predicates:
*
- *
+ *
*
* {@code
* // To remove all the annotations:
* (a) -> true
- *
+ *
* // To remove annotations with a concrete annotation type:
* (a) -> a.annotationType().equals(Foo.class)
- *
+ *
* // To remove annotation equal to a specified object:
* (a) -> a.equals(fooAnnotation)
- *
+ *
* // To remove annotations that are considered equivalent for the purposes of typesafe resolution:
* (a) -> beanManager.areQualifiersEquivalent(a, fooQualifier)
* (a) -> beanManager.areInterceptorBindingsEquivalent(a, fooInterceptorBinding)
* }
*
- *
+ *
* @param predicate {@link Predicate} used to filter annotations to remove
* @return self
*/
@@ -81,22 +80,22 @@ public interface AnnotatedMethodConfigurator {
/**
* Remove all the annotations.
- *
+ *
* @return self
*/
default AnnotatedMethodConfigurator removeAll() {
return remove((a) -> true);
}
-
+
/**
- *
+ *
* @return an immutable list of {@link AnnotatedParameterConfigurator}s reflecting the
* {@link AnnotatedMethod#getParameters()}
*/
List> params();
/**
- *
+ *
* @param predicate Testing the original {@link AnnotatedParameter}
* @return a sequence of {@link AnnotatedParameterConfigurator}s matching the given predicate
* @see AnnotatedParameterConfigurator#getAnnotated()
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/configurator/AnnotatedParameterConfigurator.java b/api/src/main/java/jakarta/enterprise/inject/spi/configurator/AnnotatedParameterConfigurator.java
index 9203aa5a2..fa9b09822 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/configurator/AnnotatedParameterConfigurator.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/configurator/AnnotatedParameterConfigurator.java
@@ -1,8 +1,5 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2016, 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.
@@ -25,7 +22,9 @@
*
* This interface is part of the {@link AnnotatedTypeConfigurator} SPI and helps defining an {@link AnnotatedParameter}
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @author Martin Kouba
* @author Antoine Sabot-Durand
@@ -33,13 +32,13 @@
* @param the class containing the method declaring the parameter
*/
public interface AnnotatedParameterConfigurator {
-
+
/**
- *
+ *
* @return the original {@link AnnotatedParameter}
*/
AnnotatedParameter getAnnotated();
-
+
/**
* Add an annotation to the parameter.
*
@@ -47,42 +46,42 @@ public interface AnnotatedParameterConfigurator {
* @return self
*/
AnnotatedParameterConfigurator add(Annotation annotation);
-
+
/**
* Remove annotations that match the specified predicate.
*
*
* Example predicates:
*
- *
+ *
*
* {@code
* // To remove all the annotations:
* (a) -> true
- *
+ *
* // To remove annotations with a concrete annotation type:
* (a) -> a.annotationType().equals(Foo.class)
- *
+ *
* // To remove annotation equal to a specified object:
* (a) -> a.equals(fooAnnotation)
- *
+ *
* // To remove annotations that are considered equivalent for the purposes of typesafe resolution:
* (a) -> beanManager.areQualifiersEquivalent(a, fooQualifier)
* (a) -> beanManager.areInterceptorBindingsEquivalent(a, fooInterceptorBinding)
* }
*
- *
+ *
* @param predicate {@link Predicate} used to filter annotations to remove
* @return self
*/
AnnotatedParameterConfigurator remove(Predicate predicate);
-
+
/**
* Remove all the annotations.
- *
+ *
* @return self
*/
- default AnnotatedParameterConfigurator removeAll() {
+ default AnnotatedParameterConfigurator removeAll() {
return remove((a) -> true);
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/configurator/AnnotatedTypeConfigurator.java b/api/src/main/java/jakarta/enterprise/inject/spi/configurator/AnnotatedTypeConfigurator.java
index 19da1bff0..d8db3c4df 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/configurator/AnnotatedTypeConfigurator.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/configurator/AnnotatedTypeConfigurator.java
@@ -1,8 +1,5 @@
/*
- * JBoss, Home of Professional Open Source
* Copyright 2016, 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.
@@ -35,16 +32,18 @@
* This API is a helper to configure a new {@link AnnotatedType} instance. The container must provide an implementation of
* this interface.
*
- *
+ *
*
* AnnotatedTypeConfigurator is not reusable.
*
- *
+ *
*
* This configurator is not thread safe and shall not be used concurrently.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @see BeforeBeanDiscovery#addAnnotatedType(Class, String)
* @see AfterTypeDiscovery#addAnnotatedType(Class, String)
@@ -57,7 +56,7 @@
public interface AnnotatedTypeConfigurator {
/**
- *
+ *
* @return the original {@link AnnotatedType}
*/
AnnotatedType getAnnotated();
@@ -76,32 +75,32 @@ public interface AnnotatedTypeConfigurator {
*
* Example predicates:
*
- *
+ *
*
* {@code
* // To remove all the annotations:
* (a) -> true
- *
+ *
* // To remove annotations with a concrete annotation type:
* (a) -> a.annotationType().equals(Foo.class)
- *
+ *
* // To remove annotation equal to a specified object:
* (a) -> a.equals(fooAnnotation)
- *
+ *
* // To remove annotations that are considered equivalent for the purposes of typesafe resolution:
* (a) -> beanManager.areQualifiersEquivalent(a, fooQualifier)
* (a) -> beanManager.areInterceptorBindingsEquivalent(a, fooInterceptorBinding)
* }
*