From f869fa7fc3fbce76bc19745201bb62484dfc8efe Mon Sep 17 00:00:00 2001 From: gjoranv Date: Wed, 31 Aug 2022 14:11:38 +0200 Subject: Revert "Clean up bundles and allowed duplicates after a failed reconfig." This reverts commit b0a398eaeadfaf12e31bcfef2e41892439db1149. --- .../src/main/java/com/yahoo/container/di/Osgi.java | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'container-core/src/main/java/com/yahoo/container/di/Osgi.java') diff --git a/container-core/src/main/java/com/yahoo/container/di/Osgi.java b/container-core/src/main/java/com/yahoo/container/di/Osgi.java index 02f42fdb9b8..a3ebc909a6e 100644 --- a/container-core/src/main/java/com/yahoo/container/di/Osgi.java +++ b/container-core/src/main/java/com/yahoo/container/di/Osgi.java @@ -9,6 +9,7 @@ import org.osgi.framework.Bundle; import java.util.Collection; import java.util.Set; +import java.util.stream.Collectors; import static java.util.Collections.emptySet; @@ -16,8 +17,6 @@ import static java.util.Collections.emptySet; * This interface has default implementations of all methods, to allow using it * for testing, instead of mocking or a test implementation. * - * TODO: remove test code from this interface. - * * @author gjoranv * @author Tony Vaagenes * @author ollivir @@ -25,6 +24,7 @@ import static java.util.Collections.emptySet; public interface Osgi { default void installPlatformBundles(Collection bundlePaths) { + //System.out.println("installPlatformBundles " + bundlePaths); } /** @@ -32,21 +32,12 @@ public interface Osgi { * and therefore should be scheduled for uninstalling. */ default Set useApplicationBundles(Collection bundles) { - return emptySet(); - } - - /** - * To be used when a new application generation fails, e.g. during component construction. - * Reverts all state related to application bundles to the previous generation. - * - * Returns the set of bundles that was exclusively used by the new generation, - * and therefore should be scheduled for uninstalling. - */ - default Collection revertApplicationBundles() { + //System.out.println("useBundles " + bundles.stream().map(Object::toString).collect(Collectors.joining(", "))); return emptySet(); } default Class resolveClass(BundleInstantiationSpecification spec) { + //System.out.println("resolving class " + spec.classId); try { return Class.forName(spec.classId.getName()); } catch (ClassNotFoundException e) { @@ -55,6 +46,7 @@ public interface Osgi { } default Bundle getBundle(ComponentSpecification spec) { + //System.out.println("resolving bundle " + spec); return new MockBundle(); } } -- cgit v1.2.3