[jboss-cvs] JBossAS SVN: r103705 - projects/snowdrop/branches/1_0/documentation/user-guide/src/main/docbook.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Apr 8 11:48:16 EDT 2010
Author: marius.bogoevici
Date: 2010-04-08 11:48:15 -0400 (Thu, 08 Apr 2010)
New Revision: 103705
Modified:
projects/snowdrop/branches/1_0/documentation/user-guide/src/main/docbook/user-guide.xml
Log:
docs
Modified: projects/snowdrop/branches/1_0/documentation/user-guide/src/main/docbook/user-guide.xml
===================================================================
--- projects/snowdrop/branches/1_0/documentation/user-guide/src/main/docbook/user-guide.xml 2010-04-08 15:43:16 UTC (rev 103704)
+++ projects/snowdrop/branches/1_0/documentation/user-guide/src/main/docbook/user-guide.xml 2010-04-08 15:48:15 UTC (rev 103705)
@@ -269,7 +269,7 @@
.sar's, .war's, .ear's, .har's, and .rar's work. Using the JBoss
Spring deployer you can create Spring jars:</para>
- <screen>my-app.spring/
+ <screen>my-app.jar/
org/
acme/
MyBean.class
@@ -277,7 +277,7 @@
META-INF/
jboss-spring.xml</screen>
- <para>So, my-app.spring is a jar that contains classes, like any other
+ <para>So, my-app.JAR is a jar that contains classes, like any other
JAR and a jboss-spring.xml file in the META-INF/ of the jar. This
jboss-spring.xml file is like any other Spring xml file. By default,
the JBoss Spring Deployer will register this bean factory defined in
@@ -316,7 +316,8 @@
<programlisting language="XML"><beans>
<description>BeanFactory=(MyApp)</description>
-...
+ ...
+ <bean id="springBean" class="example.SpringBean"/>
</beans></programlisting>
<para>MyApp will be used as the JNDI name in this example.</para>
@@ -335,6 +336,29 @@
...
</beans></programlisting>
</section>
+
+ <section>
+ <title>Injection into EJBs</title>
+
+ <para>Once an ApplicationContext has been successfully bootstrapped,
+ the Spring beans defined in it can be used for injection into EJBs. To
+ that end, the EJBs must be intercepted with the
+ SpringLifecycleInterceptor, as in the following example:</para>
+
+ <programlisting>@Stateless
+ at Interceptors(SpringLifecycleInterceptor.class)
+public class InjectedEjbImpl implements InjectedEjb
+{
+ @Spring(bean = "springBean", jndiName = "MyApp")
+ private SpringBean springBean;
+
+ /* rest of the class definition ommitted */
+}</programlisting>
+
+ <para>In this example, the EJB InjectedEjbImpl will be injected with
+ the bean named 'springBean', defined in the ApplicationContext
+ previously described in sections 3.3 and 3.5.</para>
+ </section>
</section>
</chapter>
</book>
More information about the jboss-cvs-commits
mailing list