package aQute.launchpad; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.Closeable; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.PrintStream; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.Hashtable; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.Set; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Consumer; import java.util.jar.JarOutputStream; import java.util.jar.Manifest; import java.util.stream.Collectors; import java.util.stream.Stream; import org.eclipse.jdt.annotation.Nullable; import org.osgi.annotation.versioning.ProviderType; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; import org.osgi.framework.BundleException; import org.osgi.framework.Constants; import org.osgi.framework.Filter; import org.osgi.framework.FrameworkEvent; import org.osgi.framework.FrameworkUtil; import org.osgi.framework.InvalidSyntaxException; import org.osgi.framework.ServiceEvent; import org.osgi.framework.ServiceException; import org.osgi.framework.ServiceReference; import org.osgi.framework.ServiceRegistration; import org.osgi.framework.hooks.service.EventListenerHook; import org.osgi.framework.hooks.service.FindHook; import org.osgi.framework.hooks.service.ListenerHook.ListenerInfo; import org.osgi.framework.launch.Framework; import org.osgi.framework.namespace.PackageNamespace; import org.osgi.framework.wiring.BundleCapability; import org.osgi.framework.wiring.BundleWiring; import org.osgi.framework.wiring.FrameworkWiring; //import org.osgi.service.component.runtime.ServiceComponentRuntime; //import org.osgi.service.component.runtime.dto.ComponentDescriptionDTO; import org.osgi.util.tracker.ServiceTracker; import aQute.bnd.service.specifications.RunSpecification; import aQute.launchpad.internal.ProbeImpl; import aQute.lib.converter.Converter; import aQute.lib.exceptions.Exceptions; import aQute.lib.inject.Injector; import aQute.lib.io.IO; import aQute.lib.startlevel.StartLevelRuntimeHandler; import aQute.lib.strings.Strings; import aQute.libg.glob.Glob; import aQute.libg.parameters.ParameterMap; /** * This class provides an OSGi framework that is configured with the current bnd * workspace. A project directory is used to find the workspace. This makes all * repositories in the workspace available to the framework. To be able to test * JUnit code against/in this framework it is necessary that all packages on the * buildpath and testpath are actually exported in the framework. This class * will ensure that. Once the framework is up and running it will be possible to * add bundles to it. There are a number of ways that this can be achieved: *