return exitCode;
}
monitor.systemStarted(kernel);
AbstractNameQuery query = new AbstractNameQuery(PersistentConfigurationList.class.getName());
if (configs.isEmpty()) {
// --override wasn't used (nothing explicit), see what was running before
Set<AbstractName> configLists = kernel.listGBeans(query);
for (AbstractName configListName : configLists) {
try {
configs.addAll((List<Artifact>) kernel.invoke(configListName, "restore"));
} catch (IOException e) {
System.err.println("Unable to restore last known configurations");
e.printStackTrace();
shutdownKernel();
return 1;
}
}
}
monitor.foundModules(configs.toArray(new Artifact[configs.size()]));
// load the rest of the configurations
try {
ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
try {
for (Artifact configID : configs) {
monitor.moduleLoading(configID);
configurationManager.loadConfiguration(configID, lifecycleMonitor);
monitor.moduleLoaded(configID);
monitor.moduleStarting(configID);
configurationManager.startConfiguration(configID, lifecycleMonitor);
monitor.moduleStarted(configID);
}
// the server has finished loading the persistent configuration so inform the gbean
AbstractNameQuery startedQuery = new AbstractNameQuery(ServerStatus.class.getName());
Set statusBeans = kernel.listGBeans(startedQuery);
for(Iterator itr = statusBeans.iterator();itr.hasNext();) {
AbstractName statusName = (AbstractName)itr.next();
ServerStatus status = (ServerStatus)kernel.getGBean(statusName);
if(status != null) {