in atomos/src/main/java/org/apache/felix/atomos/impl/base/AtomosBase.java [1717:1772]
private void installAtomosContents(AtomosLayer atomosLayer,
boolean installBundles,
boolean startBundles)
{
if (installBundles)
{
debug("Installing Atomos content.");
List<Bundle> bundles = new ArrayList<>();
atomosLayer.getAtomosContents().stream().sorted().forEach((atomosContent) -> //
{
if (getBundle(atomosContent) == null)
{
debug("Installing AtomosContent: %s", atomosContent);
try
{
Bundle b = atomosContent.install();
if (b != null && b.getBundleId() != 0)
{
bundles.add(b);
}
}
catch (BundleException e)
{
debug("Failed to install to install %s: %s", atomosContent,
e.getMessage());
}
}
});
if (startBundles)
{
for (Bundle b : bundles)
{
debug("Starting connected bundle: %s", b);
BundleRevision rev = b.adapt(BundleRevision.class);
if ((rev.getTypes() & BundleRevision.TYPE_FRAGMENT) == 0)
{
try
{
b.start();
}
catch (BundleException e)
{
debug("Failed to install to install %s: %s", e,
b,
e.getMessage());
}
}
}
for (AtomosLayer child : atomosLayer.getChildren())
{
installAtomosContents(child, installBundles, startBundles);
}
}
}
}