<?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"
    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">

    <model name="main">
        <service name="ForwardingRouter">
            <inbound>
                <forwarding-router/>
            </inbound>
        </service>
        
        <service name="IdempotentSecureHashReceiverRouter">
            <inbound>
                <idempotent-secure-hash-receiver-router>
                    <!-- TODO 
                    <xsd:element ref="abstract-property-extractor"/>
                    -->
                </idempotent-secure-hash-receiver-router>
            </inbound>
        </service>
        
        <service name="InboundPassThroughRouter">
            <inbound>
                <inbound-pass-through-router>
                    <!-- TODO 
                    <xsd:element ref="abstract-property-extractor"/>
                    -->
                </inbound-pass-through-router>
            </inbound>
        </service>
        
        <service name="SelectiveConsumerRouter">
            <inbound>
                <selective-consumer-router transformFirst="false"/>
            </inbound>
        </service>
    </model>
</mule>

<!-- 
    <xsd:element name="idempotent-receiver-router" type="idempotentReceiverType"
                 substitutionGroup="abstract-inbound-router"/>
    <xsd:complexType name="idempotentReceiverType">
        <xsd:complexContent>
            <xsd:extension base="filteredInboundRouterType">
                <xsd:sequence>
                    <xsd:element ref="abstract-storage" minOccurs="0"/>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:element name="wire-tap-router" type="wireTapRouterType" substitutionGroup="abstract-inbound-router"/>
    <xsd:complexType name="wireTapRouterType">
        <xsd:complexContent>
            <xsd:extension base="filteredInboundRouterType">
                <xsd:sequence>
                    <xsd:element ref="abstract-outbound-endpoint" minOccurs="1" maxOccurs="1"/>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:element name="selective-consumer-router" type="selectiveConsumerRouterType"
                 substitutionGroup="abstract-inbound-router"/>
    <xsd:complexType name="selectiveConsumerRouterType">
        <xsd:complexContent>
            <xsd:extension base="filteredInboundRouterType">
                <xsd:sequence>
                    <xsd:element ref="abstract-transformer" minOccurs="0" maxOccurs="unbounded"/>
                </xsd:sequence>
                <xsd:attribute name="transformer-refs" type="xsd:NMTOKENS"/>
                <xsd:attribute name="transformerFirst" type="substitutableBoolean"/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:element name="message-chunking-aggregator-router" type="correlationRouterType"
                 substitutionGroup="abstract-inbound-router"/>
    <xsd:element name="correlation-resequencer-router" type="correlationRouterType"
                 substitutionGroup="abstract-inbound-router"/>
    <xsd:complexType name="correlationRouterType">
        <xsd:complexContent>
            <xsd:extension base="filteredInboundRouterType">
                <xsd:attribute name="correlationExpression" type="xsd:string"/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:element name="correlation-aggregator-router" type="correlationAggregatorRouterType"
                 substitutionGroup="abstract-inbound-router"/>
    <xsd:complexType name="correlationAggregatorRouterType">
        <xsd:complexContent>
            <xsd:extension base="correlationRouterType">
                <xsd:attribute name="class" type="substitutableClass" use="required"/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:element name="custom-inbound-router" type="customInboundRouterType"
                 substitutionGroup="abstract-inbound-router"/>
    <xsd:complexType name="customInboundRouterType">
        <xsd:complexContent>
            <xsd:extension base="filteredInboundRouterType">
                <xsd:sequence>
                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="abstract-inbound-endpoint" minOccurs="0" maxOccurs="unbounded"/>
                </xsd:sequence>
                <xsd:attribute name="class" type="xsd:NMTOKEN" use="required"/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    ResponseRouters 

    <xsd:element name="single-response-router" type="responseRouterType" substitutionGroup="abstract-response-router"/>
    <xsd:complexType name="responseRouterType">
        <xsd:complexContent>
            <xsd:extension base="abstractResponseRouterType">
                <xsd:sequence>
                    <xsd:element ref="abstract-response-endpoint" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:choice minOccurs="0">
                        <xsd:element ref="abstract-property-extractor"/>
                        <xsd:element ref="custom-property-extractor"/>
                    </xsd:choice>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:element name="custom-response-router" type="customResponseRouterType"
                 substitutionGroup="abstract-response-router"/>
    <xsd:complexType name="customResponseRouterType">
        <xsd:complexContent>
            <xsd:extension base="responseRouterType">
                <xsd:sequence>
                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
                </xsd:sequence>
                <xsd:attribute name="class" type="xsd:NMTOKEN" use="required"/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>


    Outbound Router implementations

    <xsd:element name="outbound-pass-through-router" type="outboundRouterType"
                 substitutionGroup="abstract-outbound-router"/>
    <xsd:complexType name="outboundRouterType">
        <xsd:complexContent>
            <xsd:extension base="abstractOutboundRouterType">
                <xsd:sequence>
                    <xsd:element ref="abstract-outbound-endpoint" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element name="reply-to" type="replyToType" minOccurs="0"/>
                    <xsd:element ref="abstract-transaction" minOccurs="0"/>
                    <xsd:choice minOccurs="0">
                        <xsd:element ref="abstract-property-extractor"/>
                        <xsd:element ref="custom-property-extractor"/>
                    </xsd:choice>
                </xsd:sequence>
                <xsd:attribute name="enableCorrelation" default="IF_NOT_SET">
                    <xsd:simpleType>
                        <xsd:restriction base="xsd:NMTOKEN">
                            <xsd:enumeration value="ALWAYS"/>
                            <xsd:enumeration value="NEVER"/>
                            <xsd:enumeration value="IF_NOT_SET"/>
                        </xsd:restriction>
                    </xsd:simpleType>
                </xsd:attribute>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:element name="filtering-router" type="filteringOutboundRouterType"
                 substitutionGroup="abstract-outbound-router"/>
    <xsd:element name="chaining-router" type="filteringOutboundRouterType"
                 substitutionGroup="abstract-outbound-router"/>
    <xsd:element name="exception-based-router" type="filteringOutboundRouterType"
                 substitutionGroup="abstract-outbound-router"/>
    <xsd:element name="multicasting-router" type="filteringOutboundRouterType"
                 substitutionGroup="abstract-outbound-router"/>
    <xsd:element name="template-endpoint-router" type="filteringOutboundRouterType"
                 substitutionGroup="abstract-outbound-router"/>
    <xsd:complexType name="filteringOutboundRouterType">
        <xsd:complexContent>
            <xsd:extension base="outboundRouterType">
                <xsd:sequence>
                    <xsd:element ref="abstract-filter" minOccurs="0"/>
                    <xsd:element ref="abstract-transformer" minOccurs="0" maxOccurs="unbounded"/>
                </xsd:sequence>
                <xsd:attribute name="transformer-refs" type="xsd:NMTOKENS"/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:element name="endpoint-selector-router" type="endpointSelectorRouterType"
                 substitutionGroup="abstract-outbound-router"/>
    <xsd:complexType name="endpointSelectorRouterType">
        <xsd:complexContent>
            <xsd:extension base="filteringOutboundRouterType">
                <xsd:attribute name="selectorProperty" type="xsd:string" use="required"/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:element name="list-message-splitter-router" type="messageSplitterOutboundRouterType"
                 substitutionGroup="abstract-outbound-router"/>
    <xsd:complexType name="messageSplitterOutboundRouterType">
        <xsd:complexContent>
            <xsd:extension base="filteringOutboundRouterType">
                <xsd:attribute name="honorSynchronicity" type="substitutableBoolean"/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:element name="message-chunking-router" type="chunkingRouterType" substitutionGroup="abstract-outbound-router"/>
    <xsd:complexType name="chunkingRouterType">
        <xsd:complexContent>
            <xsd:extension base="filteringOutboundRouterType">
                <xsd:attribute name="messageSize" type="substitutableInt"/>
                <xsd:attribute name="numberOfMessages" type="substitutableInt"/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:element name="static-recipient-list-router" type="staticRecipientListRouterType"
                 substitutionGroup="abstract-outbound-router"/>
    <xsd:complexType name="staticRecipientListRouterType">
        <xsd:complexContent>
            <xsd:extension base="filteringOutboundRouterType">
                <xsd:sequence>
                    <xsd:element name="recipients" type="listOrSetType" minOccurs="0" maxOccurs="1"/>
                </xsd:sequence>
                <xsd:attribute name="recipientsProperty" type="xsd:string"/>
                <xsd:attribute name="recipientsDelimiter" type="xsd:string"/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:element name="custom-outbound-router" type="customOutboundRouterType"
                 substitutionGroup="abstract-outbound-router"/>
    <xsd:complexType name="customOutboundRouterType">
        <xsd:complexContent>
            <xsd:extension base="filteringOutboundRouterType">
                <xsd:sequence>
                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
                </xsd:sequence>
                <xsd:attribute name="class" type="xsd:NMTOKEN" use="required"/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>
 -->