Java Reference
In-Depth Information
specify the proxy interface. The proxy interface will enable the generation of a proxy
object to stand in for the real JNDI object. Hence, the proxy interface must be the same as
the JNDI object interface. As shown in Listing 4-8, I have specified the local home inter-
face as the proxy interface. Note that the actual JNDI object will be made available on
first use.
Listing 4-8. insurance-servlet.xml
<?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 - ->
<bean name="underwritingBusinessDelegate"
class="com.apress.insurance.view.delegate.UnderWritingBusinessDelegate">
<property name="uwrLocalHome" ref="uwrSlsbLocalHome" />
</bean>
<bean id="uwrSlsbLocalHome"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="UnderwritingBeanLocal" />
<property name="cache" value="false" />
<property name="lookupOnStartup" value="false" />
<property name="proxyInterface"
value="com.apress.einsure.business.ejbfacade.UnderwritingLocalHome" />
</bean>
</beans>
The eInsure application had a large number of session beans carrying out business
workflow. But this resulted in lots of redundant metadata information bloating the Spring
configuration file. You can minimize the duplication of configuration information by
inheriting from an abstract template definition, as shown in Listing 4-9.
Listing 4-9. insurance-servlet.xml
<?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" >
Search WWH ::




Custom Search