openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1808414 [3/7] - in /openwebbeans/cms-site/trunk/content/meecrowave: ./ meecrowave-core/ meecrowave-gradle/ meecrowave-jolokia/ meecrowave-jpa/ meecrowave-jta/ meecrowave-maven/ meecrowave-oauth2/ testing/
Date Fri, 15 Sep 2017 06:58:58 GMT
Modified: openwebbeans/cms-site/trunk/content/meecrowave/meecrowave-core/cli.pdf
URL: http://svn.apache.org/viewvc/openwebbeans/cms-site/trunk/content/meecrowave/meecrowave-core/cli.pdf?rev=1808414&r1=1808413&r2=1808414&view=diff
==============================================================================
--- openwebbeans/cms-site/trunk/content/meecrowave/meecrowave-core/cli.pdf (original)
+++ openwebbeans/cms-site/trunk/content/meecrowave/meecrowave-core/cli.pdf Fri Sep 15 06:58:57
2017
@@ -4,8 +4,8 @@
 << /Title (Meecrowave Command Line Interface)
 /Creator (Asciidoctor PDF 1.5.0.alpha.11, based on Prawn 1.3.0)
 /Producer (Asciidoctor PDF 1.5.0.alpha.11, based on Prawn 1.3.0)
-/CreationDate (D:20170713104108+02'00')
-/ModDate (D:20170713104108+02'00')
+/CreationDate (D:20170915085704+02'00')
+/ModDate (D:20170915085704+02'00')
 >>
 endobj
 2 0 obj

Modified: openwebbeans/cms-site/trunk/content/meecrowave/meecrowave-core/configuration.html
URL: http://svn.apache.org/viewvc/openwebbeans/cms-site/trunk/content/meecrowave/meecrowave-core/configuration.html?rev=1808414&r1=1808413&r2=1808414&view=diff
==============================================================================
--- openwebbeans/cms-site/trunk/content/meecrowave/meecrowave-core/configuration.html (original)
+++ openwebbeans/cms-site/trunk/content/meecrowave/meecrowave-core/configuration.html Fri
Sep 15 06:58:57 2017
@@ -400,6 +400,72 @@ and make it active using <code>addCustom
 </div>
 </div>
 <div class="sect1">
+<h2 id="_cdi_se_api">CDI SE API</h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>CDI 2.0 introduces a "SE API" for CDI. It looks like:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-java" data-lang="java">try
(final SeContainer container = SeContainerInitializer.newInstance()
+        .disableDiscovery()
+        .addBeanClasses(Configured.class)
+        .initialize()) {
+    // your main
+}</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>Meecrowave inherits from OpenWebBeans SE API implementation and therefore this SE
API will work out of the box.</p>
+</div>
+<div class="paragraph">
+<p>It is implemented as a <code>bake()</code> and you can still access
the <code>Builder</code> configuration or even <code>Meecrowave</code>
itself if needed:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-java" data-lang="java">try
(final SeContainer container = SeContainerInitializer.newInstance()
+        .disableDiscovery()
+        .addBeanClasses(Configured.class)
+        .initialize()) {
+
+    // use the configuration to access extensions, custom config or even server port
+    Meecrowave.Builder config = container.select(Meecrowave.Builder.class).get();
+    int port = config.getHttpPort();
+
+    // default wait implementation relying on tomcat one
+    container.select(Meecrowave.class).get().await(); // wait for the program to be killed
(tomcat.await() equivalent)
+
+}</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>All the configuration of meecrowave is still available using properties:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-java" data-lang="java">try
(final SeContainer container = SeContainerInitializer.newInstance()
+     .addProperty("nameOfTheProperty", instanceInTheRightType)
+     .initialize()) {
+    container.select(Meecrowave.class).get().await();
+}</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>The type should match the type expected by the <code>Builder</code>
instance. Note you can also just pass directly a <code>Builder</code> instance
as value
+(the property name is not important) if you want something preconfigured:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-java" data-lang="java">try
(final SeContainer container = SeContainerInitializer.newInstance()
+     .addProperty("meecrowaveConfiguration", new Meecrowave.Builder().randomPort())
+     .initialize()) {
+    container.select(Meecrowave.class).get().await();
+}</code></pre>
+</div>
+</div>
+</div>
+</div>
+<div class="sect1">
 <h2 id="_automatic_configuration">Automatic configuration</h2>
 <div class="sectionbody">
 <div class="paragraph">



Mime
View raw message