Fix FELIX-2666 Rename the temporal handler annotation to avoid collision
@Requires (for temporal dependencies) becomes deprecated, replaced by @Temporal.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1052475 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/annotations/src/main/java/org/apache/felix/ipojo/handler/temporal/Requires.java b/ipojo/annotations/src/main/java/org/apache/felix/ipojo/handler/temporal/Requires.java
index 782ed7e..3e9e03a 100644
--- a/ipojo/annotations/src/main/java/org/apache/felix/ipojo/handler/temporal/Requires.java
+++ b/ipojo/annotations/src/main/java/org/apache/felix/ipojo/handler/temporal/Requires.java
@@ -1,4 +1,4 @@
-/*
+/*
* 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
@@ -24,25 +24,27 @@
/**
* Temporal dependency annotation.
* Allows specifying a temporal dependency.
- * Be aware that despite is it provided in the annotations jar,
+ * Be aware that despite is it provided in the annotations jar,
* it refers to an external handler.
* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ * @deprecated replaced by {@link Temporal}
*/
@Target(ElementType.FIELD)
+@Deprecated
public @interface Requires {
-
+
/**
* Set the LDAP filter of the dependency.
* Default : no filter
*/
String filter() default "";
-
+
/**
* Timeout of the dependency.
* Default : true
*/
long timeout() default 3000;
-
+
/**
* Set the on timeout action.
* Supports null, nullable, empty, and default-implementation.
@@ -51,13 +53,13 @@
* Default: no action (i.e throws a runtime exception)
*/
String onTimeout() default "";
-
+
/**
* Set the service specification (for Collection fields).
* This attribute is mandatory for Collections.
*/
String specification() default "";
-
+
/**
* Inject a proxy instead of the real object.
* This allows passing this reference to collaborators.
diff --git a/ipojo/annotations/src/main/java/org/apache/felix/ipojo/handler/temporal/Temporal.java b/ipojo/annotations/src/main/java/org/apache/felix/ipojo/handler/temporal/Temporal.java
new file mode 100644
index 0000000..70e96bf
--- /dev/null
+++ b/ipojo/annotations/src/main/java/org/apache/felix/ipojo/handler/temporal/Temporal.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.handler.temporal;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+/**
+ * Temporal dependency annotation.
+ * Allows specifying a temporal dependency.
+ * Be aware that despite is it provided in the annotations jar,
+ * it refers to an external handler.
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+@Target(ElementType.FIELD)
+public @interface Temporal {
+
+ /**
+ * Set the LDAP filter of the dependency.
+ * Default : no filter
+ */
+ String filter() default "";
+
+ /**
+ * Timeout of the dependency.
+ * Default : true
+ */
+ long timeout() default 3000;
+
+ /**
+ * Set the on timeout action.
+ * Supports null, nullable, empty, and default-implementation.
+ * In this latter case, you must specify the qualified class name
+ * of the default-implementation (instead of default-implementation).
+ * Default: no action (i.e throws a runtime exception)
+ */
+ String onTimeout() default "";
+
+ /**
+ * Set the service specification (for Collection fields).
+ * This attribute is mandatory for Collections.
+ */
+ String specification() default "";
+
+ /**
+ * Inject a proxy instead of the real object.
+ * This allows passing this reference to collaborators.
+ * Default: false
+ */
+ boolean proxy() default false;
+
+}
diff --git a/ipojo/handler/temporal/src/main/java/org/apache/felix/ipojo/handler/temporal/TemporalHandler.java b/ipojo/handler/temporal/src/main/java/org/apache/felix/ipojo/handler/temporal/TemporalHandler.java
index de9c2a8..6e05562 100644
--- a/ipojo/handler/temporal/src/main/java/org/apache/felix/ipojo/handler/temporal/TemporalHandler.java
+++ b/ipojo/handler/temporal/src/main/java/org/apache/felix/ipojo/handler/temporal/TemporalHandler.java
@@ -1,4 +1,4 @@
-/*
+/*
* 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
@@ -41,12 +41,12 @@
* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
*/
public class TemporalHandler extends PrimitiveHandler implements DependencyStateListener {
-
+
/**
* Default timeout if not specified.
*/
public static final int DEFAULT_TIMEOUT = 3000;
-
+
/**
* No policy.
*/
@@ -64,15 +64,15 @@
*/
public static final int EMPTY = 3;
/**
- * Uses {@code null}.
+ * Uses {@code null}.
*/
public static final int NULL = 4;
-
+
/**
* The handler namespace.
*/
public static final String NAMESPACE = "org.apache.felix.ipojo.handler.temporal";
-
+
/**
* The list of managed dependencies.
*/
@@ -87,7 +87,7 @@
((TemporalDependency) m_dependencies.get(i)).start();
}
}
-
+
/**
* Stop method. Stops managed dependencies.
* @see org.apache.felix.ipojo.Handler#stop()
@@ -109,6 +109,12 @@
public void configure(Element meta, Dictionary dictionary) throws ConfigurationException {
PojoMetadata manipulation = getFactory().getPojoMetadata();
Element[] deps = meta.getElements("requires", NAMESPACE);
+
+ // Also check with temporal is no requires.
+ if (deps == null || deps.length == 0) {
+ deps = meta.getElements("temporal", NAMESPACE);
+ }
+
for (int i = 0; i < deps.length; i++) {
if (!deps[i].containsAttribute("field") || m_dependencies.contains(deps[i].getAttribute("field"))) {
error("One temporal dependency must be attached to a field or the field is already used");
@@ -120,10 +126,10 @@
if (fieldmeta == null) {
error("The field " + field + " does not exist in the class " + getInstanceManager().getClassName());
return;
- }
-
+ }
+
String fil = deps[i].getAttribute("filter");
- Filter filter = null;
+ Filter filter = null;
if (fil != null) {
try {
filter = getInstanceManager().getContext().createFilter(fil);
@@ -132,7 +138,7 @@
return;
}
}
-
+
boolean agg = false;
boolean collection = false;
String spec = fieldmeta.getFieldType();
@@ -148,24 +154,24 @@
error("A dependency injected inside a Collection must contain the 'specification' attribute");
}
}
-
+
String prox = deps[i].getAttribute("proxy");
//boolean proxy = prox != null && prox.equals("true");
// Use proxy by default except for array:
boolean proxy = prox == null || prox.equals("true");
-
+
if (prox == null && proxy) { // Proxy set because of the default.
if (agg && ! collection) { // Aggregate and array
proxy = false;
}
}
-
+
if (proxy && agg) {
if (! collection) {
error("Proxied aggregate temporal dependencies cannot be an array. Only collections are supported");
}
}
-
+
long timeout = DEFAULT_TIMEOUT;
if (deps[i].containsAttribute("timeout")) {
String to = deps[i].getAttribute("timeout");
@@ -175,7 +181,7 @@
timeout = new Long(deps[i].getAttribute("timeout")).longValue();
}
}
-
+
int policy = NO_POLICY;
String di = null;
String onTimeout = deps[i].getAttribute("onTimeout");
@@ -195,20 +201,20 @@
policy = DEFAULT_IMPLEMENTATION;
}
}
-
+
Class specification = DependencyModel.loadSpecification(spec, getInstanceManager().getContext());
TemporalDependency dep = new TemporalDependency(specification, agg, collection, proxy, filter, getInstanceManager().getContext(), timeout, policy, di, this);
m_dependencies.add(dep);
-
+
if (! proxy) { // Register method interceptor only if are not a proxy
MethodMetadata[] methods = manipulation.getMethods();
for (int k = 0; k < methods.length; k++) {
getInstanceManager().register(methods[k], dep);
}
}
-
+
getInstanceManager().register(fieldmeta, dep);
- }
+ }
}
/**
@@ -226,6 +232,6 @@
* @see org.apache.felix.ipojo.util.DependencyStateListener#validate(org.apache.felix.ipojo.util.DependencyModel)
*/
public void validate(DependencyModel dependencymodel) { }
-
+
}
diff --git a/ipojo/handler/temporal/src/main/resources/metadata.xml b/ipojo/handler/temporal/src/main/resources/metadata.xml
index bd52e4c..e514b20 100644
--- a/ipojo/handler/temporal/src/main/resources/metadata.xml
+++ b/ipojo/handler/temporal/src/main/resources/metadata.xml
@@ -6,9 +6,9 @@
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
@@ -21,4 +21,8 @@
classname="org.apache.felix.ipojo.handler.temporal.TemporalHandler"
name="requires" namespace="org.apache.felix.ipojo.handler.temporal">
</handler>
+ <handler
+ classname="org.apache.felix.ipojo.handler.temporal.TemporalHandler"
+ name="temporal" namespace="org.apache.felix.ipojo.handler.temporal">
+ </handler>
</ipojo>
\ No newline at end of file
diff --git a/ipojo/handler/temporal/src/main/resources/temporal.xsd b/ipojo/handler/temporal/src/main/resources/temporal.xsd
index 3f2d47c..33bd3bd 100644
--- a/ipojo/handler/temporal/src/main/resources/temporal.xsd
+++ b/ipojo/handler/temporal/src/main/resources/temporal.xsd
@@ -6,9 +6,9 @@
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
@@ -21,6 +21,8 @@
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:element name="requires" type="TemporalServiceDependencyType"></xs:element>
+ <xs:element name="temporal" type="TemporalServiceDependencyType"></xs:element>
+
<xs:complexType name="TemporalServiceDependencyType">
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/TemporalDependencies.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/TemporalDependencies.java
index c364c7a..353c910 100644
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/TemporalDependencies.java
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/TemporalDependencies.java
@@ -5,13 +5,13 @@
import org.apache.felix.ipojo.metadata.Element;
public class TemporalDependencies extends OSGiTestCase {
-
+
private IPOJOHelper helper;
-
+
public void setUp() {
helper = new IPOJOHelper(this);
}
-
+
public void testSimple() {
Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalSimple");
Element[] provs = meta.getElements("requires", "org.apache.felix.ipojo.handler.temporal");
@@ -24,7 +24,20 @@
String oto = provs[0].getAttribute("onTimeout");
assertNull("No onTimeout", oto);
}
-
+
+ public void testTemporal() {
+ Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.temporal.Temporal");
+ Element[] provs = meta.getElements("temporal", "org.apache.felix.ipojo.handler.temporal");
+ assertNotNull("Temporal exists ", provs);
+ String field = provs[0].getAttribute("field");
+ assertNotNull("Field not null", field);
+ assertEquals("Field is fs", "fs", field);
+ String to = provs[0].getAttribute("timeout");
+ assertNull("No timeout", to);
+ String oto = provs[0].getAttribute("onTimeout");
+ assertNull("No onTimeout", oto);
+ }
+
public void testDI() {
Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalWithDI");
Element[] provs = meta.getElements("requires", "org.apache.felix.ipojo.handler.temporal");
@@ -32,12 +45,12 @@
String field = provs[0].getAttribute("field");
assertNotNull("Field not null", field);
assertEquals("Field is fs", "fs", field);
-
+
String oto = provs[0].getAttribute("onTimeout");
assertEquals("onTimeout is the DI", "org.apache.felix.ipojo.test.scenarios.component.ProvidesSimple", oto);
-
+
}
-
+
public void testEmptyArray() {
Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalWithEmptyArray");
Element[] provs = meta.getElements("requires", "org.apache.felix.ipojo.handler.temporal");
@@ -45,12 +58,12 @@
String field = provs[0].getAttribute("field");
assertNotNull("Field not null", field);
assertEquals("Field is fs", "fs", field);
-
+
String oto = provs[0].getAttribute("onTimeout");
assertEquals("onTimeout is empty-array", "empty-array", oto);
-
+
}
-
+
public void testNull() {
Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalWithNull");
Element[] provs = meta.getElements("requires", "org.apache.felix.ipojo.handler.temporal");
@@ -58,12 +71,12 @@
String field = provs[0].getAttribute("field");
assertNotNull("Field not null", field);
assertEquals("Field is fs", "fs", field);
-
+
String oto = provs[0].getAttribute("onTimeout");
assertEquals("onTimeout is null", "null", oto);
-
+
}
-
+
public void testNullable() {
Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalWithNullable");
Element[] provs = meta.getElements("requires", "org.apache.felix.ipojo.handler.temporal");
@@ -71,12 +84,12 @@
String field = provs[0].getAttribute("field");
assertNotNull("Field not null", field);
assertEquals("Field is fs", "fs", field);
-
+
String oto = provs[0].getAttribute("onTimeout");
assertEquals("onTimeout is nullable", "nullable", oto);
-
+
}
-
+
public void testFilter() {
Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalWithFilter");
Element[] provs = meta.getElements("requires", "org.apache.felix.ipojo.handler.temporal");
@@ -84,12 +97,12 @@
String field = provs[0].getAttribute("field");
assertNotNull("Field not null", field);
assertEquals("Field is fs", "fs", field);
-
+
String filter = provs[0].getAttribute("filter");
assertEquals("Filter", "(vendor=clement)", filter);
-
+
}
-
+
public void testTimeout() {
Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalWithTimeout");
Element[] provs = meta.getElements("requires", "org.apache.felix.ipojo.handler.temporal");
@@ -97,12 +110,12 @@
String field = provs[0].getAttribute("field");
assertNotNull("Field not null", field);
assertEquals("Field is fs", "fs", field);
-
+
String to = provs[0].getAttribute("timeout");
assertEquals("Check timeout", "100", to);
-
+
}
-
+
public void testSimpleCollection() {
Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalCollection");
Element dep = getElementPerField(meta, "fs1");
@@ -110,7 +123,7 @@
assertNotNull("Specification not null", spec);
assertEquals("Check specification", "org.apache.felix.ipojo.test.scenarios.annotations.service.FooService", spec);
}
-
+
public void testCollectionWithTimeout() {
Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalCollection");
Element dep = getElementPerField(meta, "fs2");
@@ -120,7 +133,7 @@
String to = dep.getAttribute("timeout");
assertEquals("Check timeout", "300", to);
}
-
+
public void testCollectionWithPolicy() {
Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalCollection");
Element dep = getElementPerField(meta, "fs3");
@@ -130,7 +143,7 @@
String to = dep.getAttribute("ontimeout");
assertEquals("Check policy", "empty", to);
}
-
+
public void testCollectionWithProxy() {
Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalCollection");
Element dep = getElementPerField(meta, "fs4");
@@ -140,7 +153,7 @@
String proxy = dep.getAttribute("proxy");
assertEquals("Check proxy", "true", proxy);
}
-
+
private Element getElementPerField(Element elem, String field) {
Element[] provs = elem.getElements("requires", "org.apache.felix.ipojo.handler.temporal");
assertNotNull("Temporal exists ", provs);
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/temporal/Temporal.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/temporal/Temporal.java
new file mode 100644
index 0000000..c2b9d5c
--- /dev/null
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/temporal/Temporal.java
@@ -0,0 +1,13 @@
+package org.apache.felix.ipojo.test.scenarios.component.temporal;
+
+import org.apache.felix.ipojo.annotations.Component;
+import org.apache.felix.ipojo.handler.temporal.Requires;
+import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
+
+@Component
+public class Temporal {
+
+ @org.apache.felix.ipojo.handler.temporal.Temporal
+ private FooService fs;
+
+}
diff --git a/ipojo/tests/handler/temporal/pom.xml b/ipojo/tests/handler/temporal/pom.xml
index d20cb9b..6f54cdd 100644
--- a/ipojo/tests/handler/temporal/pom.xml
+++ b/ipojo/tests/handler/temporal/pom.xml
@@ -82,7 +82,7 @@
org.apache.felix.ipojo.test*
</Private-Package>
<Test-Suite>
- org.apache.felix.ipojo.test.scenarios.temporal.TemporalTestSuite
+ org.apache.felix.ipojo.test.scenarios.temporal.TemporalTestSuite
</Test-Suite>
</instructions>
</configuration>
@@ -98,9 +98,9 @@
</execution>
</executions>
</plugin>
-
-
- <plugin>
+
+
+ <plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-junit4osgi-plugin</artifactId>
<version>1.1.0-SNAPSHOT</version>
diff --git a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/TemporalTest.java b/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/TemporalTest.java
new file mode 100644
index 0000000..b8d884d
--- /dev/null
+++ b/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/TemporalTest.java
@@ -0,0 +1,339 @@
+/*
+ * 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.temporal;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.scenarios.temporal.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.temporal.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+import org.osgi.framework.ServiceReference;
+
+public class TemporalTest extends OSGiTestCase {
+
+ public void testDelay() {
+ String prov = "provider";
+ ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
+ String un = "under-1";
+ ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-CheckServiceProviderUsingTemporal", un);
+
+ ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
+ assertNotNull("Check foo availability", ref_fs);
+
+ ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+ assertNotNull("Check cs availability", ref_cs);
+
+ CheckService cs = (CheckService) context.getService(ref_cs);
+ assertTrue("Check invocation", cs.check());
+
+ // Stop the provider.
+ provider.stop();
+ assertNull("No FooService", Utils.getServiceReference(context, FooService.class.getName(), null));
+ ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+ assertNotNull("Check cs availability - 2", ref_cs);
+ long begin = System.currentTimeMillis();
+ DelayedProvider dp = new DelayedProvider(provider, 200);
+ dp.start();
+ cs = (CheckService) context.getService(ref_cs);
+
+ assertTrue("Check invocation - 2", cs.check());
+ long end = System.currentTimeMillis();
+
+ assertTrue("Assert delay (" + (end - begin) + ")", (end - begin) >= 200);
+
+ ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+ assertNotNull("Check cs availability - 3", ref_cs);
+ cs = (CheckService) context.getService(ref_cs);
+ assertTrue("Check invocation - 3", cs.check());
+
+ provider.stop();
+ provider.dispose();
+ under.stop();
+ under.dispose();
+ }
+
+ public void testDelayWithProxy() {
+ String prov = "provider";
+ ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
+ String un = "under-1";
+ ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-ProxiedCheckServiceProviderUsingTemporal", un);
+
+ ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
+ assertNotNull("Check foo availability", ref_fs);
+
+ ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+ assertNotNull("Check cs availability", ref_cs);
+
+ CheckService cs = (CheckService) context.getService(ref_cs);
+ assertTrue("Check invocation", cs.check());
+
+ // Stop the provider.
+ provider.stop();
+ ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+ assertNotNull("Check cs availability - 2", ref_cs);
+ long begin = System.currentTimeMillis();
+ DelayedProvider dp = new DelayedProvider(provider, 200);
+ dp.start();
+ cs = (CheckService) context.getService(ref_cs);
+ assertTrue("Check invocation - 2", cs.check());
+ long end = System.currentTimeMillis();
+
+ assertTrue("Assert delay", (end - begin) >= 200);
+
+ ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+ assertNotNull("Check cs availability - 3", ref_cs);
+ cs = (CheckService) context.getService(ref_cs);
+ assertTrue("Check invocation - 3", cs.check());
+
+ provider.stop();
+ provider.dispose();
+ under.stop();
+ under.dispose();
+ }
+
+
+ public void testTimeout() {
+ String prov = "provider";
+ ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
+ String un = "under-1";
+ ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-CheckServiceProviderUsingTemporal", un);
+
+ ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
+ assertNotNull("Check foo availability", ref_fs);
+
+ ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+ assertNotNull("Check cs availability", ref_cs);
+
+ CheckService cs = (CheckService) context.getService(ref_cs);
+ assertTrue("Check invocation", cs.check());
+
+ // Stop the provider.
+ provider.stop();
+ ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+ assertNotNull("Check cs availability - 2", ref_cs);
+ DelayedProvider dp = new DelayedProvider(provider, 4000);
+ dp.start();
+ cs = (CheckService) context.getService(ref_cs);
+ try {
+ cs.check();
+ } catch(RuntimeException e) {
+ // OK
+ dp.stop();
+ provider.stop();
+ provider.dispose();
+ under.stop();
+ under.dispose();
+ return;
+ }
+
+ fail("Timeout expected");
+ }
+
+
+ public void testTimeoutWithProxy() {
+ String prov = "provider";
+ ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
+ String un = "under-1";
+ ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-ProxiedCheckServiceProviderUsingTemporal", un);
+
+ ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
+ assertNotNull("Check foo availability", ref_fs);
+
+ ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+ assertNotNull("Check cs availability", ref_cs);
+
+ CheckService cs = (CheckService) context.getService(ref_cs);
+ assertTrue("Check invocation", cs.check());
+
+ // Stop the provider.
+ provider.stop();
+ ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+ assertNotNull("Check cs availability - 2", ref_cs);
+ DelayedProvider dp = new DelayedProvider(provider, 4000);
+ dp.start();
+ cs = (CheckService) context.getService(ref_cs);
+ try {
+ cs.check();
+ } catch(RuntimeException e) {
+ // OK
+ dp.stop();
+ provider.stop();
+ provider.dispose();
+ under.stop();
+ under.dispose();
+ return;
+ }
+
+ fail("Timeout expected");
+ }
+
+
+ public void testDelayTimeout() {
+ String prov = "provider";
+ ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
+ String un = "under-1";
+ ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-CheckServiceProviderTimeoutUsingTemporal", un);
+
+ ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
+ assertNotNull("Check foo availability", ref_fs);
+
+ ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+ assertNotNull("Check cs availability", ref_cs);
+
+ CheckService cs = (CheckService) context.getService(ref_cs);
+ assertTrue("Check invocation", cs.check());
+
+ // Stop the provider.
+ provider.stop();
+ ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+ assertNotNull("Check cs availability - 2", ref_cs);
+ long begin = System.currentTimeMillis();
+ DelayedProvider dp = new DelayedProvider(provider, 200);
+ dp.start();
+ cs = (CheckService) context.getService(ref_cs);
+ assertTrue("Check invocation - 2", cs.check());
+ long end = System.currentTimeMillis();
+
+ assertTrue("Assert delay", (end - begin) >= 200);
+
+ ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+ assertNotNull("Check cs availability - 3", ref_cs);
+ cs = (CheckService) context.getService(ref_cs);
+ assertTrue("Check invocation - 3", cs.check());
+
+ provider.stop();
+ provider.dispose();
+ under.stop();
+ under.dispose();
+ }
+
+ public void testDelayTimeoutWithProxy() {
+ String prov = "provider";
+ ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
+ String un = "under-1";
+ ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-ProxiedCheckServiceProviderTimeoutUsingTemporal", un);
+
+ ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
+ assertNotNull("Check foo availability", ref_fs);
+
+ ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+ assertNotNull("Check cs availability", ref_cs);
+
+ CheckService cs = (CheckService) context.getService(ref_cs);
+ assertTrue("Check invocation", cs.check());
+
+ // Stop the provider.
+ provider.stop();
+ ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+ assertNotNull("Check cs availability - 2", ref_cs);
+ long begin = System.currentTimeMillis();
+ DelayedProvider dp = new DelayedProvider(provider, 200);
+ dp.start();
+ cs = (CheckService) context.getService(ref_cs);
+ assertTrue("Check invocation - 2", cs.check());
+ long end = System.currentTimeMillis();
+
+ assertTrue("Assert delay", (end - begin) >= 200);
+
+ ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+ assertNotNull("Check cs availability - 3", ref_cs);
+ cs = (CheckService) context.getService(ref_cs);
+ assertTrue("Check invocation - 3", cs.check());
+
+ provider.stop();
+ provider.dispose();
+ under.stop();
+ under.dispose();
+ }
+
+ public void testSetTimeout() {
+ String prov = "provider";
+ ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
+ String un = "under-1";
+ ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-CheckServiceProviderTimeoutUsingTemporal", un);
+
+ ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
+ assertNotNull("Check foo availability", ref_fs);
+
+ ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+ assertNotNull("Check cs availability", ref_cs);
+
+ CheckService cs = (CheckService) context.getService(ref_cs);
+ assertTrue("Check invocation", cs.check());
+
+ // Stop the provider.
+ provider.stop();
+ ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+ assertNotNull("Check cs availability - 2", ref_cs);
+ DelayedProvider dp = new DelayedProvider(provider, 400);
+ dp.start();
+ cs = (CheckService) context.getService(ref_cs);
+ try {
+ cs.check();
+ } catch(RuntimeException e) {
+ // OK
+ dp.stop();
+ provider.stop();
+ provider.dispose();
+ under.stop();
+ under.dispose();
+ return;
+ }
+
+ fail("Timeout expected");
+ }
+
+
+ public void testSetTimeoutWithProxy() {
+ String prov = "provider";
+ ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
+ String un = "under-1";
+ ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-ProxiedCheckServiceProviderTimeoutUsingTemporal", un);
+
+ ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
+ assertNotNull("Check foo availability", ref_fs);
+
+ ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+ assertNotNull("Check cs availability", ref_cs);
+
+ CheckService cs = (CheckService) context.getService(ref_cs);
+ assertTrue("Check invocation", cs.check());
+
+ // Stop the provider.
+ provider.stop();
+ ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+ assertNotNull("Check cs availability - 2", ref_cs);
+ DelayedProvider dp = new DelayedProvider(provider, 400);
+ dp.start();
+ cs = (CheckService) context.getService(ref_cs);
+ try {
+ cs.check();
+ } catch(RuntimeException e) {
+ // OK
+ dp.stop();
+ provider.stop();
+ provider.dispose();
+ under.stop();
+ under.dispose();
+ return;
+ }
+
+ fail("Timeout expected");
+ }
+}
diff --git a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/TemporalTestSuite.java b/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/TemporalTestSuite.java
index a03b6a5..180a39c 100644
--- a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/TemporalTestSuite.java
+++ b/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/TemporalTestSuite.java
@@ -1,4 +1,4 @@
-/*
+/*
* 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
@@ -30,10 +30,11 @@
OSGiTestSuite ots = new OSGiTestSuite("Temporal Dependency Test Suite", bc);
ots.addTestSuite(NoDelayTest.class);
ots.addTestSuite(DelayTest.class);
- ots.addTestSuite(NullableTest.class);
+ ots.addTestSuite(NullableTest.class);
ots.addTestSuite(DefaultImplementationTest.class);
ots.addTestSuite(NullTest.class);
ots.addTestSuite(EmptyTest.class);
+ ots.addTestSuite(TemporalTest.class);
return ots;
}
diff --git a/ipojo/tests/handler/temporal/src/main/resources/metadata.xml b/ipojo/tests/handler/temporal/src/main/resources/metadata.xml
index 2588b5b..0ce312d 100644
--- a/ipojo/tests/handler/temporal/src/main/resources/metadata.xml
+++ b/ipojo/tests/handler/temporal/src/main/resources/metadata.xml
@@ -1,6 +1,6 @@
<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
+ xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd
org.apache.felix.ipojo.handler.temporal http://felix.apache.org/ipojo/schemas/SNAPSHOT/temporal.xsd"
xmlns="org.apache.felix.ipojo"
xmlns:temp="org.apache.felix.ipojo.handler.temporal">
@@ -8,220 +8,237 @@
<temp:requires field="fs"/>
<provides/>
</component>
-
+ <component classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider" name="TEMPORAL-CheckServiceProviderUsingTemporal">
+ <temp:temporal field="fs"/>
+ <provides/>
+ </component>
+
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCheckServiceProvider" name="TEMPORAL-ProxiedCheckServiceProvider">
<temp:requires field="fs" proxy="true"/>
<provides/>
</component>
-
+ <component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCheckServiceProvider" name="TEMPORAL-ProxiedCheckServiceProviderUsingTemporal">
+ <temp:temporal field="fs" proxy="true"/>
+ <provides/>
+ </component>
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider" name="TEMPORAL-CheckServiceProviderTimeout">
<temp:requires field="fs" timeout="300"/>
<provides/>
</component>
-
+ <component classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider" name="TEMPORAL-CheckServiceProviderTimeoutUsingTemporal">
+ <temp:temporal field="fs" timeout="300"/>
+ <provides/>
+ </component>
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCheckServiceProvider" name="TEMPORAL-ProxiedCheckServiceProviderTimeout">
<temp:requires field="fs" proxy="true" timeout="300"/>
<provides/>
</component>
-
+ <component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCheckServiceProvider" name="TEMPORAL-ProxiedCheckServiceProviderTimeoutUsingTemporal">
+ <temp:temporal field="fs" proxy="true" timeout="300"/>
+ <provides/>
+ </component>
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckServiceProvider" name="TEMPORAL-MultipleCheckServiceProvider">
<temp:requires field="fs"/>
<provides/>
</component>
-
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.CollectionCheckServiceProvider" name="TEMPORAL-ColCheckServiceProvider">
<temp:requires field="fs" specification="org.apache.felix.ipojo.test.scenarios.temporal.service.FooService"/>
<provides/>
</component>
-
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCollectionCheckServiceProvider" name="TEMPORAL-ProxiedColCheckServiceProvider">
<temp:requires field="fs" proxy="true" specification="org.apache.felix.ipojo.test.scenarios.temporal.service.FooService"/>
<provides/>
</component>
-
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.FooProvider" name="TEMPORAL-FooProvider">
<provides/>
</component>
-
+
<!-- Dependencies using nullables -->
<component classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckServiceProvider" name="TEMPORAL-NullableMultipleCheckServiceProvider">
<temp:requires field="fs" onTimeout="nullable"/>
<provides/>
</component>
-
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.CollectionCheckServiceProvider" name="TEMPORAL-NullableColCheckServiceProvider">
<temp:requires field="fs" onTimeout="nullable" specification="org.apache.felix.ipojo.test.scenarios.temporal.service.FooService"/>
<provides/>
</component>
-
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCollectionCheckServiceProvider" name="TEMPORAL-NullableProxiedColCheckServiceProvider">
<temp:requires field="fs" proxy="true" onTimeout="nullable" specification="org.apache.felix.ipojo.test.scenarios.temporal.service.FooService"/>
<provides/>
</component>
-
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider" name="TEMPORAL-NullableCheckServiceProvider">
<temp:requires field="fs" onTimeout="nullable"/>
<provides/>
</component>
-
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCheckServiceProvider" name="TEMPORAL-NullableProxiedCheckServiceProvider">
<temp:requires field="fs" proxy="true" onTimeout="nullable"/>
<provides/>
</component>
-
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider" name="TEMPORAL-NullableCheckServiceProviderTimeout">
<temp:requires field="fs" timeout="300" onTimeout="nullable"/>
<provides/>
</component>
-
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCheckServiceProvider" name="TEMPORAL-NullableProxiedCheckServiceProviderTimeout">
<temp:requires field="fs" proxy="true" onTimeout="nullable" timeout="300"/>
<provides/>
</component>
-
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckServiceProvider" name="TEMPORAL-NullableMultipleCheckServiceProviderTimeout">
<temp:requires field="fs" timeout="300" onTimeout="nullable"/>
<provides/>
</component>
-
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.CollectionCheckServiceProvider" name="TEMPORAL-NullableColCheckServiceProviderTimeout">
<temp:requires field="fs" onTimeout="nullable" timeout="300" specification="org.apache.felix.ipojo.test.scenarios.temporal.service.FooService"/>
<provides/>
</component>
-
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCollectionCheckServiceProvider" name="TEMPORAL-NullableProxiedColCheckServiceProviderTimeout">
<temp:requires field="fs" proxy="true" onTimeout="nullable" timeout="300" specification="org.apache.felix.ipojo.test.scenarios.temporal.service.FooService"/>
<provides/>
</component>
-
+
<!-- Dependencies using default implementation -->
<component classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckServiceProvider" name="TEMPORAL-DIMultipleCheckServiceProvider">
<temp:requires field="fs" onTimeout="org.apache.felix.ipojo.test.scenarios.component.NullableFooProvider"/>
<provides/>
</component>
-
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.CollectionCheckServiceProvider" name="TEMPORAL-DIColCheckServiceProvider">
<temp:requires field="fs" onTimeout="org.apache.felix.ipojo.test.scenarios.component.NullableFooProvider" specification="org.apache.felix.ipojo.test.scenarios.temporal.service.FooService"/>
<provides/>
</component>
-
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCollectionCheckServiceProvider" name="TEMPORAL-DIProxiedColCheckServiceProvider">
<temp:requires field="fs" proxy="true" onTimeout="org.apache.felix.ipojo.test.scenarios.component.NullableFooProvider" specification="org.apache.felix.ipojo.test.scenarios.temporal.service.FooService"/>
<provides/>
</component>
-
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider" name="TEMPORAL-DICheckServiceProvider">
<temp:requires field="fs" onTimeout="org.apache.felix.ipojo.test.scenarios.component.NullableFooProvider"/>
<provides/>
</component>
-
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCheckServiceProvider" name="TEMPORAL-DIProxiedCheckServiceProvider">
<temp:requires field="fs" proxy="true" onTimeout="org.apache.felix.ipojo.test.scenarios.component.NullableFooProvider"/>
<provides/>
</component>
-
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider" name="TEMPORAL-DICheckServiceProviderTimeout">
<temp:requires field="fs" timeout="300" onTimeout="org.apache.felix.ipojo.test.scenarios.component.NullableFooProvider"/>
<provides/>
</component>
-
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCheckServiceProvider" name="TEMPORAL-DIProxiedCheckServiceProviderTimeout">
<temp:requires field="fs" proxy="true" timeout="300" onTimeout="org.apache.felix.ipojo.test.scenarios.component.NullableFooProvider"/>
<provides/>
</component>
-
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckServiceProvider" name="TEMPORAL-DIMultipleCheckServiceProviderTimeout">
<temp:requires field="fs" timeout="300" onTimeout="org.apache.felix.ipojo.test.scenarios.component.NullableFooProvider"/>
<provides/>
</component>
-
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.CollectionCheckServiceProvider" name="TEMPORAL-DIColCheckServiceProviderTimeout">
<temp:requires field="fs" timeout="300" onTimeout="org.apache.felix.ipojo.test.scenarios.component.NullableFooProvider" specification="org.apache.felix.ipojo.test.scenarios.temporal.service.FooService"/>
<provides/>
</component>
-
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCollectionCheckServiceProvider" name="TEMPORAL-DIProxiedColCheckServiceProviderTimeout">
<temp:requires field="fs" proxy="true" timeout="300" onTimeout="org.apache.felix.ipojo.test.scenarios.component.NullableFooProvider" specification="org.apache.felix.ipojo.test.scenarios.temporal.service.FooService"/>
<provides/>
</component>
-
+
<!-- Dependencies using null -->
<component classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckServiceProvider" name="TEMPORAL-NullMultipleCheckServiceProvider">
<temp:requires field="fs" onTimeout="null"/>
<provides/>
</component>
-
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.CollectionCheckServiceProvider" name="TEMPORAL-NullColCheckServiceProvider">
<temp:requires field="fs" onTimeout="null" specification="org.apache.felix.ipojo.test.scenarios.temporal.service.FooService"/>
<provides/>
</component>
-
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCollectionCheckServiceProvider" name="TEMPORAL-NullProxiedColCheckServiceProvider">
<temp:requires field="fs" proxy="true" onTimeout="null" specification="org.apache.felix.ipojo.test.scenarios.temporal.service.FooService"/>
<provides/>
</component>
-
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider" name="TEMPORAL-NullCheckServiceProvider">
<temp:requires field="fs" onTimeout="null"/>
<provides/>
</component>
-
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCheckServiceProvider" name="TEMPORAL-NullProxiedCheckServiceProvider">
<temp:requires field="fs" proxy="true" onTimeout="null"/>
<provides/>
</component>
-
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider" name="TEMPORAL-NullCheckServiceProviderTimeout">
<temp:requires field="fs" timeout="300" onTimeout="null"/>
<provides/>
</component>
-
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCheckServiceProvider" name="TEMPORAL-NullProxiedCheckServiceProviderTimeout">
<temp:requires field="fs" proxy="true" timeout="300" onTimeout="null"/>
<provides/>
</component>
-
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckServiceProvider" name="TEMPORAL-NullMultipleCheckServiceProviderTimeout">
<temp:requires field="fs" timeout="300" onTimeout="null"/>
<provides/>
</component>
-
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.CollectionCheckServiceProvider" name="TEMPORAL-NullColCheckServiceProviderTimeout">
<temp:requires field="fs" timeout="300" onTimeout="null" specification="org.apache.felix.ipojo.test.scenarios.temporal.service.FooService"/>
<provides/>
</component>
-
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCollectionCheckServiceProvider" name="TEMPORAL-NullProxiedColCheckServiceProviderTimeout">
<temp:requires field="fs" proxy="true" timeout="300" onTimeout="null" specification="org.apache.felix.ipojo.test.scenarios.temporal.service.FooService"/>
<provides/>
</component>
-
+
<!-- Dependencies using empty arrays -->
<component classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckServiceProvider" name="TEMPORAL-EmptyMultipleCheckServiceProvider">
<temp:requires field="fs" onTimeout="empty-array"/>
<provides/>
</component>
-
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.CollectionCheckServiceProvider" name="TEMPORAL-EmptyColCheckServiceProvider">
<temp:requires field="fs" onTimeout="empty" specification="org.apache.felix.ipojo.test.scenarios.temporal.service.FooService"/>
<provides/>
</component>
-
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCollectionCheckServiceProvider" name="TEMPORAL-EmptyProxiedColCheckServiceProvider">
<temp:requires field="fs" proxy="true" onTimeout="empty" specification="org.apache.felix.ipojo.test.scenarios.temporal.service.FooService"/>
<provides/>
</component>
-
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckServiceProvider" name="TEMPORAL-EmptyMultipleCheckServiceProviderTimeout">
<temp:requires field="fs" timeout="300" onTimeout="empty-array"/>
<provides/>
</component>
-
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.CollectionCheckServiceProvider" name="TEMPORAL-EmptyColCheckServiceProviderTimeout">
<temp:requires field="fs" timeout="300" onTimeout="empty" specification="org.apache.felix.ipojo.test.scenarios.temporal.service.FooService"/>
<provides/>
</component>
-
+
<component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCollectionCheckServiceProvider" name="TEMPORAL-EmptyProxiedColCheckServiceProviderTimeout">
<temp:requires field="fs" timeout="300" proxy="true" onTimeout="empty" specification="org.apache.felix.ipojo.test.scenarios.temporal.service.FooService"/>
<provides/>