ModuleStartup startupService =
habitatInfo.habitat.getComponent(ModuleStartup.class, habitatInfo.habitat.DEFAULT_NAME);
if (startupService != null) {
try {
logger.info("Stopping " + startupService);
startupService.stop();
} catch (Exception e) {
logger.log(Level.WARNING, "HK2Main:stop():Exception while stopping ModuleStartup service.", e);
}
}
destroyHabitat(habitatInfo.habitat);