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

    <spring:bean name="jndiFactory" class="org.mule.transport.rmi.MuleRMIFactory"/>

    <spring:bean name="jndiContext" factory-bean="jndiFactory" factory-method="create"/>

    <jnp:connector name="jnp" jndiContext-ref="jndiContext" securityPolicy="rmi.policy"/>

    <vm:connector name="vmQueue" queueEvents="true"/>

    <endpoint name="Sender" address="jnp://localhost:1099/SimpleMathsUMO?method=addTen"/>
    <jnp:endpoint name="Sender2" host="localhost" port="1099" object="MatchingUMO" method="reverseString"/>

    <endpoint name="GoodType"
              address="jnp://localhost:1099/MatchingUMO?method=reverseString&amp;methodArgumentTypes=java.lang.String"/>

    <jnp:endpoint name="BadType" address="jnp://localhost:1099/MatchingUMO"
                  method="reverseString" methodArgumentTypes="java.lang.StringBuffer"/>

    <model name="sample">

        <service name="TestUMO">
            <inbound>
                <inbound-endpoint address="vm://testin"/>
                <forwarding-router/>
            </inbound>
            <outbound>
                <filtering-router>
                    <jnp:outbound-endpoint ref="Sender"/>
                    <payload-type-filter expectedType="java.lang.Integer"/>
                </filtering-router>
                <filtering-router>
                    <outbound-endpoint ref="Sender2"/>
                    <payload-type-filter expectedType="java.lang.String"/>
                </filtering-router>
            </outbound>
        </service>

    </model>

</mule>
