<?xml version="1.0" encoding="UTF-8"?>
<!--
// File name   :
// Description : schema definition for cluster daemon
//
// Author : eyindanga(Add configuration for JGroups-based discovery.)
// Version:
// Date:
//
-->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
           targetNamespace="http://www.objectweb.org/jonas/ns"
           xmlns="http://www.w3.org/2001/XMLSchema"
           xmlns:jonas="http://www.objectweb.org/jonas/ns"
           elementFormDefault="qualified"
           attributeFormDefault="unqualified"
           version="5.0">

  <xsd:annotation>
    <xsd:documentation>
      @(#)jonas-clusterd_5_0.xsd  08/07/05
    </xsd:documentation>
  </xsd:annotation>
  <xsd:annotation>
    <xsd:documentation>
      <![CDATA[
      JOnAS: Java(TM) Open Application Server
      Copyright (C) 2004-2009 Bull S.A.S
      Contact: jonas-team@ow2.org

      This library 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 any later version.

      This library 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 library; if not, write to the Free Software
      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
      USA

      Initial Author : Philippe Durieux
      ]]>
   </xsd:documentation>
  </xsd:annotation>
  <xsd:annotation>
    <xsd:documentation>
      <![CDATA[
     This is XML Schema for jonas cluster daemon.
     All JOnAS cluster-daemon deployment descriptors must indicate
     the cluster-daemon schema by using the Jonas namespace:
         http://www.objectweb.org/jonas/ns
     and by indicating the version of the schema by
     using the version element as shown below:
         <cluster-daemon xmlns="http://www.objectweb.org/jonas/ns"
                            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                            xsi:schemaLocation="http://www.objectweb.org/jonas/ns
                         http://jonas.ow2.org/ns/jonas-clusterd_5_0.xsd">
         ...
         </cluster-daemon>
     The instance documents may indicate the published version of
     the schema using the xsi:schemaLocation attribute for the
     JOnAS namespace with the following location:
         http://jonas.ow2.org/ns/jonas-clusterd_5_0.xsd
      ]]>
    </xsd:documentation>
  </xsd:annotation>
<!-- ======================================================================= -->
<!--                        Interaction description                               -->
<!-- ======================================================================= -->
  <xsd:simpleType name="InteractionType">
    <xsd:annotation>
      <xsd:documentation>

  The InteractionType specifies how the cluster daemon must
  manage the JVM childs of JOnAS

  The value must be one of the following:

      tighly-coupled
      loosely-coupled

      </xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="tighly-coupled"/>
      <xsd:enumeration value="loosely-coupled"/>
    </xsd:restriction>
  </xsd:simpleType>
<!-- ======================================================================= -->
<!--                        Discovery description                               -->
<!-- ======================================================================= -->

  <xsd:complexType name="DiscoveryType">
    <xsd:annotation>
      <xsd:documentation>Configure JGroups discovery</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="group-name" type="xsd:string"/>
      <xsd:element name="stack-file" type="xsd:string"/>
      <xsd:element name="start-up" type="xsd:boolean"/>
    </xsd:sequence>
  </xsd:complexType>

<!-- ======================================================================= -->
<!--                        Server description                               -->
<!-- ======================================================================= -->

  <xsd:complexType name="ServerType">
    <xsd:annotation>
      <xsd:documentation>Description of a JOnAS instance</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="name" type="xsd:string"/>
      <!-- Description [optional] -->
      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
      <xsd:element name="java-home" type="xsd:string"/>
      <xsd:element name="jonas-root" type="xsd:string"/>
      <xsd:element name="jonas-base" type="xsd:string"/>
      <xsd:element name="xprm" type="xsd:string"/>
      <xsd:element name="auto-boot" type="xsd:boolean"/>
      <!-- jonasCommand [optional] -->
      <xsd:element name="jonas-cmd" type="xsd:string" minOccurs="0"/>
    </xsd:sequence>
  </xsd:complexType>


<!-- ======================================================================= -->
<!--                        Cluster daemon description                           -->
<!-- ======================================================================= -->
  <xsd:complexType name="ClusterDaemonType">
    <xsd:annotation>
      <xsd:documentation>
          The cluster daemon xml file describes the configuration of the local JOnAS instances
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="name" type="xsd:string" minOccurs="1" maxOccurs="1"/>
      <xsd:element name="domain-name" type="xsd:string" minOccurs="0" maxOccurs="1"/>
      <xsd:element name="jonas-interaction-mode" type="jonas:InteractionType" minOccurs="1" maxOccurs="1"/>

      <!-- The following 5 elements are the same as their homonymes
           starting with jonas.service in the jonas.properties file -->
      <xsd:element name="jmx.secured" type="xsd:boolean" minOccurs="0" maxOccurs="1"/>
      <xsd:element name="jmx.authentication.method" type="xsd:string" minOccurs="0" maxOccurs="1"/>
      <xsd:element name="jmx.authentication.parameter" type="xsd:string" minOccurs="0" maxOccurs="1"/>
      <xsd:element name="jmx.authorization.method" type="xsd:string" minOccurs="0" maxOccurs="1"/>
      <xsd:element name="jmx.authorization.parameter" type="xsd:string" minOccurs="0" maxOccurs="1"/>

      <!-- Configuration for JGroups-based discovery -->
      <xsd:element name="discovery" type="jonas:DiscoveryType" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>Configuration for JGroups-based discovery</xsd:documentation>
        </xsd:annotation>
      </xsd:element>

      <!-- A cluster daemon configuration is an ordered list of items. -->
      <xsd:element name="server" type="jonas:ServerType"
        minOccurs="0" maxOccurs="unbounded">
        <xsd:annotation>
          <xsd:documentation>JOnAS instance</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>

<!-- ======================================================================= -->
<!--                        Root node 'cluster-daemon'                            -->
<!-- ======================================================================= -->

  <xsd:element name="cluster-daemon" type="jonas:ClusterDaemonType"/>

</xsd:schema>
