private String findCommonHost(final Collection<WebModule> webModules) { String host = null; for (final WebModule w: webModules) { final String wHost = w.getHost(); if (host == null) { host = wHost; } else if (!host.equals(wHost)) { return "lib"; // surely better to do } } return host != null ? host : "localhost"; }
private String findHost(final String id, final Collection<WebModule> webModules) { for (final WebModule w: webModules) { if (w.getModuleId().equals(id)) { final String host = w.getHost(); return host != null ? host : "localhost"; } } return "localhost"; }
private String findHost(final String id, final Collection<WebModule> webModules) { for (final WebModule w: webModules) { if (w.getModuleId().equals(id)) { final String host = w.getHost(); return host != null ? host : "localhost"; } } return "localhost"; }
public String uniqueHostIfExists() { final boolean hasWebApps = !getWebModules().isEmpty(); if (isWebapp() && hasWebApps) { return getWebModules().iterator().next().getHost(); } else if (hasWebApps) { String id = null; for (final WebModule web : getWebModules()) { if (id == null) { id = web.getHost(); } else if (!id.equals(web.getHost())) { return ""; // find something better as in org.apache.openejb.config.InitEjbDeployments } } return id; } return ""; }
public String uniqueHostIfExists() { final boolean hasWebApps = !getWebModules().isEmpty(); if (isWebapp() && hasWebApps) { return getWebModules().iterator().next().getHost(); } else if (hasWebApps) { String id = null; for (final WebModule web : getWebModules()) { if (id == null) { id = web.getHost(); } else if (!id.equals(web.getHost())) { return ""; // find something better as in org.apache.openejb.config.InitEjbDeployments } } return id; } return ""; }
private void buildWebModules(AppModule appModule, JndiEncInfoBuilder jndiEncInfoBuilder, AppInfo appInfo) throws OpenEJBException { for (WebModule webModule : appModule.getWebModules()) { WebApp webApp = webModule.getWebApp(); WebAppInfo webAppInfo = new WebAppInfo(); webAppInfo.description = webApp.getDescription(); webAppInfo.displayName = webApp.getDisplayName(); webAppInfo.codebase = webModule.getJarLocation(); webAppInfo.moduleId = webModule.getModuleId(); webAppInfo.watchedResources.addAll(webModule.getWatchedResources()); webAppInfo.host = webModule.getHost(); webAppInfo.contextRoot = webModule.getContextRoot(); webAppInfo.jndiEnc = jndiEncInfoBuilder.build(webApp, webModule.getJarLocation(), webAppInfo.moduleId); webAppInfo.portInfos.addAll(configureWebservices(webModule.getWebservices())); configureWebserviceSecurity(webAppInfo, webModule); for (Servlet servlet : webModule.getWebApp().getServlet()) { ServletInfo servletInfo = new ServletInfo(); servletInfo.servletName = servlet.getServletName(); servletInfo.servletClass = servlet.getServletClass(); webAppInfo.servlets.add(servletInfo); } appInfo.webApps.add(webAppInfo); } }
webAppInfo.host = webModule.getHost();
webAppInfo.host = webModule.getHost();