ldapsStarted = true;
    private void startLDAPS( ServerStartupConfiguration cfg, Hashtable env ) throws NamingException    {        // Skip if disabled        if ( !cfg.isEnableLdaps() )        {            return;        }        // We use the reflection API in case this is not running on JDK 1.5+.        IoFilterChainBuilder chain;        try        {            chain = ( IoFilterChainBuilder ) Class.forName( "org.apache.directory.server.ssl.LdapsInitializer", true,                ServerContextFactory.class.getClassLoader() ).getMethod( "init", new Class[]                { ServerStartupConfiguration.class } ).invoke( null, new Object[]                { cfg } );        }        catch ( InvocationTargetException e )        {            if ( e.getCause() instanceof NamingException )            {                throw ( NamingException ) e.getCause();            }            else            {                throw ( NamingException ) new NamingException( "Failed to load LDAPS initializer." ).initCause( e                    .getCause() );            }        }        catch ( Exception e )        {            throw ( NamingException ) new NamingException( "Failed to load LDAPS initializer." ).initCause( e );        }        startLDAP0( cfg, env, cfg.getLdapsPort(), chain );    }