<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE mule-configuration PUBLIC "-//MuleSource //DTD mule-configuration XML V1.0//EN"
                                "http://mule.mulesource.org/dtds/mule-configuration.dtd">

<mule-configuration id="InjectionProblem" version="1.0">

     <!-- embed Spring configuration to create a Jms Connection factory -->
    <container-context className="org.mule.module.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</value></property>
    </bean>
                </beans>
                ]]>
            </text-property>
        </properties>
    </container-context>

    <!-- Testing with ActiveMq -->
    <connector name="jmsConnector" className="org.mule.transport.jms.JmsConnector">
        <properties>
            <container-property name="connectionFactory" reference="jmsConnectionFactory"/>
            <property name="specification" value="1.1"/>
        </properties>
    </connector>

    <!--
        The Mule model initialises and manages your UMO components
    -->
    <model name="InjectionProblem">
        <mule-descriptor name="pojo1"
            implementation="org.mule.component.simple.EchoComponent">
            <inbound-router>
                <endpoint address="vm://pojo1" />
            </inbound-router>

            <outbound-router>
                <router className="org.mule.routing.outbound.OutboundPassThroughRouter" >
                    <endpoint address="jms://pojo2" />
                </router>
            </outbound-router>
        </mule-descriptor>

        <mule-descriptor name="pojo2"
            implementation="org.mule.component.simple.EchoComponent">
            <inbound-router>
                <endpoint address="jms://pojo2"/>
            </inbound-router>

            <outbound-router>
                <router className="org.mule.routing.outbound.OutboundPassThroughRouter">
                    <endpoint address="jms://pojo3"/>
                </router>
            </outbound-router>
        </mule-descriptor>

        <mule-descriptor name="pojo3"
            implementation="org.mule.component.simple.EchoComponent">
            <inbound-router>
                <endpoint address="jms://pojo3"/>
            </inbound-router>

            <outbound-router>
                <router className="org.mule.routing.outbound.OutboundPassThroughRouter">
                    <endpoint address="jms://pojo4"/>
                    <reply-to address="jms://response"/>
                </router>
            </outbound-router>
        </mule-descriptor>

        <!-- This component will append " Received" to the message so we know we're getting the correct one -->
        <mule-descriptor name="pojo4"
            implementation="org.mule.tck.testmodels.services.TestReceiver">
            <inbound-router>
                <endpoint address="jms://pojo4"/>
            </inbound-router>
        </mule-descriptor>
    </model>

</mule-configuration>
