<?xml version="1.0"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!DOCTYPE role-list [
<!ELEMENT role-list (role+)>
<!ATTLIST role-list cocoon-version CDATA #REQUIRED>
<!ELEMENT role (hint*)>
<!ELEMENT hint EMPTY>
<!ATTLIST role name CDATA #REQUIRED
               shorthand CDATA #REQUIRED
               default-class CDATA #IMPLIED
>
<!ATTLIST hint shorthand CDATA #REQUIRED
               class CDATA #REQUIRED
>
]>

<!-- Defininition of component roles. The "cocoon-version" attribute is used by some xroles patch
     files that depend on the actual Cocoon version -->
<role-list cocoon-version="2.1">

  <role name="org.apache.excalibur.source.SourceFactorySelector"
        shorthand="source-factories"
        default-class="org.apache.cocoon.components.ExtendedComponentSelector">
  </role>

  <role name="org.apache.excalibur.source.SourceResolver"
        shorthand="source-resolver"
        default-class="org.apache.excalibur.source.impl.SourceResolverImpl"/>

  <!-- The entity resolver used by most parsers -->
  <role name="org.apache.excalibur.xml.EntityResolver"
        shorthand="entity-resolver"
        default-class="org.apache.cocoon.components.resolver.DefaultResolver"/>

  <!-- Parser:

       Starting with Cocoon 2.1 we have a bunch of different parser:
       - a SAX parser (producing SAX events)
       - a DOM parser (producing a document)
       - an HTML parser (producing SAX events from an HTML document)
       ...
  -->

  <!-- This is the usual SAX parser -->
  <role name="org.apache.excalibur.xml.sax.SAXParser"
        shorthand="xml-parser"
        default-class="org.apache.excalibur.xml.impl.JaxpParser"/>

  <!-- This is the usual DOM parser -->
  <role name="org.apache.excalibur.xml.dom.DOMParser"
        shorthand="dom-parser"
        default-class="org.apache.excalibur.xml.impl.JaxpParser"/>

  <!-- A Dom Serializer -->
  <role default-class="org.apache.excalibur.xml.dom.DefaultDOMSerializer" name="org.apache.excalibur.xml.dom.DOMSerializer" shorthand="dom-serializer"/>

  <!-- XSLT: -->
  <role name="org.apache.excalibur.xml.xslt.XSLTProcessor"
        shorthand="xslt-processor"
        default-class="org.apache.cocoon.components.xslt.TraxProcessor"/>

  <role name="org.apache.excalibur.xml.xpath.XPathProcessor"
        shorthand="xpath-processor"
        default-class="org.apache.excalibur.xml.xpath.XPathProcessorImpl"/>

  <!-- Stores: -->
  <role name="org.apache.excalibur.store.Store"
       shorthand="store"
       default-class="org.apache.cocoon.components.store.impl.EHDefaultStore"/>

  <role name="org.apache.excalibur.store.Store/TransientStore"
        shorthand="transient-store"
        default-class="org.apache.cocoon.components.store.impl.DefaultTransientStore"/>

  <role name="org.apache.excalibur.store.Store/XPathXMLFileTransientStore"
        shorthand="xmlfile-store"
        default-class="org.apache.cocoon.components.store.impl.DefaultTransientStore"/>

<!--
  The persistent store is only an auxiliary store that shouldn't be
  used by Cocoon users. It should only be used - if required - by
  the Store. If we use JCS, we don't need a persistent store.
  <role name="org.apache.excalibur.store.Store/PersistentStore"
        shorthand="persistent-store"
        default-class="org.apache.cocoon.components.store.impl.DefaultPersistentStore"/>
