Modifying the applicationcontext.xml file – HP Integrity NonStop J-Series User Manual

Page 263

Advertising
background image

<parameter name="ServiceObjectSupplier"
>org.apache.axis2.extensions.spring.receivers.SpringAppContextAwareObjectSupplier</parameter>
<parameter name="SpringBeanName" >empdao</parameter>
<operation name="deleteEmployee">
<messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
</operation>
<operation name="getDetail">
<messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
</operation>
<operation name="insertDetail">
<messageReceiver class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>
</operation>
</service>
</serviceGroup>

Modifying the applicationContext.xml File

Modify the applicationContext.xml file to:

Add a bean definition for integrating Axis2/Java in the EmpInfo application

Edit the JDBC resource location

To modify the applicationContext.xml file, complete the following steps:

1.

Specify the applicationContext bean as shown:

<bean id="applicationContext"
class="org.apache.axis2.extensions.spring.receivers.ApplicationContextHolder" />

2.

Edit the bean instance of the PropertyPlaceholderConfigurer class to change the
location of the jdbc.properties file, as shown:

<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations" value="jdbc.properties"/>
</bean>

After modifications, the applicationContext.xml file should appear as:

<?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.0.xsd">

<bean id="applicationContext"
class="org.apache.axis2.extensions.spring.receivers.ApplicationContextHolder" />
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName">
<value>${jdbc.driver}</value>
</property>
<property name="url">
<value>${jdbc.url}</value>
</property>
<property name="username">
<value>${jdbc.username}</value>
</property>
<property name="password">
<value>${jdbc.password}</value>
</property>
<property name="connectionProperties">
<props>
<prop key="catalog">
${jdbc.catalog}
</prop>
<prop key="schema">
${jdbc.schema}
</prop>
</props>

</property>
</bean>
<bean id="empdao" class="com.hp.empinfo.service.EmployeeDao">
<property name="dataSource">
<ref bean="dataSource" />
</property>
</bean>
<bean id="propertyConfigurer"

class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations" value="jdbc.properties"/>
</bean>
</beans>

Integrating Axis2/Java into Spring 263

Advertising
This manual is related to the following products: