<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE mule-configuration PUBLIC "-//MuleSource //DTD mule-configuration XML V1.0//EN"
                                "http://mule.mulesource.org/dtds/mule-configuration.dtd">

<mule-configuration id="Mule_Loan_broker_ESB" version="1.0">
    <description>
    The Loan Broker ESB example implements the Loan Broker Example using an ESB topology.
    See http://mule.mulesource.org/wiki/display/MULE/LoanBroker+ESB for details.
    </description>

    <!-- Embed Spring configuration to create a Jms Connection factory -->
    <container-context className="org.mule.extras.spring.SpringContainerContext">
        <properties>
            <text-property name="configuration">
                <![CDATA[
                <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
                <beans>
                    <bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
                        <property name="brokerURL"><value>vm://localhost?broker.persistent=false&amp;broker.useJmx=false</value></property>
                    </bean>
                </beans>
                ]]>
            </text-property>
        </properties>
    </container-context>

    <connector name="ejbConnector" className="org.mule.providers.ejb.EjbConnector">
        <properties>
            <property name="jndiInitialFactory" value="org.openejb.client.LocalInitialContextFactory"/>
            <property name="securityPolicy" value="security.policy"/>
            <map name="jndiProviderProperties">
                <system-property name="openejb.base" key="mule.home"/>
                <property name="openejb.configuration" value="./lib/user/openejb.conf"/>
                <property name="logging.conf" value="./conf/log4j.properties"/>
                <property name="openejb.nobanner" value="true"/>
                <!-- Override properties for unit tests. -->
                <file-properties location="openejb.properties" override="true"/>
            </map>
        </properties>
    </connector>

    <connector name="jmsConnector" className="org.mule.providers.jms.activemq.ActiveMqJmsConnector">
        <properties>
            <!-- The ActiveMQ ConnectionFactory is configured as a Spring bean. -->
            <container-property name="connectionFactory" reference="jmsConnectionFactory"/>
            <property name="specification" value="1.1"/>
        </properties>
    </connector>


    <transformers>
        <transformer name="Request" className="com.order.jms.ValidateOrder"/>                
    </transformers>

  
    <model name="order-jms">   
    
        <mule-descriptor name="order"     implementation="com.order.jms.SaveOrder">

            <inbound-router>
           	           <endpoint address="axis:http://localhost:8383/services" transformers="Request" />                    
            </inbound-router>            
            <outbound-router>
	                    <router className="org.mule.routing.outbound.OutboundPassThroughRouter">
	                        <endpoint address="jms://order.view">
	                        <properties>
			    <property value="wrapped" name="style"/>
			    <property value="literal" name="use"/>
			    <property name="methodNamespace"    value="http://jms.order.com"/>
				</properties>
				</endpoint>				
	                    </router>
	    </outbound-router>
	    
	                         
     </mule-descriptor>   
        
        
      <mule-descriptor name="view"   implementation="com.order.jms.ViewOrder">
	     <inbound-router>
	 	<endpoint address="jms://order.view"/>	                                  
	     </inbound-router> 
	    
      </mule-descriptor>                
        
    </model>
</mule-configuration>
