Fix issue FELIX-1906
Provide a 'modified' callback when an injected service is modified.
This commit:
modify the dependency model to support such callback
update the handlers
extends the api
provides the annotation
modify the XSD schema
Add tests
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@885210 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/tests/core/annotations/pom.xml b/ipojo/tests/core/annotations/pom.xml
index d1a05d4..1a1b0e1 100644
--- a/ipojo/tests/core/annotations/pom.xml
+++ b/ipojo/tests/core/annotations/pom.xml
@@ -1,111 +1,111 @@
<!--
- 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
+ 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
+ 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.
+ 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.
-->
<project>
- <modelVersion>4.0.0</modelVersion>
- <packaging>bundle</packaging>
- <name>iPOJO Annotations Test Suite</name>
- <artifactId>tests.core.annotations</artifactId>
- <groupId>ipojo.tests</groupId>
- <version>1.5.0-SNAPSHOT</version>
- <dependencies>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.ipojo</artifactId>
- <version>${pom.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.ipojo.metadata
- </artifactId>
- <version>${pom.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.osgi.core</artifactId>
- <version>1.0.1</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
- <version>1.1.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.ipojo.annotations</artifactId>
- <version>${pom.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.ipojo.handler.eventadmin</artifactId>
- <version>${pom.version}</version>
- </dependency>
- </dependencies>
+ <modelVersion>4.0.0</modelVersion>
+ <packaging>bundle</packaging>
+ <name>iPOJO Annotations Test Suite</name>
+ <artifactId>tests.core.annotations</artifactId>
+ <groupId>ipojo.tests</groupId>
+ <version>1.5.0-SNAPSHOT</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.ipojo</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.ipojo.metadata
+ </artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <version>1.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.ipojo.annotations</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.ipojo.handler.eventadmin</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <version>1.4.3</version>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Export-Package>
- org.apache.felix.ipojo.test.scenarios.annotations.service
- </Export-Package>
- <Bundle-SymbolicName>
- ${pom.artifactId}
- </Bundle-SymbolicName>
- <Private-Package>
- org.apache.felix.ipojo.test*
- </Private-Package>
- <Test-Suite>
- org.apache.felix.ipojo.test.scenarios.annotations.AnnotationsTestSuite
- </Test-Suite>
- </instructions>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-ipojo-plugin</artifactId>
- <version>${pom.version}</version>
- <executions>
- <execution>
- <goals>
- <goal>ipojo-bundle</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <version>1.4.3</version>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Export-Package>
+ org.apache.felix.ipojo.test.scenarios.annotations.service
+ </Export-Package>
+ <Bundle-SymbolicName>
+ ${pom.artifactId}
+ </Bundle-SymbolicName>
+ <Private-Package>
+ org.apache.felix.ipojo.test*
+ </Private-Package>
+ <Test-Suite>
+ org.apache.felix.ipojo.test.scenarios.annotations.AnnotationsTestSuite
+ </Test-Suite>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-ipojo-plugin</artifactId>
+ <version>${pom.version}</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>ipojo-bundle</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Dependency.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Dependency.java
index ddeea7d..f69e76d 100644
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Dependency.java
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Dependency.java
@@ -72,6 +72,17 @@
assertEquals("Check fs2 bind", "bindFS2Inv", bind);
assertEquals("Check fs2 unbind", "unbindFS2Inv", unbind);
assertEquals("Check fs2 id", "inv", id);
+
+ // Check mod
+ dep = getDependencyById(deps, "mod");
+ id = dep.getAttribute("id");
+ bind = getBind(dep);
+ unbind = getUnbind(dep);
+ String mod = getModified(dep);
+ assertEquals("Check mod bind", "bindMod", bind);
+ assertEquals("Check mod unbind", "unbindMod", unbind);
+ assertEquals("Check mod modified", "modifiedMod", mod);
+ assertEquals("Check mod id", "mod", id);
}
private Element getDependencyById(Element[] deps, String name) {
@@ -108,5 +119,15 @@
}
return null;
}
+
+ private String getModified(Element dep) {
+ Element[] elem = dep.getElements("callback");
+ for (int i = 0; elem != null && i < elem.length; i++) {
+ if (elem[i].getAttribute("type").equalsIgnoreCase("modified")) {
+ return elem[i].getAttribute("method");
+ }
+ }
+ return null;
+ }
}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Dependency.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Dependency.java
index 97b053f..906fa4f 100644
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Dependency.java
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Dependency.java
@@ -2,6 +2,7 @@
import org.apache.felix.ipojo.annotations.Bind;
import org.apache.felix.ipojo.annotations.Component;
+import org.apache.felix.ipojo.annotations.Modified;
import org.apache.felix.ipojo.annotations.Requires;
import org.apache.felix.ipojo.annotations.Unbind;
import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
@@ -59,6 +60,21 @@
}
+ @Bind(id="mod")
+ public void bindMod() {
+
+ }
+
+ @Unbind(id="mod")
+ public void unbindMod() {
+
+ }
+
+ @Modified(id="mod")
+ public void modifiedMod() {
+
+ }
+
}
diff --git a/ipojo/tests/core/service-dependency/pom.xml b/ipojo/tests/core/service-dependency/pom.xml
index ba4df5c..3b112f9 100644
--- a/ipojo/tests/core/service-dependency/pom.xml
+++ b/ipojo/tests/core/service-dependency/pom.xml
@@ -1,102 +1,122 @@
<!--
- 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
+ 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
+ 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.
+ 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.
-->
<project>
- <modelVersion>4.0.0</modelVersion>
- <packaging>bundle</packaging>
- <name>iPOJO Service Dependency Test Suite</name>
- <artifactId>tests.core.service.dependency</artifactId>
- <groupId>ipojo.tests</groupId>
- <version>1.5.0-SNAPSHOT</version>
- <dependencies>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.ipojo</artifactId>
- <version>${pom.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.ipojo.metadata</artifactId>
- <version>${pom.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.osgi.core</artifactId>
- <version>1.0.1</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
- <version>1.1.0-SNAPSHOT</version>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <version>1.4.3</version>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Export-Package>
- org.apache.felix.ipojo.test.scenarios.service.dependency.service
- </Export-Package>
- <Bundle-SymbolicName>
- ${pom.artifactId}
- </Bundle-SymbolicName>
- <Private-Package>
- org.apache.felix.ipojo.test*
- </Private-Package>
- <Test-Suite>
- org.apache.felix.ipojo.test.scenarios.service.dependency.DependencyTestSuite
- </Test-Suite>
- </instructions>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-ipojo-plugin</artifactId>
- <version>${pom.version}</version>
- <executions>
- <execution>
- <goals>
- <goal>ipojo-bundle</goal>
- </goals>
- <configuration>
- <ignoreAnnotations>true</ignoreAnnotations>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.4</source>
- <target>1.4</target>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <modelVersion>4.0.0</modelVersion>
+ <packaging>bundle</packaging>
+ <name>iPOJO Service Dependency Test Suite</name>
+ <artifactId>tests.core.service.dependency</artifactId>
+ <groupId>ipojo.tests</groupId>
+ <version>1.5.0-SNAPSHOT</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.ipojo</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.ipojo.metadata</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <version>1.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <version>1.4.3</version>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Export-Package>
+ org.apache.felix.ipojo.test.scenarios.service.dependency.service
+ </Export-Package>
+ <Bundle-SymbolicName>
+ ${pom.artifactId}
+ </Bundle-SymbolicName>
+ <Private-Package>
+ org.apache.felix.ipojo.test*
+ </Private-Package>
+ <Test-Suite>
+ org.apache.felix.ipojo.test.scenarios.service.dependency.DependencyTestSuite
+ </Test-Suite>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-ipojo-plugin</artifactId>
+ <version>${pom.version}</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>ipojo-bundle</goal>
+ </goals>
+ <configuration>
+ <ignoreAnnotations>true</ignoreAnnotations>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.4</source>
+ <target>1.4</target>
+ </configuration>
+ </plugin>
+
+ <!--
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-junit4osgi-plugin</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <configuration>
+ <org.osgi.http.port>8083</org.osgi.http.port>
+ </configuration>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ -->
+ </plugins>
+ </build>
</project>
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
index 54af644..0cbcafb 100644
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
+++ b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
@@ -28,74 +28,111 @@
public class CheckServiceProvider extends CheckProviderParentClass implements CheckService {
- FooService fs;
-
- int simpleB = 0;
- int objectB = 0;
- int refB = 0;
- int bothB = 0;
- int mapB = 0;
- int dictB = 0;
+ FooService fs;
+
+ int simpleB = 0;
+ int objectB = 0;
+ int refB = 0;
+ int bothB = 0;
+ int mapB = 0;
+ int dictB = 0;
+
+ int modified = 0;
- public boolean check() {
- return fs.foo();
- }
+ public boolean check() {
+ return fs.foo();
+ }
- public Properties getProps() {
- Properties props = new Properties();
- props.put("voidB", new Integer(simpleB));
- props.put("objectB", new Integer(objectB));
- props.put("refB", new Integer(refB));
- props.put("bothB", new Integer(bothB));
- props.put("voidU", new Integer(simpleU));
- props.put("objectU", new Integer(objectU));
- props.put("refU", new Integer(refU));
- props.put("bothU", new Integer(bothU));
- props.put("mapB", new Integer(mapB));
- props.put("dictB", new Integer(dictB));
- props.put("mapU", new Integer(mapU));
- props.put("dictU", new Integer(dictU));
- if (fs != null) {
- props.put("result", new Boolean(fs.foo()));
- props.put("boolean", new Boolean(fs.getBoolean()));
- props.put("int", new Integer(fs.getInt()));
- props.put("long", new Long(fs.getLong()));
- props.put("double", new Double(fs.getDouble()));
- if(fs.getObject() != null) { props.put("object", fs.getObject()); }
- }
+ public Properties getProps() {
+ Properties props = new Properties();
+ props.put("voidB", new Integer(simpleB));
+ props.put("objectB", new Integer(objectB));
+ props.put("refB", new Integer(refB));
+ props.put("bothB", new Integer(bothB));
+ props.put("voidU", new Integer(simpleU));
+ props.put("objectU", new Integer(objectU));
+ props.put("refU", new Integer(refU));
+ props.put("bothU", new Integer(bothU));
+ props.put("mapB", new Integer(mapB));
+ props.put("dictB", new Integer(dictB));
+ props.put("mapU", new Integer(mapU));
+ props.put("dictU", new Integer(dictU));
+ if (fs != null) {
+ props.put("result", new Boolean(fs.foo()));
+ props.put("boolean", new Boolean(fs.getBoolean()));
+ props.put("int", new Integer(fs.getInt()));
+ props.put("long", new Long(fs.getLong()));
+ props.put("double", new Double(fs.getDouble()));
+ if(fs.getObject() != null) { props.put("object", fs.getObject()); }
+ }
props.put("static", CheckService.foo);
props.put("class", CheckService.class.getName());
- return props;
- }
-
- private void voidBind() {
- simpleB++;
- }
-
- protected void objectBind(FooService o) {
- if (o == null) {
- System.err.println("Bind receive null !!! ");
- return;
- }
- if(o != null && o instanceof FooService) { objectB++; }
- }
-
- public void refBind(ServiceReference sr) {
- if(sr != null) { refB++; }
- }
-
+
+
+ // Add modified
+ props.put("modified", new Integer(modified));
+
+ return props;
+ }
+
+ private void voidBind() {
+ simpleB++;
+ }
+
+ public void voidModify() {
+ modified ++;
+ }
+
+ protected void objectBind(FooService o) {
+ if (o == null) {
+ System.err.println("Bind receive null !!! ");
+ return;
+ }
+ if(o != null && o instanceof FooService) { objectB++; }
+ }
+
+ protected void objectModify(FooService o) {
+ if (o == null) {
+ System.err.println("Bind receive null !!! [" + modified + "]");
+ return;
+ }
+ if(o != null && o instanceof FooService) { modified++; }
+ }
+
+ public void refBind(ServiceReference sr) {
+ if(sr != null) { refB++; }
+ }
+
+ public void refModify(ServiceReference sr) {
+ if(sr != null) { modified++; }
+ }
+
public void bothBind(FooService o, ServiceReference sr) {
- if(sr != null && o != null && o instanceof FooService) { bothB++; }
- }
+ if(sr != null && o != null && o instanceof FooService) { bothB++; }
+ }
+
+ public void bothModify(FooService o, ServiceReference sr) {
+ if(sr != null && o != null && o instanceof FooService) { modified++; }
+ }
protected void propertiesDictionaryBind(FooService o, Dictionary props) {
if(props != null && o != null && o instanceof FooService && props.size() > 0) { dictB++; }
fs = o;
}
+ protected void propertiesDictionaryModify(FooService o, Dictionary props) {
+ if(props != null && o != null && o instanceof FooService && props.size() > 0) { modified++; }
+ fs = o;
+ }
+
protected void propertiesMapBind(FooService o, Map props) {
if(props != null && o != null && o instanceof FooService && props.size() > 0) { mapB++; }
fs = o;
- }
+ }
+
+ protected void propertiesMapModify(FooService o, Map props) {
+ if(props != null && o != null && o instanceof FooService && props.size() > 0) { modified++; }
+ fs = o;
+ }
}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType2.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType2.java
new file mode 100644
index 0000000..d57a532
--- /dev/null
+++ b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType2.java
@@ -0,0 +1,68 @@
+/*
+ * 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.
+ */
+package org.apache.felix.ipojo.test.scenarios.component;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
+import org.osgi.framework.BundleContext;
+
+public class FooProviderType2 implements FooService {
+
+ private int m_bar; // Service property.
+ private String m_foo;
+
+ private BundleContext m_context;
+
+ private static int count = 0;
+
+
+ public boolean foo() {
+ // Update
+ if (m_foo.equals("foo")) {
+ m_foo = "bar";
+ } else {
+ m_foo = "foo";
+ }
+ return true;
+ }
+
+ public Properties fooProps() {
+ Properties p = new Properties();
+ p.put("bar", new Integer(m_bar));
+ if(m_foo != null) {
+ p.put("foo", m_foo);
+ }
+ p.put("context", m_context);
+
+ p.put("count", new Integer(count));
+ return p;
+ }
+
+ public boolean getBoolean() { return true; }
+
+ public double getDouble() { return 1.0; }
+
+ public int getInt() { return 1; }
+
+ public long getLong() { return 1; }
+
+ public Boolean getObject() { return new Boolean(true); }
+
+}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DependencyTestSuite.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DependencyTestSuite.java
index 668530a..fb6eb1c 100644
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DependencyTestSuite.java
+++ b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DependencyTestSuite.java
@@ -26,17 +26,17 @@
public class DependencyTestSuite {
- public static Test suite(BundleContext bc) {
- OSGiTestSuite ots = new OSGiTestSuite("Service Dependencies Test Suite", bc);
- ots.addTestSuite(SimpleDependencies.class);
- ots.addTestSuite(OptionalDependencies.class);
- ots.addTestSuite(OptionalNoNullableDependencies.class);
- ots.addTestSuite(MultipleDependencies.class);
- ots.addTestSuite(OptionalMultipleDependencies.class);
- ots.addTestSuite(DelayedSimpleDependencies.class);
- ots.addTestSuite(DelayedOptionalDependencies.class);
- ots.addTestSuite(DelayedMultipleDependencies.class);
- ots.addTestSuite(DelayedOptionalMultipleDependencies.class);
+ public static Test suite(BundleContext bc) {
+ OSGiTestSuite ots = new OSGiTestSuite("Service Dependencies Test Suite", bc);
+ ots.addTestSuite(SimpleDependencies.class);
+ ots.addTestSuite(OptionalDependencies.class);
+ ots.addTestSuite(OptionalNoNullableDependencies.class);
+ ots.addTestSuite(MultipleDependencies.class);
+ ots.addTestSuite(OptionalMultipleDependencies.class);
+ ots.addTestSuite(DelayedSimpleDependencies.class);
+ ots.addTestSuite(DelayedOptionalDependencies.class);
+ ots.addTestSuite(DelayedMultipleDependencies.class);
+ ots.addTestSuite(DelayedOptionalMultipleDependencies.class);
ots.addTestSuite(MethodSimpleDependencies.class);
ots.addTestSuite(MethodOptionalDependencies.class);
ots.addTestSuite(MethodMultipleDependencies.class);
@@ -51,7 +51,8 @@
ots.addTestSuite(VectorMultipleDependencies.class);
ots.addTestSuite(SetMultipleDependencies.class);
ots.addTestSuite(CollectionMultipleDependencies.class);
- return ots;
- }
+ ots.addTestSuite(ModifyDependencies.class);
+ return ots;
+ }
}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ModifyDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ModifyDependencies.java
new file mode 100644
index 0000000..c99951f
--- /dev/null
+++ b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ModifyDependencies.java
@@ -0,0 +1,406 @@
+/*
+ * 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.
+ */
+package org.apache.felix.ipojo.test.scenarios.service.dependency;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.architecture.Architecture;
+import org.apache.felix.ipojo.architecture.InstanceDescription;
+import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+import org.osgi.framework.ServiceReference;
+
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
+
+public class ModifyDependencies extends OSGiTestCase {
+
+ ComponentInstance instance2, instance3, instance4, instance5, instance7, instance8;
+ ComponentInstance fooProvider;
+
+ public void setUp() {
+ try {
+ Properties prov = new Properties();
+ prov.put("instance.name","FooProvider");
+ fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-Updatable").createComponentInstance(prov);
+ fooProvider.stop();
+
+ Properties i2 = new Properties();
+ i2.put("instance.name","Void");
+ instance2 = Utils.getFactoryByName(getContext(), "VoidModifyCheckServiceProvider").createComponentInstance(i2);
+
+ Properties i3 = new Properties();
+ i3.put("instance.name","Object");
+ instance3 = Utils.getFactoryByName(getContext(), "ObjectModifyCheckServiceProvider").createComponentInstance(i3);
+
+ Properties i4 = new Properties();
+ i4.put("instance.name","Ref");
+ instance4 = Utils.getFactoryByName(getContext(), "RefModifyCheckServiceProvider").createComponentInstance(i4);
+
+ Properties i5 = new Properties();
+ i5.put("instance.name","Both");
+ instance5 = Utils.getFactoryByName(getContext(), "BothModifyCheckServiceProvider").createComponentInstance(i5);
+
+ Properties i7 = new Properties();
+ i7.put("instance.name","Map");
+ instance7 = Utils.getFactoryByName(getContext(), "MapModifyCheckServiceProvider").createComponentInstance(i7);
+
+ Properties i8 = new Properties();
+ i8.put("instance.name","Dictionary");
+ instance8 = Utils.getFactoryByName(getContext(), "DictModifyCheckServiceProvider").createComponentInstance(i8);
+ } catch(Exception e) {
+ e.printStackTrace();
+ fail(e.getMessage()); }
+
+ }
+
+ public void tearDown() {
+ instance2.dispose();
+ instance3.dispose();
+ instance4.dispose();
+ instance5.dispose();
+ instance7.dispose();
+ instance8.dispose();
+ fooProvider.dispose();
+ instance2 = null;
+ instance3 = null;
+ instance4 = null;
+ instance5 = null;
+ instance7 = null;
+ instance8 = null;
+ fooProvider = null;
+ }
+
+ public void testVoid() {
+ ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
+ assertNotNull("Check architecture availability", arch_ref);
+ InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
+ assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
+
+ fooProvider.start();
+
+ id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
+ assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
+
+ ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
+ assertNotNull("Check CheckService availability", cs_ref);
+ Object o = getContext().getService(cs_ref);
+ CheckService cs = (CheckService) o;
+ Properties props = cs.getProps();
+ //Check properties
+ assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
+ assertEquals("check void bind invocation -1 ("+((Integer)props.get("voidB")).intValue()+")", ((Integer)props.get("voidB")).intValue(), 1);
+ assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
+ assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
+ assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
+ assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
+ assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
+ assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
+ assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
+ assertEquals("check modify -1", ((Integer)props.get("modified")).intValue(), 1); // Already called inside the method
+
+
+ ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), fooProvider.getInstanceName());
+ FooService fs = (FooService) getContext().getService(ref);
+
+ fs.foo(); // Update
+
+ props = cs.getProps();
+ //Check properties
+ assertTrue("check CheckService invocation -1.1", ((Boolean)props.get("result")).booleanValue());
+ assertEquals("check void bind invocation -1.1 ("+((Integer)props.get("voidB")).intValue()+")", ((Integer)props.get("voidB")).intValue(), 1);
+ assertEquals("check void unbind callback invocation -1.1", ((Integer)props.get("voidU")).intValue(), 0);
+ assertEquals("check object bind callback invocation -1.1", ((Integer)props.get("objectB")).intValue(), 0);
+ assertEquals("check object unbind callback invocation -1.1", ((Integer)props.get("objectU")).intValue(), 0);
+ assertEquals("check ref bind callback invocation -1.1", ((Integer)props.get("refB")).intValue(), 0);
+ assertEquals("check ref unbind callback invocation -1.1", ((Integer)props.get("refU")).intValue(), 0);
+ assertEquals("check both bind callback invocation -1.1", ((Integer)props.get("bothB")).intValue(), 0);
+ assertEquals("check both unbind callback invocation -1.1", ((Integer)props.get("bothU")).intValue(), 0);
+ assertEquals("check modify -1.1", ((Integer)props.get("modified")).intValue(), 3); // 1 (first foo) + 1 (our foo) + 1 (check foo)
+ fooProvider.stop();
+
+ id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
+ assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
+
+ id = null;
+ cs = null;
+ fs = null;
+ getContext().ungetService(arch_ref);
+ getContext().ungetService(cs_ref);
+ getContext().ungetService(ref);
+
+ }
+
+ public void testObject() {
+ ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
+ assertNotNull("Check architecture availability", arch_ref);
+ InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
+ assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
+
+ fooProvider.start();
+
+ id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
+ assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
+
+ ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
+ assertNotNull("Check CheckService availability", cs_ref);
+ CheckService cs = (CheckService) getContext().getService(cs_ref);
+ Properties props = cs.getProps();
+ //Check properties
+ assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
+ assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
+ assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
+ assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 1);
+ assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
+ assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
+ assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
+ assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
+ assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
+ assertEquals("check modify -1 (" + ((Integer)props.get("modified")).intValue() + ")", ((Integer)props.get("modified")).intValue(), 1);
+
+ ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), fooProvider.getInstanceName());
+ FooService fs = (FooService) getContext().getService(ref);
+
+ fs.foo(); // Update
+
+ props = cs.getProps();
+ //Check properties
+ assertEquals("check modify -1.1", ((Integer)props.get("modified")).intValue(), 3);
+
+
+ fooProvider.stop();
+
+ id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
+ assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
+
+ id = null;
+ cs = null;
+ fs = null;
+ getContext().ungetService(arch_ref);
+ getContext().ungetService(cs_ref);
+ getContext().ungetService(ref);
+ }
+
+ public void testRef() {
+ ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
+ assertNotNull("Check architecture availability", arch_ref);
+ InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
+ assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
+
+ fooProvider.start();
+
+ id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
+ assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
+
+ ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
+ assertNotNull("Check CheckService availability", cs_ref);
+ CheckService cs = (CheckService) getContext().getService(cs_ref);
+ Properties props = cs.getProps();
+ //Check properties
+ assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
+ assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
+ assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
+ assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
+ assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
+ assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 1);
+ assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
+ assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
+ assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
+ assertEquals("check modify -1 (" + ((Integer)props.get("modified")).intValue() + ")", ((Integer)props.get("modified")).intValue(), 1);
+
+ ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), fooProvider.getInstanceName());
+ FooService fs = (FooService) getContext().getService(ref);
+
+ fs.foo(); // Update
+
+ props = cs.getProps();
+ //Check properties
+ assertEquals("check modify -1.1", ((Integer)props.get("modified")).intValue(), 3);
+
+ fooProvider.stop();
+
+ id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
+ assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
+
+ id = null;
+ cs = null;
+ fs = null;
+ getContext().ungetService(arch_ref);
+ getContext().ungetService(cs_ref);
+ getContext().ungetService(ref);
+ }
+
+ public void testBoth() {
+ ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
+ assertNotNull("Check architecture availability", arch_ref);
+ InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
+ assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
+
+ fooProvider.start();
+
+ id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
+ assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
+
+ ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
+ assertNotNull("Check CheckService availability", cs_ref);
+ CheckService cs = (CheckService) getContext().getService(cs_ref);
+ Properties props = cs.getProps();
+ //Check properties
+ assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
+ assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
+ assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
+ assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
+ assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
+ assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
+ assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
+ assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 1);
+ assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
+ assertEquals("check modify -1 (" + ((Integer)props.get("modified")).intValue() + ")", ((Integer)props.get("modified")).intValue(), 1);
+
+ ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), fooProvider.getInstanceName());
+ FooService fs = (FooService) getContext().getService(ref);
+
+ fs.foo(); // Update
+
+ props = cs.getProps();
+ //Check properties
+ assertEquals("check modify -1.1", ((Integer)props.get("modified")).intValue(), 3);
+
+ fooProvider.stop();
+
+ id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
+ assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
+
+ id = null;
+ cs = null;
+ fs = null;
+ getContext().ungetService(arch_ref);
+ getContext().ungetService(cs_ref);
+ getContext().ungetService(ref);
+ }
+
+
+ public void testMap() {
+ ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance7.getInstanceName());
+ assertNotNull("Check architecture availability", arch_ref);
+ InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
+ assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
+
+ fooProvider.start();
+
+ id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
+ assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
+
+ ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance7.getInstanceName());
+ assertNotNull("Check CheckService availability", cs_ref);
+ CheckService cs = (CheckService) getContext().getService(cs_ref);
+ Properties props = cs.getProps();
+ //Check properties
+ assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
+ assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
+ assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
+ assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
+ assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
+ assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
+ assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
+ assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
+ assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
+ assertEquals("check map bind callback invocation -1", ((Integer)props.get("mapB")).intValue(), 1);
+ assertEquals("check map unbind callback invocation -1", ((Integer)props.get("mapU")).intValue(), 0);
+ assertEquals("check dict bind callback invocation -1", ((Integer)props.get("dictB")).intValue(), 0);
+ assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
+ assertEquals("check modify -1 (" + ((Integer)props.get("modified")).intValue() + ")", ((Integer)props.get("modified")).intValue(), 1);
+
+ ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), fooProvider.getInstanceName());
+ FooService fs = (FooService) getContext().getService(ref);
+
+ fs.foo(); // Update
+
+ props = cs.getProps();
+ //Check properties
+ assertEquals("check modify -1.1", ((Integer)props.get("modified")).intValue(), 3);
+
+ fooProvider.stop();
+
+ id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
+ assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
+
+ id = null;
+ cs = null;
+ fs = null;
+ getContext().ungetService(arch_ref);
+ getContext().ungetService(cs_ref);
+ getContext().ungetService(ref);
+ }
+
+ public void testDict() {
+ ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance8.getInstanceName());
+ assertNotNull("Check architecture availability", arch_ref);
+ InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
+ assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
+
+ fooProvider.start();
+
+ id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
+ assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
+
+ ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance8.getInstanceName());
+ assertNotNull("Check CheckService availability", cs_ref);
+ CheckService cs = (CheckService) getContext().getService(cs_ref);
+ Properties props = cs.getProps();
+ //Check properties
+ assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
+ assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
+ assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
+ assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
+ assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
+ assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
+ assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
+ assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
+ assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
+ assertEquals("check map bind callback invocation -1", ((Integer)props.get("mapB")).intValue(), 0);
+ assertEquals("check map unbind callback invocation -1", ((Integer)props.get("mapU")).intValue(), 0);
+ assertEquals("check dict bind callback invocation -1", ((Integer)props.get("dictB")).intValue(), 1);
+ assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
+ assertEquals("check modify -1 (" + ((Integer)props.get("modified")).intValue() + ")", ((Integer)props.get("modified")).intValue(), 1);
+
+ ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), fooProvider.getInstanceName());
+ FooService fs = (FooService) getContext().getService(ref);
+
+ fs.foo(); // Update
+
+ props = cs.getProps();
+ //Check properties
+ assertEquals("check modify -1.1", ((Integer)props.get("modified")).intValue(), 3);
+
+ fooProvider.stop();
+
+ id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
+ assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
+
+ id = null;
+ cs = null;
+ fs = null;
+ getContext().ungetService(arch_ref);
+ getContext().ungetService(cs_ref);
+ getContext().ungetService(ref);
+ }
+
+}
diff --git a/ipojo/tests/core/service-dependency/src/main/resources/metadata.xml b/ipojo/tests/core/service-dependency/src/main/resources/metadata.xml
index bb49773..d490139 100644
--- a/ipojo/tests/core/service-dependency/src/main/resources/metadata.xml
+++ b/ipojo/tests/core/service-dependency/src/main/resources/metadata.xml
@@ -1,670 +1,744 @@
<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"
- xmlns="org.apache.felix.ipojo">
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
- name="FooProviderType-1" architecture="true">
- <provides />
- </component>
-
- <!-- Simple Dependencies -->
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- name="SimpleCheckServiceProvider" architecture="true">
- <requires field="fs" />
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- name="VoidCheckServiceProvider" architecture="true">
- <requires field="fs">
- <callback type="bind" method="voidBind" />
- <callback type="unbind" method="voidUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- name="ObjectCheckServiceProvider" architecture="true">
- <requires field="fs">
- <callback type="bind" method="objectBind" />
- <callback type="unbind" method="objectUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- name="RefCheckServiceProvider" architecture="true">
- <requires field="fs">
- <callback type="bind" method="refBind" />
- <callback type="unbind" method="refUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- name="BothCheckServiceProvider" architecture="true">
- <requires field="fs">
- <callback type="bind" method="bothBind" />
- <callback type="unbind" method="bothUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- name="MapCheckServiceProvider" architecture="true">
- <requires field="fs">
- <callback type="bind" method="propertiesMapBind" />
- <callback type="unbind" method="propertiesMapUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- name="DictCheckServiceProvider" architecture="true">
- <requires field="fs">
- <callback type="bind" method="propertiesDictionaryBind" />
- <callback type="unbind" method="propertiesDictionaryUnbind" />
- </requires>
- <provides />
- </component>
+ xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd"
+ xmlns="org.apache.felix.ipojo">
+<!--
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- name="DoubleCheckServiceProvider" architecture="true">
- <requires>
- <callback type="bind" method="objectBind" />
- <callback type="unbind" method="objectUnbind" />
- </requires>
- <requires field="fs" />
- <provides />
- </component>
+ -->
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
+ name="FooProviderType-1" architecture="true">
+ <provides />
+ </component>
+
+ <!-- Simple Dependencies -->
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
+ name="SimpleCheckServiceProvider" architecture="true">
+ <requires field="fs" />
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
+ name="VoidCheckServiceProvider" architecture="true">
+ <requires field="fs">
+ <callback type="bind" method="voidBind" />
+ <callback type="unbind" method="voidUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
+ name="ObjectCheckServiceProvider" architecture="true">
+ <requires field="fs">
+ <callback type="bind" method="objectBind" />
+ <callback type="unbind" method="objectUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
+ name="RefCheckServiceProvider" architecture="true">
+ <requires field="fs">
+ <callback type="bind" method="refBind" />
+ <callback type="unbind" method="refUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
+ name="BothCheckServiceProvider" architecture="true">
+ <requires field="fs">
+ <callback type="bind" method="bothBind" />
+ <callback type="unbind" method="bothUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
+ name="MapCheckServiceProvider" architecture="true">
+ <requires field="fs">
+ <callback type="bind" method="propertiesMapBind" />
+ <callback type="unbind" method="propertiesMapUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
+ name="DictCheckServiceProvider" architecture="true">
+ <requires field="fs">
+ <callback type="bind" method="propertiesDictionaryBind" />
+ <callback type="unbind" method="propertiesDictionaryUnbind" />
+ </requires>
+ <provides />
+ </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
- name="MObjectCheckServiceProvider" architecture="true">
- <requires>
- <callback type="bind" method="objectBind" />
- <callback type="unbind" method="objectUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
- name="MRefCheckServiceProvider" architecture="true">
- <requires
- specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService">
- <callback type="bind" method="refBind" />
- <callback type="unbind" method="refUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
- name="MBothCheckServiceProvider" architecture="true">
- <requires>
- <callback type="bind" method="bothBind" />
- <callback type="unbind" method="bothUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
- name="MMapCheckServiceProvider" architecture="true">
- <requires>
- <callback type="bind" method="propertiesMapBind" />
- <callback type="unbind" method="propertiesMapUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
- name="MDictCheckServiceProvider" architecture="true">
- <requires>
- <callback type="bind" method="propertiesDictionaryBind" />
- <callback type="unbind" method="propertiesDictionaryUnbind" />
- </requires>
- <provides />
- </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
+ name="DoubleCheckServiceProvider" architecture="true">
+ <requires>
+ <callback type="bind" method="objectBind" />
+ <callback type="unbind" method="objectUnbind" />
+ </requires>
+ <requires field="fs" />
+ <provides />
+ </component>
- <!-- Simple & Optional Dependencies -->
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- name="SimpleOptionalCheckServiceProvider" architecture="true">
- <requires field="fs" optional="true" id="FooService"/>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- name="SimpleOptionalNoNullableCheckServiceProvider" architecture="true">
- <requires field="fs" optional="true" nullable="false" />
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- name="VoidOptionalCheckServiceProvider" architecture="true">
- <requires field="fs" optional="true">
- <callback type="bind" method="voidBind" />
- <callback type="unbind" method="voidUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- name="VoidOptionalNoNullableCheckServiceProvider" architecture="true">
- <requires field="fs" optional="true" nullable="false">
- <callback type="bind" method="voidBind" />
- <callback type="unbind" method="voidUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- name="ObjectOptionalCheckServiceProvider" architecture="true">
- <requires field="fs" optional="true">
- <callback type="bind" method="objectBind" />
- <callback type="unbind" method="objectUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- name="ObjectOptionalNoNullableCheckServiceProvider" architecture="true">
- <requires field="fs" optional="true" nullable="false">
- <callback type="bind" method="objectBind" />
- <callback type="unbind" method="objectUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- name="RefOptionalCheckServiceProvider" architecture="true">
- <requires field="fs" optional="true">
- <callback type="bind" method="refBind" />
- <callback type="unbind" method="refUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- name="RefOptionalNoNullableCheckServiceProvider" architecture="true">
- <requires field="fs" optional="true" nullable="false">
- <callback type="bind" method="refBind" />
- <callback type="unbind" method="refUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- name="BothOptionalCheckServiceProvider" architecture="true">
- <requires field="fs" optional="true">
- <callback type="bind" method="bothBind" />
- <callback type="unbind" method="bothUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- name="MapOptionalCheckServiceProvider" architecture="true">
- <requires field="fs" optional="true">
- <callback type="bind" method="propertiesMapBind" />
- <callback type="unbind" method="propertiesMapUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- name="DictOptionalCheckServiceProvider" architecture="true">
- <requires field="fs" optional="true">
- <callback type="bind" method="propertiesDictionaryBind" />
- <callback type="unbind" method="propertiesDictionaryUnbind" />
- </requires>
- <provides />
- </component>
-
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- name="BothOptionalNoNullableCheckServiceProvider" architecture="true">
- <requires field="fs" optional="true" nullable="false">
- <callback type="bind" method="bothBind" />
- <callback type="unbind" method="bothUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- name="MapOptionalNoNullableCheckServiceProvider" architecture="true">
- <requires field="fs" optional="true" nullable="false">
- <callback type="bind" method="propertiesMapBind" />
- <callback type="unbind" method="propertiesMapUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- name="DictOptionalNoNullableCheckServiceProvider" architecture="true">
- <requires field="fs" optional="true" nullable="false">
- <callback type="bind" method="propertiesDictionaryBind" />
- <callback type="unbind" method="propertiesDictionaryUnbind" />
- </requires>
- <provides />
- </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
+ name="MObjectCheckServiceProvider" architecture="true">
+ <requires>
+ <callback type="bind" method="objectBind" />
+ <callback type="unbind" method="objectUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
+ name="MRefCheckServiceProvider" architecture="true">
+ <requires
+ specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService">
+ <callback type="bind" method="refBind" />
+ <callback type="unbind" method="refUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
+ name="MBothCheckServiceProvider" architecture="true">
+ <requires>
+ <callback type="bind" method="bothBind" />
+ <callback type="unbind" method="bothUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
+ name="MMapCheckServiceProvider" architecture="true">
+ <requires>
+ <callback type="bind" method="propertiesMapBind" />
+ <callback type="unbind" method="propertiesMapUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
+ name="MDictCheckServiceProvider" architecture="true">
+ <requires>
+ <callback type="bind" method="propertiesDictionaryBind" />
+ <callback type="unbind" method="propertiesDictionaryUnbind" />
+ </requires>
+ <provides />
+ </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
- name="MObjectOptionalCheckServiceProvider" architecture="true">
- <requires optional="true">
- <callback type="bind" method="objectBind" />
- <callback type="unbind" method="objectUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
- name="MRefOptionalCheckServiceProvider" architecture="true">
- <requires
- specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
- optional="true">
- <callback type="bind" method="refBind" />
- <callback type="unbind" method="refUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
- name="MBothOptionalCheckServiceProvider" architecture="true">
- <requires
- specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
- optional="true">
- <callback type="bind" method="bothBind" />
- <callback type="unbind" method="bothUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
- name="MMapOptionalCheckServiceProvider" architecture="true">
- <requires
- specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
- optional="true">
- <callback type="bind" method="propertiesMapBind" />
- <callback type="unbind" method="propertiesMapUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
- name="MDictOptionalCheckServiceProvider" architecture="true">
- <requires
- specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
- optional="true">
- <callback type="bind" method="propertiesDictionaryBind" />
- <callback type="unbind" method="propertiesDictionaryUnbind" />
- </requires>
- <provides />
- </component>
+ <!-- Simple & Optional Dependencies -->
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
+ name="SimpleOptionalCheckServiceProvider" architecture="true">
+ <requires field="fs" optional="true" id="FooService"/>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
+ name="SimpleOptionalNoNullableCheckServiceProvider" architecture="true">
+ <requires field="fs" optional="true" nullable="false" />
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
+ name="VoidOptionalCheckServiceProvider" architecture="true">
+ <requires field="fs" optional="true">
+ <callback type="bind" method="voidBind" />
+ <callback type="unbind" method="voidUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
+ name="VoidOptionalNoNullableCheckServiceProvider" architecture="true">
+ <requires field="fs" optional="true" nullable="false">
+ <callback type="bind" method="voidBind" />
+ <callback type="unbind" method="voidUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
+ name="ObjectOptionalCheckServiceProvider" architecture="true">
+ <requires field="fs" optional="true">
+ <callback type="bind" method="objectBind" />
+ <callback type="unbind" method="objectUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
+ name="ObjectOptionalNoNullableCheckServiceProvider" architecture="true">
+ <requires field="fs" optional="true" nullable="false">
+ <callback type="bind" method="objectBind" />
+ <callback type="unbind" method="objectUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
+ name="RefOptionalCheckServiceProvider" architecture="true">
+ <requires field="fs" optional="true">
+ <callback type="bind" method="refBind" />
+ <callback type="unbind" method="refUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
+ name="RefOptionalNoNullableCheckServiceProvider" architecture="true">
+ <requires field="fs" optional="true" nullable="false">
+ <callback type="bind" method="refBind" />
+ <callback type="unbind" method="refUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
+ name="BothOptionalCheckServiceProvider" architecture="true">
+ <requires field="fs" optional="true">
+ <callback type="bind" method="bothBind" />
+ <callback type="unbind" method="bothUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
+ name="MapOptionalCheckServiceProvider" architecture="true">
+ <requires field="fs" optional="true">
+ <callback type="bind" method="propertiesMapBind" />
+ <callback type="unbind" method="propertiesMapUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
+ name="DictOptionalCheckServiceProvider" architecture="true">
+ <requires field="fs" optional="true">
+ <callback type="bind" method="propertiesDictionaryBind" />
+ <callback type="unbind" method="propertiesDictionaryUnbind" />
+ </requires>
+ <provides />
+ </component>
+
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
+ name="BothOptionalNoNullableCheckServiceProvider" architecture="true">
+ <requires field="fs" optional="true" nullable="false">
+ <callback type="bind" method="bothBind" />
+ <callback type="unbind" method="bothUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
+ name="MapOptionalNoNullableCheckServiceProvider" architecture="true">
+ <requires field="fs" optional="true" nullable="false">
+ <callback type="bind" method="propertiesMapBind" />
+ <callback type="unbind" method="propertiesMapUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
+ name="DictOptionalNoNullableCheckServiceProvider" architecture="true">
+ <requires field="fs" optional="true" nullable="false">
+ <callback type="bind" method="propertiesDictionaryBind" />
+ <callback type="unbind" method="propertiesDictionaryUnbind" />
+ </requires>
+ <provides />
+ </component>
+
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
+ name="MObjectOptionalCheckServiceProvider" architecture="true">
+ <requires optional="true">
+ <callback type="bind" method="objectBind" />
+ <callback type="unbind" method="objectUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
+ name="MRefOptionalCheckServiceProvider" architecture="true">
+ <requires
+ specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
+ optional="true">
+ <callback type="bind" method="refBind" />
+ <callback type="unbind" method="refUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
+ name="MBothOptionalCheckServiceProvider" architecture="true">
+ <requires
+ specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
+ optional="true">
+ <callback type="bind" method="bothBind" />
+ <callback type="unbind" method="bothUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
+ name="MMapOptionalCheckServiceProvider" architecture="true">
+ <requires
+ specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
+ optional="true">
+ <callback type="bind" method="propertiesMapBind" />
+ <callback type="unbind" method="propertiesMapUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
+ name="MDictOptionalCheckServiceProvider" architecture="true">
+ <requires
+ specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
+ optional="true">
+ <callback type="bind" method="propertiesDictionaryBind" />
+ <callback type="unbind" method="propertiesDictionaryUnbind" />
+ </requires>
+ <provides />
+ </component>
- <!-- Simple & Optional Dependencies with default-implementation -->
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- name="DISimpleOptionalCheckServiceProvider" architecture="true">
- <requires field="fs" optional="true"
- default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl" />
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- name="DIVoidOptionalCheckServiceProvider" architecture="true">
- <requires field="fs" optional="true"
- default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
- <callback type="bind" method="voidBind" />
- <callback type="unbind" method="voidUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- name="DIObjectOptionalCheckServiceProvider" architecture="true">
- <requires field="fs" optional="true"
- default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
- <callback type="bind" method="objectBind" />
- <callback type="unbind" method="objectUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- name="DIRefOptionalCheckServiceProvider" architecture="true">
- <requires field="fs" optional="true"
- default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
- <callback type="bind" method="refBind" />
- <callback type="unbind" method="refUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- name="DIBothOptionalCheckServiceProvider" architecture="true">
- <requires field="fs" optional="true"
- default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
- <callback type="bind" method="bothBind" />
- <callback type="unbind" method="bothUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- name="DIMapOptionalCheckServiceProvider" architecture="true">
- <requires field="fs" optional="true"
- default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
- <callback type="bind" method="propertiesMapBind" />
- <callback type="unbind" method="propertiesMapUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- name="DIDictOptionalCheckServiceProvider" architecture="true">
- <requires field="fs" optional="true"
- default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
- <callback type="bind" method="propertiesDictionaryBind" />
- <callback type="unbind" method="propertiesDictionaryUnbind" />
- </requires>
- <provides />
- </component>
+ <!-- Simple & Optional Dependencies with default-implementation -->
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
+ name="DISimpleOptionalCheckServiceProvider" architecture="true">
+ <requires field="fs" optional="true"
+ default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl" />
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
+ name="DIVoidOptionalCheckServiceProvider" architecture="true">
+ <requires field="fs" optional="true"
+ default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
+ <callback type="bind" method="voidBind" />
+ <callback type="unbind" method="voidUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
+ name="DIObjectOptionalCheckServiceProvider" architecture="true">
+ <requires field="fs" optional="true"
+ default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
+ <callback type="bind" method="objectBind" />
+ <callback type="unbind" method="objectUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
+ name="DIRefOptionalCheckServiceProvider" architecture="true">
+ <requires field="fs" optional="true"
+ default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
+ <callback type="bind" method="refBind" />
+ <callback type="unbind" method="refUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
+ name="DIBothOptionalCheckServiceProvider" architecture="true">
+ <requires field="fs" optional="true"
+ default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
+ <callback type="bind" method="bothBind" />
+ <callback type="unbind" method="bothUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
+ name="DIMapOptionalCheckServiceProvider" architecture="true">
+ <requires field="fs" optional="true"
+ default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
+ <callback type="bind" method="propertiesMapBind" />
+ <callback type="unbind" method="propertiesMapUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
+ name="DIDictOptionalCheckServiceProvider" architecture="true">
+ <requires field="fs" optional="true"
+ default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
+ <callback type="bind" method="propertiesDictionaryBind" />
+ <callback type="unbind" method="propertiesDictionaryUnbind" />
+ </requires>
+ <provides />
+ </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
- name="DIMObjectOptionalCheckServiceProvider" architecture="true">
- <requires optional="true"
- default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
- <callback type="bind" method="objectBind" />
- <callback type="unbind" method="objectUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
- name="DIMRefOptionalCheckServiceProvider" architecture="true">
- <requires
- specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
- optional="true"
- default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
- <callback type="bind" method="refBind" />
- <callback type="unbind" method="refUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
- name="DIMBothOptionalCheckServiceProvider" architecture="true">
- <requires
- specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
- optional="true"
- default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
- <callback type="bind" method="bothBind" />
- <callback type="unbind" method="bothUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
- name="DIMMapOptionalCheckServiceProvider" architecture="true">
- <requires
- specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
- optional="true"
- default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
- <callback type="bind" method="propertiesMapBind" />
- <callback type="unbind" method="propertiesMapUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
- name="DIMDictOptionalCheckServiceProvider" architecture="true">
- <requires
- specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
- optional="true"
- default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
- <callback type="bind" method="propertiesDictionaryBind" />
- <callback type="unbind" method="propertiesDictionaryUnbind" />
- </requires>
- <provides />
- </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
+ name="DIMObjectOptionalCheckServiceProvider" architecture="true">
+ <requires optional="true"
+ default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
+ <callback type="bind" method="objectBind" />
+ <callback type="unbind" method="objectUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
+ name="DIMRefOptionalCheckServiceProvider" architecture="true">
+ <requires
+ specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
+ optional="true"
+ default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
+ <callback type="bind" method="refBind" />
+ <callback type="unbind" method="refUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
+ name="DIMBothOptionalCheckServiceProvider" architecture="true">
+ <requires
+ specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
+ optional="true"
+ default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
+ <callback type="bind" method="bothBind" />
+ <callback type="unbind" method="bothUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
+ name="DIMMapOptionalCheckServiceProvider" architecture="true">
+ <requires
+ specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
+ optional="true"
+ default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
+ <callback type="bind" method="propertiesMapBind" />
+ <callback type="unbind" method="propertiesMapUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
+ name="DIMDictOptionalCheckServiceProvider" architecture="true">
+ <requires
+ specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
+ optional="true"
+ default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
+ <callback type="bind" method="propertiesDictionaryBind" />
+ <callback type="unbind" method="propertiesDictionaryUnbind" />
+ </requires>
+ <provides />
+ </component>
- <!-- Multiple Dependencies -->
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
- name="SimpleMultipleCheckServiceProvider" architecture="true">
- <requires field="fs" />
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
- name="VoidMultipleCheckServiceProvider" architecture="true">
- <requires field="fs">
- <callback type="bind" method="voidBind" />
- <callback type="unbind" method="voidUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
- name="ObjectMultipleCheckServiceProvider" architecture="true">
- <requires field="fs">
- <callback type="bind" method="objectBind" />
- <callback type="unbind" method="objectUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
- name="RefMultipleCheckServiceProvider" architecture="true">
- <requires field="fs">
- <callback type="bind" method="refBind" />
- <callback type="unbind" method="refUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
- name="BothMultipleCheckServiceProvider" architecture="true">
- <requires field="fs">
- <callback type="bind" method="bothBind" />
- <callback type="unbind" method="bothUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
- name="MapMultipleCheckServiceProvider" architecture="true">
- <requires field="fs">
- <callback type="bind" method="propertiesMapBind" />
- <callback type="unbind" method="propertiesMapUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
- name="DictMultipleCheckServiceProvider" architecture="true">
- <requires field="fs">
- <callback type="bind" method="propertiesDictionaryBind" />
- <callback type="unbind" method="propertiesDictionaryUnbind" />
- </requires>
- <provides />
- </component>
-
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.MethodMultipleCheckService"
- name="MObjectMultipleCheckServiceProvider" architecture="true">
- <requires aggregate="true">
- <callback type="bind" method="objectBind" />
- <callback type="unbind" method="objectUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.MethodMultipleCheckService"
- name="MRefMultipleCheckServiceProvider" architecture="true">
- <requires
- specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
- aggregate="true">
- <callback type="bind" method="refBind" />
- <callback type="unbind" method="refUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.MethodMultipleCheckService"
- name="MBothMultipleCheckServiceProvider" architecture="true">
- <requires aggregate="true">
- <callback type="bind" method="bothBind" />
- <callback type="unbind" method="bothUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.MethodMultipleCheckService"
- name="MMapMultipleCheckServiceProvider" architecture="true">
- <requires aggregate="true">
- <callback type="bind" method="propertiesMapBind" />
- <callback type="unbind" method="propertiesMapUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.MethodMultipleCheckService"
- name="MDictMultipleCheckServiceProvider" architecture="true">
- <requires aggregate="true">
- <callback type="bind" method="propertiesDictionaryBind" />
- <callback type="unbind" method="propertiesDictionaryUnbind" />
- </requires>
- <provides />
- </component>
+ <!-- Multiple Dependencies -->
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
+ name="SimpleMultipleCheckServiceProvider" architecture="true">
+ <requires field="fs" />
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
+ name="VoidMultipleCheckServiceProvider" architecture="true">
+ <requires field="fs">
+ <callback type="bind" method="voidBind" />
+ <callback type="unbind" method="voidUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
+ name="ObjectMultipleCheckServiceProvider" architecture="true">
+ <requires field="fs">
+ <callback type="bind" method="objectBind" />
+ <callback type="unbind" method="objectUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
+ name="RefMultipleCheckServiceProvider" architecture="true">
+ <requires field="fs">
+ <callback type="bind" method="refBind" />
+ <callback type="unbind" method="refUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
+ name="BothMultipleCheckServiceProvider" architecture="true">
+ <requires field="fs">
+ <callback type="bind" method="bothBind" />
+ <callback type="unbind" method="bothUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
+ name="MapMultipleCheckServiceProvider" architecture="true">
+ <requires field="fs">
+ <callback type="bind" method="propertiesMapBind" />
+ <callback type="unbind" method="propertiesMapUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
+ name="DictMultipleCheckServiceProvider" architecture="true">
+ <requires field="fs">
+ <callback type="bind" method="propertiesDictionaryBind" />
+ <callback type="unbind" method="propertiesDictionaryUnbind" />
+ </requires>
+ <provides />
+ </component>
+
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.MethodMultipleCheckService"
+ name="MObjectMultipleCheckServiceProvider" architecture="true">
+ <requires aggregate="true">
+ <callback type="bind" method="objectBind" />
+ <callback type="unbind" method="objectUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.MethodMultipleCheckService"
+ name="MRefMultipleCheckServiceProvider" architecture="true">
+ <requires
+ specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
+ aggregate="true">
+ <callback type="bind" method="refBind" />
+ <callback type="unbind" method="refUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.MethodMultipleCheckService"
+ name="MBothMultipleCheckServiceProvider" architecture="true">
+ <requires aggregate="true">
+ <callback type="bind" method="bothBind" />
+ <callback type="unbind" method="bothUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.MethodMultipleCheckService"
+ name="MMapMultipleCheckServiceProvider" architecture="true">
+ <requires aggregate="true">
+ <callback type="bind" method="propertiesMapBind" />
+ <callback type="unbind" method="propertiesMapUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.MethodMultipleCheckService"
+ name="MDictMultipleCheckServiceProvider" architecture="true">
+ <requires aggregate="true">
+ <callback type="bind" method="propertiesDictionaryBind" />
+ <callback type="unbind" method="propertiesDictionaryUnbind" />
+ </requires>
+ <provides />
+ </component>
- <!-- Multiple & Optional Dependencies -->
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
- name="SimpleOptionalMultipleCheckServiceProvider"
- architecture="true">
- <requires field="fs" optional="true" />
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
- name="VoidOptionalMultipleCheckServiceProvider"
- architecture="true">
- <requires field="fs" optional="true">
- <callback type="bind" method="voidBind" />
- <callback type="unbind" method="voidUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
- name="ObjectOptionalMultipleCheckServiceProvider"
- architecture="true">
- <requires field="fs" optional="true">
- <callback type="bind" method="objectBind" />
- <callback type="unbind" method="objectUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
- name="RefOptionalMultipleCheckServiceProvider"
- architecture="true">
- <requires field="fs" optional="true">
- <callback type="bind" method="refBind" />
- <callback type="unbind" method="refUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.MethodMultipleCheckService"
- name="MObjectOptionalMultipleCheckServiceProvider"
- architecture="true">
- <requires aggregate="true" optional="true">
- <callback type="bind" method="objectBind" />
- <callback type="unbind" method="objectUnbind" />
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.MethodMultipleCheckService"
- name="MRefOptionalMultipleCheckServiceProvider"
- architecture="true">
- <requires
- specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
- aggregate="true" optional="true">
- <callback type="bind" method="refBind" />
- <callback type="unbind" method="refUnbind" />
- </requires>
- <provides />
- </component>
-
- <!-- Aggregate dependency as List -->
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.ListCheckService"
- name="SimpleListCheckServiceProvider" architecture="true">
- <requires field="fs" specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"/>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.ListCheckService"
- name="OptionalListCheckServiceProvider"
- architecture="true">
- <requires specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService" field="fs" optional="true" />
- <provides />
- </component>
-
- <!-- Aggregate dependency as Vector -->
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.VectorCheckService"
- name="SimpleVectorCheckServiceProvider" architecture="true">
- <requires field="fs">
- <callback type="bind" method="objectBind"/>
- <callback type="unbind" method="objectUnbind"/>
- </requires>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.VectorCheckService"
- name="OptionalVectorCheckServiceProvider"
- architecture="true">
- <requires specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService" field="fs" optional="true" />
- <provides />
- </component>
-
- <!-- Aggregate dependency as Set -->
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.SetCheckService"
- name="SimpleSetCheckServiceProvider" architecture="true">
- <requires field="fs" specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"/>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.SetCheckService"
- name="OptionalSetCheckServiceProvider"
- architecture="true">
- <requires specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService" field="fs" optional="true" />
- <provides />
- </component>
-
- <!-- Aggregate dependency as Collection -->
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.CollectionCheckService"
- name="SimpleCollectionCheckServiceProvider" architecture="true">
- <requires field="fs" specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"/>
- <provides />
- </component>
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.CollectionCheckService"
- name="OptionalCollectionCheckServiceProvider"
- architecture="true">
- <requires specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService" field="fs" optional="true" />
- <provides />
- </component>
-
+ <!-- Multiple & Optional Dependencies -->
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
+ name="SimpleOptionalMultipleCheckServiceProvider"
+ architecture="true">
+ <requires field="fs" optional="true" />
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
+ name="VoidOptionalMultipleCheckServiceProvider"
+ architecture="true">
+ <requires field="fs" optional="true">
+ <callback type="bind" method="voidBind" />
+ <callback type="unbind" method="voidUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
+ name="ObjectOptionalMultipleCheckServiceProvider"
+ architecture="true">
+ <requires field="fs" optional="true">
+ <callback type="bind" method="objectBind" />
+ <callback type="unbind" method="objectUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
+ name="RefOptionalMultipleCheckServiceProvider"
+ architecture="true">
+ <requires field="fs" optional="true">
+ <callback type="bind" method="refBind" />
+ <callback type="unbind" method="refUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.MethodMultipleCheckService"
+ name="MObjectOptionalMultipleCheckServiceProvider"
+ architecture="true">
+ <requires aggregate="true" optional="true">
+ <callback type="bind" method="objectBind" />
+ <callback type="unbind" method="objectUnbind" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.MethodMultipleCheckService"
+ name="MRefOptionalMultipleCheckServiceProvider"
+ architecture="true">
+ <requires
+ specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
+ aggregate="true" optional="true">
+ <callback type="bind" method="refBind" />
+ <callback type="unbind" method="refUnbind" />
+ </requires>
+ <provides />
+ </component>
+
+ <!-- Aggregate dependency as List -->
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.ListCheckService"
+ name="SimpleListCheckServiceProvider" architecture="true">
+ <requires field="fs" specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"/>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.ListCheckService"
+ name="OptionalListCheckServiceProvider"
+ architecture="true">
+ <requires specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService" field="fs" optional="true" />
+ <provides />
+ </component>
+
+ <!-- Aggregate dependency as Vector -->
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.VectorCheckService"
+ name="SimpleVectorCheckServiceProvider" architecture="true">
+ <requires field="fs">
+ <callback type="bind" method="objectBind"/>
+ <callback type="unbind" method="objectUnbind"/>
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.VectorCheckService"
+ name="OptionalVectorCheckServiceProvider"
+ architecture="true">
+ <requires specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService" field="fs" optional="true" />
+ <provides />
+ </component>
+
+ <!-- Aggregate dependency as Set -->
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.SetCheckService"
+ name="SimpleSetCheckServiceProvider" architecture="true">
+ <requires field="fs" specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"/>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.SetCheckService"
+ name="OptionalSetCheckServiceProvider"
+ architecture="true">
+ <requires specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService" field="fs" optional="true" />
+ <provides />
+ </component>
+
+ <!-- Aggregate dependency as Collection -->
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.CollectionCheckService"
+ name="SimpleCollectionCheckServiceProvider" architecture="true">
+ <requires field="fs" specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"/>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.CollectionCheckService"
+ name="OptionalCollectionCheckServiceProvider"
+ architecture="true">
+ <requires specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService" field="fs" optional="true" />
+ <provides />
+ </component>
+
+
+ <!-- Modify method test -->
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType2"
+ name="FooProviderType-Updatable" architecture="true">
+ <provides>
+ <property name="foo" field="m_foo" value="foo"/>
+ </provides>
+ </component>
+
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
+ name="VoidModifyCheckServiceProvider" architecture="true">
+ <requires field="fs">
+ <callback type="bind" method="voidBind" />
+ <callback type="unbind" method="voidUnbind" />
+ <callback type="modified" method="voidModify"/>
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
+ name="ObjectModifyCheckServiceProvider" architecture="true">
+ <requires field="fs">
+ <callback type="bind" method="objectBind" />
+ <callback type="unbind" method="objectUnbind" />
+ <callback type="modified" method="objectModify" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
+ name="RefModifyCheckServiceProvider" architecture="true">
+ <requires field="fs">
+ <callback type="bind" method="refBind" />
+ <callback type="unbind" method="refUnbind" />
+ <callback type="modified" method="refModify" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
+ name="BothModifyCheckServiceProvider" architecture="true">
+ <requires field="fs">
+ <callback type="bind" method="bothBind" />
+ <callback type="unbind" method="bothUnbind" />
+ <callback type="modified" method="bothModify" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
+ name="MapModifyCheckServiceProvider" architecture="true">
+ <requires field="fs">
+ <callback type="bind" method="propertiesMapBind" />
+ <callback type="unbind" method="propertiesMapUnbind" />
+ <callback type="modified" method="propertiesMapModify" />
+ </requires>
+ <provides />
+ </component>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
+ name="DictModifyCheckServiceProvider" architecture="true">
+ <requires field="fs">
+ <callback type="bind" method="propertiesDictionaryBind" />
+ <callback type="unbind" method="propertiesDictionaryUnbind" />
+ <callback type="modified" method="propertiesDictionaryModify" />
+ </requires>
+ <provides />
+ </component>
+
</ipojo>