Source:
<code>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); <START> ServiceController<?> hostService = phaseContext.getServiceRegistry().getService(hostServiceName); <END> String defaultWebModule = null; if (hostService != null) { defaultWebModule = ((Host) hostService.getValue()).getDefaultWebModule(); } processDeployment(warMetaData, deploymentUnit, phaseContext.getServiceTarget(), deploymentName, hostName, serverInstanceName, defaultWebModule); }</code><technical_language>I time properly review this now, this feel right. DUPs services great safe if DeploymentUnitPhaseService running DUP a dependency service looked up. is fragile</technical_language>

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); }