security/subsystem/src/main/java/org/jboss/as/security/plugins/JNDIBasedSecurityManagement.java
private Object lookUpJNDI(String contextName) {
        Object result = null;
        try {
            Context ctx = new InitialContext();
            if (contextName.startsWith(SecurityConstants.JAAS_CONTEXT_ROOT))
                result = ctx.lookup(contextName);
            else
                result = ctx.lookup(SecurityConstants.JAAS_CONTEXT_ROOT + contextName);
        } catch (Exception e) {
            SecurityLogger.ROOT_LOGGER.tracef("Look up of JNDI for %s failed with %s", contextName, e.getLocalizedMessage());
            return null;
        }
        return result;
    }
private Object lookUpJNDI(String contextName) {
        Object result = null;
        try {
            Context ctx = new InitialContext();
            if (contextName.startsWith(SecurityConstants.JAAS_CONTEXT_ROOT))
                result = ctx.lookup(contextName);
            else
                result = ctx.lookup(SecurityConstants.JAAS_CONTEXT_ROOT + contextName);
        } catch (Exception e) {
            SecurityLogger.ROOT_LOGGER.tracef("Look up of JNDI for %s failed with %s", contextName, e.getLocalizedMessage());
            return null;
        }
        return result;
    }
private Object lookUpJNDI ( String contextName ) { Object result = null ; try { Context ctx = new InitialContext ( ) ; if ( contextName . startsWith ( SecurityConstants . JAAS_CONTEXT_ROOT ) ) result = ctx . lookup ( contextName ) ; else result = ctx . lookup ( SecurityConstants . JAAS_CONTEXT_ROOT + contextName ) ; } catch ( Exception e ) { SecurityLogger . ROOT_LOGGER . tracef ( "Look up of JNDI for %s failed with %s" , contextName , e . getLocalizedMessage ( ) ) ; return null ; } return result ; }
Lookup a context in JNDI

@param contextName the context
@return the Object found at the context or null if there is nothing bound
Lookup a context in JNDI