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

<!--
  ~ JBoss, Home of Professional Open Source.
  ~ Copyright 2011, Red Hat, Inc., and individual contributors
  ~ as indicated by the @author tags. See the copyright.txt file in the
  ~ distribution for a full listing of individual contributors.
  ~
  ~ This is free software; you can redistribute it and/or modify it
  ~ under the terms of the GNU Lesser General Public License as
  ~ published by the Free Software Foundation; either version 2.1 of
  ~ the License, or (at your option) any later version.
  ~
  ~ This software is distributed in the hope that it will be useful,
  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  ~ Lesser General Public License for more details.
  ~
  ~ You should have received a copy of the GNU Lesser General Public
  ~ License along with this software; if not, write to the Free
  ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  -->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            targetNamespace="urn:jboss:ejb-client:1.0"
            xmlns="urn:jboss:ejb-client:1.0"
            elementFormDefault="unqualified"
            attributeFormDefault="unqualified"
            version="1.0">

    <!-- Root element -->
    <xsd:element name="jboss-ejb-client" type="jboss-ejb-clientType">
        <xsd:annotation>
            <xsd:documentation>
                Root element for a jboss-ejb-client.xml file
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:complexType name="jboss-ejb-clientType">
        <xsd:annotation>
            <xsd:documentation>
                The EJB client configurations
            </xsd:documentation>
        </xsd:annotation>
        <xsd:all>
            <xsd:element name="client-context" type="client-contextType">
                <annotation xmlns="http://www.w3.org/2001/XMLSchema">
                    <documentation>
                        Configurations that will be used to setup an EJB client context for the
                        deployment.
                    </documentation>
                </annotation>
            </xsd:element>
        </xsd:all>

    </xsd:complexType>

    <xsd:complexType name="client-contextType">
        <xsd:all>
            <xsd:element name="ejb-receivers" type="ejb-receiversType">
                <annotation xmlns="http://www.w3.org/2001/XMLSchema">
                    <documentation>
                        Configures EJB receivers for the client context
                    </documentation>
                </annotation>
            </xsd:element>
        </xsd:all>
    </xsd:complexType>

    <xsd:complexType name="ejb-receiversType">
        <xsd:choice minOccurs="0" maxOccurs="unbounded">
            <xsd:element name="remoting-ejb-receiver" type="remoting-ejb-receiverType">
                <annotation xmlns="http://www.w3.org/2001/XMLSchema">
                    <documentation>
                        Configures a remoting based EJB receiver
                    </documentation>
                </annotation>
            </xsd:element>
        </xsd:choice>
        <xsd:attribute name="exclude-local-receiver" type="xsd:boolean" use="optional" default="false">
            <annotation xmlns="http://www.w3.org/2001/XMLSchema">
                <documentation>
                    Set to true if the local receiver which gets added to the EJB client context by default, has to be
                    excluded from the context
                </documentation>
            </annotation>
        </xsd:attribute>
        <xsd:attribute name="local-receiver-pass-by-value" type="xsd:boolean" use="optional" default="true">
            <annotation xmlns="http://www.w3.org/2001/XMLSchema">
                <documentation>
                    Set to false if the local receiver that's available in the EJB client context, should use
                    pass-by-reference (instead of pass-by-value) semantics for the EJB invocations.
                </documentation>
            </annotation>
        </xsd:attribute>
    </xsd:complexType>


    <xsd:complexType name="remoting-ejb-receiverType">
        <xsd:attribute name="outbound-connection-ref" type="xsd:string" use="required">
            <annotation xmlns="http://www.w3.org/2001/XMLSchema">
                <documentation>
                    Reference to an outbound connection configured in the remoting subsytem
                </documentation>
            </annotation>
        </xsd:attribute>
    </xsd:complexType>

</xsd:schema>

