blob: 905275d756d7994b371b381936002fa6fdfe07cb [file] [log] [blame]
<?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.1.0">
<!-- component ignores configuration -->
<scr:component name="SimpleComponent.configuration.ignore"
enabled="false"
configuration-policy="ignore">
<implementation class="org.apache.felix.scr.integration.components.SimpleComponent" />
<property name="service.pid" value="SimpleComponent.configuration.ignore" />
</scr:component>
<!-- component takes configuration as available -->
<scr:component name="SimpleComponent.configuration.optional"
enabled="false"
configuration-policy="optional" >
<implementation class="org.apache.felix.scr.integration.components.SimpleComponent" />
<property name="service.pid" value="SimpleComponent.configuration.optional" />
</scr:component>
<!-- component requires configuration -->
<scr:component name="SimpleComponent.configuration.require"
enabled="false"
configuration-policy="require" >
<implementation class="org.apache.felix.scr.integration.components.SimpleComponent" />
<property name="service.pid" value="SimpleComponent.configuration.require" />
</scr:component>
<!-- component dynamically updates configuration -->
<scr:component name="DynamicConfigurationComponent"
enabled="false" modified="configure">
<implementation class="org.apache.felix.scr.integration.components.SimpleComponent" />
<property name="service.pid" value="DynamicConfigurationComponent" />
</scr:component>
<!-- component dynamically updates configuration with a required reference plus target-->
<scr:component name="DynamicConfigurationComponentWithRequiredReference"
enabled="false" modified="configure">
<implementation class="org.apache.felix.scr.integration.components.SimpleComponent" />
<property name="service.pid" value="DynamicConfigurationComponentWithRequiredReference" />
<reference
name="ref"
interface="org.apache.felix.scr.integration.components.SimpleService"
cardinality="1..1"
policy="dynamic"
bind="setSimpleService"
unbind="unsetSimpleService"
target="(filterprop=__nothing__)"
/>
</scr:component>
<scr:component name="DynamicConfigurationComponentWithOptionalReference"
enabled="false" modified="configure" immediate="true">
<implementation class="org.apache.felix.scr.integration.components.SimpleComponent" />
<property name="service.pid" value="DynamicConfigurationComponentWithRequiredReference" />
<reference
name="ref"
interface="org.apache.felix.scr.integration.components.SimpleService"
cardinality="0..1"
policy="dynamic"
bind="setSimpleService"
unbind="unsetSimpleService"
target="(filterprop=__nothing__)"
/>
</scr:component>
<!-- component instances created by factory configuration -->
<scr:component name="FactoryConfigurationComponent"
enabled="false"
configuration-policy="require" >
<implementation class="org.apache.felix.scr.integration.components.SimpleComponent" />
<property name="service.pid" value="FactoryConfigurationComponent" />
</scr:component>
<!-- component instances created by factory configuration -->
<scr:component name="FactoryConfigurationComponent_enabled"
enabled="true"
configuration-policy="require" >
<implementation class="org.apache.felix.scr.integration.components.SimpleComponent" />
<property name="service.pid" value="FactoryConfigurationComponent" />
</scr:component>
<!-- component is a simple service to verify non-use of private props -->
<scr:component name="ServiceComponent"
enabled="false" immediate="true"
configuration-policy="ignore" >
<implementation class="org.apache.felix.scr.integration.components.SimpleComponent" />
<property name="service.pid" value="ServiceComponent" />
<property name="prop.public" value="required" />
<property name=".prop.private" value="private" />
<service>
<provide interface="java.lang.Object" />
</service>
</scr:component>
<!-- component is a simple service to verify deactivation when not being used any longer -->
<scr:component name="DelayedServiceComponent"
enabled="false" immediate="false"
configuration-policy="ignore" >
<implementation class="org.apache.felix.scr.integration.components.SimpleComponent" />
<property name="service.pid" value="ServiceComponent" />
<service>
<provide interface="java.lang.Object" />
</service>
</scr:component>
<!-- Component Factory Instances -->
<scr:component name="factory.component"
enabled="false"
factory="factory.component.factory" >
<implementation class="org.apache.felix.scr.integration.components.SimpleComponent" />
</scr:component>
<!-- Component Factory Instances, requiring configuration -->
<scr:component name="factory.component.configuration"
enabled="false"
configuration-policy="require"
factory="factory.component.factory.configuration" >
<implementation class="org.apache.felix.scr.integration.components.SimpleComponent" />
</scr:component>
<!-- Component Factory Instances, requiring configuration -->
<scr:component name="factory.component.reference"
enabled="false"
configuration-policy="ignore"
factory="factory.component.factory.reference" >
<implementation class="org.apache.felix.scr.integration.components.SimpleComponent" />
<reference
name="ref"
interface="org.apache.felix.scr.integration.components.SimpleService"
cardinality="1..n"
policy="static"
bind="bindSimpleService"
unbind="unbindSimpleService"
target="(filterprop=required)"
/>
</scr:component>
<!-- Component Factory Instances, instance is referred to by another component -->
<scr:component name="factory.component.referred"
enabled="false"
factory="factory.component.factory.referred" >
<implementation class="org.apache.felix.scr.integration.components.SimpleServiceImpl" />
<service>
<provide interface="org.apache.felix.scr.integration.components.SimpleService" />
</service>
</scr:component>
<!-- component has a reference to service created by the factory.component.referred factory component-->
<scr:component name="ComponentReferringToFactoryObject"
enabled="false"
immediate="true">
<implementation class="org.apache.felix.scr.integration.components.SimpleComponent" />
<property name="service.pid" value="ComponentReferringToFactoryObject" />
<reference
name="ref"
interface="org.apache.felix.scr.integration.components.SimpleService"
cardinality="1..1"
policy="dynamic"
bind="bindSimpleService"
unbind="unbindSimpleService"
target="(service.pid=myFactoryInstance)"
/>
</scr:component>
</components>