if (root.getComponent() != null) {
String componentName = root.getComponent().getIdentification().getName();
exists = container.getRegistry().isLocalComponentRegistered(componentName);
}
else if (root.getServiceAssembly() != null) {
ServiceAssembly sa = root.getServiceAssembly();
String name = sa.getIdentification().getName();
exists = deploymentService.isSaDeployed(name);
}
else if (root.getSharedLibrary() != null) {
String name = root.getSharedLibrary().getIdentification().getName();
exists = installationService.containsSharedLibrary(name);