protected DirContext createContext ( Hashtable < String , Object > environment ) { DirContext ctx = null ; try { ctx = getDirContextInstance ( environment ) ; if ( LOG . isInfoEnabled ( ) ) { Hashtable < ? , ? > ctxEnv = ctx . getEnvironment ( ) ; String ldapUrl = ( String ) ctxEnv . get ( Context . PROVIDER_URL ) ; LOG . debug ( "Got Ldap context on server '" + ldapUrl + "'" ) ; } return ctx ; } catch ( NamingException e ) { closeContext ( ctx ) ; throw LdapUtils . convertLdapException ( e ) ; } }
Create a DirContext using the supplied environment .