<!-- | |
~ 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. | |
--> | |
<ipojo | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd | |
org.apache.felix.composite http://felix.apache.org/ipojo/schemas/SNAPSHOT/composite.xsd" | |
xmlns="org.apache.felix.ipojo" | |
xmlns:comp="org.apache.felix.ipojo.composite" | |
xmlns:cs="org.apache.felix.ipojo.test.composite.handler.CheckServiceHandler"> | |
<comp:composite name="composite.bar.1" architecture="true"> | |
<subservice action="instantiate" specification="org.apache.felix.ipojo.runtime.core.services.BarService"/> | |
</comp:composite> | |
<comp:composite name="composite.bar.2" architecture="true"> | |
<subservice action="instantiate" specification="org.apache.felix.ipojo.runtime.core.services.BarService" aggregate="true"/> | |
</comp:composite> | |
<comp:composite name="composite.bar.3" architecture="true"> | |
<subservice action="instantiate" specification="org.apache.felix.ipojo.runtime.core.services.BarService" optional="true"/> | |
</comp:composite> | |
<comp:composite name="composite.bar.4" architecture="true"> | |
<subservice action="instantiate" specification="org.apache.felix.ipojo.runtime.core.services.FooService" aggregate="true" optional="true"/> | |
</comp:composite> | |
<comp:composite name="composite.bar.5-accept" architecture="true"> | |
<subservice action="instantiate" specification="org.apache.felix.ipojo.runtime.core.services.FooService"> | |
<property name="boolean" value="true"/> | |
<property name="string" value="foo"/> | |
<property name="strAprop" value="{foo, bar, baz}"/> | |
<property name="int" value="5"/> | |
</subservice> | |
</comp:composite> | |
<comp:composite name="composite.bar.5-refuse1" architecture="true"> | |
<subservice action="instantiate" specification="org.apache.felix.ipojo.runtime.core.services.BarService"> | |
<property name="foo" value="bar"/> | |
<property name="boolean" value="true"/> | |
<property name="string" value="foo"/> | |
<property name="strAprop" value="{foo, bar, baz}"/> | |
<property name="int" value="5"/> | |
</subservice> | |
</comp:composite> | |
<comp:composite name="composite.bar.5-refuse2" architecture="true"> | |
<subservice action="instantiate" specification="org.apache.felix.ipojo.runtime.core.services.BarService"> | |
<property name="string" value="foo"/> | |
<property name="strAprop" value="{foo, bar, baz}"/> | |
</subservice> | |
</comp:composite> | |
<!-- Instance of a specified component --> | |
<comp:composite name="composite.inst.1" architecture="true"> | |
<instance component="COMPO-FooProviderType-1" /> <!-- name="FooProv" --> | |
<instance component="COMPO-FooProviderType-Dyn2"> | |
<property name="boolean" value="true"/> | |
<property name="string" value="foo"/> | |
<property name="strAProp" value="{a,b,c}"/> | |
</instance> | |
</comp:composite> | |
<!-- Scope test --> | |
<component name="SCOPE-provider" classname="org.apache.felix.ipojo.runtime.core.components.ServiceProvider"> | |
<provides/> | |
</component> | |
<component name="SCOPE-cons" classname="org.apache.felix.ipojo.runtime.core.components.ServiceConsumer"> | |
<provides/> | |
<requires field="service"/> | |
</component> | |
<comp:composite name="SCOPE-scope"> | |
<instance component="SCOPE-provider"/> | |
<instance component="SCOPE-cons"/> | |
</comp:composite> | |
<comp:composite name="SCOPE-badscope"> | |
<instance component="SCOPE-cons"/> | |
</comp:composite> | |
<!-- Instance configuration --> | |
<comp:composite name="CONF-MySuperComposite"> | |
<instance component="COMPO-FooProviderType-2"> | |
<property name="int" value="3"/> | |
</instance> | |
<subservice action="instantiate" | |
specification="org.apache.felix.ipojo.runtime.core.services.FooService"> | |
<property name="boolean" value="true"/> | |
<property name="string" value="foo"/> | |
<property name="strAprop" value="{foo, bar, baz}"/> | |
<property name="int" value="3"/> | |
</subservice> | |
</comp:composite> | |
</ipojo> |