Source:
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if(RequestControllerActivationMarker.isRequestControllerEnabled(deploymentUnit)) { if(deploymentUnit.getParent() == null) { ControlPointService.install(phaseContext.getServiceTarget(), deploymentUnit.getName(), UndertowExtension.SUBSYSTEM_NAME); } } final WarMetaData warMetaData = deploymentUnit.getAttachment(WarMetaData.ATTACHMENT_KEY); if (warMetaData == null) { return; } String deploymentName; if (deploymentUnit.getParent() == null) { deploymentName = deploymentUnit.getName(); } else { deploymentName = deploymentUnit.getParent().getName() + "." + deploymentUnit.getName(); } final Map.Entry<String,String> severHost = defaultModuleMappingProvider.getMapping(deploymentName); String defaultHostForDeployment; String defaultServerForDeployment; if (severHost != null) { defaultServerForDeployment = severHost.getKey(); defaultHostForDeployment = severHost.getValue(); } else { defaultServerForDeployment = this.defaultServer; defaultHostForDeployment = this.defaultHost; } String serverInstanceName = warMetaData.getMergedJBossWebMetaData().getServerInstanceName() == null ? defaultServerForDeployment : warMetaData.getMergedJBossWebMetaData().getServerInstanceName(); String hostName = hostNameOfDeployment(warMetaData, defaultHostForDeployment); CapabilityServiceSupport support = deploymentUnit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT); ServiceName hostServiceName = support.getCapabilityServiceName(Capabilities.CAPABILITY_HOST, serverInstanceName, hostName); ServiceController<?> hostService = phaseContext.getServiceRegistry().getService(hostServiceName); String defaultWebModule = null; if (hostService != null) { defaultWebModule = ((Host) hostService.getValue()).getDefaultWebModule(); } processDeployment(warMetaData, deploymentUnit, phaseContext.getServiceTarget(), deploymentName, hostName, serverInstanceName, defaultWebModule); }

Target:
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if(RequestControllerActivationMarker.isRequestControllerEnabled(deploymentUnit)) { if(deploymentUnit.getParent() == null) { ControlPointService.install(phaseContext.getServiceTarget(), deploymentUnit.getName(), UndertowExtension.SUBSYSTEM_NAME); } } final WarMetaData warMetaData = deploymentUnit.getAttachment(WarMetaData.ATTACHMENT_KEY); if (warMetaData == null) { return; } String deploymentName; if (deploymentUnit.getParent() == null) { deploymentName = deploymentUnit.getName(); } else { deploymentName = deploymentUnit.getParent().getName() + "." + deploymentUnit.getName(); } final Map.Entry<String,String> serverHost = defaultModuleMappingProvider.getMapping(deploymentName); String defaultHostForDeployment; String defaultServerForDeployment; if (serverHost != null) { defaultServerForDeployment = serverHost.getKey(); defaultHostForDeployment = serverHost.getValue(); } else { defaultServerForDeployment = this.defaultServer; defaultHostForDeployment = this.defaultHost; } String serverInstanceName = warMetaData.getMergedJBossWebMetaData().getServerInstanceName() == null ? defaultServerForDeployment : warMetaData.getMergedJBossWebMetaData().getServerInstanceName(); String hostName = hostNameOfDeployment(warMetaData, defaultHostForDeployment); boolean isDefaultWebModule = serverHost != null && serverInstanceName.equals(defaultServerForDeployment) && hostName.equals(defaultHostForDeployment); processDeployment(warMetaData, deploymentUnit, phaseContext.getServiceTarget(), deploymentName, hostName, serverInstanceName, isDefaultWebModule); }