}
// unpackLocation returns null if no jbi descriptor is found
if (tmpDir == null) {
throw failure("deploy", "Unable to find jbi descriptor: " + location);
}
Descriptor root = null;
try {
root = DescriptorFactory.buildDescriptor(tmpDir);
} catch (Exception e) {
throw failure("deploy", "Unable to build jbi descriptor: " + location, e);
}
if (root == null) {
throw failure("deploy", "Unable to find jbi descriptor: " + location);
}
if (root != null) {
try {
container.getBroker().suspend();
if (root.getComponent() != null) {
updateComponent(entry, autoStart, tmpDir, root);
} else if (root.getSharedLibrary() != null) {
updateSharedLibrary(entry, tmpDir, root);
} else if (root.getServiceAssembly() != null) {
updateServiceAssembly(entry, autoStart, tmpDir, root);
}
} finally {
container.getBroker().resume();
}