in atomos/src/main/java/org/apache/felix/atomos/impl/base/AtomosBase.java [282:316]
final void connectAtomosContent(
String connectLocation,
AtomosContentBase atomosContent)
{
debug("Connecting content: %s %s", atomosContent, connectLocation);
if (connectLocation == null)
{
throw new IllegalArgumentException("A null connect loation is not allowed.");
}
lockWrite();
try
{
AtomosContent existing = connectLocationToAtomosContent.get(connectLocation);
if (existing != null && !atomosContent.equals(existing))
{
throw new IllegalStateException(
"The bundle location is already used by the AtomosContent "
+ existing);
}
String computeLocation = atomosContentToConnectLocation.compute(atomosContent,
(c, l) -> l == null ? connectLocation : l);
if (!Objects.equals(connectLocation, computeLocation))
{
throw new IllegalStateException(
"Atomos content location is already set: " + computeLocation);
}
connectLocationToAtomosContent.put(connectLocation, atomosContent);
atomosKeyToConnectLocation.put(atomosContent.getKey(), connectLocation);
}
finally
{
unlockWrite();
}
}