security/subsystem/src/main/java/org/jboss/as/security/service/SecurityDomainService.java
@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);
    }
@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);
    }
{@inheritDoc}