replace XML usage of JndiObjectFactoryBean with <jee:jndi-lookup/>

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@1401 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Mark Pollack 2009-06-19 12:22:18 +00:00
parent 0dab269dba
commit 6b37493d2f
5 changed files with 1792 additions and 1737 deletions

File diff suppressed because it is too large Load Diff

View File

@ -198,7 +198,8 @@
<para>Destinations, like ConnectionFactories, are JMS administered <para>Destinations, like ConnectionFactories, are JMS administered
objects that can be stored and retrieved in JNDI. When configuring a objects that can be stored and retrieved in JNDI. When configuring a
Spring application context you can use the JNDI factory class Spring application context you can use the JNDI factory class
<classname>JndiObjectFactoryBean</classname> to perform dependency <classname>JndiObjectFactoryBean</classname> /
<literal>&lt;jee:jndi-lookup&gt;</literal> to perform dependency
injection on your object's references to JMS destinations. However, injection on your object's references to JMS destinations. However,
often this strategy is cumbersome if there are a large number of often this strategy is cumbersome if there are a large number of
destinations in the application or if there are advanced destination destinations in the application or if there are advanced destination

View File

@ -286,15 +286,14 @@ public class ProductDaoImpl implements ProductDao {
<programlisting language="xml">&lt;beans&gt; <programlisting language="xml">&lt;beans&gt;
&lt;bean id="myDataSource" class="org.springframework.jndi.JndiObjectFactoryBean"&gt; &lt;jee:jndi-lookup id="myDataSource" jndi-name="java:comp/env/jdbc/myds"/&gt;
&lt;property name="jndiName" value="java:comp/env/jdbc/myds"/&gt;
&lt;/bean&gt;
&lt;/beans&gt;</programlisting> &lt;/beans&gt;</programlisting>
<para>You can also access a JNDI-located <para>You can also access a JNDI-located
<interfacename>SessionFactory</interfacename>, using Spring's <interfacename>SessionFactory</interfacename>, using Spring's
<classname>JndiObjectFactoryBean</classname> to retrieve and expose it. <classname>JndiObjectFactoryBean</classname> /
<literal>&lt;jee:jndi-lookup&gt;</literal> to retrieve and expose it.
However, that is typically not common outside of an EJB context.</para> However, that is typically not common outside of an EJB context.</para>
</section> </section>
@ -618,13 +617,9 @@ public class ProductDaoImpl implements ProductDao {
<programlisting language="xml">&lt;beans&gt; <programlisting language="xml">&lt;beans&gt;
&lt;bean id="myDataSource1" class="org.springframework.jndi.JndiObjectFactoryBean"&gt; &lt;jee:jndi-lookup id="dataSource1" jndi-name="java:comp/env/jdbc/myds1"/&gt;
&lt;property name="jndiName value="java:comp/env/jdbc/myds1"/&gt;
&lt;/bean&gt;
&lt;bean id="myDataSource2" class="org.springframework.jndi.JndiObjectFactoryBean"&gt; &lt;jee:jndi-lookup id="dataSource2" jndi-name="java:comp/env/jdbc/myds2"/&gt;
&lt;property name="jndiName" value="java:comp/env/jdbc/myds2"/&gt;
&lt;/bean&gt;
&lt;bean id="mySessionFactory1" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"&gt; &lt;bean id="mySessionFactory1" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"&gt;
&lt;property name="dataSource" ref="myDataSource1"/&gt; &lt;property name="dataSource" ref="myDataSource1"/&gt;
@ -795,7 +790,8 @@ public class ProductDaoImpl implements ProductDao {
<para>If in your application context you are already directly <para>If in your application context you are already directly
obtaining the JTA obtaining the JTA
<interfacename>PlatformTransactionManager</interfacename> object <interfacename>PlatformTransactionManager</interfacename> object
(presumably from JNDI via <literal>JndiObjectFactoryBean</literal>) (presumably from JNDI via
<literal>JndiObjectFactoryBean/<literal>&lt;jee:jndi-lookup&gt;</literal></literal>)
and feeding it for example to Spring's and feeding it for example to Spring's
<classname>JtaTransactionManager</classname>, then the easiest way <classname>JtaTransactionManager</classname>, then the easiest way
is to simply specify a reference to this as the value of is to simply specify a reference to this as the value of
@ -953,12 +949,13 @@ public class ProductDaoImpl implements ProductDao {
<para>A JDO <interfacename>PersistenceManagerFactory</interfacename> can <para>A JDO <interfacename>PersistenceManagerFactory</interfacename> can
also be set up in the JNDI environment of a J2EE application server, also be set up in the JNDI environment of a J2EE application server,
usually through the JCA connector provided by the particular JDO usually through the JCA connector provided by the particular JDO
implementation. Spring's standard implementation. Spring's standard <literal>JndiObjectFactoryBean /
<literal>JndiObjectFactoryBean</literal> can be used to retrieve and <literal>&lt;jee:jndi-lookup&gt;</literal></literal> can be used to
expose such a <interfacename>PersistenceManagerFactory</interfacename>. retrieve and expose such a
However, outside an EJB context, there is often no compelling benefit in <interfacename>PersistenceManagerFactory</interfacename>. However,
holding the <interfacename>PersistenceManagerFactory</interfacename> in outside an EJB context, there is often no compelling benefit in holding
JNDI: only choose such setup for a good reason. See "container resources the <interfacename>PersistenceManagerFactory</interfacename> in JNDI:
only choose such setup for a good reason. See "container resources
versus local resources" in the Hibernate section for a discussion; the versus local resources" in the Hibernate section for a discussion; the
arguments there apply to JDO as well.</para> arguments there apply to JDO as well.</para>
</section> </section>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff