use of org.jboss.security.config.ApplicationPolicyRegistration in project wildfly by wildfly.
the class SecurityDomainService method stop.
/** {@inheritDoc} */
@Override
public void stop(StopContext context) {
SecurityLogger.ROOT_LOGGER.debugf("Stopping security domain service %s", name);
final JNDIBasedSecurityManagement securityManagement = (JNDIBasedSecurityManagement) securityManagementValue.getValue();
securityManagement.removeSecurityDomain(name);
// TODO clear auth cache?
final ApplicationPolicyRegistration applicationPolicyRegistration = (ApplicationPolicyRegistration) configurationValue.getValue();
applicationPolicyRegistration.removeApplicationPolicy(name);
}
use of org.jboss.security.config.ApplicationPolicyRegistration in project wildfly by wildfly.
the class SecurityDomainService method start.
/** {@inheritDoc} */
@Override
public void start(StartContext context) throws StartException {
SecurityLogger.ROOT_LOGGER.debugf("Starting SecurityDomainService(%s)", name);
if (applicationPolicy != null) {
final ApplicationPolicyRegistration applicationPolicyRegistration = (ApplicationPolicyRegistration) configurationValue.getValue();
applicationPolicyRegistration.addApplicationPolicy(applicationPolicy.getName(), applicationPolicy);
}
final JNDIBasedSecurityManagement securityManagement = (JNDIBasedSecurityManagement) securityManagementValue.getValue();
AuthenticationCacheFactory cacheFactory = null;
if ("infinispan".equals(cacheType)) {
cacheFactory = new InfinispanAuthenticationCacheFactory(cacheManagerValue.getValue(), name);
} else if ("default".equals(cacheType)) {
cacheFactory = new DefaultAuthenticationCacheFactory();
}
try {
securityDomainContext = securityManagement.createSecurityDomainContext(name, cacheFactory);
} catch (Exception e) {
throw SecurityLogger.ROOT_LOGGER.unableToStartException("SecurityDomainService", e);
}
if (jsseSecurityDomain != null) {
try {
jsseSecurityDomain.reloadKeyAndTrustStore();
securityDomainContext.setJSSE(jsseSecurityDomain);
} catch (Exception e) {
throw SecurityLogger.ROOT_LOGGER.unableToStartException("SecurityDomainService", e);
}
}
securityManagement.getSecurityManagerMap().put(name, securityDomainContext);
}
Aggregations