Search in sources :

Example 1 with SecurityDomainService

use of org.jboss.as.security.service.SecurityDomainService in project wildfly by wildfly.

the class SecurityDomainAdd method launchServices.

public void launchServices(OperationContext context, String securityDomain, ModelNode model) 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();
    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());
    if (SecurityDomainResourceDefinition.INFINISPAN_CACHE_TYPE.equals(cacheType)) {
        builder.addDependency(InfinispanRequirement.CONTAINER.getServiceName(context.getCapabilityServiceSupport(), SecurityDomainResourceDefinition.CACHE_CONTAINER_NAME), Object.class, securityDomainService.getCacheManagerInjector());
        builder.addDependency(InfinispanDefaultCacheRequirement.CONFIGURATION.getServiceName(context, SecurityDomainResourceDefinition.CACHE_CONTAINER_NAME));
    }
    builder.setInitialMode(ServiceController.Mode.ACTIVE).install();
}
Also used : SecurityDomainService(org.jboss.as.security.service.SecurityDomainService) ISecurityManagement(org.jboss.security.ISecurityManagement) ApplicationPolicy(org.jboss.security.config.ApplicationPolicy) JBossJSSESecurityDomain(org.jboss.security.JBossJSSESecurityDomain) JSSESecurityDomain(org.jboss.security.JSSESecurityDomain) ServiceTarget(org.jboss.msc.service.ServiceTarget) SecurityDomainContext(org.jboss.as.security.plugins.SecurityDomainContext)

Aggregations

SecurityDomainContext (org.jboss.as.security.plugins.SecurityDomainContext)1 SecurityDomainService (org.jboss.as.security.service.SecurityDomainService)1 ServiceTarget (org.jboss.msc.service.ServiceTarget)1 ISecurityManagement (org.jboss.security.ISecurityManagement)1 JBossJSSESecurityDomain (org.jboss.security.JBossJSSESecurityDomain)1 JSSESecurityDomain (org.jboss.security.JSSESecurityDomain)1 ApplicationPolicy (org.jboss.security.config.ApplicationPolicy)1