You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by gn...@apache.org on 2013/03/26 13:49:02 UTC

svn commit: r1461092 - in /aries/site/trunk: content/modules/blueprintnoosgi.mdtext content/modules/blueprintweb.mdtext templates/navigation.mdtext

Author: gnodet
Date: Tue Mar 26 12:49:02 2013
New Revision: 1461092

URL: http://svn.apache.org/r1461092
Log:
Add docs about blueprint-noosgi and blueprint-web

Added:
    aries/site/trunk/content/modules/blueprintnoosgi.mdtext
    aries/site/trunk/content/modules/blueprintweb.mdtext
Modified:
    aries/site/trunk/templates/navigation.mdtext

Added: aries/site/trunk/content/modules/blueprintnoosgi.mdtext
URL: http://svn.apache.org/viewvc/aries/site/trunk/content/modules/blueprintnoosgi.mdtext?rev=1461092&view=auto
==============================================================================
--- aries/site/trunk/content/modules/blueprintnoosgi.mdtext (added)
+++ aries/site/trunk/content/modules/blueprintnoosgi.mdtext Tue Mar 26 12:49:02 2013
@@ -0,0 +1,51 @@
+Title: BlueprintNoOSGi
+<a name="BlueprintNoOSGi"></a>
+# Blueprint No-OSGi
+
+The Blueprint No-OSGi module makes it easy to use OSGi Blueprint as a dependency injection framework outside of OSGi containers such as inside any Servlet Engine. 
+
+You can then use Blueprint as a small standards base alternative to the Spring Framework's XML dependency injection files.
+
+<a name="BlueprintNoOSGi-HowToUse"></a>
+## How to use Blueprint No-OSGi
+
+Just create the blueprint container giving the urls of the xml descriptors
+
+	BlueprintContainerImpl container = new BlueprintContainerImpl(classLoader, resourcePaths);
+    
+You can then access the instantiated beans using the blueprint api
+
+	Foo foo = (Foo) container.getComponentInstance("foo");
+
+When you're done with the container, you need to destroy it
+
+	container.destroy();
+	
+<a name="BlueprintNoOSGi-Limitations"></a>
+## Limitations
+
+The Blueprint No-OSGi module has limitations due to the fact that OSGi is not available.
+The use of <reference/> and <reference-list/> and <service/> elements are not supported.
+
+<a name="BlueprintNoOSGi-Configuraiton"></a>	
+## Configuring blueprint through properties
+
+Blueprint beans can be configured using the variable substitutions.
+You need to declare the ext namespace and add the property placeholder bean in your blueprint xml
+
+	<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+	           xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.2.0">
+		<ext:property-placeholder>
+	    	<ext:default-properties>
+	        	<ext:property name="myProperty" value="defaultValue" />
+	    	</ext:default-properties>
+		</ext:property-placeholder>
+		...
+		<bean ...>
+			<property name="myProperty" value="${myProperty}" />
+		</bean>
+	</blueprint>
+
+Default values can be specified by passing a **Map<String,String>** object at container creation time.
+Note that the default values for system override (compared to standard blueprint use in OSGi) has been changed so that the properties passed to the container and system properties will override default values.
+

Added: aries/site/trunk/content/modules/blueprintweb.mdtext
URL: http://svn.apache.org/viewvc/aries/site/trunk/content/modules/blueprintweb.mdtext?rev=1461092&view=auto
==============================================================================
--- aries/site/trunk/content/modules/blueprintweb.mdtext (added)
+++ aries/site/trunk/content/modules/blueprintweb.mdtext Tue Mar 26 12:49:02 2013
@@ -0,0 +1,56 @@
+Title: BlueprintWeb
+<a name="BlueprintWeb"></a>
+# BlueprintWeb
+
+The Blueprint Web module makes it easy to use OSGi Blueprint as a dependency injection framework outside of OSGi containers such as inside any Servlet Engine. 
+
+You can then use Blueprint as a small standards base alternative to the Spring Framework's XML dependency injection files.
+
+<a name="BlueprintWeb-HowToUse"></a>
+## How to use Blueprint Web
+
+Just add the following to your web.xml
+
+	  <listener>
+	      <listener-class>org.apache.aries.blueprint.web.BlueprintContextListener</listener-class>
+	  </listener>
+
+This will then make your web application look in the classpath for all files called **META-INF/blueprint.xml**. Each one will then be loaded and created in a single BlueprintContainer for your web application.
+
+Then in each jar or in the web application itself, just create a file called **src/main/resources/META-INF/blueprint.xml** which will then get included into jars or into your WAR.
+
+If you wish to use a different name for the location of the blueprint files you can specify the **blueprintLocation** property as a context parameter as follows:
+
+	  <context-param>
+	      <param-name>blueprintLocation</param-name>
+	      <param-value>META-INF/myName.xml</param-value>
+	  </context-param>
+
+<a name="BlueprintWeb-Configuraiton"></a>	
+## Configuring blueprint through properties
+
+Blueprint beans can be configured using the variable substitutions.
+You need to declare the ext namespace and add the property placeholder bean in your blueprint xml
+
+	<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+	           xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.2.0">
+		<ext:property-placeholder>
+	    	<ext:default-properties>
+	        	<ext:property name="myProperty" value="defaultValue" />
+	    	</ext:default-properties>
+		</ext:property-placeholder>
+		...
+		<bean ...>
+			<property name="myProperty" value="${myProperty}" />
+		</bean>
+	</blueprint>
+
+The default value can be overriden by specifying an the blueprintProperties property as a context parameter in the web.xml:
+
+	<context-param>
+    	<param-name>blueprintProperties</param-name>
+    	<param-value>myConfigFile.properties</param-value>
+	</context-param>
+
+The value of this parameter is a comma separated list of properties file loaded from the class loader.
+In this case, adding a file called **src/main/resources/myConfigFile.properties** will do the trick.

Modified: aries/site/trunk/templates/navigation.mdtext
URL: http://svn.apache.org/viewvc/aries/site/trunk/templates/navigation.mdtext?rev=1461092&r1=1461091&r2=1461092&view=diff
==============================================================================
--- aries/site/trunk/templates/navigation.mdtext (original)
+++ aries/site/trunk/templates/navigation.mdtext Tue Mar 26 12:49:02 2013
@@ -114,9 +114,15 @@
 	<div class="menuitem">
 		<a href="/modules/blueprint.html">Blueprint</a> 
 	</div>
-        <div class="menuitem">
-                <a href="/modules/blueprintannotation.html">Blueprint Annotations</a>
-        </div>
+	<div class="menuitem">
+		<a href="/modules/blueprintannotation.html">Blueprint Annotations</a>
+	</div>
+	<div class="menuitem">
+		<a href="/modules/blueprintnoosgi.html">Blueprint No-OSGi</a>
+	</div>
+	<div class="menuitem">
+		<a href="/modules/blueprintweb.html">Blueprint Web</a>
+	</div>
 	<div class="menuitem">
 		<a href="/modules/jndiproject.html">JNDI</a> 
 	</div>