public void launchServices(OperationContext context, String securityDomain, ModelNode model, ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers) throws OperationFailedException {
final ApplicationPolicy applicationPolicy = createApplicationPolicy(context, securityDomain, model);
final JSSESecurityDomain jsseSecurityDomain = createJSSESecurityDomain(context, securityDomain, model);
final String cacheType = getAuthenticationCacheType(model);
final SecurityDomainService securityDomainService = new SecurityDomainService(securityDomain,
applicationPolicy, jsseSecurityDomain, cacheType);
final ServiceTarget target = context.getServiceTarget();
// some login modules may require the TransactionManager
final Injector<TransactionManager> transactionManagerInjector = new Injector<TransactionManager>() {
public void inject(final TransactionManager value) throws InjectionException {
TransactionManagerLocator.setTransactionManager(value);
}
public void uninject() {
}
};
ServiceBuilder<SecurityDomainContext> builder = target
.addService(SecurityDomainService.SERVICE_NAME.append(securityDomain), securityDomainService)
.addDependency(SecurityManagementService.SERVICE_NAME, ISecurityManagement.class,
securityDomainService.getSecurityManagementInjector())
.addDependency(JaasConfigurationService.SERVICE_NAME, Configuration.class,
securityDomainService.getConfigurationInjector())
.addDependency(ServiceBuilder.DependencyType.OPTIONAL, ServiceName.JBOSS.append("txn", "TransactionManager"), TransactionManager.class,
transactionManagerInjector);
if ("infinispan".equals(cacheType)) {
builder.addDependency(EmbeddedCacheManagerService.getServiceName(CACHE_CONTAINER_NAME),
Object.class, securityDomainService.getCacheManagerInjector());
}
if (verificationHandler != null) {
builder.addListener(verificationHandler);
}