You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by Karl Kildén <an...@apache.org> on 2013/10/03 09:57:56 UTC

CMS diff: OpenWebBeans FAQ

Clone URL (Committers only):
https://cms.apache.org/redirect?new=anonymous;action=diff;uri=http://openwebbeans.apache.org/owbsetup_se.mdtext

Karl Kildén

Index: trunk/content/owbsetup_se.mdtext
===================================================================
--- trunk/content/owbsetup_se.mdtext	(revision 1528737)
+++ trunk/content/owbsetup_se.mdtext	(working copy)
@@ -16,12 +16,59 @@
            specific language governing permissions and limitations
            under the License.
 
-# OpenWebBeans FAQ
+# OpenWebBeans and JavaSE
 
+To add OpenWebBeans to your javaSE project you need to take the following steps:
 
-TODO
-- where does OWB differ from the CDI-1.0 spec
-- what is the default EL version used in OWB
-- how can I provide own plugins if there is a new spec part (e.g EL-3.0) I like to support
+ 1. Add required jars to your project
+ 2. Bootstrap OpenWebBeans
+ 3. Done! Congratulations.
 
 
+###Adding required jars to your project
+
+You can add OpenWebBeans to your project manually by adding jars or with Apache Maven. How to download is explained here: [download page][1].
+
+
+For JavaSE you need:
+
+  - **spi**
+  - **impl**
+
+
+Those two parts of OpenWeBeans are what you could call "system core". They are the only OWB artifacts you need for JavaSE capabilities and for the time being the existing plugins basically just adds JavaEE capabilities. 
+After you have added the jars described above to your project accordingly to the download page and added them to your projects classpath.
+
+###Bootstrapping OpenWebBeans
+
+For now we recommend two ways for booting up the OpenWebBeans container: [**Deltaspike CdiCtrl**][2] or booting it yourself in i.e. a standard main method. For most projects Deltaspike CdiCtrl will be the smoother choice. Going native and booting it yourself could however be useful if you need full control to do advanced things. Deltaspike CdiCtrl is documented in the link provided above.
+
+
+**Option number two - booting yourself**
+
+    :::java
+    import org.apache.deltaspike.cdise.api.CdiContainer;
+    import org.apache.deltaspike.cdise.api.CdiContainerLoader;
+    import org.apache.deltaspike.cdise.api.ContextControl;
+    import javax.enterprise.context.ApplicationScoped;
+
+    public class MainApp {
+        private static ContainerLifecycle lifecycle = null;
+        public static void main(String[] args) {
+            lifecycle = WebBeansContext.currentInstance().getService(ContainerLifecycle.class);
+            lifecycle.startApplication(null);
+        }
+
+        public static void shutdown() {
+            lifecycle.stopApplication(null);
+        }
+    }
+
+
+
+From here you might want to look at our samples selection: [samples][3].
+
+
+  [1]: /openwebbeans/download.html
+  [2]: http://deltaspike.apache.org/documentation.html#with-java-se
+  [3]: /openwebbeans/samples.html
\ No newline at end of file