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:
parent
0dab269dba
commit
6b37493d2f
File diff suppressed because it is too large
Load Diff
|
|
@ -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><jee:jndi-lookup></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
|
||||||
|
|
|
||||||
|
|
@ -286,15 +286,14 @@ public class ProductDaoImpl implements ProductDao {
|
||||||
|
|
||||||
<programlisting language="xml"><beans>
|
<programlisting language="xml"><beans>
|
||||||
|
|
||||||
<bean id="myDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
|
<jee:jndi-lookup id="myDataSource" jndi-name="java:comp/env/jdbc/myds"/>
|
||||||
<property name="jndiName" value="java:comp/env/jdbc/myds"/>
|
|
||||||
</bean>
|
|
||||||
|
|
||||||
</beans></programlisting>
|
</beans></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><jee:jndi-lookup></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"><beans>
|
<programlisting language="xml"><beans>
|
||||||
|
|
||||||
<bean id="myDataSource1" class="org.springframework.jndi.JndiObjectFactoryBean">
|
<jee:jndi-lookup id="dataSource1" jndi-name="java:comp/env/jdbc/myds1"/>
|
||||||
<property name="jndiName value="java:comp/env/jdbc/myds1"/>
|
|
||||||
</bean>
|
|
||||||
|
|
||||||
<bean id="myDataSource2" class="org.springframework.jndi.JndiObjectFactoryBean">
|
<jee:jndi-lookup id="dataSource2" jndi-name="java:comp/env/jdbc/myds2"/>
|
||||||
<property name="jndiName" value="java:comp/env/jdbc/myds2"/>
|
|
||||||
</bean>
|
|
||||||
|
|
||||||
<bean id="mySessionFactory1" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
|
<bean id="mySessionFactory1" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
|
||||||
<property name="dataSource" ref="myDataSource1"/>
|
<property name="dataSource" ref="myDataSource1"/>
|
||||||
|
|
@ -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><jee:jndi-lookup></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><jee:jndi-lookup></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
Loading…
Reference in New Issue