|
Home > Archive > Apache Directory Project > October 2007 > LdapServer init in BigBang
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
LdapServer init in BigBang
|
|
| Emmanuel Lecharny 2007-10-19, 1:12 pm |
| Hi,
while removing the SASL chain, I had some problem with some access to
DirectoryService instance. As the BindHandler were initialized in the
LdapServer constructor, the DirectoryService is null as it is
initialized after.
What I suggest is to initialize the default handler in the
LdapServer.start() method,
just before the server launch :
....
/*
* The serveur is now initialized, we can
* install the default requests handlers, which need
* access to the DirectoryServer instance.
*/
installDefaultHandlers();
startLDAP0( getIpPort(), chain );
started =3D true;
}
Here, the installDefauktHandlers() method will install the default
handlers if no specific handler has been installed :
/**
* Install the LDAP request handlers.
*/
private void installDefaultHandlers()
{
if ( getAbandonHandler() =3D=3D null )
{
setAbandonHandler( new DefaultAbandonHandler() );
}
....
I have tested this approach, and it works perfectly well, and let the
user define its own handler in a embedded server.
I will commit this code in bigbang branch, but if anyone has a better
solution, I would be glad to revert this code !
--=20
Regards,
Cordialement,
Emmanuel L=E9charny
www.iktek.com
| |
| Alex Karasulu 2007-10-19, 7:11 pm |
| This sounds great Emmanuel thanks!
Alex
On 10/19/07, Emmanuel Lecharny <elecharny-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> Hi,
>
> while removing the SASL chain, I had some problem with some access to
> DirectoryService instance. As the BindHandler were initialized in the
> LdapServer constructor, the DirectoryService is null as it is
> initialized after.
>
> What I suggest is to initialize the default handler in the
> LdapServer.start() method,
> just before the server launch :
>
> ...
> /*
> * The serveur is now initialized, we can
> * install the default requests handlers, which need
> * access to the DirectoryServer instance.
> */
> installDefaultHandlers();
>
> startLDAP0( getIpPort(), chain );
>
> started = true;
> }
>
> Here, the installDefauktHandlers() method will install the default
> handlers if no specific handler has been installed :
>
> /**
> * Install the LDAP request handlers.
> */
> private void installDefaultHandlers()
> {
> if ( getAbandonHandler() == null )
> {
> setAbandonHandler( new DefaultAbandonHandler() );
> }
>
> ...
>
> I have tested this approach, and it works perfectly well, and let the
> user define its own handler in a embedded server.
>
> I will commit this code in bigbang branch, but if anyone has a better
> solution, I would be glad to revert this code !
>
> --
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com
>
|
|
|
|
|