if ( null == provider ) {   if ( isAnonymous( env ) && env.containsKey( EnvKeys.DISABLE_ANONYMOUS ) ) { throw new LdapNoPermissionException( "cannot bind as anonymous " + "on startup while disabling anonymous binds w/ property: " + EnvKeys.DISABLE_ANONYMOUS ); }  this.initialEnv = env;  initialize(); boolean createMode = createAdminAccount();  if ( createMode ) { importLdif(); }   if ( !initialEnv.containsKey( EnvKeys.DISABLE_PROTOCOL ) ) { startUpWireProtocol(); } }  ctx = ( ServerContext ) provider.getLdapContext( env );
    public Context getInitialContext( Hashtable env ) throws NamingException    {        env = ( Hashtable ) env.clone();        Context ctx = null;        if ( env.containsKey( EnvKeys.SHUTDOWN ) )        {            if ( this.provider == null )            {                // monitor.shutDownCalledOnStoppedProvider()                return new DeadContext();            }            try            {                this.provider.shutdown();                if ( this.minaRegistry != null )                {                    this.minaRegistry.unbind( minaService );                }            }            catch ( Throwable t )            {                t.printStackTrace();            }            finally            {                ctx = new DeadContext();                provider = null;                initialEnv = null;            }            return ctx;        }        if ( env.containsKey( EnvKeys.SYNC ) )        {            provider.sync();            return provider.getLdapContext( env );        }        checkSecuritySettings( env );        if ( isAnonymous( env ) )        {            env.put( PRINCIPAL, "" );        }        // fire up the backend subsystem if we need to        if ( null == provider )        {            // we need to check this here instead of in AuthenticationService            // because otherwise we are going to start up the system incorrectly            if ( isAnonymous( env )                    && env.containsKey( EnvKeys.DISABLE_ANONYMOUS ) )            {                throw new LdapNoPermissionException( "cannot bind as anonymous "                        + "on startup while disabling anonymous binds w/ property: "                        + EnvKeys.DISABLE_ANONYMOUS );            }            this.initialEnv = env;            initialize();            boolean createMode = createAdminAccount();            if ( createMode )            {                importLdif();            }            // fire up the front end if we have not explicitly disabled it            if ( !initialEnv.containsKey( EnvKeys.DISABLE_PROTOCOL ) )            {                startUpWireProtocol();            }        }        ctx = ( ServerContext ) provider.getLdapContext( env );        return ctx;    }