public static String jndiLookup(String key) {
        String value = null;
        try {
            Context c = new InitialContext();
            value = (String) c.lookup(JNDI_PREFIX + key);
        } catch (NoInitialContextException e) {
            logger.trace("JNDI not configured for Sentry (NoInitialContextEx)");
        } catch (NamingException e) {
            logger.trace("No /sentry/" + key + " in JNDI");
        } catch (RuntimeException e) {
            logger.warn("Odd RuntimeException while testing for JNDI", e);
        }
        return value;
    }
public static String jndiLookup ( String key ) { String value = null ; try { Context c = new InitialContext ( ) ; value = ( String ) c . lookup ( JNDI_PREFIX + key ) ; } catch ( NoInitialContextException e ) { logger . trace ( "JNDI not configured for Sentry (NoInitialContextEx)" ) ; } catch ( NamingException e ) { logger . trace ( "No /sentry/" + key + " in JNDI" ) ; } catch ( RuntimeException e ) { logger . warn ( "Odd RuntimeException while testing for JNDI" , e ) ; } return value ; }
Looks up for a JNDI definition of the provided key.

@param key name of configuration key, e.g. "dsn"
@return the value as defined in JNDI or null if it isn't defined.