http://www.mulesource.com/
安装mule IDE:
windows preference->help->software updates->add->"http://dist.muleforge.org/mule-ide/updates/3.4/"
附上mule的文档如下。
感觉写博客太累,总写不好,决定每碰到一个问题的时候再把它加到博客里面来吧。
spring与mule的结合的troubleshooting:
将spring 定义写到mule context
xmlns="http://www.mulesource.org/schema/mule/core/2.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-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.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-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/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
。。。
<context:property-placeholder location="jdbc.properties"/>
<spring:bean id="clinicDAO" class="com.join.kang.petclinic.dao.impl.PetClinicDaoImpl">
<spring:property name="dataSource">
<spring:ref local="dataSource"/>
</spring:property>
</spring:bean>
定义好了这个以后,因为这个配置文件是mule的,所以不能用spring的方式去取得它的实例,mule里面有自己的方式,如下:
MuleContext muleContext = new DefaultMuleContextFactory().createMuleContext(
new SpringXmlConfigurationBuilder(".\\conf\\spring-mule-config.xml"));
ApplicationContext ctx = (ApplicationContext)muleContext.getRegistry().lookupObject(
SpringRegistry.SPRING_APPLICATION_CONTEXT);
PetClinicDaoImpl dao = (PetClinicDaoImpl)ctx.getBean("clinicDAO");
当然也可以用spring独立出来的方式,那样的话就需要用到spring的import,处理方式就和spring一样了:
<spring:beans>
<spring:import resource="applicationContext-hibernate.xml"/>
</spring:beans>