in jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/SharedLibraryInstaller.java [74:105]
public void uninstall(boolean force) throws Exception {
// Shut down
stop(force);
// Retrieve shared library
SharedLibrary library = deployer.getSharedLibrary(getName());
if (library == null && !force) {
throw ManagementSupport.failure("uninstallSharedLibrary", "SharedLibrary '" + getName() + "' is not installed.");
}
// Check that it is not used by a running component
if (library.getComponents().length > 0 && !force) {
StringBuilder sb = new StringBuilder();
for (Component comp : library.getComponents()) {
if (sb.length() > 0) {
sb.append(", ");
}
sb.append(comp.getName());
}
throw ManagementSupport.failure("uninstallSharedLibrary", "Shared library " + getName() + " is in use by components " + sb.toString());
}
// Unregister library
deployer.unregisterSharedLibrary(library);
// Remove preferences
try {
deleteStorage();
} catch (IOException e) {
logger.warn("Error cleaning persistent state for component: " + getName(), e);
}
// Uninstall bundle
uninstallBundle();
// Remove files
FileUtil.deleteFile(installRoot);
}