openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject svn commit: r1533705 - /openwebbeans/cms-site/trunk/content/openwebbeans-spi.mdtext
Date Sat, 19 Oct 2013 08:17:04 GMT
Author: struberg
Date: Sat Oct 19 08:17:03 2013
New Revision: 1533705

explain the trick to load the right SPI implementation


Modified: openwebbeans/cms-site/trunk/content/openwebbeans-spi.mdtext
--- openwebbeans/cms-site/trunk/content/openwebbeans-spi.mdtext (original)
+++ openwebbeans/cms-site/trunk/content/openwebbeans-spi.mdtext Sat Oct 19 08:17:03 2013
@@ -18,7 +18,7 @@ Notice:    Licensed to the Apache Softwa
 # OpenWebBeans SPI
-###What is an SPI?
+##What is an SPI?
 > Service Provider Interface (SPI) is an API intended to be implemented
 > or extended by a third party. It can be used to enable framework
@@ -26,8 +26,10 @@ Notice:    Licensed to the Apache Softwa
 - [wikipedia][1]
-###How does the SPI functionality work in OpenWebBeans?
-First off reading about [OpenWebBeans Core](openwebbeans-impl.html) will give you the overall
+##Why using a SPI in OpenWebBeans?
+First off reading about [OpenWebBeans Core](openwebbeans-impl.html) will give you
+the overall idea about the usage of SPIs in our plugin system. 
 Now as mentioned in that description the SPI is simply used to integrate other 
 frameworks with OpenWebBeans. The point of gravity for Java EE is definitely going
 towards CDI today and the SPI pattern ensures that OpenWebBeans can manage this handily.
@@ -64,9 +66,32 @@ After seeing this interface one can easi
 Now since this is part of the specification for JSF 2.x the JSF plugin of course implements
it and actually the JSF 1.2 plugin as well. Supporting the Conversation Id in another plugin
should be rather intuitive and this is true for the SPI in general. 
+### How does OWB know which implementation it should pick?
+Each OpenWebBeans JAR has a property file to configure it's internal features
+and also the SPI implementation which should be used:
+    META-INF/openwebbeans/
+All those files contain at single property ``configuration.ordinal`` which defines their

+'importance'. Any setting from a property file with a higher configuration.ordinal will 
+overwrite settings from one with a lower configuration.ordinal. The internally used 
+configuration.ordinal values range from 1 to 100.
+For example: if you use a different UI technology than JSF like Vaadin, you could still provide

+CDI Conversations by writing an own implementation of the respective SPI and tweak
+some configuration settings:
+    configuration.ordinal=120 
+    # enable CDI conversation support at all
+    org.apache.webbeans.application.supportsConversation=true
+    # define your own implementation of our ConversationService SPI
+    org.apache.webbeans.spi.ConversationService=some.mycomp.MyVaadinConversationService
+All those tricks allow us to remain extensible in the future and to support whatever scenario

+we will face.

View raw message