AuthenticatorConfig[] configs = null;
GenericAuthenticatorConfig[] configs = null;
    public void init( InterceptorContext ctx ) throws NamingException    {        /*         * Create and add the Authentication service interceptor to before         * interceptor chain.         */        boolean allowAnonymous = !ctx.getEnvironment().containsKey( EnvKeys.DISABLE_ANONYMOUS );        // create authenticator context        AuthenticatorContext authenticatorContext = new AuthenticatorContext();        authenticatorContext.setPartitionNexus( ctx.getRootNexus() );        authenticatorContext.setAllowAnonymous( allowAnonymous );        try // initialize default authenticators        {            // create anonymous authenticator            AuthenticatorConfig authenticatorConfig = new AuthenticatorConfig();            authenticatorConfig.setAuthenticatorName( "none" );            authenticatorConfig.setAuthenticatorContext( authenticatorContext );            org.apache.ldap.server.auth.Authenticator authenticator = new AnonymousAuthenticator();            authenticator.init( authenticatorConfig );            this.register( authenticator );            // create simple authenticator            authenticatorConfig = new AuthenticatorConfig();            authenticatorConfig.setAuthenticatorName( "simple" );            authenticatorConfig.setAuthenticatorContext( authenticatorContext );            authenticator = new SimpleAuthenticator();            authenticator.init( authenticatorConfig );            this.register( authenticator );        }        catch ( Exception e )        {            throw new NamingException( e.getMessage() );        }        AuthenticatorConfig[] configs = null;        configs = AuthenticatorConfigBuilder                .getAuthenticatorConfigs( new Hashtable( ctx.getEnvironment() ) );        for ( int ii = 0; ii < configs.length; ii++ )        {            try            {                configs[ii].setAuthenticatorContext( authenticatorContext );                String authenticatorClass = configs[ii].getAuthenticatorClass();                Class clazz = Class.forName( authenticatorClass );                Constructor constructor = clazz.getConstructor( new Class[] { } );                AbstractAuthenticator authenticator = ( AbstractAuthenticator ) constructor.newInstance( new Object[] { } );                authenticator.init( configs[ii] );                this.register( authenticator );            }            catch ( Exception e )            {                e.printStackTrace();            }        }    }