You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by st...@apache.org on 2013/10/04 15:00:51 UTC
svn commit: r1529151 -
/openwebbeans/cms-site/trunk/content/owbsetup_se.mdtext
Author: struberg
Date: Fri Oct 4 13:00:50 2013
New Revision: 1529151
URL: http://svn.apache.org/r1529151
Log:
add 'OWB in JavaSE' documentation contributed by Karl Kilden
Modified:
openwebbeans/cms-site/trunk/content/owbsetup_se.mdtext
Modified: openwebbeans/cms-site/trunk/content/owbsetup_se.mdtext
URL: http://svn.apache.org/viewvc/openwebbeans/cms-site/trunk/content/owbsetup_se.mdtext?rev=1529151&r1=1529150&r2=1529151&view=diff
==============================================================================
--- openwebbeans/cms-site/trunk/content/owbsetup_se.mdtext (original)
+++ openwebbeans/cms-site/trunk/content/owbsetup_se.mdtext Fri Oct 4 13:00:50 2013
@@ -16,12 +16,59 @@ Notice: Licensed to the Apache Softwa
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