directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Göktürk Gezer <gokt...@apache.org>
Subject Questions about the design of the "component-hub"
Date Mon, 28 Nov 2011 00:25:30 GMT
Hi Devs,

As i go through implementing component-hub, i couldn't think clearly about
some things, so i need some pointers on them. I've made some decisions on
code based on my experiments but i need to hear more from you on these
specific issues.

component-hub is responsible for providing main extendibility facilities,
which contains the DIT configuration hooks. component-hub is providing the
DIT configuration hooks as a way for users to configure the component
instances.( the instance of a EventInterceptor for example). Then some
DirectoryListener implementation will listen for specified DIT entries for
changes and then reconfigure the instances. First question is whether
should i use PersistentSearch or implement DirectoryListener interface
myself. DirectoryListeners are called by EventInterceptor so that will make
the listening code have to go through LdapCoreSession. How PersistentSearch
is different? Is there any mechanism other than these two??

Second thing is like chicken-and-egg problem, specifically about
Interceptors. To add the custom generated schemas and the DIT configuration
hooks for instances, the current code access the server through session
(LdapCoreSessionConnection). But for LdapCoreSession to work as expected,
the interceptors are needed(at least, to work in the way it meant to). How
i solved this issue is by deferring all the write operations until
DirectoryService is fully initialized. component-hub will be able to
access, instantiate and use the interceptors( and other types of
components). However, until its being notified of full initialization of
DirectoryService, it defers the custom schema and DIT configuration hook
entries to be written to DIT. Is there any problem with that approach that
i couldn't see? This approach is clear but it may introduce some rendezvous
like concurrency management into code, increasing server startup about 1
second. The other way to do is initializing component-hub with the
DirectoryService reference having its Schema and Config Partition set. And
then we access the partitions directly without going through nexus and
interceptors. But to handle it with the second way, we must be sure nothing
is dependent on Interceptors until server is fully initialized.(*1). Which
way would you choose?

(*1) init() method of SubEntryInterceptor is using nexus to do some search.
But at that point in the code no partition is added to the nexus, not even
schema partition is set on DirectoryService. What exactly the code there is
doing, is it broken or am i missing something?


Regards,
Göktürk

Mime
View raw message