[jboss-cvs] JBossAS SVN: r90138 - projects/microcontainer/mcdocs/trunk/userguide/src/main/docbook.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Jun 12 05:58:44 EDT 2009


Author: kabir.khan at jboss.com
Date: 2009-06-12 05:58:44 -0400 (Fri, 12 Jun 2009)
New Revision: 90138

Modified:
   projects/microcontainer/mcdocs/trunk/userguide/src/main/docbook/User_Guide.xml
Log:
Add example of non-static factory where factory is installed as MC bean

Modified: projects/microcontainer/mcdocs/trunk/userguide/src/main/docbook/User_Guide.xml
===================================================================
--- projects/microcontainer/mcdocs/trunk/userguide/src/main/docbook/User_Guide.xml	2009-06-12 09:57:26 UTC (rev 90137)
+++ projects/microcontainer/mcdocs/trunk/userguide/src/main/docbook/User_Guide.xml	2009-06-12 09:58:44 UTC (rev 90138)
@@ -1594,28 +1594,31 @@
 &lt;/bean&gt; </programlisting>
           </listitem>
           <listitem>
-            <para>Non-static factory method</para>
-            <programlisting role="JAVA">@Factory (factory=@Value(javabean=@JavaBeanValue(org.jboss.example.MyOtherFactory.class)),
-          factoryMethod=&quot;createBean&quot;)
+            <para>Non-static factory method (instance of factory created as JavaBean when needed)</para>
+            <programlisting role="JAVA">@Factory (
+   factory=@Value(javabean=@JavaBeanValue(org.jboss.example.MyOtherFactory.class)),
+   factoryMethod=&quot;createBean&quot;)
 public class SimpleBean {
     ...
 }</programlisting>
-            <programlisting role="XML">&lt;bean name=&quot;MyOtherFactory&quot; class=&quot;org.jboss.example.MyOtherFactory&quot;/&gt;
-
-&lt;bean name=&quot;SimpleBean&quot; class=&quot;org.jboss.example.SimpleBean&quot;&gt;
-    &lt;constructor factoryMethod=&quot;createBean&quot;&gt;
-        &lt;factory bean=&quot;MyOtherFactory&quot;/&gt;
-    &lt;/constructor&gt;
+            <programlisting role="XML">&lt;bean name=&quot;SimpleBean&quot; class=&quot;org.jboss.example.SimpleBean&quot;&gt;
+      &lt;constructor factoryMethod=&quot;createBean&quot;&gt;
+         &lt;factory&gt;
+            &lt;javabean xmlns="urn:jboss:javabean:1.0" 
+                class="org.jboss.example.MyOtherFactory"/&gt;
+         &lt;/factory&gt;
+      &lt;/constructor&gt;
 &lt;/bean&gt;</programlisting>
           </listitem>
           <listitem>
-            <para>Non-static factory method with parameters</para>
-            <programlisting role="JAVA">@Factory (factory=@Value(javabean=@JavaBeanValue(org.jboss.example.MyOtherFactory.class)),
-          factoryMethod=&quot;createBean&quot;,
-          parameters={@Value(string=@StringValue(&quot;a string&quot;)), at Value(string=@StringValue(&quot;7&quot;))})
-public class SimpleBean {
-    ...
-}</programlisting>
+            <para>Non-static factory method with parameters (instance of factory installed as a Microcontainer bean)</para>
+            <programlisting role="JAVA">@Factory (
+   factory=@Value(inject=@Inject(bean="Factory"))),
+   factoryMethod=&quot;createBean&quot;,
+   parameters={@Value(string=@StringValue(&quot;a string&quot;)),
+       @Value(string=@StringValue(&quot;7&quot;))})
+public class SimpleBean {</programlisting>
+
             <programlisting role="XML">&lt;bean name=&quot;MyOtherFactory&quot; class=&quot;org.jboss.example.MyOtherFactory&quot;/&gt;
 
 &lt;bean name=&quot;SimpleBean&quot; class=&quot;org.jboss.example.SimpleBean&quot;&gt;




More information about the jboss-cvs-commits mailing list