private String hostNameOfDeployment(final WarMetaData metaData, String defaultHost) { Collection<String> hostNames = null; if (metaData.getMergedJBossWebMetaData() != null) { hostNames = metaData.getMergedJBossWebMetaData().getVirtualHosts(); } if (hostNames == null || hostNames.isEmpty()) { hostNames = Collections.singleton(defaultHost); } String hostName = hostNames.iterator().next(); if (hostName == null) { throw UndertowLogger.ROOT_LOGGER.nullHostName(); } return hostName; }
/** * Get the object name of the ServiceMetaData instance associated with * the WebMetaData. This uses the pattern: * "jboss.web.deployment:war="+metaData.getContextRoot() * if there are no virtual hosts, otherwise * "jboss.web.deployment:war="+metaData.getVirtualHosts()[0]+metaData.getContextRoot() * @param metaData - the web app metaData * @return the war object name */ protected String getObjectName(JBossWebMetaData metaData) { // Obtain the war virtual host and context root to define a unique war name String virtualHost = ""; List<String> hosts = metaData.getVirtualHosts(); if (hosts != null && hosts.size() > 0) { virtualHost = hosts.get(0); } String ctxPath = metaData.getContextRoot(); // The ctx path value cannot be empty in the object name if (ctxPath == null || ctxPath.length() == 0) ctxPath = "/"; return "jboss.web.deployment:war=" + virtualHost + ctxPath; }
private String hostNameOfDeployment(final WarMetaData metaData, String defaultHost) { Collection<String> hostNames = null; if (metaData.getMergedJBossWebMetaData() != null) { hostNames = metaData.getMergedJBossWebMetaData().getVirtualHosts(); } if (hostNames == null || hostNames.isEmpty()) { hostNames = Collections.singleton(defaultHost); } String hostName = hostNames.iterator().next(); if (hostName == null) { throw UndertowLogger.ROOT_LOGGER.nullHostName(); } return hostName; }
private String hostNameOfDeployment(final WarMetaData metaData, String defaultHost) { Collection<String> hostNames = null; if (metaData.getMergedJBossWebMetaData() != null) { hostNames = metaData.getMergedJBossWebMetaData().getVirtualHosts(); } if (hostNames == null || hostNames.isEmpty()) { hostNames = Collections.singleton(defaultHost); } String hostName = hostNames.iterator().next(); if (hostName == null) { throw UndertowLogger.ROOT_LOGGER.nullHostName(); } return hostName; }
@Override protected void performDeploy(WebApplication webApp, String warUrl) throws Exception { // Decode the URL as tomcat can't deal with paths with escape chars warUrl = URLDecoder.decode(warUrl, "UTF-8"); webApp.setDomain(config.getCatalinaDomain()); JBossWebMetaData metaData = webApp.getMetaData(); // Get any jboss-web/virtual-hosts List<String> vhostNames = metaData.getVirtualHosts(); // Map the virtual hosts onto the configured hosts String hostName = mapVirtualHosts(vhostNames); if (hostName == null) { Iterator hostNames = getDefaultHosts(); if (hostNames.hasNext()) { hostName = hostNames.next().toString(); } } if (hostName == null) { throw new IllegalStateException("No default host defined"); } performDeployInternal(webApp, hostName, warUrl); }
/** * Called as part of the undeploy() method template to ask the subclass for perform the web container specific * undeployment steps. */ @Override protected void performUndeploy(WebApplication warInfo, String warUrl) throws Exception { if (warInfo == null) { log.debug("performUndeploy, no WebApplication found for URL " + warUrl); return; } log.info("undeploy, ctxPath=" + warInfo.getMetaData().getContextRoot()); JBossWebMetaData metaData = warInfo.getMetaData(); // Get any jboss-web/virtual-hosts List<String> vhostNames = metaData.getVirtualHosts(); // Map the virtual hosts onto the configured hosts String hostName = mapVirtualHosts(vhostNames); if (hostName == null) { Iterator hostNames = getDefaultHosts(); if (hostNames.hasNext()) { hostName = hostNames.next().toString(); } } performUndeployInternal(warInfo, hostName, warUrl); }
case VIRTUAL_HOST: List<String> virtualHosts = wmd.getVirtualHosts(); if (virtualHosts == null) { virtualHosts = new ArrayList<String>();
((JBossEnvironmentRefsGroupMetaData)getJndiEnvironmentRefsGroup()).merge(jenv, env, null, overrideFile, overridenFile, mustOverride); if(override != null && override.getVirtualHosts()!= null) setVirtualHosts(override.getVirtualHosts());
EnvironmentRefsGroupMetaDataMerger.merge((EnvironmentRefsGroupMetaData) dest.getJndiEnvironmentRefsGroup(), jenv, env, overrideFile, overridenFile, mustOverride); if (override != null && override.getVirtualHosts() != null) dest.setVirtualHosts(override.getVirtualHosts());