{
// --------------------------------------------------------------------
// 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( EnvKeys.SCHEMAS ) )
{
String schemaList = ( String ) initialEnv.get( EnvKeys.SCHEMAS );
schemaList = StringTools.deepTrim( schemaList );
schemas = schemaList.split( " " );
for ( int ii = 0; ii < schemas.length; ii++ )
{
schemas[ii] = schemas[ii].trim();
}
}
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( EnvKeys.WKDIR ) )
{
wkdir = ( ( String ) initialEnv.get( EnvKeys.WKDIR ) ).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, suffix, wkdir );
AttributeTypeRegistry attributeTypeRegistry;
attributeTypeRegistry = bootstrapRegistries .getAttributeTypeRegistry();
OidRegistry oidRegistry;
oidRegistry = bootstrapRegistries.getOidRegistry();
ExpressionEvaluator evaluator;
evaluator = new ExpressionEvaluator( db, oidRegistry, attributeTypeRegistry );