Database db = new JdbmDatabase( upSuffix, wkdir );
Database db = new JdbmDatabase( upSuffix, normSuffix, wkdir );
    private void startUpAppPartitions( String eveWkdir )            throws NamingException    {        OidRegistry oidRegistry = globalRegistries.getOidRegistry();        AttributeTypeRegistry attributeTypeRegistry;        attributeTypeRegistry = globalRegistries.getAttributeTypeRegistry();        MatchingRuleRegistry reg = globalRegistries.getMatchingRuleRegistry();        // start getting all the parameters from the initial environment        ContextPartitionConfig[] configs = null;        configs = PartitionConfigBuilder                .getContextPartitionConfigs( initialEnv );        for ( int ii = 0; ii < configs.length; ii++ )        {            // ----------------------------------------------------------------            // create working directory under eve directory for app partition            // ----------------------------------------------------------------            String wkdir = eveWkdir + File.separator + configs[ii].getId();            mkdirs( eveWkdir, configs[ii].getId() );            // ----------------------------------------------------------------            // create the database/store            // ----------------------------------------------------------------            Name upSuffix = new LdapName( configs[ii].getSuffix() );            Normalizer dnNorm = reg.lookup( "distinguishedNameMatch" )                    .getNormalizer();            Name normSuffix = new LdapName( ( String ) dnNorm                    .normalize( configs[ii].getSuffix() ) );            Database db = new JdbmDatabase( upSuffix, wkdir );            // ----------------------------------------------------------------            // create the search engine using db, enumerators and evaluators            // ----------------------------------------------------------------            ExpressionEvaluator evaluator;            evaluator = new ExpressionEvaluator( db, oidRegistry,                    attributeTypeRegistry );            ExpressionEnumerator enumerator;            enumerator = new ExpressionEnumerator( db, attributeTypeRegistry,                    evaluator );            SearchEngine eng = new DefaultSearchEngine( db, evaluator,                    enumerator );            // ----------------------------------------------------------------            // fill up a list with the AttributeTypes for the system indices            // ----------------------------------------------------------------            ArrayList attributeTypeList = new ArrayList();            attributeTypeList.add( attributeTypeRegistry                    .lookup( SystemPartition.ALIAS_OID ) );            attributeTypeList.add( attributeTypeRegistry                    .lookup( SystemPartition.EXISTANCE_OID ) );            attributeTypeList.add( attributeTypeRegistry                    .lookup( SystemPartition.HIERARCHY_OID ) );            attributeTypeList.add( attributeTypeRegistry                    .lookup( SystemPartition.NDN_OID ) );            attributeTypeList.add( attributeTypeRegistry                    .lookup( SystemPartition.ONEALIAS_OID ) );            attributeTypeList.add( attributeTypeRegistry                    .lookup( SystemPartition.SUBALIAS_OID ) );            attributeTypeList.add( attributeTypeRegistry                    .lookup( SystemPartition.UPDN_OID ) );            // ----------------------------------------------------------------            // if user indices are specified add those attribute types as well            // ----------------------------------------------------------------            for ( int jj = 0; jj < configs[ii].getIndices().length; jj++ )            {                attributeTypeList.add( attributeTypeRegistry                        .lookup( configs[ii].getIndices()[jj] ) );            }            // ----------------------------------------------------------------            // fire up the appPartition & register it with the nexus            // ----------------------------------------------------------------            AttributeType[] indexTypes = ( AttributeType[] ) attributeTypeList                    .toArray( new AttributeType[attributeTypeList.size()] );            String partitionClass = configs[ii].getPartitionClass();            String properties = configs[ii].getProperties();            ContextPartition partition = null;            if ( partitionClass == null )            {                // If custom partition is not defined, use the ApplicationPartion.                partition = new ApplicationPartition( upSuffix,                        normSuffix, db, eng, indexTypes );            }            else            {                // If custom partition is defined, instantiate it.                try                {                    Class clazz = Class.forName( partitionClass );                    Constructor constructor = clazz.getConstructor(                            new Class[] { Name.class, Name.class, String.class } );                    partition = ( ContextPartition ) constructor.newInstance(                            new Object[] { upSuffix, normSuffix, properties } );                }                catch ( Exception e )                {                    e.printStackTrace();                }            }            if ( partition != null )             {                 nexus.register( partition );            }            // ----------------------------------------------------------------            // add the nexus context entry            // ----------------------------------------------------------------            partition.add( configs[ii].getSuffix(), normSuffix,                    configs[ii].getAttributes() );        }    }