<?xml version="1.0" encoding="UTF-8"?>
<!--
    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.
-->
<components xmlns:scr="http://www.osgi.org/xmlns/scr/v1.2.0">

    <!-- 
        Components used for the ComponentActivationTest integration test.
        This tests components with and without activate/deactivate method
        configured and with and without activate/deactivate methods present
    -->
    
    <!-- no declaration of activate/deactivate methods -->
    <scr:component name="ActivatorComponent.no.decl"
        enabled="false">
        <implementation class="org.apache.felix.scr.integration.components.ActivatorComponent" />
    </scr:component>

    <!-- wrong declaration of activate method -->
    <scr:component name="ActivatorComponent.activate.missing"
        enabled="false"
        activate="nonExistingActivate">
        <implementation class="org.apache.felix.scr.integration.components.ActivatorComponent" />
    </scr:component>

    <!-- wrong declaration of deactivate method -->
    <scr:component name="ActivatorComponent.deactivate.missing"
        enabled="false"
        deactivate="nonExistingDeactivate">
        <implementation class="org.apache.felix.scr.integration.components.ActivatorComponent" />
    </scr:component>

    <!-- correct declaration of activate and deactivate method -->
    <scr:component name="ActivatorComponent.decl"
        enabled="false"
        activate="myActivate"
        deactivate="myDeactivate">
        <implementation class="org.apache.felix.scr.integration.components.ActivatorComponent" />
    </scr:component>

    <!-- correct declaration of activate and deactivate method, activate failure -->
    <scr:component name="ActivatorComponent.activate.fail"
        enabled="false"
        activate="myActivate"
        deactivate="myDeactivate">
        <implementation class="org.apache.felix.scr.integration.components.ActivatorComponent" />
        <property name="failActivate" value="true" />
    </scr:component>

    <!-- correct declaration of activate and deactivate method, deactivate failure -->
    <scr:component name="ActivatorComponent.deactivate.fail"
        enabled="false"
        activate="myActivate"
        deactivate="myDeactivate">
        <implementation class="org.apache.felix.scr.integration.components.ActivatorComponent" />
        <property name="failDeactivate" value="true" />
    </scr:component>

    <!-- bind service during activate -->
    <scr:component name="ActivatorComponent.activate.with.bind"
        enabled="false"
        activate="myActivate"
        deactivate="myDeactivate">
        <implementation class="org.apache.felix.scr.integration.components.ActivatorComponent" />
        <property name="registerService" value="true" />
        <reference
            name="service"
            interface="org.apache.felix.scr.integration.components.SimpleService"
            bind="bindSimpleService"
            unbind="unbindSimpleService"
            policy="dynamic"
            cardinality="0..n"
        />
    </scr:component>

    <!-- bind service during activate -->
    <scr:component name="ActivatorComponent.activate.delayed.with.bind"
        enabled="false"
        activate="myActivate"
        deactivate="myDeactivate">
        <implementation class="org.apache.felix.scr.integration.components.ActivatorComponent" />
        <service factory="false">
            <provide interface="org.apache.felix.scr.integration.components.ActivatorComponent"/>
        </service>
        <property name="registerService" value="true" />
        <reference
            name="service"
            interface="org.apache.felix.scr.integration.components.SimpleService"
            bind="bindSimpleService"
            unbind="unbindSimpleService"
            policy="dynamic"
            cardinality="0..n"
        />
    </scr:component>

    <!-- bind service during activate -->
    <scr:component name="ActivatorComponent.activate.service.factory.with.bind"
        enabled="false"
        activate="myActivate"
        deactivate="myDeactivate">
        <implementation class="org.apache.felix.scr.integration.components.ActivatorComponent" />
        <service factory="true">
            <provide interface="org.apache.felix.scr.integration.components.ActivatorComponent"/>
        </service>
        <property name="registerService" value="true" />
        <reference
            name="service"
            interface="org.apache.felix.scr.integration.components.SimpleService"
            bind="bindSimpleService"
            unbind="unbindSimpleService"
            policy="dynamic"
            cardinality="0..n"
        />
    </scr:component>

    <!-- 11 static dependency -->
    <scr:component name="ActivatorComponent.bind.single.static"
        enabled="false"
        activate="myActivate"
        deactivate="myDeactivate">
        <implementation class="org.apache.felix.scr.integration.components.ActivatorComponent" />
        <service factory="false">
            <provide interface="org.apache.felix.scr.integration.components.ActivatorComponent"/>
        </service>
        <property name="registerService" value="true" />
        <reference
            name="service"
            interface="org.apache.felix.scr.integration.components.SimpleService"
            bind="bindSimpleService"
            unbind="unbindSimpleService"
            policy="static"
            cardinality="1..1"
        />
    </scr:component>

    <!-- 1n static dependency -->
    <scr:component name="ActivatorComponent.bind.multiple.static.reluctant"
        enabled="false"
        activate="myActivate"
        deactivate="myDeactivate">
        <implementation class="org.apache.felix.scr.integration.components.ActivatorComponent" />
        <service factory="false">
            <provide interface="org.apache.felix.scr.integration.components.ActivatorComponent"/>
        </service>
        <property name="registerService" value="true" />
        <reference
            name="service"
            interface="org.apache.felix.scr.integration.components.SimpleService"
            bind="bindSimpleService"
            unbind="unbindSimpleService"
            policy="static"
            cardinality="1..n"
        />
    </scr:component>

    <!-- 1n static greedy dependency -->
    <scr:component name="ActivatorComponent.bind.multiple.static.greedy"
        enabled="false"
        activate="myActivate"
        deactivate="myDeactivate">
        <implementation class="org.apache.felix.scr.integration.components.ActivatorComponent" />
        <service factory="false">
            <provide interface="org.apache.felix.scr.integration.components.ActivatorComponent"/>
        </service>
        <property name="registerService" value="true" />
        <reference
            name="service"
            interface="org.apache.felix.scr.integration.components.SimpleService"
            bind="bindSimpleService"
            unbind="unbindSimpleService"
            policy="static"
            policy-option="greedy"
            cardinality="1..n"
        />
    </scr:component>

    <!-- 11 dynamic dependency -->
    <scr:component name="ActivatorComponent.bind.single.dynamic"
        enabled="false"
        activate="myActivate"
        deactivate="myDeactivate">
        <implementation class="org.apache.felix.scr.integration.components.ActivatorComponent" />
        <service factory="false">
            <provide interface="org.apache.felix.scr.integration.components.ActivatorComponent"/>
        </service>
        <property name="registerService" value="true" />
        <reference
            name="service"
            interface="org.apache.felix.scr.integration.components.SimpleService"
            bind="bindSimpleService"
            unbind="unbindSimpleService"
            policy="dynamic"
            cardinality="1..1"
        />
    </scr:component>

    <!-- 1n dynamic dependency -->
    <scr:component name="ActivatorComponent.bind.multiple.dynamic"
        enabled="false"
        activate="myActivate"
        deactivate="myDeactivate">
        <implementation class="org.apache.felix.scr.integration.components.ActivatorComponent" />
        <service factory="false">
            <provide interface="org.apache.felix.scr.integration.components.ActivatorComponent"/>
        </service>
        <property name="registerService" value="true" />
        <reference
            name="service"
            interface="org.apache.felix.scr.integration.components.SimpleService"
            bind="bindSimpleService"
            unbind="unbindSimpleService"
            policy="dynamic"
            cardinality="1..n"
        />
    </scr:component>


</components>
