diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index 59cccf4d..9644c74d 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -21,27 +21,18 @@ jobs: strategy: fail-fast: false matrix: - java: [ '11', '17', '21' ] + java: [ '17', '21' ] steps: - uses: actions/checkout@v4.1.1 - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v4.0.0 + uses: actions/setup-java@v4.1.0 with: distribution: 'temurin' java-version: ${{ matrix.java }} - - if: ${{ matrix.java != '11' }} - name: "Maven install > 11" + - name: "Maven install" run: | 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 -Dno-format -B -V - - if: ${{ matrix.java != '11' }} - name: "Maven test > 11" + - name: "Maven test" run: | mvn -Pstaging test -B - - if: ${{ matrix.java == '11' }} - name: "Maven test 11" - run: | - mvn -Pstaging -pl '!el' test -B + diff --git a/api/pom.xml b/api/pom.xml index 4704eabb..56004ea6 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -121,10 +121,10 @@ - 3.0.0-M1 + 3.0.0 2.0.1 - 5.0.1 - 2.2.0-M1 + 6.0.0 + 2.2.0 MMMM dd, yyyy diff --git a/api/src/main/java/jakarta/enterprise/context/ApplicationScoped.java b/api/src/main/java/jakarta/enterprise/context/ApplicationScoped.java index 6a07d0a1..19c47b9b 100644 --- a/api/src/main/java/jakarta/enterprise/context/ApplicationScoped.java +++ b/api/src/main/java/jakarta/enterprise/context/ApplicationScoped.java @@ -91,7 +91,7 @@ * @since 2.0 */ public final static class Literal extends AnnotationLiteral implements ApplicationScoped { - + /** Default ApplicationScoped literal */ public static final Literal INSTANCE = new Literal(); private static final long serialVersionUID = 1L; diff --git a/api/src/main/java/jakarta/enterprise/context/BeforeDestroyed.java b/api/src/main/java/jakarta/enterprise/context/BeforeDestroyed.java index 469e5c47..36614d6a 100644 --- a/api/src/main/java/jakarta/enterprise/context/BeforeDestroyed.java +++ b/api/src/main/java/jakarta/enterprise/context/BeforeDestroyed.java @@ -54,19 +54,29 @@ * Supports inline instantiation of the {@link BeforeDestroyed} qualifier. */ public final static class Literal extends AnnotationLiteral implements BeforeDestroyed { - + /** Default BeforeDestroyed literal for the RequestScoped scope */ public static final Literal REQUEST = of(RequestScoped.class); + /** Default BeforeDestroyed literal for the ConversationScoped scope */ public static final Literal CONVERSATION = of(ConversationScoped.class); + /** Default BeforeDestroyed literal for the SessionScoped scope */ public static final Literal SESSION = of(SessionScoped.class); + /** Default BeforeDestroyed literal for the ApplicationScoped scope */ public static final Literal APPLICATION = of(ApplicationScoped.class); private static final long serialVersionUID = 1L; + /** The scope annotation */ private final Class value; + /** + * Obtain the literal for the provided scope annotation + * + * @param value the scope annotation + * @return a new literal value for the provided scope annotation + */ public static Literal of(Class value) { return new Literal(value); } diff --git a/api/src/main/java/jakarta/enterprise/context/BusyConversationException.java b/api/src/main/java/jakarta/enterprise/context/BusyConversationException.java index 1fcd4e74..eafa12df 100644 --- a/api/src/main/java/jakarta/enterprise/context/BusyConversationException.java +++ b/api/src/main/java/jakarta/enterprise/context/BusyConversationException.java @@ -41,18 +41,37 @@ public class BusyConversationException extends ContextException { private static final long serialVersionUID = -3599813072560026919L; + /** + * Creates the exception with no detail message or cause. + */ public BusyConversationException() { super(); } + /** + * Creates the exception with given detail message. + * + * @param message the detail message + */ public BusyConversationException(String message) { super(message); } + /** + * Creates the exception with given cause. + * + * @param cause the cause + */ public BusyConversationException(Throwable cause) { super(cause); } + /** + * Creates the exception with given detail message and cause. + * + * @param message the detail message + * @param cause the cause + */ public BusyConversationException(String message, Throwable cause) { super(message, cause); } diff --git a/api/src/main/java/jakarta/enterprise/context/ContextException.java b/api/src/main/java/jakarta/enterprise/context/ContextException.java index 3f1be66e..cd921ad5 100644 --- a/api/src/main/java/jakarta/enterprise/context/ContextException.java +++ b/api/src/main/java/jakarta/enterprise/context/ContextException.java @@ -26,18 +26,37 @@ public class ContextException extends RuntimeException { private static final long serialVersionUID = -3599813072560026919L; + /** + * Creates the exception with no detail message or cause. + */ public ContextException() { super(); } + /** + * Creates the exception with given detail message. + * + * @param message the detail message + */ public ContextException(String message) { super(message); } + /** + * Creates the exception with given cause. + * + * @param cause the cause + */ public ContextException(Throwable cause) { super(cause); } + /** + * Creates the exception with given detail message and cause. + * + * @param message the detail message + * @param cause the cause + */ public ContextException(String message, Throwable cause) { super(message, cause); } diff --git a/api/src/main/java/jakarta/enterprise/context/ContextNotActiveException.java b/api/src/main/java/jakarta/enterprise/context/ContextNotActiveException.java index 1689c40d..9ae4e5b1 100644 --- a/api/src/main/java/jakarta/enterprise/context/ContextNotActiveException.java +++ b/api/src/main/java/jakarta/enterprise/context/ContextNotActiveException.java @@ -32,18 +32,37 @@ public class ContextNotActiveException extends ContextException { private static final long serialVersionUID = -3599813072560026919L; + /** + * Creates the exception with no detail message or cause. + */ public ContextNotActiveException() { super(); } + /** + * Creates the exception with given detail message. + * + * @param message the detail message + */ public ContextNotActiveException(String message) { super(message); } + /** + * Creates the exception with given cause. + * + * @param cause the cause + */ public ContextNotActiveException(Throwable cause) { super(cause); } + /** + * Creates the exception with given detail message and cause. + * + * @param message the detail message + * @param cause the cause + */ public ContextNotActiveException(String message, Throwable cause) { super(message, cause); } diff --git a/api/src/main/java/jakarta/enterprise/context/ConversationScoped.java b/api/src/main/java/jakarta/enterprise/context/ConversationScoped.java index e9c081ab..fce2cac4 100644 --- a/api/src/main/java/jakarta/enterprise/context/ConversationScoped.java +++ b/api/src/main/java/jakarta/enterprise/context/ConversationScoped.java @@ -151,7 +151,7 @@ * @since 2.0 */ public final static class Literal extends AnnotationLiteral implements ConversationScoped { - + /** Default ConversationScoped literal */ public static final Literal INSTANCE = new Literal(); private static final long serialVersionUID = 1L; diff --git a/api/src/main/java/jakarta/enterprise/context/Dependent.java b/api/src/main/java/jakarta/enterprise/context/Dependent.java index f51f30dd..22147ab1 100644 --- a/api/src/main/java/jakarta/enterprise/context/Dependent.java +++ b/api/src/main/java/jakarta/enterprise/context/Dependent.java @@ -108,7 +108,7 @@ * @since 2.0 */ public final static class Literal extends AnnotationLiteral implements Dependent { - + /** Default Dependent literal */ public static final Literal INSTANCE = new Literal(); private static final long serialVersionUID = 1L; diff --git a/api/src/main/java/jakarta/enterprise/context/Destroyed.java b/api/src/main/java/jakarta/enterprise/context/Destroyed.java index b78bb166..28e52844 100644 --- a/api/src/main/java/jakarta/enterprise/context/Destroyed.java +++ b/api/src/main/java/jakarta/enterprise/context/Destroyed.java @@ -55,19 +55,29 @@ * @author Martin Kouba */ public final static class Literal extends AnnotationLiteral implements Destroyed { - + /** Default Destroyed literal for the RequestScoped scope */ public static final Literal REQUEST = of(RequestScoped.class); + /** Default Destroyed literal for the ConversationScoped scope */ public static final Literal CONVERSATION = of(ConversationScoped.class); + /** Default Destroyed literal for the SessionScoped scope */ public static final Literal SESSION = of(SessionScoped.class); + /** Default Destroyed literal for the ApplicationScoped scope */ public static final Literal APPLICATION = of(ApplicationScoped.class); private static final long serialVersionUID = 1L; + /** The scope annotation */ private final Class value; + /** + * Obtain the literal of the provided scope annotation + * + * @param value the scope annotation + * @return a new Literal value for the provided scope annotation + */ public static Literal of(Class value) { return new Literal(value); } diff --git a/api/src/main/java/jakarta/enterprise/context/Initialized.java b/api/src/main/java/jakarta/enterprise/context/Initialized.java index 2bcd934d..7f78d3e7 100644 --- a/api/src/main/java/jakarta/enterprise/context/Initialized.java +++ b/api/src/main/java/jakarta/enterprise/context/Initialized.java @@ -55,19 +55,29 @@ * @author Martin Kouba */ public final static class Literal extends AnnotationLiteral implements Initialized { - + /** Default Initialized literal for the RequestScoped scope */ public static final Literal REQUEST = of(RequestScoped.class); + /** Default Initialized literal for the ConversationScoped scope */ public static final Literal CONVERSATION = of(ConversationScoped.class); + /** Default Initialized literal for the SessionScoped scope */ public static final Literal SESSION = of(SessionScoped.class); + /** Default Initialized literal for the ApplicationScoped scope */ public static final Literal APPLICATION = of(ApplicationScoped.class); private static final long serialVersionUID = 1L; + /** The scope annotation */ private final Class value; + /** + * Obtain the literal of the provided scope annotation + * + * @param value the scope annotation + * @return a new Literal value for the provided scope annotation + */ public static Literal of(Class value) { return new Literal(value); } diff --git a/api/src/main/java/jakarta/enterprise/context/NonexistentConversationException.java b/api/src/main/java/jakarta/enterprise/context/NonexistentConversationException.java index db571598..e7d12ce9 100644 --- a/api/src/main/java/jakarta/enterprise/context/NonexistentConversationException.java +++ b/api/src/main/java/jakarta/enterprise/context/NonexistentConversationException.java @@ -38,18 +38,37 @@ public class NonexistentConversationException extends ContextException { private static final long serialVersionUID = -3599813072560026919L; + /** + * Creates the exception with no detail message or cause. + */ public NonexistentConversationException() { super(); } + /** + * Creates the exception with given detail message. + * + * @param message the detail message + */ public NonexistentConversationException(String message) { super(message); } + /** + * Creates the exception with given cause. + * + * @param cause the cause + */ public NonexistentConversationException(Throwable cause) { super(cause); } + /** + * Creates the exception with given detail message and cause. + * + * @param message the detail message + * @param cause the cause + */ public NonexistentConversationException(String message, Throwable cause) { super(message, cause); } diff --git a/api/src/main/java/jakarta/enterprise/context/RequestScoped.java b/api/src/main/java/jakarta/enterprise/context/RequestScoped.java index 644f27e3..38505418 100644 --- a/api/src/main/java/jakarta/enterprise/context/RequestScoped.java +++ b/api/src/main/java/jakarta/enterprise/context/RequestScoped.java @@ -95,7 +95,7 @@ * @since 2.0 */ public final static class Literal extends AnnotationLiteral implements RequestScoped { - + /** Default RequestScoped literal */ public static final Literal INSTANCE = new Literal(); private static final long serialVersionUID = 1L; diff --git a/api/src/main/java/jakarta/enterprise/context/SessionScoped.java b/api/src/main/java/jakarta/enterprise/context/SessionScoped.java index 64a6a33a..e2bea927 100644 --- a/api/src/main/java/jakarta/enterprise/context/SessionScoped.java +++ b/api/src/main/java/jakarta/enterprise/context/SessionScoped.java @@ -87,7 +87,7 @@ * @since 2.0 */ public final static class Literal extends AnnotationLiteral implements SessionScoped { - + /** Default SessionScoped literal */ public static final Literal INSTANCE = new Literal(); private static final long serialVersionUID = 1L; diff --git a/api/src/main/java/jakarta/enterprise/event/NotificationOptions.java b/api/src/main/java/jakarta/enterprise/event/NotificationOptions.java index 0b735435..60b735e8 100644 --- a/api/src/main/java/jakarta/enterprise/event/NotificationOptions.java +++ b/api/src/main/java/jakarta/enterprise/event/NotificationOptions.java @@ -72,10 +72,28 @@ static Builder builder() { */ interface Builder { + /** + * Set the notification executor + * + * @param executor the {@linkplain Executor} + * @return this + */ Builder setExecutor(Executor executor); + /** + * Set an option value + * + * @param optionName option name + * @param optionValue option value + * @return this + */ Builder set(String optionName, Object optionValue); + /** + * Build the notification options + * + * @return NotificationOptions + */ NotificationOptions build(); } diff --git a/api/src/main/java/jakarta/enterprise/event/ObserverException.java b/api/src/main/java/jakarta/enterprise/event/ObserverException.java index 973ef58a..36c575fe 100644 --- a/api/src/main/java/jakarta/enterprise/event/ObserverException.java +++ b/api/src/main/java/jakarta/enterprise/event/ObserverException.java @@ -26,18 +26,37 @@ public class ObserverException extends RuntimeException { private static final long serialVersionUID = -801836224808304381L; + /** + * Creates the exception with no detail message or cause. + */ public ObserverException() { } + /** + * Creates the exception with given detail message. + * + * @param message the detail message + */ public ObserverException(String message) { super(message); } + /** + * Creates the exception with given cause. + * + * @param cause the cause + */ public ObserverException(Throwable cause) { super(cause); } + /** + * Creates the exception with given detail message and cause. + * + * @param message the detail message + * @param cause the cause + */ public ObserverException(String message, Throwable cause) { super(message, cause); } diff --git a/api/src/main/java/jakarta/enterprise/inject/Alternative.java b/api/src/main/java/jakarta/enterprise/inject/Alternative.java index 92999255..184eab06 100644 --- a/api/src/main/java/jakarta/enterprise/inject/Alternative.java +++ b/api/src/main/java/jakarta/enterprise/inject/Alternative.java @@ -71,7 +71,7 @@ * @since 2.0 */ public final static class Literal extends AnnotationLiteral implements Alternative { - + /** Default Alternative literal */ public static final Literal INSTANCE = new Literal(); private static final long serialVersionUID = 1L; diff --git a/api/src/main/java/jakarta/enterprise/inject/AmbiguousResolutionException.java b/api/src/main/java/jakarta/enterprise/inject/AmbiguousResolutionException.java index 66bac063..5add09f3 100644 --- a/api/src/main/java/jakarta/enterprise/inject/AmbiguousResolutionException.java +++ b/api/src/main/java/jakarta/enterprise/inject/AmbiguousResolutionException.java @@ -26,19 +26,38 @@ public class AmbiguousResolutionException extends ResolutionException { private static final long serialVersionUID = -2132733164534544788L; + /** + * Creates the exception with no detail message or cause. + */ public AmbiguousResolutionException() { } - public AmbiguousResolutionException(String message, Throwable throwable) { - super(message, throwable); + /** + * Creates the exception with given detail message and cause. + * + * @param message the detail message + * @param cause the cause + */ + public AmbiguousResolutionException(String message, Throwable cause) { + super(message, cause); } + /** + * Creates the exception with given detail message. + * + * @param message the detail message + */ public AmbiguousResolutionException(String message) { super(message); } - public AmbiguousResolutionException(Throwable throwable) { - super(throwable); + /** + * Creates the exception with given cause. + * + * @param cause the cause + */ + public AmbiguousResolutionException(Throwable cause) { + super(cause); } } diff --git a/api/src/main/java/jakarta/enterprise/inject/Any.java b/api/src/main/java/jakarta/enterprise/inject/Any.java index d4f2a907..313a7a1a 100644 --- a/api/src/main/java/jakarta/enterprise/inject/Any.java +++ b/api/src/main/java/jakarta/enterprise/inject/Any.java @@ -83,7 +83,7 @@ * @see Event */ public static final class Literal extends AnnotationLiteral implements Any { - + /** Default Any literal */ public static final Literal INSTANCE = new Literal(); private static final long serialVersionUID = 1L; diff --git a/api/src/main/java/jakarta/enterprise/inject/CreationException.java b/api/src/main/java/jakarta/enterprise/inject/CreationException.java index fe2a9769..b20edcfe 100644 --- a/api/src/main/java/jakarta/enterprise/inject/CreationException.java +++ b/api/src/main/java/jakarta/enterprise/inject/CreationException.java @@ -26,18 +26,37 @@ public class CreationException extends InjectionException { private static final long serialVersionUID = 1002854668862145298L; + /** + * Creates the exception with no detail message or cause. + */ public CreationException() { } + /** + * Creates the exception with given detail message. + * + * @param message the detail message + */ public CreationException(String message) { super(message); } + /** + * Creates the exception with given cause. + * + * @param cause the cause + */ public CreationException(Throwable cause) { super(cause); } + /** + * Creates the exception with given detail message and cause. + * + * @param message the detail message + * @param cause the cause + */ public CreationException(String message, Throwable cause) { super(message, cause); } diff --git a/api/src/main/java/jakarta/enterprise/inject/Default.java b/api/src/main/java/jakarta/enterprise/inject/Default.java index 73ab4904..f61f1e79 100644 --- a/api/src/main/java/jakarta/enterprise/inject/Default.java +++ b/api/src/main/java/jakarta/enterprise/inject/Default.java @@ -99,7 +99,7 @@ * @see Event */ public static final class Literal extends AnnotationLiteral implements Default { - + /** The default Default literal */ public static final Literal INSTANCE = new Literal(); private static final long serialVersionUID = 1L; diff --git a/api/src/main/java/jakarta/enterprise/inject/IllegalProductException.java b/api/src/main/java/jakarta/enterprise/inject/IllegalProductException.java index 72176721..56223681 100644 --- a/api/src/main/java/jakarta/enterprise/inject/IllegalProductException.java +++ b/api/src/main/java/jakarta/enterprise/inject/IllegalProductException.java @@ -25,18 +25,37 @@ public class IllegalProductException extends InjectionException { private static final long serialVersionUID = -6280627846071966243L; + /** + * Creates the exception with no detail message or cause. + */ public IllegalProductException() { super(); } + /** + * Creates the exception with given detail message and cause. + * + * @param message the detail message + * @param cause the cause + */ public IllegalProductException(String message, Throwable cause) { super(message, cause); } + /** + * Creates the exception with given detail message. + * + * @param message the detail message + */ public IllegalProductException(String message) { super(message); } + /** + * Creates the exception with given cause. + * + * @param cause the cause + */ public IllegalProductException(Throwable cause) { super(cause); } diff --git a/api/src/main/java/jakarta/enterprise/inject/InjectionException.java b/api/src/main/java/jakarta/enterprise/inject/InjectionException.java index 43f6d2d7..cf453358 100644 --- a/api/src/main/java/jakarta/enterprise/inject/InjectionException.java +++ b/api/src/main/java/jakarta/enterprise/inject/InjectionException.java @@ -23,19 +23,38 @@ public class InjectionException extends RuntimeException { private static final long serialVersionUID = -2132733164534544788L; + /** + * Creates the exception with no detail message or cause. + */ public InjectionException() { } - public InjectionException(String message, Throwable throwable) { - super(message, throwable); + /** + * Creates the exception with given detail message and cause. + * + * @param message the detail message + * @param cause the cause + */ + public InjectionException(String message, Throwable cause) { + super(message, cause); } + /** + * Creates the exception with given detail message. + * + * @param message the detail message + */ public InjectionException(String message) { super(message); } - public InjectionException(Throwable throwable) { - super(throwable); + /** + * Creates the exception with given cause. + * + * @param cause the cause + */ + public InjectionException(Throwable cause) { + super(cause); } } diff --git a/api/src/main/java/jakarta/enterprise/inject/ResolutionException.java b/api/src/main/java/jakarta/enterprise/inject/ResolutionException.java index aa78b86c..8bc7312e 100644 --- a/api/src/main/java/jakarta/enterprise/inject/ResolutionException.java +++ b/api/src/main/java/jakarta/enterprise/inject/ResolutionException.java @@ -22,18 +22,37 @@ public class ResolutionException extends InjectionException { private static final long serialVersionUID = -6280627846071966243L; + /** + * Creates the exception with no detail message or cause. + */ public ResolutionException() { super(); } + /** + * Creates the exception with given detail message and cause. + * + * @param message the detail message + * @param cause the cause + */ public ResolutionException(String message, Throwable cause) { super(message, cause); } + /** + * Creates the exception with given detail message. + * + * @param message the detail message + */ public ResolutionException(String message) { super(message); } + /** + * Creates the exception with given cause. + * + * @param cause the cause + */ public ResolutionException(Throwable cause) { super(cause); } diff --git a/api/src/main/java/jakarta/enterprise/inject/Specializes.java b/api/src/main/java/jakarta/enterprise/inject/Specializes.java index cdadeb91..10cd24f2 100644 --- a/api/src/main/java/jakarta/enterprise/inject/Specializes.java +++ b/api/src/main/java/jakarta/enterprise/inject/Specializes.java @@ -83,7 +83,7 @@ public static final class Literal extends AnnotationLiteral implements Specializes { private static final long serialVersionUID = 1L; - + /** Default Specializes literal */ public static final Literal INSTANCE = new Literal(); } diff --git a/api/src/main/java/jakarta/enterprise/inject/TransientReference.java b/api/src/main/java/jakarta/enterprise/inject/TransientReference.java index d0c8622a..f87a2a08 100644 --- a/api/src/main/java/jakarta/enterprise/inject/TransientReference.java +++ b/api/src/main/java/jakarta/enterprise/inject/TransientReference.java @@ -62,7 +62,7 @@ public static final class Literal extends AnnotationLiteral implements TransientReference { private static final long serialVersionUID = 1L; - + /** Default TransientReference literal */ public static final Literal INSTANCE = new Literal(); } diff --git a/api/src/main/java/jakarta/enterprise/inject/Typed.java b/api/src/main/java/jakarta/enterprise/inject/Typed.java index 70a361d3..f1386222 100644 --- a/api/src/main/java/jakarta/enterprise/inject/Typed.java +++ b/api/src/main/java/jakarta/enterprise/inject/Typed.java @@ -54,8 +54,8 @@ public @interface Typed { /** *

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

* * @return the classes corresponding to the bean types of the bean @@ -69,13 +69,20 @@ * @since 2.0 */ public final static class Literal extends AnnotationLiteral implements Typed { - + /** Default Typed literal */ public static final Literal INSTANCE = of(new Class[] {}); private static final long serialVersionUID = 1L; + /** The classes corresponding to the bean types of the bean */ private final Class[] value; + /** + * Obtain the Typed literal for the provided bean types + * + * @param value the classes corresponding to the bean types of the bean + * @return a new Literal value for the provided classes + */ public static Literal of(Class[] value) { return new Literal(value); } @@ -84,6 +91,9 @@ private Literal(Class[] value) { this.value = value; } + /** + * @return the classes corresponding to the bean types of the bean + */ public Class[] value() { return value; } diff --git a/api/src/main/java/jakarta/enterprise/inject/UnproxyableResolutionException.java b/api/src/main/java/jakarta/enterprise/inject/UnproxyableResolutionException.java index c4aebc1d..0020620a 100644 --- a/api/src/main/java/jakarta/enterprise/inject/UnproxyableResolutionException.java +++ b/api/src/main/java/jakarta/enterprise/inject/UnproxyableResolutionException.java @@ -27,20 +27,39 @@ public class UnproxyableResolutionException extends ResolutionException { private static final long serialVersionUID = 1667539354548135465L; + /** + * Creates the exception with no detail message or cause. + */ public UnproxyableResolutionException() { super(); } - public UnproxyableResolutionException(String message, Throwable throwable) { - super(message, throwable); + /** + * Creates the exception with given detail message and cause. + * + * @param message the detail message + * @param cause the cause + */ + public UnproxyableResolutionException(String message, Throwable cause) { + super(message, cause); } + /** + * Creates the exception with given detail message. + * + * @param message the detail message + */ public UnproxyableResolutionException(String message) { super(message); } - public UnproxyableResolutionException(Throwable throwable) { - super(throwable); + /** + * Creates the exception with given cause. + * + * @param cause the cause + */ + public UnproxyableResolutionException(Throwable cause) { + super(cause); } } diff --git a/api/src/main/java/jakarta/enterprise/inject/UnsatisfiedResolutionException.java b/api/src/main/java/jakarta/enterprise/inject/UnsatisfiedResolutionException.java index dff8d3ef..5f5be316 100644 --- a/api/src/main/java/jakarta/enterprise/inject/UnsatisfiedResolutionException.java +++ b/api/src/main/java/jakarta/enterprise/inject/UnsatisfiedResolutionException.java @@ -26,20 +26,39 @@ public class UnsatisfiedResolutionException extends ResolutionException { private static final long serialVersionUID = 5350603312442756709L; + /** + * Creates the exception with no detail message or cause. + */ public UnsatisfiedResolutionException() { super(); } - public UnsatisfiedResolutionException(String message, Throwable throwable) { - super(message, throwable); + /** + * Creates the exception with given detail message and cause. + * + * @param message the detail message + * @param cause the cause + */ + public UnsatisfiedResolutionException(String message, Throwable cause) { + super(message, cause); } + /** + * Creates the exception with given detail message. + * + * @param message the detail message + */ public UnsatisfiedResolutionException(String message) { super(message); } - public UnsatisfiedResolutionException(Throwable throwable) { - super(throwable); + /** + * Creates the exception with given cause. + * + * @param cause the cause + */ + public UnsatisfiedResolutionException(Throwable cause) { + super(cause); } } diff --git a/api/src/main/java/jakarta/enterprise/inject/Vetoed.java b/api/src/main/java/jakarta/enterprise/inject/Vetoed.java index a039ba6a..5ad2a76c 100644 --- a/api/src/main/java/jakarta/enterprise/inject/Vetoed.java +++ b/api/src/main/java/jakarta/enterprise/inject/Vetoed.java @@ -58,7 +58,7 @@ public static final class Literal extends AnnotationLiteral implements Vetoed { private static final long serialVersionUID = 1L; - + /** Default Vetoed literal */ public static final Literal INSTANCE = new Literal(); } diff --git a/api/src/main/java/jakarta/enterprise/inject/literal/InjectLiteral.java b/api/src/main/java/jakarta/enterprise/inject/literal/InjectLiteral.java index 22828b95..3a94bfbe 100644 --- a/api/src/main/java/jakarta/enterprise/inject/literal/InjectLiteral.java +++ b/api/src/main/java/jakarta/enterprise/inject/literal/InjectLiteral.java @@ -23,7 +23,7 @@ * @since 2.0 */ public final class InjectLiteral extends AnnotationLiteral implements Inject { - + /** Default Inject literal */ public static final InjectLiteral INSTANCE = new InjectLiteral(); private static final long serialVersionUID = 1L; diff --git a/api/src/main/java/jakarta/enterprise/inject/literal/NamedLiteral.java b/api/src/main/java/jakarta/enterprise/inject/literal/NamedLiteral.java index 095d492b..2d355ab6 100644 --- a/api/src/main/java/jakarta/enterprise/inject/literal/NamedLiteral.java +++ b/api/src/main/java/jakarta/enterprise/inject/literal/NamedLiteral.java @@ -24,13 +24,20 @@ * @since 2.0 */ public final class NamedLiteral extends AnnotationLiteral implements Named { - + /** Default Named literal */ public static final Named INSTANCE = of(""); private static final long serialVersionUID = 1L; + /** The name */ private final String value; + /** + * Create a new NamedLiteral for the given name value + * + * @param value the name + * @return new NamedLiteral + */ public static NamedLiteral of(String value) { return new NamedLiteral(value); } diff --git a/api/src/main/java/jakarta/enterprise/inject/literal/QualifierLiteral.java b/api/src/main/java/jakarta/enterprise/inject/literal/QualifierLiteral.java index 4f60f0ba..7b43962f 100644 --- a/api/src/main/java/jakarta/enterprise/inject/literal/QualifierLiteral.java +++ b/api/src/main/java/jakarta/enterprise/inject/literal/QualifierLiteral.java @@ -23,7 +23,7 @@ * @since 2.0 */ public final class QualifierLiteral extends AnnotationLiteral implements Qualifier { - + /** Default Qualifier literal */ public static final QualifierLiteral INSTANCE = new QualifierLiteral(); private static final long serialVersionUID = 1L; diff --git a/api/src/main/java/jakarta/enterprise/inject/literal/SingletonLiteral.java b/api/src/main/java/jakarta/enterprise/inject/literal/SingletonLiteral.java index 14262cdd..e188ddd6 100644 --- a/api/src/main/java/jakarta/enterprise/inject/literal/SingletonLiteral.java +++ b/api/src/main/java/jakarta/enterprise/inject/literal/SingletonLiteral.java @@ -23,7 +23,7 @@ * @since 2.0 */ public final class SingletonLiteral extends AnnotationLiteral implements Singleton { - + /** Default Singleton literal */ public static final SingletonLiteral INSTANCE = new SingletonLiteral(); private static final long serialVersionUID = 1L; diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/Annotated.java b/api/src/main/java/jakarta/enterprise/inject/spi/Annotated.java index b9ae3f65..d6d6cd36 100644 --- a/api/src/main/java/jakarta/enterprise/inject/spi/Annotated.java +++ b/api/src/main/java/jakarta/enterprise/inject/spi/Annotated.java @@ -22,7 +22,7 @@ /** *

* Represents a Java program element that can be annotated. - *

+ *

* * @see java.lang.reflect.AnnotatedElement * diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedType.java b/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedType.java index 8f5a4a52..ab17b40d 100644 --- a/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedType.java +++ b/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedType.java @@ -64,7 +64,7 @@ public interface AnnotatedType extends Annotated { /** *

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

+ *

* * @return the fields, or an empty set if none are defined */ diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/CDI.java b/api/src/main/java/jakarta/enterprise/inject/spi/CDI.java index 10e6d909..ffa9a486 100644 --- a/api/src/main/java/jakarta/enterprise/inject/spi/CDI.java +++ b/api/src/main/java/jakarta/enterprise/inject/spi/CDI.java @@ -42,7 +42,9 @@ public abstract class CDI implements Instance { private static final Object lock = new Object(); private static volatile boolean providerSetManually = false; + /** The set of discovered CDIProviders */ protected static volatile Set discoveredProviders = null; + /** {@link CDIProvider} set by user or retrieved by service loader */ protected static volatile CDIProvider configuredProvider = null; /** diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/CDIProvider.java b/api/src/main/java/jakarta/enterprise/inject/spi/CDIProvider.java index 9a7c0732..4811fc51 100644 --- a/api/src/main/java/jakarta/enterprise/inject/spi/CDIProvider.java +++ b/api/src/main/java/jakarta/enterprise/inject/spi/CDIProvider.java @@ -22,6 +22,7 @@ */ public interface CDIProvider extends Prioritized { + /** The default value for {@linkplain #getPriority()} */ public static final int DEFAULT_CDI_PROVIDER_PRIORITY = 0; /** diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/DefinitionException.java b/api/src/main/java/jakarta/enterprise/inject/spi/DefinitionException.java index 0172e053..455db37c 100644 --- a/api/src/main/java/jakarta/enterprise/inject/spi/DefinitionException.java +++ b/api/src/main/java/jakarta/enterprise/inject/spi/DefinitionException.java @@ -41,16 +41,32 @@ public class DefinitionException extends RuntimeException { private static final long serialVersionUID = -2699170549782567339L; - public DefinitionException(String message, Throwable t) { - super(message, t); + /** + * Creates the exception with given detail message and cause. + * + * @param message the detail message + * @param cause the cause + */ + public DefinitionException(String message, Throwable cause) { + super(message, cause); } + /** + * Creates the exception with given detail message. + * + * @param message the detail message + */ public DefinitionException(String message) { super(message); } - public DefinitionException(Throwable t) { - super(t); + /** + * Creates the exception with given cause. + * + * @param cause the cause + */ + public DefinitionException(Throwable cause) { + super(cause); } } diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/DeploymentException.java b/api/src/main/java/jakarta/enterprise/inject/spi/DeploymentException.java index 50627b26..0970d517 100644 --- a/api/src/main/java/jakarta/enterprise/inject/spi/DeploymentException.java +++ b/api/src/main/java/jakarta/enterprise/inject/spi/DeploymentException.java @@ -41,16 +41,32 @@ public class DeploymentException extends RuntimeException { private static final long serialVersionUID = 2604707587772339984L; - public DeploymentException(String message, Throwable t) { - super(message, t); + /** + * Creates the exception with given detail message and cause. + * + * @param message the detail message + * @param cause the cause + */ + public DeploymentException(String message, Throwable cause) { + super(message, cause); } + /** + * Creates the exception with given detail message. + * + * @param message the detail message + */ public DeploymentException(String message) { super(message); } - public DeploymentException(Throwable t) { - super(t); + /** + * Creates the exception with given cause. + * + * @param cause the cause + */ + public DeploymentException(Throwable cause) { + super(cause); } } diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/ObserverMethod.java b/api/src/main/java/jakarta/enterprise/inject/spi/ObserverMethod.java index 5f3e754e..f224dfb5 100644 --- a/api/src/main/java/jakarta/enterprise/inject/spi/ObserverMethod.java +++ b/api/src/main/java/jakarta/enterprise/inject/spi/ObserverMethod.java @@ -40,7 +40,7 @@ * @param the event type */ public interface ObserverMethod extends Prioritized { - + /** The default observer priority */ public static final int DEFAULT_PRIORITY = jakarta.interceptor.Interceptor.Priority.APPLICATION + 500; /** diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/WithAnnotations.java b/api/src/main/java/jakarta/enterprise/inject/spi/WithAnnotations.java index 86211672..9f223ba7 100644 --- a/api/src/main/java/jakarta/enterprise/inject/spi/WithAnnotations.java +++ b/api/src/main/java/jakarta/enterprise/inject/spi/WithAnnotations.java @@ -44,7 +44,12 @@ @Retention(RUNTIME) @Target(PARAMETER) public @interface WithAnnotations { - + /** + * The annotation types that must be present on the {@link AnnotatedType} + * for the {@code ProcessAnnotatedType} observer to be notified. + * + * @return required annotation types + */ Class[] value(); } diff --git a/api/src/main/java/jakarta/enterprise/util/AnnotationLiteral.java b/api/src/main/java/jakarta/enterprise/util/AnnotationLiteral.java index 00ab36ef..2baab50b 100644 --- a/api/src/main/java/jakarta/enterprise/util/AnnotationLiteral.java +++ b/api/src/main/java/jakarta/enterprise/util/AnnotationLiteral.java @@ -71,6 +71,9 @@ public abstract class AnnotationLiteral implements Annotat private transient Method[] members; private transient Integer cachedHashCode; + /** + * The literal constructor, only for subclasses. + */ protected AnnotationLiteral() { } diff --git a/api/src/main/java/jakarta/enterprise/util/Nonbinding.java b/api/src/main/java/jakarta/enterprise/util/Nonbinding.java index 9f54c1b4..8ef816d6 100644 --- a/api/src/main/java/jakarta/enterprise/util/Nonbinding.java +++ b/api/src/main/java/jakarta/enterprise/util/Nonbinding.java @@ -56,7 +56,7 @@ * @since 2.0 */ public static final class Literal extends AnnotationLiteral implements Nonbinding { - + /** Default Nonbinding literal */ public static final Literal INSTANCE = new Literal(); private static final long serialVersionUID = 1L; diff --git a/api/src/main/java/jakarta/enterprise/util/TypeLiteral.java b/api/src/main/java/jakarta/enterprise/util/TypeLiteral.java index 451a6d3f..56af037b 100644 --- a/api/src/main/java/jakarta/enterprise/util/TypeLiteral.java +++ b/api/src/main/java/jakarta/enterprise/util/TypeLiteral.java @@ -52,6 +52,9 @@ public abstract class TypeLiteral implements Serializable { private transient Type actualType; + /** + * The literal constructor, only for subclasses. + */ protected TypeLiteral() { } diff --git a/api/src/main/java/module-info.java b/api/src/main/java/module-info.java index 5154dab2..b4f3fdd7 100644 --- a/api/src/main/java/module-info.java +++ b/api/src/main/java/module-info.java @@ -11,6 +11,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +/** + * The {@code jakarta.cdi} module; defines the CDI API exported packages, dependencies and services. + */ module jakarta.cdi { exports jakarta.decorator; exports jakarta.enterprise.context; diff --git a/docs/404.html b/docs/404.html index 30362f16..30496b4c 100644 --- a/docs/404.html +++ b/docs/404.html @@ -1,13 +1,12 @@ - --- +# Copyright (c) 2021 Red Hat, Inc. and others +# +# This program and the accompanying materials are made available under the +# Apache Software License 2.0 which is available at: +# https://www.apache.org/licenses/LICENSE-2.0. +# +# SPDX-License-Identifier: Apache-2.0 + permalink: /404.html layout: default --- diff --git a/docs/Gemfile b/docs/Gemfile index e2cdb8a5..b02d8630 100644 --- a/docs/Gemfile +++ b/docs/Gemfile @@ -5,6 +5,7 @@ # https://www.apache.org/licenses/LICENSE-2.0. # # SPDX-License-Identifier: Apache-2.0 + source "https://rubygems.org" # Hello! This is where you manage which Jekyll version is used to run. # When you want to use a different version, change it below, save the diff --git a/docs/README.md b/docs/README.md index df7e3d4c..daa22de0 100644 --- a/docs/README.md +++ b/docs/README.md @@ -23,7 +23,7 @@ These instructions will get you a copy of the eclipse-ee4j.github.io/cdi/ websit 3. Fork the [project repository](https://github.com/eclipse-ee4j/cdi), then clone your fork. - git clone https://github.com/eclipse-ee4j/cdi + git clone https://github.com/jakartaee/cdi 4. Change into the project directory: @@ -44,17 +44,18 @@ These instructions will get you a copy of the eclipse-ee4j.github.io/cdi/ websit **For more regarding the use of Jekyll, please refer to the [Jekyll Step by Step Tutorial](https://jekyllrb.com/docs/step-by-step/01-setup/).** ## Writing a Blog Post + To write a blog: -- create an author entry in [_authors](https://github.com/eclipse-ee4j/cdi/tree/master/docs/_authors) -- create an blog entry under [_posts](https://github.com/eclipse-ee4j/cdi/tree/master/docs/_posts) - -the file name is `yyyy-mm-dd-slug.adoc` -- `tags` should be used with some care as an archive page is created for of them. Below are some basic rules to try follow: +- create an author entry in [_authors](https://github.com/jakartaee/cdi/tree/master/docs/_authors) +- create a blog entry under [_posts](https://github.com/jakartaee/cdi/tree/master/docs/_posts) + - the file name is `yyyy-mm-dd-slug.adoc` +- `tag` or `tags` should be used with some care as an archive page is created for of them. Below are some basic rules to follow: - `cdi-release` used for CDI release blogs - `announcement` used for general announcement with some impact. - `development-tips` used for blogs with tips to develop with CDI. - tags are space separated list `tags:cdi-release announcement` - tags must be in lowercase -- it's in markdown format, there is an example as shown with [2021-10-25-way-to-cdi4.md](https://github.com/eclipse-ee4j/cdi/blob/master/docs/_posts/2021-10-25-way-to-cdi4.md) - - Be aware that the `date` attribute in the asciidoc preamble defines when the article will be published. Use a present date while writing your article to test locally, then switch to the actual target date before submitting. -- send a pull request against the master branch and when it is merged it will be automatically incorporated into the pages site. +- it's in Markdown format, see [2021-10-25-way-to-cdi4.md](https://github.com/jakartaee/cdi/blob/master/docs/_posts/2021-10-25-way-to-cdi4.md) for example +- the `date` attribute in the front matter defines when the article will be published. Use a present date while writing your article to test locally, then switch to the actual target date before submitting. +- send a pull request against the `main` branch and when it is merged it will be automatically incorporated into the site. diff --git a/docs/_authors/asd.md b/docs/_authors/asd.md index b058d6c0..0de8dc9a 100644 --- a/docs/_authors/asd.md +++ b/docs/_authors/asd.md @@ -1,15 +1,14 @@ - --- +# Copyright (c) 2021 Red Hat, Inc. and others +# +# This program and the accompanying materials are made available under the +# Apache Software License 2.0 which is available at: +# https://www.apache.org/licenses/LICENSE-2.0. +# +# SPDX-License-Identifier: Apache-2.0 + short_name: asd name: Antoine Sabot-Durand position: Software Engineer --- -https://github.com/antoinesd \ No newline at end of file +[https://github.com/antoinesd](https://github.com/antoinesd) diff --git a/docs/_authors/ladt.md b/docs/_authors/ladt.md index c60567c7..e8b230cb 100644 --- a/docs/_authors/ladt.md +++ b/docs/_authors/ladt.md @@ -1,15 +1,14 @@ - --- +# Copyright (c) 2021 Red Hat, Inc. and others +# +# This program and the accompanying materials are made available under the +# Apache Software License 2.0 which is available at: +# https://www.apache.org/licenses/LICENSE-2.0. +# +# SPDX-License-Identifier: Apache-2.0 + short_name: ladt name: Ladislav Thon position: Software Engineer --- -https://github.com/Ladicek \ No newline at end of file +[https://github.com/Ladicek](https://github.com/Ladicek) diff --git a/docs/_authors/matn.md b/docs/_authors/matn.md index 6e2fe442..f0c09d42 100644 --- a/docs/_authors/matn.md +++ b/docs/_authors/matn.md @@ -1,15 +1,14 @@ - --- +# Copyright (c) 2021 Red Hat, Inc. and others +# +# This program and the accompanying materials are made available under the +# Apache Software License 2.0 which is available at: +# https://www.apache.org/licenses/LICENSE-2.0. +# +# SPDX-License-Identifier: Apache-2.0 + short_name: matn name: Matej Novotny position: Software Engineer --- -https://github.com/manovotn \ No newline at end of file +[https://github.com/manovotn](https://github.com/manovotn) diff --git a/docs/_authors/starksm.md b/docs/_authors/starksm.md index e5149f32..19b737bc 100644 --- a/docs/_authors/starksm.md +++ b/docs/_authors/starksm.md @@ -1,15 +1,14 @@ - --- +# Copyright (c) 2021 Red Hat, Inc. and others +# +# This program and the accompanying materials are made available under the +# Apache Software License 2.0 which is available at: +# https://www.apache.org/licenses/LICENSE-2.0. +# +# SPDX-License-Identifier: Apache-2.0 + short_name: starksm name: Scott M Stark position: Software Engineer --- -https://github.com/starksm64 \ No newline at end of file +[https://github.com/starksm64](https://github.com/starksm64) diff --git a/docs/_config.yml b/docs/_config.yml index 0af0941b..dddac5c3 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -5,6 +5,7 @@ # https://www.apache.org/licenses/LICENSE-2.0. # # SPDX-License-Identifier: Apache-2.0 + # Welcome to Jekyll! # # This config file is meant for settings that affect your whole blog, values @@ -28,9 +29,9 @@ title: Jakarta CDI email: cdi-dev@eclipse.org description: >- # this means to ignore newlines until "baseurl:" - This is the pages site for the Jakarta Contents and Dependency Injection API and Specifications project. + This is the site for the Jakarta Contexts and Dependency Injection API and Specification project. baseurl: "/cdi" # the subpath of your site, e.g. /blog -url: "https://eclipse-ee4j.github.io" # the base hostname & protocol for your site, e.g. http://example.com +url: "https://jakartaee.github.io" # the base hostname & protocol for your site, e.g. http://example.com #twitter_username: #github_username: diff --git a/docs/_data/navigation.yml b/docs/_data/navigation.yml index 0cd963b7..ff28e1af 100644 --- a/docs/_data/navigation.yml +++ b/docs/_data/navigation.yml @@ -5,6 +5,7 @@ # https://www.apache.org/licenses/LICENSE-2.0. # # SPDX-License-Identifier: Apache-2.0 + - name: Home link: / - name: About diff --git a/docs/_layouts/author.html b/docs/_layouts/author.html index baee1b4d..ca79f7df 100644 --- a/docs/_layouts/author.html +++ b/docs/_layouts/author.html @@ -1,13 +1,12 @@ - --- +# Copyright (c) 2021 Red Hat, Inc. and others +# +# This program and the accompanying materials are made available under the +# Apache Software License 2.0 which is available at: +# https://www.apache.org/licenses/LICENSE-2.0. +# +# SPDX-License-Identifier: Apache-2.0 + layout: default ---

{{ page.name }}

diff --git a/docs/_layouts/post.html b/docs/_layouts/post.html index 57938560..45dc8251 100644 --- a/docs/_layouts/post.html +++ b/docs/_layouts/post.html @@ -1,13 +1,12 @@ - --- +# Copyright (c) 2021 Red Hat, Inc. and others +# +# This program and the accompanying materials are made available under the +# Apache Software License 2.0 which is available at: +# https://www.apache.org/licenses/LICENSE-2.0. +# +# SPDX-License-Identifier: Apache-2.0 + layout: default ---

{{ page.title }}

diff --git a/docs/_posts/2021-10-25-pages-here.md b/docs/_posts/2021-10-25-pages-here.md index f5a78da9..6b601ee7 100644 --- a/docs/_posts/2021-10-25-pages-here.md +++ b/docs/_posts/2021-10-25-pages-here.md @@ -1,20 +1,18 @@ - --- -layout: post -title: "Jakarta CDI GitHub Pages" -date: 2021-10-25 22:08:50 -0500 -categories: announcement +# Copyright (c) 2021 Red Hat, Inc. and others +# +# This program and the accompanying materials are made available under the +# Apache Software License 2.0 which is available at: +# https://www.apache.org/licenses/LICENSE-2.0. +# +# SPDX-License-Identifier: Apache-2.0 + +title: "Jakarta CDI GitHub Pages" +date: 2021-10-25 22:08:50 -0500 author: starksm +tag: announcement --- # CDI GitHub Pages -The GitHub pages for Jakarta CDI has arrived. See the [README.md](https://github.com/eclipse-ee4j/cdi/tree/master/docs/README.md) file for how to build the pages site locally, and how to create a blog entry. \ No newline at end of file +The GitHub pages for Jakarta CDI has arrived. See the [README.md](https://github.com/jakartaee/cdi/tree/master/docs/README.md) file for how to build the pages site locally, and how to create a blog entry. diff --git a/docs/_posts/2021-10-25-way-to-cdi4.md b/docs/_posts/2021-10-25-way-to-cdi4.md index 19e8e8a8..b5c13f8f 100644 --- a/docs/_posts/2021-10-25-way-to-cdi4.md +++ b/docs/_posts/2021-10-25-way-to-cdi4.md @@ -1,20 +1,16 @@ - --- +# Copyright (c) 2021 Red Hat, Inc. and others +# +# This program and the accompanying materials are made available under the +# Apache Software License 2.0 which is available at: +# https://www.apache.org/licenses/LICENSE-2.0. +# +# SPDX-License-Identifier: Apache-2.0 + title: "On the Way to CDI 4.0" summary: Overview of changes coming to CDI 4.0 -layout: post author: matn -tag: Release -priority: 1 -change_frequency: daily +tag: release --- As you probably know, work is well under way for projects aiming to land in Jakarta EE 10 space and CDI is no exception. In fact, the specification is close to being rounded up for its next major release hence it is the right time to summarize what is coming. diff --git a/docs/_posts/2021-12-03-you-know-build-compatible-extensions.md b/docs/_posts/2021-12-03-you-know-build-compatible-extensions.md index 32d60017..049a68cd 100644 --- a/docs/_posts/2021-12-03-you-know-build-compatible-extensions.md +++ b/docs/_posts/2021-12-03-you-know-build-compatible-extensions.md @@ -1,23 +1,19 @@ - --- +# Copyright (c) 2021 Red Hat, Inc. and others +# +# This program and the accompanying materials are made available under the +# Apache Software License 2.0 which is available at: +# https://www.apache.org/licenses/LICENSE-2.0. +# +# SPDX-License-Identifier: Apache-2.0 + title: "You already know Build Compatible Extensions" summary: Comparison of Portable Extensions and Build Compatible Extensions -layout: post author: ladt tag: development-tips -priority: 1 -change_frequency: daily --- -As you have learned from a [previous post](https://eclipse-ee4j.github.io/cdi/2021/10/25/way-to-cdi4.html), CDI Lite comes with a new extension API called _Build Compatible Extensions_. +As you have learned from a [previous post](https://jakartaee.github.io/cdi/2021/10/25/way-to-cdi4.html), CDI Lite comes with a new extension API called _Build Compatible Extensions_. In this post, you will learn more about this API by comparison with _Portable Extensions_ and my hope is that by the end, you will see that _you already know Build Compatible Extensions_. If you don't know Portable Extensions, don't worry. diff --git a/docs/_posts/2022-01-24-400-RC3-spec.md b/docs/_posts/2022-01-24-400-RC3-spec.md index 40fc16e4..26e2fc4b 100644 --- a/docs/_posts/2022-01-24-400-RC3-spec.md +++ b/docs/_posts/2022-01-24-400-RC3-spec.md @@ -1,18 +1,16 @@ - --- -layout: post -title: "Jakarta CDI 4.0 Draft Specification" -date: 2022-01-24 20:00:00 -0500 -categories: announcement +# Copyright (c) 2021 Red Hat, Inc. and others +# +# This program and the accompanying materials are made available under the +# Apache Software License 2.0 which is available at: +# https://www.apache.org/licenses/LICENSE-2.0. +# +# SPDX-License-Identifier: Apache-2.0 + +title: "Jakarta CDI 4.0 Draft Specification" +date: 2022-01-24 20:00:00 -0500 author: starksm +tag: announcement --- A draft of the 4.0 CDI specification is available in the current build of the 4.0.0-RC3 API [jakarta-cdi-spec-4.0.pdf](https://ci.eclipse.org/cdi/job/CDI%20Release-JDK11/25/artifact/spec/target/generated-docs/jakarta-cdi-spec-4.0.pdf). diff --git a/docs/_posts/2024-02-27-whats-new-in-cdi41.md b/docs/_posts/2024-02-27-whats-new-in-cdi41.md new file mode 100644 index 00000000..df91b552 --- /dev/null +++ b/docs/_posts/2024-02-27-whats-new-in-cdi41.md @@ -0,0 +1,127 @@ +--- +# Copyright (c) 2024 Red Hat, Inc. and others +# +# This program and the accompanying materials are made available under the +# Apache Software License 2.0 which is available at: +# https://www.apache.org/licenses/LICENSE-2.0. +# +# SPDX-License-Identifier: Apache-2.0 + +title: "What's new in CDI 4.1?" +author: ladt +tag: development-tips +--- + +If you're following the activity on the [CDI repository](https://github.com/jakartaee/cdi/), or in Jakarta EE in general, you might have noticed that the CDI 4.1 release is coming soon. +In this short post, we'll take a look at what's new in the wonderful world of CDI. + +## Method Invokers + +The most important (or at least the biggest) addition to CDI is _method invokers_. +It is not terribly interesting for application developers, but it should be very useful for people who build CDI-based frameworks. + +A method invoker is, unsurprisingly, an object that allows invoking a method indirectly. +It implements the `jakarta.enterprise.invoke.Invoker` interface, which is very simple: + +```java +interface Invoker { + R invoke(T instance, Object[] arguments) throws Exception; +} +``` + +CDI extensions can create an invoker for methods (including `static` methods) declared on managed beans. +For example, let's say the application contains this bean: + +```java +@Dependent +public class MyService { + public String hello(String name) { + return "Hello " + name + "!"; + } +} +``` + +A hypothetical CDI-based framework can decide that it might need to invoke the method at runtime. +During deployment, the CDI extension provided by the framework would use + +- `ProcessManagedBean.createInvoker()`, if using a Portable Extension +- `InvokerFactory.createInvoker()`, if using a Build Compatible Extension + +to obtain an `InvokerBuilder`. Calling `build()` on it will produce + +- an `Invoker` directly, if using a Portable Extension +- an `InvokerInfo` that materializes as an `Invoker` at application runtime, if using a Build Compatible Extension + +The `Invoker` then needs to be stored somewhere until the framework actually needs it. +When the time comes to invoke the method, the framework takes the `Invoker`, obtains an instance of `MyService` and all the parameter values, and calls + +```java +invoker.invoke(myService, new Object[] { "world" }) +``` + +The return value is `"Hello world!"`, as expected. + +### Lookups + +It is fairly common that some of the parameters the method accepts are CDI beans. +It is possible to configure the `InvokerBuilder` to resolve and instantiate a correct value for such parameter automatically. +In fact, this is possible also for the instance on which the method should be invoked. +The `InvokerBuilder` has methods `withInstanceLookup()` and `withArgumentLookup()` to configure that. + +Returning back to the example above, if the CDI extension called `withInstanceLookup()` before calling `InvokerBuilder.build()`, it wouldn't have to obtain the instance of `MyService` manually. +The invoker would do it automatically. +The invocation would just use `null` as the instance value: + +```java +invoker.invoke(null, new Object[] { "world" }) +``` + +The result is still the same: `"Hello world!"`. + +## Other Improvements + +There's a couple of quality of life improvements in this release, too. + +Interceptors can now access the interceptor binding annotations from `InvocationContext`, using methods `getInterceptorBinding()` and `getInteceptorBindings()`. +This is technically a change in the Interceptors specification, but is most useful for CDI programmers, so we mention it here as well. + +Producer methods and fields can now declare a `@Priority` directly (or obtain a priority from a stereotype); they no longer have to rely on the priority value of their declaring bean. +When both the producer and its declaring bean have a priority, the producer's priority wins. + +The newly added methods `BeanContainer.isMatchingBean()` and `isMatchingEvent()` provide programmatic access to the typesafe resolution and observer resolution rules. +This is useful for frameworks that want to perform the same matching as CDI, but don't want to reimplement the rules themselves. + +The newly added method `BeanContainer.getContexts()` returns context objects of all registered contexts for given scope, regardless of whether they are active or inactive. +This is useful for authors of Build Compatible Extensions, who don't provide a context object to the container directly. +Instead, they provide a _class_ of the context object, and they need to use this method to gain access to the context object which the CDI container creates internally. + +## Deprecations + +CDI 4.1 prepares for removing a dependency on Unified EL from the core CDI API (`cdi-api.jar`). +This dependency is very narrow and really only useful for application server authors, but it's still there. + +Specifically, there are 2 methods on the `BeanManager` interface that use EL types in their signatures: + +- `getELResolver()`, which returns `ELResolver` +- `wrapExpressionFactory()`, which accepts and returns `ExpressionFactory` + +These 2 methods are deprecated in CDI 4.1 and shall be removed in CDI 5.0. + +The suggested replacement is the `ELAwareBeanManager` interface, which extends `BeanManager` and contains the same 2 methods, but exists outside of the core CDI API, in a supplemental CDI EL API artifact (`cdi-el-api.jar`). + +As mentioned above, these methods are mainly used by application servers, so this shouldn't really affect CDI users. +Also, CDI users don't have to consume the new supplemental artifact; compiling against the existing CDI API is fine. + +## CDI EE Specification Moved + +This is more of a curiosity from user perspective, but relatively important change internally. + +The _CDI in Jakarta EE_ part of the CDI specification, or _CDI EE_ for short, was moved from the CDI specification to the Jakarta EE Platform specification. +Together with that, the corresponding part of the CDI TCK (the `web` module, basically) was moved to the Jakarta EE Platform TCK. + +This doesn't affect CDI users, but is important for CDI implementations. + +## Conclusion + +CDI 4.1 is not a huge release, but it contains improvements useful for both application developers and framework authors. +If you have any questions, the friendly mailing list `cdi-dev@eclipse.org` is a great place to ask! diff --git a/docs/about.md b/docs/about.md index 40da9590..88ca331b 100644 --- a/docs/about.md +++ b/docs/about.md @@ -1,24 +1,19 @@ - --- +# Copyright (c) 2021 Red Hat, Inc. and others +# +# This program and the accompanying materials are made available under the +# Apache Software License 2.0 which is available at: +# https://www.apache.org/licenses/LICENSE-2.0. +# +# SPDX-License-Identifier: Apache-2.0 + layout: page title: About permalink: /about/ --- -This is the main Jakarta Contexts and Dependency Injection (CDI) pages site. It contains information about the latest news on Jakarta CDI. - -You can find the source code for this site in the docs directory of: -[docs](https://github.com/eclipse-ee4j/cdi/) - -You can find the source code for the Jakarta CDI API and Specification at: -[cdi](https://github.com/eclipse-ee4j/cdi/) +This is the main Jakarta Contexts and Dependency Injection (CDI) site. It contains information about the latest news on Jakarta CDI. +You can find the source code for this site in the `docs` directory: [docs](https://github.com/jakartaee/cdi/tree/main/docs) +You can find the source code for the Jakarta CDI API and Specification at: [cdi](https://github.com/jakartaee/cdi/) diff --git a/docs/authors.html b/docs/authors.html index c7531c40..68a3be69 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -1,13 +1,12 @@ - --- +# Copyright (c) 2021 Red Hat, Inc. and others +# +# This program and the accompanying materials are made available under the +# Apache Software License 2.0 which is available at: +# https://www.apache.org/licenses/LICENSE-2.0. +# +# SPDX-License-Identifier: Apache-2.0 + layout: default title: Authors --- diff --git a/docs/index.md b/docs/index.md index 9b95a9b3..096acbea 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,17 +1,14 @@ - --- +# Copyright (c) 2021 Red Hat, Inc. and others +# +# This program and the accompanying materials are made available under the +# Apache Software License 2.0 which is available at: +# https://www.apache.org/licenses/LICENSE-2.0. +# +# SPDX-License-Identifier: Apache-2.0 + # Feel free to add content and custom Front Matter to this file. # To modify the layout, see https://jekyllrb.com/docs/themes/#overriding-theme-defaults layout: home --- - - diff --git a/el/pom.xml b/el/pom.xml index 9e8ae043..8ca7b950 100644 --- a/el/pom.xml +++ b/el/pom.xml @@ -31,7 +31,7 @@ - 6.0.0-M1 + 6.0.0-RC1 diff --git a/el/src/main/java/jakarta/enterprise/inject/spi/el/ELAwareBeanManager.java b/el/src/main/java/jakarta/enterprise/inject/spi/el/ELAwareBeanManager.java index de7ef49c..bdfa1319 100644 --- a/el/src/main/java/jakarta/enterprise/inject/spi/el/ELAwareBeanManager.java +++ b/el/src/main/java/jakarta/enterprise/inject/spi/el/ELAwareBeanManager.java @@ -19,8 +19,8 @@ import jakarta.enterprise.inject.spi.BeanManager; /** - * A {@link BeanManager} that allows integrators to obtain Unified EL objects - * that are integrated with the CDI container as described in the CDI specification. + * A {@link BeanManager} that allows integrators to obtain Unified EL objects that are + * integrated with the CDI container as described in the Jakarta EE Platform specification. * * @since 4.1 */ diff --git a/el/src/main/java/module-info.java b/el/src/main/java/module-info.java index 41499c6d..d6669a0c 100644 --- a/el/src/main/java/module-info.java +++ b/el/src/main/java/module-info.java @@ -11,6 +11,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +/** + * The {@code jakarta.cdi.el} module; defines the CDI EL API exported packages and dependencies. + */ module jakarta.cdi.el { exports jakarta.enterprise.inject.spi.el; diff --git a/lang-model/src/main/java/jakarta/enterprise/lang/model/declarations/DeclarationInfo.java b/lang-model/src/main/java/jakarta/enterprise/lang/model/declarations/DeclarationInfo.java index 554fde1e..c837de98 100644 --- a/lang-model/src/main/java/jakarta/enterprise/lang/model/declarations/DeclarationInfo.java +++ b/lang-model/src/main/java/jakarta/enterprise/lang/model/declarations/DeclarationInfo.java @@ -26,6 +26,7 @@ *
  • {@linkplain FieldInfo fields}
  • *
  • {@linkplain MethodInfo methods}, including constructors
  • *
  • {@linkplain ParameterInfo method parameters}, including constructor parameters
  • + *
  • {@linkplain RecordComponentInfo record components}
  • * * * @since 4.0 @@ -51,12 +52,33 @@ default Type asType() { throw new IllegalStateException("Not a type"); } + /** + * The declaration kind: package, class, method, parameter, field, record component. + */ enum Kind { + /** + * Package + */ PACKAGE, + /** + * Class, interface, enum, annotation, or record + */ CLASS, + /** + * Method or constructor + */ METHOD, + /** + * Method parameter or constructor parameter + */ PARAMETER, + /** + * Field + */ FIELD, + /** + * Record component + */ RECORD_COMPONENT, } diff --git a/lang-model/src/main/java/jakarta/enterprise/lang/model/types/PrimitiveType.java b/lang-model/src/main/java/jakarta/enterprise/lang/model/types/PrimitiveType.java index 21d4c80e..ee9265f4 100644 --- a/lang-model/src/main/java/jakarta/enterprise/lang/model/types/PrimitiveType.java +++ b/lang-model/src/main/java/jakarta/enterprise/lang/model/types/PrimitiveType.java @@ -30,14 +30,41 @@ * @since 4.0 */ public interface PrimitiveType extends Type { + /** + * The primitive type kind: boolean, byte, short, int, long, float, double, char + */ enum PrimitiveKind { + /** + * The {@code boolean} primitive type + */ BOOLEAN, + /** + * The {@code byte} primitive type + */ BYTE, + /** + * The {@code short} primitive type + */ SHORT, + /** + * The {@code int} primitive type + */ INT, + /** + * The {@code long} primitive type + */ LONG, + /** + * The {@code float} primitive type + */ FLOAT, + /** + * The {@code double} primitive type + */ DOUBLE, + /** + * The {@code char} primitive type + */ CHAR, } diff --git a/lang-model/src/main/java/jakarta/enterprise/lang/model/types/Type.java b/lang-model/src/main/java/jakarta/enterprise/lang/model/types/Type.java index 0ed1e5f4..48f21a64 100644 --- a/lang-model/src/main/java/jakarta/enterprise/lang/model/types/Type.java +++ b/lang-model/src/main/java/jakarta/enterprise/lang/model/types/Type.java @@ -68,22 +68,28 @@ default Type asType() { return this; } + /** + * The type kind: void, primitive, class, array, parameterized type, type variable, wildcard type + */ enum Kind { - /** E.g. when method returns {@code void}. */ + /** The void pseudo-type, e.g. when method returns {@code void}. */ VOID, - /** E.g. when method returns {@code int}. */ + /** A primitive type, e.g. when method returns {@code int}. */ PRIMITIVE, - /** E.g. when method returns {@code String}. */ + /** A class type, e.g. when method returns {@code String}. */ CLASS, - /** E.g. when method returns {@code int[]} or {@code String[][]}. */ + /** An array type, e.g. when method returns {@code int[]} or {@code String[][]}. */ ARRAY, - /** E.g. when method returns {@code List}. */ + /** A parameterized type, e.g. when method returns {@code List}. */ PARAMETERIZED_TYPE, - /** E.g. when method returns {@code T} and {@code T} is a type parameter of the declaring class. */ + /** + * A type variable, e.g. when method returns {@code T} and {@code T} is a type parameter + * of the declaring class. + */ TYPE_VARIABLE, /** - * E.g. when method returns {@code List}. The kind of such type is {@code PARAMETERIZED_TYPE}, - * but the first (and only) type argument is a {@code WILDCARD_TYPE}. + * A wildcard type, e.g. when method returns {@code List}. The kind of such type + * is {@code PARAMETERIZED_TYPE}, but the first (and only) type argument is a {@code WILDCARD_TYPE}. */ WILDCARD_TYPE, } diff --git a/lang-model/src/main/java/module-info.java b/lang-model/src/main/java/module-info.java index 85f75901..aab96e73 100644 --- a/lang-model/src/main/java/module-info.java +++ b/lang-model/src/main/java/module-info.java @@ -11,6 +11,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +/** + * The {@code jakarta.cdi.lang.model} module; defines the CDI Language Model API exported packages + */ module jakarta.cdi.lang.model { exports jakarta.enterprise.lang.model; exports jakarta.enterprise.lang.model.declarations; diff --git a/spec/src/main/asciidoc/core/injectionandresolution.asciidoc b/spec/src/main/asciidoc/core/injectionandresolution.asciidoc index 69ec4565..ef2c5df4 100644 --- a/spec/src/main/asciidoc/core/injectionandresolution.asciidoc +++ b/spec/src/main/asciidoc/core/injectionandresolution.asciidoc @@ -672,7 +672,7 @@ The `iterator()` method must: * If typesafe resolution results in an unsatisfied dependency, the set of resulting beans is empty. If typesafe resolution results in an ambiguous dependency and the set of candidate beans contains at least one alternative, the set of resulting beans contains all beans that were not eliminated during ambiguity resolution. If typesafe resolution results in an ambiguous dependency and the set of candidate beans contains no alternative, the set of resulting beans contains all candidate beans. -* Return an `Iterator`, that iterates over the set of contextual references for the resulting beans, as defined in <>. +* Return an `Iterator`, that iterates over the set of contextual references for the resulting beans and required type, as defined in <>. The `stream()` method must: @@ -680,7 +680,7 @@ The `stream()` method must: * If typesafe resolution results in an unsatisfied dependency, the set of resulting beans is empty. If typesafe resolution results in an ambiguous dependency and the set of candidate beans contains at least one alternative, the set of resulting beans contains all beans that were not eliminated during ambiguity resolution. If typesafe resolution results in an ambiguous dependency and the set of candidate beans contains no alternative, the set of resulting beans contains all candidate beans. -* Return a `Stream`, that can stream over the set of contextual references for the resulting beans, as defined in <>. +* Return a `Stream`, that can stream over the set of contextual references for the resulting beans and required type, as defined in <>. The methods `isUnsatisfied()`, `isAmbiguous()` and `isResolvable()` must: diff --git a/spec/src/main/asciidoc/core/invokers.asciidoc b/spec/src/main/asciidoc/core/invokers.asciidoc index b8566a71..2a003f3c 100644 --- a/spec/src/main/asciidoc/core/invokers.asciidoc +++ b/spec/src/main/asciidoc/core/invokers.asciidoc @@ -215,6 +215,19 @@ Implementations are permitted to remember the identified beans and not repeat th All instances of `@Dependent` looked up beans obtained during `Invoker.invoke()` are destroyed before the `invoke()` method returns or throws. The order in which the instances of `@Dependent` looked up beans are destroyed is not specified. +This specification recognizes the existence of _asynchronous_ methods, where the action represented by the method does not always finish when the method returns; the _completion_ of the action is asynchronous to the method call. +For target methods that are considered asynchronous by the CDI container, the requirement to destroy instances of `@Dependent` looked up beans is relaxed: the instances of `@Dependent` looked up beans need not be destroyed before `Invoker.invoke()` returns. +It is recommended that the instances of `@Dependent` looked up beans are destroyed after the asynchronous action completes and before the completion is propagated to the caller of `Invoker.invoke()`; if an asynchronous target method completes synchronously or throws synchronously, it is recommended that the instances of `@Dependent` looked up beans are destroyed before `invoke()` returns or rethrows the exception. + +[CAUTION] +==== +The rules for recognizing asynchronous methods are not specified. +Applications which use invokers to call asynchronous methods are therefore not portable. +Future versions of this specification may define an API to give greater control over the invocation of asynchronous methods. + +Implementations that support asynchronous methods are encouraged to document the rules they follow. +==== + The order in which instances of looked up beans are obtained during `Invoker.invoke()` in not specified. If an exception is thrown when creating an instance of a looked up bean during `Invoker.invoke()`, the exception is rethrown.