<?xml version="1.0" encoding="UTF-8"?>
<!--
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - JOnAS: Java(TM) Open Application Server
  - Copyright (C) 2007-2010 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
  -
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - $Id$
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-->
<ipojo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns="org.apache.felix.ipojo"
       xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/1.6.0/core.xsd" >

  <component classname="org.ow2.jonas.web.tomcat6.Tomcat6Service"
             immediate="false">

    <provides specifications="org.ow2.jonas.web.JWebContainerService" />

    <!-- Required dependencies -->
    <!-- "Inherited" from AbsService -->
    <requires optional="false"
              specification="org.ow2.jonas.properties.ServerProperties">
      <callback type="bind" method="setServerProperties" />
    </requires>
    <!-- "Inherited" from BaseWebContainerService -->
    <requires optional="false"
              specification="org.ow2.jonas.jmx.JmxService">
      <callback type="bind" method="setJmxService" />
    </requires>
    <requires optional="false"
              specification="org.ow2.util.ee.metadata.war.api.IWarDeployableMetadataFactory">
      <callback type="bind" method="setWarDeployableMetadataFactory" />
    </requires>
    <requires optional="false"
              specification="org.ow2.jonas.naming.JNamingManager">
      <callback type="bind" method="setNaming" />
    </requires>
    <requires optional="false"
              specification="org.ow2.jonas.naming.JComponentContextFactory">
      <callback type="bind" method="setContextFactory" />
    </requires>
    <requires optional="false"
              specification="org.ow2.util.ee.deploy.api.deployer.IDeployerManager">
      <callback type="bind" method="setDeployerManager" />
    </requires>

    <!-- from Tomcat6Service -->
    <requires optional="false"
              specification="org.ow2.jonas.security.SecurityService">
      <callback type="bind" method="setSecurityService" />
    </requires>

    <requires optional="false"
              specification="org.ow2.jonas.jndi.checker.api.IResourceCheckerManager">
      <callback type="bind" method="setResourceCheckerManager" />
      <callback type="unbind" method="unsetResourceCheckerManager" />
    </requires>      

    <!-- Optional dependencies -->
    <requires optional="true"
              specification="org.ow2.jonas.ws.jaxrpc.IJAXRPCService">
      <callback type="bind" method="setJAXRPCService" />
      <!-- TODO we should have an unbind here -->
    </requires>
    <requires optional="true"
              specification="org.ow2.jonas.versioning.VersioningService">
      <callback type="bind" method="setVersioningService" />
      <callback type="unbind" method="unsetVersioningService" />
    </requires>
 
    <requires optional="true"
              specification="org.ow2.jonas.audit.AuditService">
      <callback type="bind" method="setAuditService" />
      <callback type="unbind" method="unsetAuditService" />
    </requires>
    <requires optional="true"
              specification="org.ow2.jonas.workcleaner.WorkCleanerService">
      <callback type="bind" method="setWorkCleanerService" />
    </requires>
    <requires optional="true"
              specification="org.ow2.jonas.ws.jaxws.IJAXWSService">
      <callback type="bind" method="bindJaxwsService" />
      <callback type="unbind" method="unbindJaxwsService" />
    </requires>
    <requires optional="true"
                specification="org.ow2.jonas.tm.TransactionService">
      <callback type="bind" method="setTransactionService" />
    </requires>
    <requires optional="true"
              specification="org.ow2.jonas.ejb3.IEasyBeansService">
      <callback type="bind" method="setEjb3Service" />
      <callback type="unbind" method="unsetEjb3Service" />
    </requires>

    <requires optional="true"
              specification="org.ow2.jonas.web.tomcat6.custom.ContextCustomizer"
              aggregate="true">
      <callback type="bind" method="addContextCustomizer" />
      <callback type="unbind" method="removeContextCustomizer" />
    </requires>

    <!-- LifeCycle Callbacks -->
    <callback transition="validate" method="start" />
    <callback transition="invalidate" method="stop" />

    <properties propagation="true">
      <property name="parsingwithvalidation"
                method="setParsingwithvalidation"
                type="boolean" />
        <property name="ondemand.enabled"
                  method="setOnDemandFeature"
                  type="boolean" />
        <property name="ondemand.redirectPort"
                  method="setOnDemandRedirectPort"
                  type="int" />
    </properties>
  </component>

  <!-- ============================================================= -->
  <!--        'jndi' URL scheme supporting component                 -->
  <!-- ============================================================= -->
  <component classname="org.ow2.jonas.web.tomcat6.handler.DirContextURLStreamHandlerService"
             immediate="true">

    <provides>
      <property name="url.handler.protocol"
                value="jndi"
                type="java.lang.String" />
    </provides>
  </component>

  <instance component="org.ow2.jonas.web.tomcat6.handler.DirContextURLStreamHandlerService"
            name="DirContextStreamHandler" />

</ipojo>