undertow/src/main/java/org/wildfly/extension/undertow/security/SecurityActions.java
static SecurityContext createSecurityContext(final String domain) {
        if (WildFlySecurityManager.isChecking()) {
            return WildFlySecurityManager.doUnchecked(new PrivilegedAction<SecurityContext>() {
                @Override
                public SecurityContext run() {
                    try {
                        return SecurityContextFactory.createSecurityContext(domain);
                    } catch (Exception e) {
                        throw UndertowLogger.ROOT_LOGGER.failToCreateSecurityContext(e);
                    }
                }
            });
        } else {
            try {
                return SecurityContextFactory.createSecurityContext(domain);
            } catch (Exception e) {
                throw UndertowLogger.ROOT_LOGGER.failToCreateSecurityContext(e);
            }
        }
    }
static SecurityContext createSecurityContext(final String domain) {
        if (WildFlySecurityManager.isChecking()) {
            return WildFlySecurityManager.doUnchecked(new PrivilegedAction<SecurityContext>() {
                @Override
                public SecurityContext run() {
                    try {
                        return SecurityContextFactory.createSecurityContext(domain);
                    } catch (Exception e) {
                        throw UndertowLogger.ROOT_LOGGER.failToCreateSecurityContext(e);
                    }
                }
            });
        } else {
            try {
                return SecurityContextFactory.createSecurityContext(domain);
            } catch (Exception e) {
                throw UndertowLogger.ROOT_LOGGER.failToCreateSecurityContext(e);
            }
        }
    }
Create a JBoss Security Context with the given security domain name

@param domain the security domain name (such as "other" )
@return an instanceof {@code SecurityContext}