long startTime = System.currentTimeMillis(); Properties env; ServerStartupConfiguration cfg;
DirectoryServer server = new DirectoryServer();
    public static void main( String[] args ) throws Exception    {        long startTime = System.currentTimeMillis();        Properties env;        ServerStartupConfiguration cfg;        if ( args.length > 0 )        {            log.info( "server: loading settings from {}", args[0] );            ApplicationContext factory = new FileSystemXmlApplicationContext( args[0] );            cfg = ( ServerStartupConfiguration ) factory.getBean( "configuration" );            env = ( Properties ) factory.getBean( "environment" );        }        else        {            log.info( "server: using default settings ..." );            env = new Properties();            cfg = new MutableServerStartupConfiguration();        }        env.setProperty( Context.PROVIDER_URL, "ou=system" );        env.setProperty( Context.INITIAL_CONTEXT_FACTORY, ServerContextFactory.class.getName() );        env.putAll( cfg.toJndiEnvironment() );        new InitialDirContext( env );        if (log.isInfoEnabled())        {            log.info( "server: started in {} milliseconds",                    ( System.currentTimeMillis() - startTime ) + "");        }        while ( true )        {            try            {                // this is a big time cludge for now to just play                Thread.sleep( 20000 );            }            catch ( InterruptedException e )            {            }            env.putAll( new SyncConfiguration().toJndiEnvironment() );            new InitialDirContext( env );        }    }