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
|
||||
objects that can be stored and retrieved in JNDI. When configuring a
|
||||
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,
|
||||
often this strategy is cumbersome if there are a large number of
|
||||
destinations in the application or if there are advanced destination
|
||||
|
|
|
|||
|
|
@ -286,15 +286,14 @@ public class ProductDaoImpl implements ProductDao {
|
|||
|
||||
<programlisting language="xml"><beans>
|
||||
|
||||
<bean id="myDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
|
||||
<property name="jndiName" value="java:comp/env/jdbc/myds"/>
|
||||
</bean>
|
||||
<jee:jndi-lookup id="myDataSource" jndi-name="java:comp/env/jdbc/myds"/>
|
||||
|
||||
</beans></programlisting>
|
||||
|
||||
<para>You can also access a JNDI-located
|
||||
<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>
|
||||
</section>
|
||||
|
||||
|
|
@ -618,13 +617,9 @@ public class ProductDaoImpl implements ProductDao {
|
|||
|
||||
<programlisting language="xml"><beans>
|
||||
|
||||
<bean id="myDataSource1" class="org.springframework.jndi.JndiObjectFactoryBean">
|
||||
<property name="jndiName value="java:comp/env/jdbc/myds1"/>
|
||||
</bean>
|
||||
<jee:jndi-lookup id="dataSource1" jndi-name="java:comp/env/jdbc/myds1"/>
|
||||
|
||||
<bean id="myDataSource2" class="org.springframework.jndi.JndiObjectFactoryBean">
|
||||
<property name="jndiName" value="java:comp/env/jdbc/myds2"/>
|
||||
</bean>
|
||||
<jee:jndi-lookup id="dataSource2" jndi-name="java:comp/env/jdbc/myds2"/>
|
||||
|
||||
<bean id="mySessionFactory1" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
|
||||
<property name="dataSource" ref="myDataSource1"/>
|
||||
|
|
@ -795,7 +790,8 @@ public class ProductDaoImpl implements ProductDao {
|
|||
<para>If in your application context you are already directly
|
||||
obtaining the JTA
|
||||
<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
|
||||
<classname>JtaTransactionManager</classname>, then the easiest way
|
||||
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
|
||||
also be set up in the JNDI environment of a J2EE application server,
|
||||
usually through the JCA connector provided by the particular JDO
|
||||
implementation. Spring's standard
|
||||
<literal>JndiObjectFactoryBean</literal> can be used to retrieve and
|
||||
expose such a <interfacename>PersistenceManagerFactory</interfacename>.
|
||||
However, outside an EJB context, there is often no compelling benefit in
|
||||
holding the <interfacename>PersistenceManagerFactory</interfacename> in
|
||||
JNDI: only choose such setup for a good reason. See "container resources
|
||||
implementation. Spring's standard <literal>JndiObjectFactoryBean /
|
||||
<literal><jee:jndi-lookup></literal></literal> can be used to
|
||||
retrieve and expose such a
|
||||
<interfacename>PersistenceManagerFactory</interfacename>. However,
|
||||
outside an EJB context, there is often no compelling benefit in holding
|
||||
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
|
||||
arguments there apply to JDO as well.</para>
|
||||
</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