On Sun, 2006-07-02 at 12:33 +0200, Emmanuel Lecharny wrote: > Hi list ! > > I see that there are a lot of work going on about OSGI, and I have a few > suggestions and questions : > 1) is it possible to have a kind of 'big picture' on what's is going on? > I do think that OSGI is a must-have for ADS, and I also do think that it > will have a big impact on code structure. Some kind of explanation could > help, at this point Since I am only a user of ADS and OSGi, for the big OSGi/ADS picture I'll defer to Enrique as he has done all the design and initial implementation work on this effort to date. See http://docs.safehaus.org/display/OSGI/Presentations for Enrique's October 29, 2005 presentation on ApacheDS and OSGi. You will also find some of the excellent ApacheCon OSGi presentations that are well worth viewing.
For any OSGi effort to move forward (and ADS is no exception) the OSGi ideas of - Deployment Modules (aka OSGi bundles) and - Service dependencies will need to become more integral to the design, discussions, implementation and building of the project and/or subprojects. What follows hopefully provides some explanation about the initial ADS OSGi efforts and will help to contribute to promoting those ideas in ADS. ADS Projects 'How are ADS classes packaged, archived and shared as bundles within an OSGi environment?' Although it only takes a few lines in a Java Jar's Manifest to turn a standard Java Jar into an OSGi bundle, the main ADS projects and subprojects have not as yet incorporated the additional maven metadata necessary for creating OSGi super jar/bundles. In other words - the main ADS projects and subprojects are building legacy java jars. Legacy Bundling a Generic Issue The legacy jar Deployment issue is also being discussed on the felix-dev under the Subject: 'OSGi Manifests in Maven JARs'. Apparently Richard Hall has requested Jason van Zyl of the maven team investigate integrating the OSGi manifest tagging into the standard maven jar plugin in order to automatically OSGize any jar built in maven. Migrating Legacy ADS Jars Because each ADS jar was not initially created as an OSGi bundle, OSGi bundles must be created in a separate project encapsulating the legacy jar. Additionally because multiple jars can be encapsulated the question comes up as which collection of legacy jars makes sense to encapsulate together. <Comment>I find this encapsulating and grouping of legacy ADS jars to be the most brittle part of the initial OSGi implementation.</Comment> Initial ADS Library Bundles Currently the maven-osgi-achetype (sic) and maven-osgi-plugins (see /trunks/apacheds) are used to create ADS OSGi bundles by encapsulating legacy ADS jars. If one looks at the maven pom.xml project files in the sub directories of trunks/apacheds/osgi you will see that Enrique has opted to bundle one or in most cases multiple ADS legacy and/or third-party jars to create the OSGi bundles necessary to run an ADS. Some of these project create bundles that just share code (sometimes called library bundles) other projects create OSGi Services (published interfaces) that depend on the packages in the library jars, and because ADS is of course a server some bundles create network services. Putting it all together Once all the separate project bundles are created they have to be installed and started within an OSGi framework. This assembly process is automated by the trunks/apacheds/osgi/server-main project. It pulls the ADS osgi bundles out of the maven repository, adds the necessary OSGi (felix) framework, and provides a startup script. > 2) we may need to create a components into JIRA for OSGI related > issues, because right now they are all pushed to DIRSERVER. May be a > DIROSGI ? Agree. > 3) Is there somewhere we can find a line of code? I don't see any > sub-project into a branch or into sandbox. Lots of lines of code. As mentioned above the bulk of the OSGi work is in the trunks/apacheds/osgi but Enrique also has some sandbox projects as well. (You may have seen some of my patches to configuration sandbox project.) Running ADS OSGi There are two basic tasks necessary to bring up an ADS in OSGi. 1. Main OSGi code is in the trunks/apacheds/osgi. You will have to build the projects in this directory manually (mvn clean install in the trunks/apacheds/osgi dir) as it is not called by the parent pom.xml in trunks/apacheds. This will build and assemble all jars in trunks/apacheds/osgi/server-main. 2. a. Change directories to the trunks/apacheds/osgi/server-main b. as root (we're using port 389 as the LDAP ) c. run: ./apacheds Caveats I have several JIRA patches outstanding for several of the OSGi bundles that I don't believe were committed. YMMV. cheers, John Conlon
