directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Karasulu" <akaras...@apache.org>
Subject Re: stop and restart embedded server (1.0.2)
Date Sun, 26 Aug 2007 23:56:11 GMT
Hi Brain,

Please take a look at the tearDown() method of the following class and it's
super class:

    *http://tinyurl.com/26kttx

*This should show you how to properly shutdown the server.  There is no easy
way right now
to programmatically shutdown just the LDAP port without stopping the whole
server.  There
is a UI you can trigger to be launched if the server is running on the
console which allows you
to just stop listening on the port.  However this I don't think really helps
you a lot.  Take a look
at the server-jndi project's ServerContextFactory to see if there is an
alternative means to hack
the code to do this.

If you like submit a patch via JIRA and we can review this as a new feature.

HTH,
Alex


On 8/26/07, Brian Wallis <brian.wallis@infomedix.com.au> wrote:
>
>
> G'day,
>    I'm attempting to build some testcases that use multiple ldap
> servers and want to test failure scenarios.
>
> I am starting up three apacheds instances on different ports and then
> I want to stop and restart them as required for the various test
> scenarios. I cannot work out how to do this. I am using the following
> to stop the servers and it does seem to stop them.
>
>      Hashtable env = new Hashtable();
>      env.putAll(new ShutdownConfiguration
> (instanceName).toJndiEnvironment());
>      env.put(Context.PROVIDER_URL, "ou=system");
>      env.put(Context.INITIAL_CONTEXT_FACTORY,
> "org.apache.directory.server.jndi.ServerContextFactory");
>      env.put(Context.SECURITY_PRINCIPAL, "uid=admin,ou=system");
>      env.put(Context.SECURITY_CREDENTIALS, "secret");
>      new InitialDirContext(env);
>
> but I cannot work out how to restart the server again.
>
> What I really want to do is just stop it from listening on its port
> and the re-enable it.
>
> thanks,
> brian wallis...
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message