in atomos/src/main/java/org/apache/felix/atomos/impl/base/AtomosBase.java [634:663]
protected final void addAtomosLayer(AtomosLayerBase atomosLayer)
{
addingLayer(atomosLayer);
if (idToLayer.putIfAbsent(atomosLayer.getId(), atomosLayer) != null)
{
throw new IllegalStateException(
"AtomosLayer already exists for id: " + atomosLayer.getId());
}
for (AtomosContent atomosContent : atomosLayer.getAtomosContents())
{
if (atomosLocationToAtomosContent.putIfAbsent(
atomosContent.getAtomosLocation(), (AtomosContentBase) atomosContent) != null)
{
throw new IllegalStateException("Atomos content location already exists: "
+ atomosContent.getAtomosLocation());
}
if (Constants.SYSTEM_BUNDLE_LOCATION.equals(atomosContent.getAtomosLocation()))
{
// system bundle location is always marked as connected
connectAtomosContent(Constants.SYSTEM_BUNDLE_LOCATION,
(AtomosContentBase) atomosContent);
}
}
for (AtomosLayer parent : atomosLayer.getParents())
{
((AtomosLayerBase) parent).addChild(atomosLayer);
}
}