Java Reference
In-Depth Information
<!- - Other beans - ->
<bean name="underwritingBusinessDelegate"
class="com.apress.insurance.view.delegate.UnderWritingBusinessDelegate">
<property name="uwrLocalHome" ref="uwrSlsbLocalHome" />
</bean>
<bean name="uwrSlsbLocalHome"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="UnderwritingBeanLocal" />
</bean>
</beans>
Note that with local EJBs the various properties related to JNDI lookup are
redundant.
EJB 3 Lookup
With EJB 3 you can turn a POJO into a session bean by using Java EE standard annota-
tions. You are no longer burdened with the home interface and XML deployment
descriptors. All these have immensely simplified EJB development. The changes in EJB 3,
however, have not changed how the Spring service locator works. You can still use the
JndiObjectFactoryBean as a service locator by configuration. As shown in Listing 4-6, it is
used to look up two different session beans.
Listing 4-6. insurance-servlet.xml : EJB 3 Lookup
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=" http://www.springframework.org/schema/beans"
xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=" http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"
>
<!- - Other beans - ->
<!- - Remote EJB 3 SLSB - ->
<bean id="uwrRemoteService"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="UwrRemoteServiceBean/Remote" />
 
Search WWH ::




Custom Search