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 .