nexus = new RootNexus( system );
nexus = new RootNexus( system, new LockableAttributesImpl() );
    private void initialize() throws NamingException    {        // --------------------------------------------------------------------        // Load the schema here and check that it is ok!        // --------------------------------------------------------------------        BootstrapRegistries bootstrapRegistries = new BootstrapRegistries();        BootstrapSchemaLoader loader = new BootstrapSchemaLoader();        String[] schemas = DEFAULT_SCHEMAS;        if ( initialEnv.containsKey( SCHEMAS_ENV ) )        {            schemas = ( ( String ) initialEnv.get( SCHEMAS_ENV ) ).split( "," );        }        loader.load( schemas, bootstrapRegistries );        List errors = bootstrapRegistries.checkRefInteg();        if ( ! errors.isEmpty() )        {            NamingException e = new NamingException();            e.setRootCause( ( Throwable ) errors.get( 0 ) );            throw e;        }        // --------------------------------------------------------------------        // Fire up the system partition        // --------------------------------------------------------------------        String wkdir = DEFAULT_WKDIR;        if ( initialEnv.containsKey( WKDIR_ENV ) )        {            wkdir = ( ( String ) initialEnv.get( WKDIR_ENV ) ).trim();        }        File wkdirFile = new File( wkdir );        if ( wkdirFile.isAbsolute() )        {            if ( ! wkdirFile.exists() )            {                throw new NamingException( "working directory " +  wkdir + " does not exist" );            }        }        else        {            File current = new File( "." );            mkdirs( current.getAbsolutePath(), wkdir );        }        LdapName suffix = new LdapName();        suffix.add( SystemPartition.SUFFIX );        Database db = new JdbmDatabase( suffix, wkdir );        AttributeTypeRegistry attributeTypeRegistry;        attributeTypeRegistry = bootstrapRegistries.getAttributeTypeRegistry();        OidRegistry oidRegistry;        oidRegistry = bootstrapRegistries.getOidRegistry();        ExpressionEvaluator evaluator;        evaluator = new ExpressionEvaluator( db, oidRegistry, attributeTypeRegistry );        ExpressionEnumerator enumerator;        enumerator = new ExpressionEnumerator( db, evaluator );        SearchEngine eng = new DefaultSearchEngine( db, evaluator, enumerator );        AttributeType[] attributes = new AttributeType[] {            attributeTypeRegistry.lookup( SystemPartition.ALIAS_OID ),            attributeTypeRegistry.lookup( SystemPartition.EXISTANCE_OID ),            attributeTypeRegistry.lookup( SystemPartition.HIERARCHY_OID ),            attributeTypeRegistry.lookup( SystemPartition.NDN_OID ),            attributeTypeRegistry.lookup( SystemPartition.ONEALIAS_OID ),            attributeTypeRegistry.lookup( SystemPartition.SUBALIAS_OID ),            attributeTypeRegistry.lookup( SystemPartition.UPDN_OID )        };        system = new SystemPartition( db, eng, attributes );        globalRegistries = new GlobalRegistries( system, bootstrapRegistries );        nexus = new RootNexus( system );        provider = new EveJndiProvider( nexus );        // --------------------------------------------------------------------        // Adding interceptors        // --------------------------------------------------------------------        /*         * Create and add the Authentication service interceptor to before         * interceptor chain.         */        InvocationStateEnum[] state = new InvocationStateEnum[]{            InvocationStateEnum.PREINVOCATION        };        boolean allowAnonymous = initialEnv.containsKey( ANONYMOUS_ENV );        ConcreteNameComponentNormalizer normalizer;        normalizer = new ConcreteNameComponentNormalizer( globalRegistries.getAttributeTypeRegistry() );        Interceptor interceptor = new AuthenticationService( nexus, normalizer, allowAnonymous );        provider.addInterceptor( interceptor, state );        /*         * Create and add the Eve Exception service interceptor to both the         * before and onError interceptor chains.         */        state = new InvocationStateEnum[]{ InvocationStateEnum.POSTINVOCATION };        FilterService filterService = new FilterServiceImpl();        interceptor = ( Interceptor ) filterService;        provider.addInterceptor( interceptor, state );        /*         * Create and add the Authorization service interceptor to before         * interceptor chain.         */        state = new InvocationStateEnum[]{ InvocationStateEnum.PREINVOCATION };        interceptor = new AuthorizationService( normalizer, filterService );        provider.addInterceptor( interceptor, state );        /*         * Create and add the Eve Exception service interceptor to both the         * before and onError interceptor chains.         */        state = new InvocationStateEnum[]{            InvocationStateEnum.PREINVOCATION,            InvocationStateEnum.FAILUREHANDLING        };        interceptor = new EveExceptionService( nexus );        provider.addInterceptor( interceptor, state );        /*         * Create and add the Eve schema service interceptor to before chain.         */        state = new InvocationStateEnum[]{ InvocationStateEnum.PREINVOCATION };        interceptor = new SchemaService( nexus, globalRegistries, filterService );        provider.addInterceptor( interceptor, state );        /*         * Create and add the Eve operational attribute managment service         * interceptor to both the before and after interceptor chains.         */        state = new InvocationStateEnum[]{            InvocationStateEnum.PREINVOCATION,            InvocationStateEnum.POSTINVOCATION        };        interceptor = new OperationalAttributeService( nexus, globalRegistries, filterService );        provider.addInterceptor( interceptor, state );        // fire up the app partitions now!        if ( initialEnv.get( PARTITIONS_ENV ) != null )        {            startUpAppPartitions( wkdir );        }    }