use of com.sun.enterprise.web.WebContainer in project Payara by payara.
the class MapperListener method init.
/**
* Initialize associated mapper.
*/
public void init() {
if (webContainer == null) {
logger.log(Level.SEVERE, LogFacade.CANNOT_FIND_WEB_CONTAINER);
return;
}
try {
httpService = webContainer.getHttpService();
engine = webContainer.getEngine();
if (engine == null) {
logger.log(Level.SEVERE, LogFacade.CANNOT_FIND_ENGINE);
return;
}
if (defaultHost != null) {
mapper.setDefaultHostName(defaultHost);
}
for (VirtualServer vs : httpService.getVirtualServer()) {
Container host = engine.findChild(vs.getId());
if (host instanceof StandardHost) {
registerHost((StandardHost) host);
for (Container context : host.findChildren()) {
if (context instanceof StandardContext) {
registerContext((StandardContext) context);
for (Container wrapper : context.findChildren()) {
if (wrapper instanceof StandardWrapper) {
registerWrapper((StandardWrapper) wrapper);
}
}
}
}
}
}
} catch (Exception e) {
logger.log(Level.WARNING, LogFacade.ERROR_REGISTERING_CONTEXTS, e);
}
}
Aggregations