AbstractName storeName = impl.getAbstractName();
Boolean inPlaceConfiguration = (Boolean) kernel.invoke(storeName, IS_IN_PLACE_CONFIGURATION_METH, new Object[]{previous}, IS_IN_PLACE_CONFIGURATION_SIG);
commandContext.setInPlace(inPlaceConfiguration.booleanValue());
doDeploy(target, false);
Artifact configID = Artifact.create(getResultTargetModuleIDs()[0].getModuleID());
LifecycleResults results = manager.reloadConfiguration(previous, configID.getVersion());
// Activate it
//todo: make this asynchronous
boolean newStarted = false;
for (Iterator it = results.getStopped().iterator(); it.hasNext();) {
Artifact name = (Artifact) it.next();
updateStatus("Stopped "+name);
}
for (Iterator it = results.getUnloaded().iterator(); it.hasNext();) {
Artifact name = (Artifact) it.next();
updateStatus("Unloaded "+name);
}
for (Iterator it = results.getLoaded().iterator(); it.hasNext();) {
Artifact name = (Artifact) it.next();
updateStatus("Loaded "+name);
}
for (Iterator it = results.getStarted().iterator(); it.hasNext();) {
Artifact name = (Artifact) it.next();
updateStatus("Started "+name);
if(configID.matches(name)) {
newStarted = true;
}
}
for (Iterator it = results.getFailed().keySet().iterator(); it.hasNext();) {
Artifact name = (Artifact) it.next();
updateStatus("Failed on "+name+": "+results.getFailedCause(name).getMessage());
doFail((Exception)results.getFailedCause(name));
}
if(results.getFailed().size() == 0 && !newStarted) {
updateStatus("Note: new module was not started (probably because old module was not running).");
}
}