You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by ro...@apache.org on 2019/11/22 22:04:03 UTC
[aries-cdi] 17/19: readme updates
This is an automated email from the ASF dual-hosted git repository.
rotty3000 pushed a commit to branch rotty3000/cdi-spi
in repository https://gitbox.apache.org/repos/asf/aries-cdi.git
commit c1f3201a985d67b3599d28587db7dfdcf7282f1e
Author: Raymond Augé <ro...@apache.org>
AuthorDate: Fri Nov 22 16:49:46 2019 -0500
readme updates
Signed-off-by: Raymond Augé <ro...@apache.org>
---
README.md | 47 ++++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 42 insertions(+), 5 deletions(-)
diff --git a/README.md b/README.md
index bd7fd8f..0f607ab 100644
--- a/README.md
+++ b/README.md
@@ -78,15 +78,23 @@ If you want to emulate the CDI default use:
In bnd `4.3.0+` you can rely purely on the discovery mode calculated from existing `beans.xml` files in your project. This grants even less configuration friction for existing projects migrating to OSGi CDI.
-## Pre-built runtime
+## Pre-built runtimes
-This repository provides an example for how to assemble an executable jar providing a complete runtime for you to just drop in your CDI bundles. It comes complete with logging, Gogo shell, Config Admin, Http Whiteboard support, and OSGi Promises.
+This repository provides two examples for how to assemble an executable jar providing a complete runtime for you to just drop in your CDI bundles. These come complete with logging, Gogo shell, Config Admin, Http Whiteboard support, and OSGi Promises.
-Once you've completed a successfull build, you should be able to execute the command:
+Once you've completed a successful build, you should be able to execute the commands:
-`java -jar cdi-executable/target/executable.jar`
+#### OpenWebBeans
-and be presented with a gogo shell prompt ready for you to install a CDI bundle.
+`java -jar cdi-executable/target/weld-executable.jar`
+
+and be presented a gogo shell prompt running in a framework that uses Aries CDI over **Apache OpenWebBeans** ready for you to install a CDI bundle.
+
+#### Weld
+
+`java -jar cdi-executable/target/owb-executable.jar`
+
+and be presented with a gogo shell prompt running in a framework that uses Aries CDI over **JBoss Weld** ready for you to install a CDI bundle.
## Architecture Overview
@@ -172,4 +180,33 @@ When a CDI bundle is identified by CCR several steps are taken before any bean i
- `@BeforeDestroy(ComponentScoped.class)`
- `@Destroyed(ComponentScoped.class)`
+## Aries CDI SPI
+
+Aries CDI now has an SPI for enabling it to be used with any CDI container impl.
+
+The requirements to satisfy this SPI are quite simple:
+
+- Aries CDI Extender requires:
+
+ - a **prototype scoped** service that implements `javax.enterprise.inject.se.SeContainerInitializer`
+
+ - this service must have a service property `aries.cdi.spi` whose value is not important but the recommendation is a human readable name of the implementation
+
+ - Aries CDI will pass two values via the properties methods of `javax.enterprise.inject.se.SeContainerInitializer` as defined by `org.apache.aries.cdi.spi.Keys`
+
+ - the `SeContainerInitializer` will be called like this:
+
+ ```java
+ _seContainer = _seContainerInitializerInstance
+ .setClassLoader((org.apache.aries.cdi.spi.loader.SpiLoader)spiLoader)
+ .addBeanClasses(classes)
+ .setProperties(properties)
+ .addProperty(BEANS_XML_PROPERTY, containerState.beansModel().getBeansXml())
+ .addProperty(BUNDLECONTEXT_PROPERTY, bundle().getBundleContext())
+ .addExtensions(extensions)
+ .initialize();
+ ```
+
+ - The behaviour of this container should be to start the `@ApplicationScoped` context immediately. This allows for services from the container component to be published right away.
+
Check out the many questions and answers in the [FAQ](faq.md).
\ No newline at end of file