/** * Gets id of the context. Context id * is host name + context root name. * * @param standardContext context instance * @return id of the context */ private String getId(final StandardContext standardContext) { return getId(Contexts.getHostname(standardContext), standardContext.getPath(), standardContext.getWebappVersion()); }
final String hostname = Contexts.getHostname(standardContext); if (hostname != null && !"_".equals(hostname)) { webApp.host = hostname;
private WebBeansContext getWebBeansContext(final ContextInfo contextInfo) { final AppContext appContext = getContainerSystem().getAppContext(contextInfo.appInfo.appId); if (appContext == null) { return null; } WebBeansContext webBeansContext = appContext.getWebBeansContext(); if (webBeansContext == null) { return null; } for (final WebContext web : appContext.getWebContexts()) { final String stdName = removeFirstSlashAndWar(contextInfo.standardContext.getName()); if (stdName == null) { continue; } final String name = removeFirstSlashAndWar(web.getContextRoot()); if (stdName.equals(name)) { webBeansContext = web.getWebbeansContext(); if (Contexts.getHostname(contextInfo.standardContext).equals(web.getHost())) { break; } // else loop hoping to find a better matching } } if (webBeansContext == null) { webBeansContext = appContext.getWebBeansContext(); } return webBeansContext; }
final String hostname = org.apache.tomee.catalina.Contexts.getHostname(standardContext); String path = standardContext.findParameter(TomcatWebAppBuilder.OPENEJB_WEBAPP_MODULE_ID); if (path == null) { // standardContext not created by OpenEJB
contextInfo = addContextInfo(Contexts.getHostname(standardContext), standardContext); if (webAppInfo == null) { webAppInfo = w; } else if (w.host != null && w.host.equals(Contexts.getHostname(standardContext))) { webAppInfo = w; webAppInfo.host = Contexts.getHostname(standardContext); webAppInfo.contextRoot = standardContext.getPath();
webModule.setHost(Contexts.getHostname(standardContext));
+ Contexts.getHostname(standardContext).replace("_", hosts.getDefaultHost()) + " -> " + finalName(standardContext.getPath()));