diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index ddc6db3bb..61c79891f 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -25,11 +25,11 @@ jobs: - if: ${{ matrix.java != '11' }} name: "Maven install > 11" run: | - mvn -Pstaging install -DskipTests=true -B -V + mvn -Pstaging install -DskipTests=true -Dno-format -B -V - if: ${{ matrix.java == '11' }} name: "Maven install 11" run: | - mvn -Pstaging -pl '!el' install -DskipTests=true -B -V + mvn -Pstaging -pl '!el' install -DskipTests=true -Dno-format -B -V - if: ${{ matrix.java != '11' }} name: "Maven test > 11" run: | diff --git a/.gitignore b/.gitignore index dccf579c8..58515ad74 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ spec/en/master-filtered.xml *.iws .idea *.swp +.cache diff --git a/api/src/main/java/jakarta/decorator/Decorator.java b/api/src/main/java/jakarta/decorator/Decorator.java index 3b3578ac5..e7497f711 100644 --- a/api/src/main/java/jakarta/decorator/Decorator.java +++ b/api/src/main/java/jakarta/decorator/Decorator.java @@ -8,7 +8,7 @@ * 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,19 +29,21 @@ *
* Specifies that a class is a decorator. May be applied to a managed bean class. *
- * + * *- * @Decorator + * @Decorator * class TimestampLogger implements Logger { ... } *- * + * *
* Decorators of a session bean must comply with the bean provider programming restrictions defined by the EJB specification. * Decorators of a stateful session bean must comply with the rules for instance passivation and conversational state defined by * the EJB specification. *
* - *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 23e331a77..4e7573897 100644 --- a/api/src/main/java/jakarta/decorator/Delegate.java +++ b/api/src/main/java/jakarta/decorator/Delegate.java @@ -8,7 +8,7 @@ * 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,45 +29,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. * - * + * *- * @Decorator - * class TimestampLogger implements Logger { - * @Inject @Delegate @Any Logger logger; - * ... + * @Decorator + * class TimestampLogger implements Logger { + * @Inject @Delegate @Any Logger logger; + * ... * } *- * + * *
- * @Decorator - * class TimestampLogger implements Logger { + * @Decorator + * class TimestampLogger implements Logger { * private Logger logger; - * + * * @Inject - * public TimestampLogger(@Delegate @Debug Logger logger) { - * this.logger=logger; - * } - * ... + * public TimestampLogger(@Delegate @Debug Logger logger) { + * this.logger=logger; + * } + * ... * } *- * + * *
* A decorator must have exactly one delegate injection point. The delegate injection point must be an injected field, * initializer method parameter or bean constructor method parameter. *
- * + * ** The container injects a delegate object to the delegate injection point. The delegate object implements the delegate type and * delegates method invocations along the decorator stack. When the container calls a decorator during business method * interception, the decorator may invoke any method of the delegate object. If a decorator invokes the delegate object at any * other time, the invoked method throws an {@link java.lang.IllegalStateException}. *
- * + * *- * @Decorator - * class TimestampLogger implements Logger { - * @Inject @Delegate @Any Logger logger; - * + * @Decorator + * class TimestampLogger implements Logger { + * @Inject @Delegate @Any Logger logger; + * * void log(String message) { * logger.log( timestamp() + ": " + message ); * } @@ -75,10 +75,12 @@ * } ** - *
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 4610ed955..14bf3a78a 100644 --- a/api/src/main/java/jakarta/decorator/package-info.java +++ b/api/src/main/java/jakarta/decorator/package-info.java @@ -8,89 +8,114 @@ * 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.
- * + *+ * 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. + *
+ * *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:
+ * + *+ * The set of decorated types of a decorator includes all + * bean types of the managed bean that are Java interfaces, + * except for {@link java.io.Serializable}. The decorator bean + * class and its superclasses are not decorated types of the + * decorator. The decorator class may be abstract. + *
+ * + *+ * A decorator intercepts every method: + *
*A decorator may be an abstract class, and is not required to - * implement every method of every decorated type.
- * + * + *+ * A decorator may be an abstract class, and is not required to + * implement every method of every decorated type. + *
+ * *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.
- * + * + *+ * 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. + *
+ * *By default, a bean archive has no enabled decorators. A - * decorator must be explicitly enabled by listing its bean class + * + *
+ * 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: + *
+ * *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 a9ede12e3..6ab372aed 100644 --- a/api/src/main/java/jakarta/enterprise/context/ApplicationScoped.java +++ b/api/src/main/java/jakarta/enterprise/context/ApplicationScoped.java @@ -34,8 +34,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.
*
@@ -43,8 +43,8 @@ *
* *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
,
+ * 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
,
- * 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:
- *
ServletContext
if the application is a web application deployed to a Servlet container, orjava.lang.Object
for other types of application.@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:
+ *
+ *
+ * ServletContext
if the application is a web application deployed to a Servlet container, orjava.lang.Object
for other types of application.* 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 @@ -29,10 +29,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 */ diff --git a/api/src/main/java/jakarta/enterprise/context/ContextException.java b/api/src/main/java/jakarta/enterprise/context/ContextException.java index 220a17279..3371d84f2 100644 --- a/api/src/main/java/jakarta/enterprise/context/ContextException.java +++ b/api/src/main/java/jakarta/enterprise/context/ContextException.java @@ -8,7 +8,7 @@ * 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 +20,7 @@ ** Indicates a problem relating to context management. *
- * + * * @author Pete Muir * @author Shane Bryzak */ diff --git a/api/src/main/java/jakarta/enterprise/context/ContextNotActiveException.java b/api/src/main/java/jakarta/enterprise/context/ContextNotActiveException.java index 8ef814004..7153f2e28 100644 --- a/api/src/main/java/jakarta/enterprise/context/ContextNotActiveException.java +++ b/api/src/main/java/jakarta/enterprise/context/ContextNotActiveException.java @@ -8,7 +8,7 @@ * 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,9 +22,9 @@ ** Indicates that a context is not active. *
- * + * * @see Context - * + * * @author Pete Muir * @author Shane Bryzak * @author Gavin King diff --git a/api/src/main/java/jakarta/enterprise/context/Conversation.java b/api/src/main/java/jakarta/enterprise/context/Conversation.java index 4d5b7ebfd..77b950894 100644 --- a/api/src/main/java/jakarta/enterprise/context/Conversation.java +++ b/api/src/main/java/jakarta/enterprise/context/Conversation.java @@ -8,7 +8,7 @@ * 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,28 +21,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 { @@ -50,7 +52,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(); @@ -59,7 +61,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. @@ -70,7 +72,7 @@ public interface Conversation { ** Marks the current long-running conversation transient. *
- * + * * @throws IllegalStateException if the current conversation is already marked transient. */ public void end(); @@ -79,7 +81,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. */ @@ -89,7 +91,7 @@ public interface Conversation { ** Get the timeout of the current conversation. *
- * + * * @return the current timeout in milliseconds. */ public long getTimeout(); @@ -98,7 +100,7 @@ public interface Conversation { ** Set the timeout of the current conversation. *
- * + * * @param milliseconds the new timeout in milliseconds. */ public void setTimeout(long milliseconds); @@ -107,7 +109,7 @@ public interface Conversation { ** Determine if the conversation is marked transient or long-running. *
- * + * * @returntrue
if the conversation is marked transient, or false
if 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 a3c30e2e9..9af90ae9a 100644
--- a/api/src/main/java/jakarta/enterprise/context/ConversationScoped.java
+++ b/api/src/main/java/jakarta/enterprise/context/ConversationScoped.java
@@ -32,10 +32,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: @@ -44,12 +44,13 @@ *
- * 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:
*
ServletRequest
if the application is a web application deployed to a Servlet container, orjava.lang.Object
for other types of application.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.
*
*
*
@@ -106,14 +107,14 @@
* 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.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:
*
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 diff --git a/api/src/main/java/jakarta/enterprise/context/Dependent.java b/api/src/main/java/jakarta/enterprise/context/Dependent.java index 02583b17e..762b30d54 100644 --- a/api/src/main/java/jakarta/enterprise/context/Dependent.java +++ b/api/src/main/java/jakarta/enterprise/context/Dependent.java @@ -26,14 +26,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. @@ -59,13 +58,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.
*
@@ -73,18 +72,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.
*
@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.@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.@Dependent
injected into a producer method is a dependent object of the
* producer method bean instance that is being produced.@Dependent
obtained by direct invocation of an
- * {@link Instance} is a dependent object of the instance of {@link Instance}.@Dependent
obtained by direct invocation of an {@link Instance} is a
+ * dependent object of the instance of {@link Instance}.
diff --git a/api/src/main/java/jakarta/enterprise/context/Destroyed.java b/api/src/main/java/jakarta/enterprise/context/Destroyed.java
index 760c878c8..8d733786d 100644
--- a/api/src/main/java/jakarta/enterprise/context/Destroyed.java
+++ b/api/src/main/java/jakarta/enterprise/context/Destroyed.java
@@ -46,6 +46,7 @@
/**
* The scope for which to observe destruction
+ *
* @return the scope type class
*/
Class extends Annotation> value();
diff --git a/api/src/main/java/jakarta/enterprise/context/Initialized.java b/api/src/main/java/jakarta/enterprise/context/Initialized.java
index 49b2035e7..9e8549c5f 100644
--- a/api/src/main/java/jakarta/enterprise/context/Initialized.java
+++ b/api/src/main/java/jakarta/enterprise/context/Initialized.java
@@ -46,6 +46,7 @@
/**
* The scope for which to observe initialization
+ *
* @return the scope type class
*/
Class extends Annotation> value();
@@ -56,13 +57,13 @@
* @author Martin Kouba
*/
public final static class Literal extends AnnotationLiteral
* 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 CDI Lite implementations are not required to provide support for conversations.
+ * CDI Lite implementations are not required to provide support for conversations.
+ *
* Specifies that an annotation type is a normal scope type.
*
* 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.
* NonexistentConversationException
.
* 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 c6af80f85..da2b0369d 100644
--- a/api/src/main/java/jakarta/enterprise/context/RequestScoped.java
+++ b/api/src/main/java/jakarta/enterprise/context/RequestScoped.java
@@ -34,8 +34,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.
*
@@ -43,8 +43,9 @@ *
* *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
,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
,service()
method, all doFilter()
methods, and all
* requestDestroyed()
and onComplete()
notifications return,@PostConstruct
callback completes, if it did not already exist when the @PostConstruct
- * callback occurred.@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:
*
* 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: @@ -57,18 +57,18 @@ * *
HttpSessionListeners
have been called, orinvalidate()
was called, after all filters and ServletRequestListeners
have been
- * called.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 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 4227019de..6e291fe75 100644 --- a/api/src/main/java/jakarta/enterprise/context/control/ActivateRequestContext.java +++ b/api/src/main/java/jakarta/enterprise/context/control/ActivateRequestContext.java @@ -16,28 +16,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 da269fcec..0a6b3772b 100644 --- a/api/src/main/java/jakarta/enterprise/context/control/RequestContextController.java +++ b/api/src/main/java/jakarta/enterprise/context/control/RequestContextController.java @@ -20,21 +20,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. @@ -46,20 +46,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 86e701e49..2cf1d32f7 100644 --- a/api/src/main/java/jakarta/enterprise/context/package-info.java +++ b/api/src/main/java/jakarta/enterprise/context/package-info.java @@ -8,122 +8,147 @@ * 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: + * + * *The following built-in scopes are provided: + * + *
+ * The following built-in scopes are provided: * {@link jakarta.enterprise.context.Dependent @Dependent}, * {@link jakarta.enterprise.context.RequestScoped @RequestScoped}, * {@link jakarta.enterprise.context.ConversationScoped @ConversationScoped}, * {@link jakarta.enterprise.context.SessionScoped @SessionScoped}, * {@link jakarta.enterprise.context.ApplicationScoped @ApplicationScoped}, - * {@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
+ * {@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.
- * + * 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. + *
+ * *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 + * + *
+ * 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.
- * + * {@link jakarta.inject.Singleton @Singleton} pseudo-scopes. + * + * *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: + *
+ * *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: + * + * ** {@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 @@ -39,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 Pete Muir * @since 1.1 */ @@ -54,7 +54,7 @@ public interface AlterableContext extends 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 5e996d8c7..a1154c8a0 100644 --- a/api/src/main/java/jakarta/enterprise/context/spi/Context.java +++ b/api/src/main/java/jakarta/enterprise/context/spi/Context.java @@ -8,7 +8,7 @@ * 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,12 +26,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 @@ -41,12 +41,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 */ @@ -55,7 +55,7 @@ public interface Context { /** * Get the scope type of the context object. - * + * * @return the scope */ public Class extends Annotation> getScope(); @@ -63,30 +63,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. - * + * * @paramtrue
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 96eda8834..022f96c4e 100644
--- a/api/src/main/java/jakarta/enterprise/context/spi/Contextual.java
+++ b/api/src/main/java/jakarta/enterprise/context/spi/Contextual.java
@@ -8,7 +8,7 @@
* 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,9 +24,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
@@ -39,7 +39,7 @@ public interface ContextualThe 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 a5abbe720..69be79a31 100644 --- a/api/src/main/java/jakarta/enterprise/event/Event.java +++ b/api/src/main/java/jakarta/enterprise/event/Event.java @@ -8,7 +8,7 @@ * 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,74 +20,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:
*
* @Inject * @Any * Event<LoggedInEvent> loggedInEvent; *- * + * *
* The fire()
method accepts an event object:
*
- * public void login() { + * public void login() { * ... * loggedInEvent.fire( new LoggedInEvent(user) ); * } *- * + * *
* Any combination of qualifiers may be specified at the injection point: *
- * + * ** @Inject * @Admin * Event<LoggedInEvent> adminLoggedInEvent; *- * + * *
* Or, the {@link Any @Any} qualifier may be used, allowing the application to specify qualifiers * dynamically: *
- * + * ** @Inject * @Any * Event<LoggedInEvent> loggedInEvent; *- * + * *
* For an injected Event
:
*
- * 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* 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 @@ -115,9 +116,11 @@ 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 @@ -136,23 +139,26 @@ public interface Event
* Obtains a child Event
for the given additional required qualifiers.
*
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
* Obtains a child Event
for the given required type and additional required qualifiers.
*
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);
@@ -175,12 +182,13 @@ public interface Event
* Obtains a child Event
for the given required type and additional required qualifiers.
*
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 4e23a10c5..0a6819627 100644
--- a/api/src/main/java/jakarta/enterprise/event/ImmutableNotificationOptions.java
+++ b/api/src/main/java/jakarta/enterprise/event/ImmutableNotificationOptions.java
@@ -8,7 +8,7 @@
* 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 +21,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 8621779d5..df63794c6 100644
--- a/api/src/main/java/jakarta/enterprise/event/NotificationOptions.java
+++ b/api/src/main/java/jakarta/enterprise/event/NotificationOptions.java
@@ -8,7 +8,7 @@
* 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 +19,7 @@
/**
* Notification options are used to configure observer notification.
- *
+ *
* @author Martin Kouba
* @see Event#fireAsync(Object, NotificationOptions)
* @since 2.0
@@ -27,20 +27,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
*/
@@ -49,7 +49,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
@@ -59,7 +59,7 @@ static NotificationOptions of(String optionName, Object optionValue) {
}
/**
- *
+ *
* @return the options builder
*/
static Builder builder() {
@@ -68,7 +68,7 @@ static Builder builder() {
/**
* Notification options builder.
- *
+ *
* @author Martin Kouba
* @since 2.0
*/
diff --git a/api/src/main/java/jakarta/enterprise/event/ObserverException.java b/api/src/main/java/jakarta/enterprise/event/ObserverException.java
index a491ba4c3..d6ec19f50 100644
--- a/api/src/main/java/jakarta/enterprise/event/ObserverException.java
+++ b/api/src/main/java/jakarta/enterprise/event/ObserverException.java
@@ -8,7 +8,7 @@
* 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 +20,7 @@
* * Indicates that a checked exception was thrown by an observer method during event notification. *
- * + * * @author Pete Muir * @author Gavin King */ diff --git a/api/src/main/java/jakarta/enterprise/event/Observes.java b/api/src/main/java/jakarta/enterprise/event/Observes.java index c1d9ea4c5..a297007d0 100644 --- a/api/src/main/java/jakarta/enterprise/event/Observes.java +++ b/api/src/main/java/jakarta/enterprise/event/Observes.java @@ -8,7 +8,7 @@ * 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,52 +30,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 @@ -89,11 +89,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; @@ -102,10 +103,11 @@ ** 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 */ 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 00a7e6e35..17cb3033a 100644 --- a/api/src/main/java/jakarta/enterprise/event/ObservesAsync.java +++ b/api/src/main/java/jakarta/enterprise/event/ObservesAsync.java @@ -8,7 +8,7 @@ * 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,54 +25,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 @@ -86,14 +86,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 7a277406e..eccc89cf6 100644 --- a/api/src/main/java/jakarta/enterprise/event/Reception.java +++ b/api/src/main/java/jakarta/enterprise/event/Reception.java @@ -8,7 +8,7 @@ * 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,16 +22,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/TransactionPhase.java b/api/src/main/java/jakarta/enterprise/event/TransactionPhase.java index c6ca1c81d..d68f09b42 100644 --- a/api/src/main/java/jakarta/enterprise/event/TransactionPhase.java +++ b/api/src/main/java/jakarta/enterprise/event/TransactionPhase.java @@ -8,7 +8,7 @@ * 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 +24,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 { @@ -74,9 +76,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 1f0f9450e..dfa2955e9 100644 --- a/api/src/main/java/jakarta/enterprise/event/package-info.java +++ b/api/src/main/java/jakarta/enterprise/event/package-info.java @@ -8,110 +8,141 @@ * 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: + *
+ * *The {@link jakarta.enterprise.event.Event} interface is used to - * fire events.
- * + * + *+ * The {@link jakarta.enterprise.event.Event} interface is used to + * fire events. + *
+ * *The event object acts as a payload, to propagate state from - * producer to consumer. An event object is an instance of a concrete - * Java class with no type variables.
- * - *The event types of the event include all superclasses and - * interfaces of the runtime class of the event object. An event type - * may not contain a type variable.
- * + * + *+ * The event object acts as a payload, to propagate state from + * producer to consumer. An event object is an instance of a concrete + * Java class with no type variables. + *
+ * + *+ * The event types of the event include all superclasses and + * interfaces of the runtime class of the event object. An event type + * may not contain a type variable. + *
+ * *The event qualifiers act as topic selectors, allowing the consumer + * + *
+ * 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}.
- * + * instance of any {@linkplain jakarta.inject.Qualifier qualifier type}. + * + * *An {@linkplain jakarta.enterprise.event.Observes observer method} + * + *
+ * 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:
- * + * or {@link jakarta.enterprise.event.ObservesAsync @ObservesAsync}. + * + * + *+ * An observer method will be notified of an event if: + *
+ * *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: + *
+ * *
* 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:
*
* Indicates that a checked exception was thrown during creation of a bean. *
- * + * * @author Pete Muir * @author Gavin King */ diff --git a/api/src/main/java/jakarta/enterprise/inject/Decorated.java b/api/src/main/java/jakarta/enterprise/inject/Decorated.java index 0eb9cfee9..6cce0b0d8 100644 --- a/api/src/main/java/jakarta/enterprise/inject/Decorated.java +++ b/api/src/main/java/jakarta/enterprise/inject/Decorated.java @@ -8,7 +8,7 @@ * 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,7 +30,7 @@ ** A decorator may inject metadata about the bean it is decorating *
- * + * ** @Decorator * class TimestampLogger implements Logger { @@ -38,19 +38,21 @@ * @Delegate * @Any * Logger logger; - * + * * @Inject * @Decorated * Bean<Logger> bean; - * + * * void log(String message) { * ... * } * } ** - *
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/Disposes.java b/api/src/main/java/jakarta/enterprise/inject/Disposes.java index 726903006..a0a1bc3de 100644 --- a/api/src/main/java/jakarta/enterprise/inject/Disposes.java +++ b/api/src/main/java/jakarta/enterprise/inject/Disposes.java @@ -8,7 +8,7 @@ * 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,54 +27,54 @@ ** Identifies the disposed parameter of a disposer method. May be applied to a parameter of a method of a bean class. *
- * + * ** public class UserDatabaseEntityManager { - * + * * @Produces * @ConversationScoped * @UserDatabase * public EntityManager create(EntityManagerFactory emf) { * return emf.createEntityManager(); * } - * + * * public void close(@Disposes @UserDatabase EntityManager em) { * em.close(); * } - * + * * } *- * + * *
* public class Resources { - * + * * @PersistenceContext * @Produces * @UserDatabase * private EntityManager em; - * + * * public void close(@Disposes @UserDatabase EntityManager em) { * em.close(); * } - * + * * } *- * + * *
* A disposer method allows the application to perform customized cleanup of an object returned by a * {@linkplain 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 @@ -82,31 +82,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. *
- * + * ** public void close(@Disposes @UserDatabase EntityManager em, Logger log) { ... } *- * + * *
* 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 d58c23115..0b485152e 100644 --- a/api/src/main/java/jakarta/enterprise/inject/IllegalProductException.java +++ b/api/src/main/java/jakarta/enterprise/inject/IllegalProductException.java @@ -8,7 +8,7 @@ * 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/InjectionException.java b/api/src/main/java/jakarta/enterprise/inject/InjectionException.java index 16de0936f..f75c0c50d 100644 --- a/api/src/main/java/jakarta/enterprise/inject/InjectionException.java +++ b/api/src/main/java/jakarta/enterprise/inject/InjectionException.java @@ -8,7 +8,7 @@ * 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,7 +18,7 @@ /** * Indicates a problem relating to dependency injection. - * + * * @author Pete Muir */ public class InjectionException extends RuntimeException { diff --git a/api/src/main/java/jakarta/enterprise/inject/Instance.java b/api/src/main/java/jakarta/enterprise/inject/Instance.java index a29746caa..28d08ddc8 100644 --- a/api/src/main/java/jakarta/enterprise/inject/Instance.java +++ b/api/src/main/java/jakarta/enterprise/inject/Instance.java @@ -8,7 +8,7 @@ * 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,88 +29,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: *
- * + * *
* In these situations, an instance of the Instance
may be injected:
*
* @Inject * Instance<PaymentProcessor> paymentProcessor; *- * + * *
* Any combination of qualifiers may be specified at the injection point: *
- * + * ** @Inject * @PayBy(CHEQUE) * Instance<PaymentProcessor> chequePaymentProcessor; *- * + * *
- * Or, the {@link 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: *
- * + * ** @Inject * @Any * Instance<PaymentProcessor> anyPaymentProcessor; *- * + * *
* For an injected Instance
:
*
- * 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}.
*
* PaymentProcessor pp = chequePaymentProcessor.get(); *- * + * *
* The inherited {@link java.lang.Iterable#iterator()} method returns an iterator over contextual references for beans that
* match the required type and required qualifiers and are eligible for injection into the class into which the parent
* Instance
was injected.
*
* for (PaymentProcessor pp : anyPaymentProcessor) * pp.test(); *- * + * * @see jakarta.inject.Provider#get() * @see java.lang.Iterable#iterator() * @see AnnotationLiteral * @see TypeLiteral - * + * * @author Gavin King * @author John Ament * @author Martin Kouba - * + * * @param
* Obtains a child Instance
for the given additional required qualifiers.
*
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
* Obtains a child Instance
for the given required type and additional required qualifiers.
*
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);
@@ -148,13 +147,13 @@ public interface Instance
* Obtains a child Instance
for the given required type and additional required qualifiers.
*
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);
@@ -177,7 +176,7 @@ default StreamInstance
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.
*/
@@ -188,21 +187,23 @@ default StreamInstance
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.
*
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();
@@ -213,13 +214,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 @@ -228,8 +229,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.
@@ -242,11 +243,12 @@ default boolean isResolvable() {
Handle
- * 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.
*
- * 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.
*
* An interceptor may inject metadata about the bean it is intercepting.
*
* @Transactional @Interceptor
* public class TransactionInterceptor {
- *
+ *
* @Inject @Intercepted Bean<?> bean;
- *
- * @AroundInvoke
+ *
+ * @AroundInvoke
* public Object manageTransaction(InvocationContext ctx) throws Exception { ... }
- *
+ *
* }
*
- *
+ *
* @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 fcd74c571..0eedb4e30 100644
--- a/api/src/main/java/jakarta/enterprise/inject/Model.java
+++ b/api/src/main/java/jakarta/enterprise/inject/Model.java
@@ -8,7 +8,7 @@
* 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 +32,7 @@
* The built-in stereotype intended for use with beans that define the model layer of an MVC web application architecture such
* as JSF.
*
* Identifies a producer method or field. May be applied to a method or field of a bean class. *
- * + * ** A producer method must be a non-abstract method of a managed bean class or session bean class. A producer method may be * either static or non-static. If the bean is a session bean, the producer method must be either a business method of the EJB * or a static method of the bean class. *
- * + * ** public class Shop { - * @Produces @ApplicationScoped - * @Catalog @Named("catalog") + * @Produces @ApplicationScoped + * @Catalog @Named("catalog") * List<Product> getProducts() { ... } * ... * } *- * + * *
* A producer field must be a field of a managed bean class or session bean class. A producer field may be either static or * non-static. If the bean is a session bean, the producer field must be a static field of the bean class. *
- * + * *- * public class Shop { - * @Produces @ApplicationScoped - * @Catalog @Named("catalog") + * 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 8755260dc..81a644f76 100644 --- a/api/src/main/java/jakarta/enterprise/inject/ResolutionException.java +++ b/api/src/main/java/jakarta/enterprise/inject/ResolutionException.java @@ -8,7 +8,7 @@ * 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,7 +17,7 @@ /** * Indicates a problem relating to typesafe resolution. - * + * * @author Gavin King */ public class ResolutionException extends InjectionException { diff --git a/api/src/main/java/jakarta/enterprise/inject/Specializes.java b/api/src/main/java/jakarta/enterprise/inject/Specializes.java index e64735373..08784d89c 100644 --- a/api/src/main/java/jakarta/enterprise/inject/Specializes.java +++ b/api/src/main/java/jakarta/enterprise/inject/Specializes.java @@ -8,7 +8,7 @@ * 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,38 +31,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: *
- * + * *- * 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. *
- * + * *@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.@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.@Specializes
, then it must be non-static and directly override another
- * producer method. Then the first producer method directly specializes the second producer method.@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.@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.@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 */ @@ -71,7 +73,7 @@ @Retention(RUNTIME) @Documented public @interface Specializes { - + /** * Supports inline instantiation of the {@link Specializes} annotation. * diff --git a/api/src/main/java/jakarta/enterprise/inject/Stereotype.java b/api/src/main/java/jakarta/enterprise/inject/Stereotype.java index 49b266449..b38b77c00 100644 --- a/api/src/main/java/jakarta/enterprise/inject/Stereotype.java +++ b/api/src/main/java/jakarta/enterprise/inject/Stereotype.java @@ -8,7 +8,7 @@ * 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,31 +27,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: *
- * + * ** The default scope of a stereotype is defined by annotating the stereotype with a scope type. A stereotype may declare at most * one scope. If a bean explicitly declares a scope, any default scopes declared by its stereotypes are ignored. *
- * + * ** @RequestScoped * @Stereotype @@ -60,13 +60,13 @@ * public @interface Action { * } *- * + * *
* The interceptor bindings of a stereotype are defined by annotating the stereotype with the interceptor binding types. A * stereotype may declare zero, one or multiple interceptor bindings. An interceptor binding declared by a stereotype is * inherited by any bean that declares that stereotype. *
- * + * ** @RequestScoped * @Secure @@ -77,22 +77,22 @@ * public @interface Action { * } *- * + * *
* A stereotype may also specify that: *
- * + * *- * 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. *
- * + * ** @RequestScoped * @Named @@ -104,12 +104,12 @@ * public @interface Action { * } *- * + * *
- * 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. *
- * + * ** @Alternative * @Stereotype @@ -118,10 +118,10 @@ * public @interface Mock { * } *- * + * *
- * 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. *
* *@@ -138,9 +138,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 aaf93bfc1..373aec5da 100644 --- a/api/src/main/java/jakarta/enterprise/inject/TransientReference.java +++ b/api/src/main/java/jakarta/enterprise/inject/TransientReference.java @@ -8,7 +8,7 @@ * 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,21 +28,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 */ @@ -51,7 +52,7 @@ @Retention(RUNTIME) @Documented public @interface TransientReference { - + /** * Supports inline instantiation of the {@link TransientReference} annotation. * diff --git a/api/src/main/java/jakarta/enterprise/inject/Typed.java b/api/src/main/java/jakarta/enterprise/inject/Typed.java index 95174bcc7..8b8a7b504 100644 --- a/api/src/main/java/jakarta/enterprise/inject/Typed.java +++ b/api/src/main/java/jakarta/enterprise/inject/Typed.java @@ -72,7 +72,7 @@ */ public final static class Literal extends AnnotationLiteralimplements Typed { - public static final Literal INSTANCE = of(new Class>[]{}); + public static final Literal INSTANCE = of(new Class>[] {}); private static final long serialVersionUID = 1L; diff --git a/api/src/main/java/jakarta/enterprise/inject/UnproxyableResolutionException.java b/api/src/main/java/jakarta/enterprise/inject/UnproxyableResolutionException.java index d7dcac236..7c54d241e 100644 --- a/api/src/main/java/jakarta/enterprise/inject/UnproxyableResolutionException.java +++ b/api/src/main/java/jakarta/enterprise/inject/UnproxyableResolutionException.java @@ -8,7 +8,7 @@ * 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 +21,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 */ diff --git a/api/src/main/java/jakarta/enterprise/inject/UnsatisfiedResolutionException.java b/api/src/main/java/jakarta/enterprise/inject/UnsatisfiedResolutionException.java index e9a067b6b..0752a749f 100644 --- a/api/src/main/java/jakarta/enterprise/inject/UnsatisfiedResolutionException.java +++ b/api/src/main/java/jakarta/enterprise/inject/UnsatisfiedResolutionException.java @@ -8,7 +8,7 @@ * 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 +20,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 */ diff --git a/api/src/main/java/jakarta/enterprise/inject/Vetoed.java b/api/src/main/java/jakarta/enterprise/inject/Vetoed.java index a4a4de0de..0c3466606 100644 --- a/api/src/main/java/jakarta/enterprise/inject/Vetoed.java +++ b/api/src/main/java/jakarta/enterprise/inject/Vetoed.java @@ -8,7 +8,7 @@ * 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,20 +29,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) 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 df54baab3..2b482764a 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,13 +10,14 @@ package jakarta.enterprise.inject.build.compatible.spi; +import java.util.Collection; + import jakarta.enterprise.invoke.InvokerBuilder; 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/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/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 96b28dc7f..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 @@ -20,10 +20,10 @@ * **
* * Parameter values are transferred from the builder to the {@code Parameters}-accepting 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 8a74e44f5..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 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 d6ecc44a9..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 @@ -47,6 +47,7 @@ public interface SyntheticComponents { *- 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}. ** 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 4e2b102c6..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 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 @@ */ /** - *The build compatible extension SPI. See:
+ *+ * The build compatible extension SPI. See: + *
* **
- {@link jakarta.enterprise.inject.build.compatible.spi.BuildCompatibleExtension}
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 faf9f70d6..7a16c019e 100644 --- a/api/src/main/java/jakarta/enterprise/inject/se/SeContainer.java +++ b/api/src/main/java/jakarta/enterprise/inject/se/SeContainer.java @@ -28,20 +28,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