deploymentUnit.addToAttachmentList(Attachments.DEPLOYMENT_COMPLETE_SERVICES, webappServiceName);
deploymentUnit.addToAttachmentList(Attachments.DEPLOYMENT_COMPLETE_SERVICES, realmServiceName);
final JBossWebRealmService realmService = new JBossWebRealmService(deploymentUnit);
ServiceBuilder<Realm> realmBuilder = serviceTarget.addService(realmServiceName, realmService);
realmBuilder
.addDependency(DependencyType.REQUIRED, SecurityDomainService.SERVICE_NAME.append(securityDomain), SecurityDomainContext.class,
realmService.getSecurityDomainContextInjector()).setInitialMode(Mode.ACTIVE).install();
final WebDeploymentService webappService = new WebDeploymentService(webContext, injectionContainer, setupActions, attributes);
ServiceBuilder<StandardContext> webappBuilder = serviceTarget.addService(webappServiceName, webappService)
.addDependency(WebSubsystemServices.JBOSS_WEB_HOST.append(hostName), VirtualHost.class, new WebContextInjector(webContext))
.addDependencies(injectionContainer.getServiceNames()).addDependency(realmServiceName, Realm.class, webappService.getRealm())