use of com.sun.enterprise.web.EmbeddedWebContainer in project Payara by payara.
the class WebContainerImpl method init.
// --------------------------------------------------------- Private Methods
private void init() {
if (initialized) {
return;
}
if (config == null) {
// use default settings
config = new WebContainerConfig();
}
container = habitat.getServiceHandle(org.glassfish.api.container.Container.class, "com.sun.enterprise.web.WebContainer");
if (container == null) {
log.severe("Cannot find webcontainer implementation");
return;
}
ActiveDescriptor<?> activeDescriptor = habitat.getBestDescriptor(BuilderHelper.createContractFilter("com.sun.enterprise.web.EmbeddedWebContainer"));
if (activeDescriptor == null) {
log.severe("Cannot find embedded implementation");
return;
}
embeddedInhabitant = habitat.getServiceHandle(activeDescriptor);
try {
webContainer = (com.sun.enterprise.web.WebContainer) container.getService();
embedded = (EmbeddedWebContainer) embeddedInhabitant.getService();
if ((webContainer == null) || (embedded == null)) {
log.severe("Cannot find webcontainer implementation");
return;
}
engine = webContainer.getEngine();
if (engine == null) {
log.severe("Cannot find engine implementation");
return;
}
initialized = true;
} catch (Exception e) {
log.severe("Init exception " + e.getMessage());
}
}
Aggregations