Without update selectors we can't propagate the update
Nodes supporting updates can't propagate the update because we can't
differentiate which one we want to refresh.
diff --git a/component-dsl/src/main/java/org/apache/aries/component/dsl/internal/RefreshWhenOSGi.java b/component-dsl/src/main/java/org/apache/aries/component/dsl/internal/RefreshWhenOSGi.java
index 0db1055..e591787 100644
--- a/component-dsl/src/main/java/org/apache/aries/component/dsl/internal/RefreshWhenOSGi.java
+++ b/component-dsl/src/main/java/org/apache/aries/component/dsl/internal/RefreshWhenOSGi.java
@@ -28,24 +28,28 @@
public class RefreshWhenOSGi<T> extends OSGiImpl<T> {
public RefreshWhenOSGi(OSGi<T> program, Predicate<T> refresher) {
- super((executionContext, op) -> program.run(
- executionContext,
- op.pipe(
- t -> {
- OSGiResult osgiResult = op.publish(t);
+ super((executionContext, op) -> {
+ OSGiResult result = program.run(
+ executionContext,
+ op.pipe(
+ t -> {
+ OSGiResult osgiResult = op.publish(t);
- return new OSGiResultImpl(
- osgiResult::close,
- () -> {
- if (refresher.test(t)) {
- return true;
+ return new OSGiResultImpl(
+ osgiResult::close,
+ () -> {
+ if (refresher.test(t)) {
+ return true;
+ }
+
+ return osgiResult.update();
}
+ );
+ }
+ ));
- return osgiResult.update();
- }
- );
- }
- )));
+ return new OSGiResultImpl(result::close, () -> false);
+ });
}
}