-->
  <!-- Normally uses the org.apache.excalibur.store.impl.StoreJanitorImpl as
       the default-class but as that uses its own Thread spawning there is
       the org.apache.cocoon.components.store.impl.CocoonStoreJanitor class
       to use a daemon thread from the org.apache.cocoon.components.thread.RunnableManager
       component
       NOT: As soon as our patch has been accepted by the Excalibur community and an
            excalibur-store has been release we can switch back to the original
            org.apache.excalibur.store.impl.StoreJanitorImpl class
  -->
  <role name="org.apache.excalibur.store.StoreJanitor"
       shorthand="store-janitor"
       default-class="org.apache.cocoon.components.store.impl.CocoonStoreJanitor"/>

  <!--=========================================================================
       Sitemap engine
      =========================================================================-->

  <!-- the sitemap engine -->
  <role name="org.apache.cocoon.Processor"
        shorthand="sitemap"
        default-class="org.apache.cocoon.components.treeprocessor.TreeProcessor"/>

  <role name="org.apache.cocoon.components.classloader.ClassLoaderManager"
        shorthand="classloader"
        default-class="org.apache.cocoon.components.classloader.ClassLoaderManagerImpl"/>

  <role name="org.apache.cocoon.components.image.ImageEncoderSelector"
        shorthand="image-encoder"/>

  <role name="org.apache.avalon.excalibur.datasource.DataSourceComponentSelector"
        shorthand="datasources"
        default-class="org.apache.cocoon.components.ExtendedComponentSelector">
	  <hint shorthand="jdbc" class="org.apache.avalon.excalibur.datasource.ResourceLimitingJdbcDataSource"/>
    <hint shorthand="j2ee" class="org.apache.avalon.excalibur.datasource.J2eeDataSource"/>
    <hint shorthand="informix" class="org.apache.avalon.excalibur.datasource.InformixDataSource"/>
  </role>

  <role name="org.apache.excalibur.xmlizer.XMLizer"
        shorthand="xmlizer"
        default-class="org.apache.excalibur.xmlizer.DefaultXMLizer"/>

  <role name="org.apache.cocoon.components.sax.XMLSerializer"
        shorthand="xml-serializer"
        default-class="org.apache.cocoon.components.sax.XMLByteStreamCompiler"/>

  <role name="org.apache.cocoon.components.sax.XMLDeserializer"
        shorthand="xml-deserializer"
        default-class="org.apache.cocoon.components.sax.XMLByteStreamInterpreter"/>

  <role name="org.apache.cocoon.components.notification.NotifyingBuilder"
        shorthand="notifying-builder"
        default-class="org.apache.cocoon.components.notification.DefaultNotifyingBuilder"/>

  <role name="org.apache.cocoon.caching.Cache"
        shorthand="cache"
        default-class="org.apache.cocoon.caching.impl.CacheImpl"/>

  <!-- i18n components for resource bundle handling -->
  <role name="org.apache.cocoon.i18n.BundleFactory"
        shorthand="i18n-bundles"
        default-class="org.apache.cocoon.i18n.XMLResourceBundleFactory"/>

  <!-- Control flow layer: the interpreters selector and continuations  manager -->
  <role name="org.apache.cocoon.components.flow.Interpreter"
        shorthand="flow-interpreters"
        default-class="org.apache.cocoon.components.ExtendedComponentSelector" />

  <role name="org.apache.cocoon.components.flow.ContinuationsManager"
        shorthand="continuations-manager"
        default-class="org.apache.cocoon.components.flow.ContinuationsManagerImpl" />

  <!-- input/output modules -->
  <role name="org.apache.cocoon.components.modules.input.InputModuleSelector"
        shorthand="input-modules"
        default-class="org.apache.cocoon.components.ExtendedComponentSelector"/>

  <role name="org.apache.cocoon.components.modules.output.OutputModuleSelector"
        shorthand="output-modules"
        default-class="org.apache.cocoon.components.ExtendedComponentSelector"/>

  <role name="org.apache.cocoon.components.modules.input.SitemapVariableHolder"
        shorthand="global-variables"
        default-class="org.apache.cocoon.components.modules.input.SitemapVariableHolder"/>

  <!-- Storing data in the current request -->
  <role name="org.apache.cocoon.components.persistence.RequestDataStore"
        shorthand="request-data-store"
        default-class="org.apache.cocoon.components.persistence.RequestDataStoreImpl"/>

  <!-- Running commands (Runnable) in background -->
  <role name="org.apache.cocoon.components.thread.RunnableManager"
        shorthand="runnable-manager"
        default-class="org.apache.cocoon.components.thread.DefaultRunnableManager"/>

</role-list>
