/**
* Starts the web container
*/
private void startWebContainer() {
Sniffer webSniffer = habitat.getComponent(Sniffer.class,"web");
if (webSniffer==null) {
if (logger.isLoggable(Level.INFO)) {
logger.info("core.web_container_not_installed");
}
return;
}
if (containerRegistry.getContainer(
webSniffer.getContainersNames()[0]) != null) {
containerRegistry.getContainer(
webSniffer.getContainersNames()[0]).getContainer();
} else {
Module snifferModule = modulesRegistry.find(webSniffer.getClass());
try {
Collection<EngineInfo> containersInfo =
containerStarter.startContainer(webSniffer, snifferModule);
if (containersInfo != null && !containersInfo.isEmpty()) {
// Start each container
for (EngineInfo info : containersInfo) {
info.getContainer();
if (logger.isLoggable(Level.INFO)) {
logger.log(Level.INFO, "core.start_container_done",
webSniffer.getModuleType());
}
}
} else {
logger.severe("core.unable_start_container_no_exception");
}
} catch (Exception e) {
String msg = MessageFormat.format(
rb.getString("core.unable_start_container"),
webSniffer.getContainersNames()[0]);
logger.log(Level.SEVERE, msg, e);
}
}
}