openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1162797 - /openwebbeans/trunk/webbeans-spi/src/site/apt/configuration.apt
Date Mon, 29 Aug 2011 13:37:53 GMT
Author: struberg
Date: Mon Aug 29 13:37:52 2011
New Revision: 1162797

URL: http://svn.apache.org/viewvc?rev=1162797&view=rev
Log:
OWB-571 add documentation about OWBs config mechanism

Modified:
    openwebbeans/trunk/webbeans-spi/src/site/apt/configuration.apt

Modified: openwebbeans/trunk/webbeans-spi/src/site/apt/configuration.apt
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-spi/src/site/apt/configuration.apt?rev=1162797&r1=1162796&r2=1162797&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-spi/src/site/apt/configuration.apt (original)
+++ openwebbeans/trunk/webbeans-spi/src/site/apt/configuration.apt Mon Aug 29 13:37:52 2011
@@ -9,4 +9,62 @@
 ~~ distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 ~~ KIND, either express or implied. See the License for the specific language
 ~~ governing permissions and limitations under the License.
-Apache OpenWebBeans Configuration Mechanism
+Apache OpenWebBeans Configuration
+
+  Since OpenWebBeans is built in a modular fashion, we need a way to activate
+  different implementations for a SPI Service by just dropping a JAR file
+  into the classpath. This is where the OpenWebBeans configuration mechanism
+  kicks in.
+
+* Basis configuration mechanism
+
+  When the OpenWebBeans container starts, it parses the whole classpath for
+  his configuration data which are contained in files with the name
+
+-----------------
+META-INF/openwebbeans/openwebbeans.properties
+-----------------
+
+  Each of this files have a single property with the name
+
+-----------------
+configuration.ordinal=10
+-----------------
+
+  The configured number of the configuration.ordinal represents the order
+  of which the properties gets stacked up. After reading all openwebbeans.properties
+  files, we sort them according to their configuration.ordinal in ascending manner.
+
+  If no configuration.ordinal is given, a default value of 100 is assumed.
+
+  As last step, all the property values will get merged into a single
+  Properties instance in the order of their configuration.ordinal. As
+  a result, properties from files with higher configuration.ordinal will
+  override properties with the same name from a configuration file with lower
+  configuration.ordinal.
+
+  The final value for a specific property will be used to determine the SPI implementation
class.
+
+
+* Configure your own SPI implementations
+
+  If you, for example, like to provide your own ScannerService, then create a class
+  which implements the org.apache.webbeans.spi.ScannerService interface.
+
+  For using your own ScannerService instead of the default one, just add a
+
+-----------------
+META-INF/openwebbeans/openwebbeans.properties
+-----------------
+
+  file to your JAR and add the following line:
+
+-----------------
+# this is the sample configuration for using an own ScannerService
+
+# use a higher configuration.ordinal than the provided configuration files
+configuration.ordinal=101
+
+# Sample implementation of org.apache.webbeans.corespi.ScannerService.
+org.apache.webbeans.spi.ScannerService=com.mycompany.myproject.MySpecialScannerService
+-----------------



Mime
View raw message