Java Reference
In-Depth Information
Listing 5-40. springburlap-config.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"
>
<bean name="policyQuoteDelegate"
class="com.xpress.channel.PolicyQuoteBusinessDelegate" >
<property name="service"
ref="policyQuoteBurlapService" />
</bean>
<bean id="policyQuoteBurlapService"
class="org.springframework.remoting.caucho.BurlapProxyFactoryBean">
<property name="serviceUrl"
value=" http://localhost:7001/eInsureWeb/remoting/PolicyQuoteService"/>
<property name="serviceInterface"
value="com.apress.einsure.business.api.PolicyQuoteApplicationService"/>
</bean>
</beans>
It is important to note that since I have used a proxy object with P2I, the business
delegate does not need to change. Last but not least, Listing 5-41 shows the stand-alone
client.
Listing 5-41. PolicyQuoteBurlapClient.java
public class PolicyQuoteBurlapClient {
public static void main(String[] args) {
accessViaSpringClient();
}
public static void accessViaSpringClient() {
String configFile = "com/xpress/channel/springburlap-config.xml";
ApplicationContext ctx = new ClassPathXmlApplicationContext(configFile);
PolicyQuoteBusinessDelegate delegate =
(PolicyQuoteBusinessDelegate) ctx.getBean("policyQuoteDelegate");
 
Search WWH ::




Custom Search