Skip to content

Commit

Permalink
edits per review
Browse files Browse the repository at this point in the history
  • Loading branch information
dmuelle committed Sep 17, 2024
1 parent 1dfd86a commit ad93842
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/ROOT/pages/cdi-extension-user-feature.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

Contexts and Dependency Injection (CDI) provides powerful extensions to augment, extend, or override the behavior of CDI. To enable CDI to find the extensions inside an Open Liberty user feature, you must implement an Open Liberty-specific SPI: `io.openliberty.cdi.spi.CDIExtensionMetadata`.

The link:https://openliberty.io/docs/latest/reference/javadoc/spi/cdi-1.2.html?path=24.0.0.8/com.ibm.websphere.appserver.spi.cdi_1.1-javadoc/io/openliberty/cdi/spi/package-summary.html[CDIExtensionMetadata] class also enables the two most common uses of a CDI Extension: registering a class as a CDI bean, and registering an annotation as a bean defining annotation (BDA).
The link:https://openliberty.io/docs/latest/reference/javadoc/spi/cdi-1.2.html?path=24.0.0.8/com.ibm.websphere.appserver.spi.cdi_1.1-javadoc/io/openliberty/cdi/spi/package-summary.html[CDIExtensionMetadata] class also provides shortcuts for the two most common uses of a CDI Extension: registering a class as a CDI bean, and registering an annotation as a bean defining annotation (BDA).

The following example shows an implementation of the `CDIExtensionMetadata` class, with three possible methods that extend the class.

Expand All @@ -24,13 +24,13 @@ getBeanClasses::
The `CDIBean` class becomes a CDI bean that can be injected with `@Inject CDIBean cdiBean`. If it does not have a scope, the scope defaults to `@Dependent`.

getBeanDefiningAnnotationClasses::
The `CDIAnnotation` class becomes a bean defining annotation. Any class that is annotated with `@Annotation` can be injected through CDI. Unless `CDIAnnotation` defines otherwise, the default scope is `@Dependent`. For more information about how annotations define their scope, see link:https://jakarta.ee/specifications/cdi/4.0/jakarta-cdi-spec-4.0#scopes[Scopes in CDI 4.0].
The `CDIAnnotation` class becomes a bean defining annotation. Any class that is annotated with `@CDIAnnotation` can be injected through CDI. Unless `CDIAnnotation` defines otherwise, the default scope is `@Dependent`. For more information about how annotations define their scope, see link:https://jakarta.ee/specifications/cdi/4.0/jakarta-cdi-spec-4.0#scopes[Scopes in CDI 4.0].

getExtensions::
The `CDIExtension` class is processed as a full CDI extension.


In this example, each of these methods has a default implementation that returns an empty set, so you can implement only the ones that are relevant to your needs.
Each of these methods has a default implementation that returns an empty set, so you can implement only the ones that are relevant to your needs.

[source,java]
----
Expand Down

0 comments on commit ad93842

Please sign in to comment.