[jboss-cvs] JBossAS SVN: r63473 - in projects/microcontainer/trunk: docs/gettingstarted/src/docbkx/en/modules and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jun 12 09:55:28 EDT 2007


Author: alesj
Date: 2007-06-12 09:55:28 -0400 (Tue, 12 Jun 2007)
New Revision: 63473

Modified:
   projects/microcontainer/trunk/container/src/main/org/jboss/reflect/spi/ProgressionConvertor.java
   projects/microcontainer/trunk/docs/gettingstarted/src/docbkx/en/modules/basics.xml
   projects/microcontainer/trunk/docs/gettingstarted/src/docbkx/en/modules/managed.xml
   projects/microcontainer/trunk/docs/gettingstarted/src/docbkx/en/modules/spring.xml
Log:
Spring-int examples, System property impl override.

Modified: projects/microcontainer/trunk/container/src/main/org/jboss/reflect/spi/ProgressionConvertor.java
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/reflect/spi/ProgressionConvertor.java	2007-06-12 13:55:23 UTC (rev 63472)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/reflect/spi/ProgressionConvertor.java	2007-06-12 13:55:28 UTC (rev 63473)
@@ -33,8 +33,8 @@
    /**
     * Check if progression is supported.
     *
-    * @param target
-    * @param source
+    * @param target target's class
+    * @param source source's class
     * @return true, if we can progress source's value class type to target class
     */
    boolean canProgress(Class<? extends Object> target, Class<? extends Object> source);

Modified: projects/microcontainer/trunk/docs/gettingstarted/src/docbkx/en/modules/basics.xml
===================================================================
--- projects/microcontainer/trunk/docs/gettingstarted/src/docbkx/en/modules/basics.xml	2007-06-12 13:55:23 UTC (rev 63472)
+++ projects/microcontainer/trunk/docs/gettingstarted/src/docbkx/en/modules/basics.xml	2007-06-12 13:55:28 UTC (rev 63473)
@@ -429,7 +429,7 @@
       </programlisting>
 
       <para>Sometimes it is still usefull to be able to set or inject a value which can be morfed / progressed into
-         needed type althogh existing type is not compatible (normally getting ClasCastException). This is mostly true
+         needed type althogh existing type is not compatible (normally getting ClassCastException). This is mostly true
          for java.lang.Number subclasses. Let's see how <varname>progression</varname> is used on the following example.
       </para>
 
@@ -453,6 +453,13 @@
          property name means that a field is of type double. A<varname>Float</varname> coresponds to Float type. Etc.
       </para>
 
+      <para>You can change the progression behavior by setting System property
+         <varname>org.jboss.reflect.plugins.progressionConvertor</varname>,
+         putting the ProgressionConvertor's implementation fully qualified class name as value.
+         By default SimpleProgressionConvertor implementation is used. Another existing implementation is
+         NullProgressionConvertor, which doesn't do any actual progression.
+      </para>
+
    </section>
 
    <section>
@@ -1163,6 +1170,13 @@
          }
       </programlisting>
 
+      <para>While using callbacks on the Collection subclasses, currently only basic Collection subinterfaces
+         are supported: List, Set and Queue. See BasicCollectionCallbackItemFactory for more details.
+         But you can change the Collection callback behaviour by providing your own CollectionCallbackItemFactory.
+         You do this by setting System property <varname>org.jboss.dependency.collectionCallbackItemFactory</varname>
+         and putting CollectionCallbackItemFactory implementation fully qualified class name as a value.
+      </para>
+
    </section>
 
 </section>
\ No newline at end of file

Modified: projects/microcontainer/trunk/docs/gettingstarted/src/docbkx/en/modules/managed.xml
===================================================================
--- projects/microcontainer/trunk/docs/gettingstarted/src/docbkx/en/modules/managed.xml	2007-06-12 13:55:23 UTC (rev 63472)
+++ projects/microcontainer/trunk/docs/gettingstarted/src/docbkx/en/modules/managed.xml	2007-06-12 13:55:28 UTC (rev 63473)
@@ -3,7 +3,7 @@
       "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
 
 <chapter id="managed">
-   <title>Manager module</title>
+   <title>Managed module</title>
 
    <para>
       Managed ...

Modified: projects/microcontainer/trunk/docs/gettingstarted/src/docbkx/en/modules/spring.xml
===================================================================
--- projects/microcontainer/trunk/docs/gettingstarted/src/docbkx/en/modules/spring.xml	2007-06-12 13:55:23 UTC (rev 63472)
+++ projects/microcontainer/trunk/docs/gettingstarted/src/docbkx/en/modules/spring.xml	2007-06-12 13:55:28 UTC (rev 63473)
@@ -5,7 +5,105 @@
 <section>
    <title>Spring integration</title>
 
-   <para>XYZ
+   <para>Spring integration allows Spring XML files to be used for IoC without Spring BeanFactory/ApplicationContext.
+      This is possible as JBoss Microcontainer supports the same set of IoC features as Spring.
+      All you need to do is declare the right namespace: <varname>urn:jboss:spring-beans:2.0</varname>.
+      See the following example for a simple plain Spring XML example.
    </para>
 
+   <programlisting>
+      &lt;beans xmlns="urn:jboss:spring-beans:2.0">
+
+         &lt;bean id="testBean" class="org.jboss.test.spring.support.SimpleBean">
+            &lt;constructor-arg index="2">
+               &lt;value>SpringBean&lt;/value>
+            &lt;/constructor-arg>
+            &lt;constructor-arg index="0">
+               &lt;value>1&lt;/value>
+            &lt;/constructor-arg>
+            &lt;constructor-arg index="1">
+               &lt;value>3.14159&lt;/value>
+            &lt;/constructor-arg>
+            &lt;property name="mylist">
+               &lt;list value-type="java.lang.String">
+                  &lt;value>onel&lt;/value>
+                  &lt;value>twol&lt;/value>
+                  &lt;value>threel&lt;/value>
+               &lt;/list>
+            &lt;/property>
+            &lt;property name="myset">
+               &lt;set value-type="java.lang.String">
+                  &lt;value>ones&lt;/value>
+                  &lt;value>twos&lt;/value>
+                  &lt;value>ones&lt;/value>
+               &lt;/set>
+            &lt;/property>
+            &lt;property name="mymap">
+               &lt;map key-type="java.lang.String">
+                  &lt;entry>
+                     &lt;key>
+                        &lt;value>test_key&lt;/value>
+                     &lt;/key>
+                     &lt;value type="java.lang.String">myvalue&lt;/value>
+                  &lt;/entry>
+               &lt;/map>
+            &lt;/property>
+         &lt;/bean>
+
+      &lt;/beans>
+   </programlisting>
+
+   <para>But things would be too easy if we just let get away with plain Spring XML.
+      So what you can do is mix and match Microcontainer beans with Spring beans. It doesn't matter which
+      starting element you choose, as long as your beans have the right namespace.
+      Let see this on the next two examples.
+   </para>
+
+   <programlisting>
+      &lt;deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+         &lt;bean name="oldBean" class="org.jboss.test.spring.support.OldBean">
+            &lt;property name="testBean">
+               &lt;inject/>
+            &lt;/property>
+         &lt;/bean>
+
+         &lt;bean xmlns="urn:jboss:spring-beans:2.0" id="testBean" class="org.jboss.test.spring.support.SimpleBean">
+            &lt;property name="mylist">
+               &lt;list value-type="java.lang.String">
+                  &lt;value>onel&lt;/value>
+                  &lt;value>twol&lt;/value>
+                  &lt;value>threel&lt;/value>
+               &lt;/list>
+            &lt;/property>
+         &lt;/bean>
+
+      &lt;/deployment>
+   </programlisting>
+
+   <para>In this example we have a Microcontainer beans at the start (deployment element at the start), and we mix
+      them with Spring beans.
+   </para>
+
+   <programlisting>
+      &lt;beans xmlns="urn:jboss:spring-beans:2.0">
+
+         &lt;bean id="testBean" class="org.jboss.test.spring.support.SimpleBean">
+            &lt;property name="refBean">
+               &lt;ref bean="oldBean"/>
+            &lt;/property>
+         &lt;/bean>
+
+         &lt;bean xmlns="urn:jboss:bean-deployer:2.0" name="oldBean" class="org.jboss.test.spring.support.OldBean">
+            &lt;property name="javaBeanString">JavaBean&lt;/property>
+         &lt;/bean>
+
+      &lt;/beans>
+   </programlisting>
+
+   <para>Here we start with Spring XML and add Microcontainer beans.</para>
+
+   <para>As you can see, all you need to change from your existing XML, be it Spring or Microcontainer,
+      is the namespace on the staring Spring beans element or bean element.</para>
+
 </section>
\ No newline at end of file




More information about the jboss-cvs-commits mailing list