Mule+Spring+Ibatis的配置

    ISBN二期用Mule+Spring+ibatis框架,目前框架已经搭建成功,做一个小结。将Spring里面所有的serviceBean和daoBean的配置都转移到mule的配置文件中,如下:

<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesource.org/schema/mule/core/2.2"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:vm="http://www.mulesource.org/schema/mule/vm/2.2"
xmlns:ejb="http://www.mulesource.org/schema/mule/ejb/2.2"
xmlns:jms="http://www.mulesource.org/schema/mule/jms/2.2"
xsi:schemaLocation="
               http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
               http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd
               http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
               http://www.mulesource.org/schema/mule/core/2.2 http://www.mulesource.org/schema/mule/core/2.2/mule.xsd
               http://www.mulesource.org/schema/mule/vm/2.2 http://www.mulesource.org/schema/mule/vm/2.2/mule-vm.xsd
               http://www.mulesource.org/schema/mule/ejb/2.2 http://www.mulesource.org/schema/mule/ejb/2.2/mule-ejb.xsd
               http://www.mulesource.org/schema/mule/jms/2.2 http://www.mulesource.org/schema/mule/jms/2.2/mule-jms.xsd">

<spring:bean id="systemManageDao"
  class="com.isbn.app.dao.systemmanage.SystemManageDaoImpl">
    <spring:property name="sqlMapClient" ref="sqlMapClient"></spring:property>
</spring:bean>

<spring:bean id="systemManageService"
class="com.isbn.app.service.systemmanage.SystemManageServiceImpl">
<spring:property name="systemManageDao" ref="systemManageDao"></spring:property>
</spring:bean>

<model name="Bookstore">
<service name="SystemManageService">
<inbound>
<!-- Public interface -->
<inbound-endpoint
address="cxf:http://0.0.0.0:8777/services/systemManage" />
</inbound>

<component>
<spring-object bean="systemManageService" />
</component>
</service>
</model>
</mule>
该配置文件中只包含服务和springBean的配置,其中数据源、连接池以及事务的配置统一放在另外一个配置文件中,多个配置文件的情况下,可在web.xml中,如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Bookstore Administration</display-name>
<description>
Administration console for the Mule-powered On-line Bookstore
</description>

<!-- The Mule configuration is provided as a context parameter -->
<context-param>
<param-name>org.mule.config</param-name>
<param-value>/WEB-INF/config/isbn-config.xml,/WEB-INF/config/isbn-systemmanage-config.xml,/WEB-INF/config/isbn-publish-config.xml,/WEB-INF/config/isbn-audit-config.xml,/WEB-INF/config/isbn-plan-config.xml</param-value>
</context-param>

<listener>
<listener-class>
org.mule.config.builders.MuleXmlBuilderContextListener
</listener-class>
</listener>


<servlet>
<servlet-name>muleServlet</servlet-name>
<servlet-class>
org.mule.transport.servlet.MuleRESTReceiverServlet
</servlet-class>

<init-param>
<param-name>
org.mule.servlet.default.content.type
</param-name>
<param-value>text/html</param-value>
</init-param>
</servlet>

<servlet-mapping>
<servlet-name>muleServlet</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>

<welcome-file-list>
<welcome-file>admin.jsp</welcome-file>
</welcome-file-list>
</web-app>

你可能感兴趣的:(spring,xml,Web,框架,ibatis)