[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>
+ <beans xmlns="urn:jboss:spring-beans:2.0">
+
+ <bean id="testBean" class="org.jboss.test.spring.support.SimpleBean">
+ <constructor-arg index="2">
+ <value>SpringBean</value>
+ </constructor-arg>
+ <constructor-arg index="0">
+ <value>1</value>
+ </constructor-arg>
+ <constructor-arg index="1">
+ <value>3.14159</value>
+ </constructor-arg>
+ <property name="mylist">
+ <list value-type="java.lang.String">
+ <value>onel</value>
+ <value>twol</value>
+ <value>threel</value>
+ </list>
+ </property>
+ <property name="myset">
+ <set value-type="java.lang.String">
+ <value>ones</value>
+ <value>twos</value>
+ <value>ones</value>
+ </set>
+ </property>
+ <property name="mymap">
+ <map key-type="java.lang.String">
+ <entry>
+ <key>
+ <value>test_key</value>
+ </key>
+ <value type="java.lang.String">myvalue</value>
+ </entry>
+ </map>
+ </property>
+ </bean>
+
+ </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>
+ <deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="oldBean" class="org.jboss.test.spring.support.OldBean">
+ <property name="testBean">
+ <inject/>
+ </property>
+ </bean>
+
+ <bean xmlns="urn:jboss:spring-beans:2.0" id="testBean" class="org.jboss.test.spring.support.SimpleBean">
+ <property name="mylist">
+ <list value-type="java.lang.String">
+ <value>onel</value>
+ <value>twol</value>
+ <value>threel</value>
+ </list>
+ </property>
+ </bean>
+
+ </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>
+ <beans xmlns="urn:jboss:spring-beans:2.0">
+
+ <bean id="testBean" class="org.jboss.test.spring.support.SimpleBean">
+ <property name="refBean">
+ <ref bean="oldBean"/>
+ </property>
+ </bean>
+
+ <bean xmlns="urn:jboss:bean-deployer:2.0" name="oldBean" class="org.jboss.test.spring.support.OldBean">
+ <property name="javaBeanString">JavaBean</property>
+ </bean>
+
+ </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