Return-Path: Delivered-To: apmail-jackrabbit-commits-archive@www.apache.org Received: (qmail 44004 invoked from network); 29 Jan 2010 10:20:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 29 Jan 2010 10:20:44 -0000 Received: (qmail 31849 invoked by uid 500); 29 Jan 2010 10:20:44 -0000 Delivered-To: apmail-jackrabbit-commits-archive@jackrabbit.apache.org Received: (qmail 31785 invoked by uid 500); 29 Jan 2010 10:20:44 -0000 Mailing-List: contact commits-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list commits@jackrabbit.apache.org Received: (qmail 31776 invoked by uid 99); 29 Jan 2010 10:20:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Jan 2010 10:20:44 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.130] (HELO eos.apache.org) (140.211.11.130) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Jan 2010 10:20:41 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id 0A0E516E2B for ; Fri, 29 Jan 2010 10:20:20 +0000 (GMT) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Apache Wiki To: Apache Wiki Date: Fri, 29 Jan 2010 10:20:19 -0000 Message-ID: <20100129102019.14206.55668@eos.apache.org> Subject: =?utf-8?q?=5BJackrabbit_Wiki=5D_Update_of_=22JackrabbitOsgi=22_by_FelixMe?= =?utf-8?q?schberger?= X-Virus-Checked: Checked by ClamAV on apache.org Dear Wiki user, You have subscribed to a wiki page or wiki category on "Jackrabbit Wiki" fo= r change notification. The "JackrabbitOsgi" page has been changed by FelixMeschberger. http://wiki.apache.org/jackrabbit/JackrabbitOsgi?action=3Ddiff&rev1=3D1&rev= 2=3D2 -------------------------------------------------- =3D Embedding A Jackrabbit Repository in an OSGi Framework =3D The Apache Sling project has provided an infrastructure for embedding and= accessing JCR Repositories right from the start. With Jackrabbit 2 it is a= bout time, that Jackrabbit itself becomes more OSGi friendly and provides m= any of the features which are currently part of Apache Sling. = - This page is about the changes and enhancements proposed in the [[http://= svn.apache.org/repos/asf/jackrabbit/sandbox/jackrabbit2-bundle][Jackrabbit = 2 Bundle Sandbox]]. + This page is about the changes and enhancements proposed in the [[http://= svn.apache.org/repos/asf/jackrabbit/sandbox/jackrabbit2-bundle|Jackrabbit 2= Bundle Sandbox]]. = =3D=3D Apache Sling JCR Bundles =3D=3D Apache Sling currently provides the following JCR related bundles: = Bundle Current Version Jackrabbit Version Description + || '''Bundle''' || '''Current Version''' || '''Jackrabbit Version''' || '= ''Description''' || - = - ||Bundle||Current Version||J= ackrabbit Version||Description|| - = - ||Sling JCR API||2.0.6||--||= Provides additional API to simplify use. Most notably contains the SlingRep= ository interface to ease configuration pain for bundles requiring administ= rative repository access. This bundle used to include and provide the JCR 1= .0 API in the OSGi framework. This has been removed to allow the provision = of the JCR 2.0 API as a proper bundle. || + ||Sling JCR API ||2.0.6 ||-- ||Provides additional API to simplify use. M= ost notably contains the SlingRepository interface to ease configuration pa= in for bundles requiring administrative repository access. This bundle used= to include and provide the JCR 1.0 API in the OSGi framework. This has bee= n removed to allow the provision of the JCR 2.0 API as a proper bundle. || - ||Sling JCR Base||2.0.4||1.5||Provides an abstract default implementation= of the SlingRepository interface and includes the Jackrabbit RMI library a= t version 1.5 to access a repository over RMI. This abstract base implement= ation supports accessing repositories both through JNDI and RMI.|| + ||Sling JCR Base ||2.0.4 ||1.5 ||Provides an abstract default implementat= ion of the SlingRepository interface and includes the Jackrabbit RMI librar= y at version 1.5 to access a repository over RMI. This abstract base implem= entation supports accessing repositories both through JNDI and RMI. || - ||Sling JCR Classloader||3.0|| ||Provides support to load classes from th= e repository. This bundle was based on the Jackrabbit Repository Classloade= r. Now it contains a stripped-down copy of the class loader with a few fixe= s.|| + ||Sling JCR Classloader ||3.0 || ||Provides support to load classes from = the repository. This bundle was based on the Jackrabbit Repository Classloa= der. Now it contains a stripped-down copy of the class loader with a few fi= xes. || - ||Sling Jackrabbit Client||2.0.2|| ||A concrete extension of the Abstract= SlingRepository in the Sling JCR Base bundle. This extension is almost empt= y, since the basic support is already provided by the abstract class.|| + ||Sling Jackrabbit Client ||2.0.2 || ||A concrete extension of the Abstra= ctSlingRepository in the Sling JCR Base bundle. This extension is almost em= pty, since the basic support is already provided by the abstract class. || - ||Sling Jackrabbit Server||2.0.4||1.6||Embeds Jackrabbit Core and most of= its dependencies like Lucene, Derby, PDFBox, etc.|| + ||Sling Jackrabbit Server ||2.0.4 ||1.6 ||Embeds Jackrabbit Core and most= of its dependencies like Lucene, Derby, PDFBox, etc. || - ||Sling Jackrabbit Access Manager||2.0.2||1.6||Supports Access Control Ma= nagement in a Jackrabbit Repository using the Sling Features.|| + ||Sling Jackrabbit Access Manager ||2.0.2 ||1.6 ||Supports Access Control= Management in a Jackrabbit Repository using the Sling Features. || - ||Sling Jackrabbit User Manager||2.0.2||1.6||Supports User Management in = a Jackrabbit Repository using the Sling features.|| + ||Sling Jackrabbit User Manager ||2.0.2 ||1.6 ||Supports User Management = in a Jackrabbit Repository using the Sling features. || = = Note: The future of the Jackrabbit Repository Classloader library has not= yet been decided upon. At the moment, we have a relatively stable release = in the Commons subproject and Apache Sling has a stripped-down fork of that= class loader. It will have to be discussed where we are heading with this = beast and what the requirements of the Community will be around this. = Of these bundles, the ''Sling Jackrabbit Server'' bundle is probably the = one which should be integrated in the Jackrabbit Core library. Over time I = could imagine to also merge most of the ''Sling JCR Base'' and ''Sling JCR = Client'' bundles into the Jackrabbit project. = + = + =3D=3D Current State of OSGi Support in Jackrabbit =3D=3D + = + Currently many helper libraries of Jackrabbit are already setup as proper= OSGi bundles. Most notably this includes the Jackrabbit API, JCR Commons, = SPI, and SPI Commons libraries. + = + The major missing link is the Jackrabbit Core library, which is the actua= l implementation of the repository. + = + = + =3D=3D Extensions to Jackrabbit Core =3D=3D + = + The goal of turning the Jackrabbit Core library into an OSGi bundle is to= preserve as much of the functionality of the current Sling Jackrabbit Serv= er bundle as possible. Concretely this means: + = + * Build the Jackrabbit Core library as a bundle (obviously) + * Embed only as much dependencies as are really needed (goal: none) + * Support easy startup and access to the embedded repository instances + * Provide some degree of dynamic extensibility (at least provide the pl= uggability currently supported by the Sling Jackrabbit Server bundle) + = + = + =3D=3D=3D Jackrabbit Core Bundle and Embedded Dependencies =3D=3D=3D + = + The biggest issue when bundelizing the Jackrabbit Core bundle is the is t= he list of dependencies and extensibility. = + = + The problem with dependencies is, that Jackrabbit Core has quite big numb= er of dependencies. To launch a Jackrabbit repository a number of libraries= have been collected and put together. Some of these libraries are availabl= e as OSGi bundles (e.g. the Jackrabbit helper libraries, the JCR 2.0 API, D= erby) and some are not (yet) (e.g. Lucene, Concurrent, Commons Pool, Common= s DBCP). Tika is special in that it will be available as a bundle starting = with release 0.6. + = + The problem with extensibility is, that Jackrabbit Core has not been buil= t with the kind of modularity in mind as provided by OSGi. This means inter= nal extension API is not properly separated from internal implementations. = This makes it close to impossible to expose the API as OSGi {{{Export-Packa= ge}}} without also requiring to exposing internal packages. + = + The current approach followed in the [[http://svn.apache.org/repos/asf/ja= ckrabbit/sandbox/jackrabbit2-bundle|Jackrabbit 2 Bundle Sandbox]] is to emb= ed libraries, which are not available as bundles and to not embed libraries= available as bundles. + = + = + =3D=3D=3D Easy Startup and Access =3D=3D=3D + = + For easy startup and access the OSGi specification offers great functiona= lities: To startup an embedded repository instance, we need a location to s= tore the filesystem data to and a location to access a configuration. Both = properties can easily be provided through the OSGi Configuration Admin Serv= ice. This is what we do in the Sling Jackrabbit Server bundle and thus this= is also implemented in the current approach. + = + Accessing an embedded repository is equally easy: As soon as a repository= has been configured and started, it will be registered as an OSGi service = and can be referenced like any other service using the service name. An emb= edded Jackrabbit Repository is registered under the two names implemented b= y Jackrabbit Core: {{{javax.jcr.Jackrabbit}}} and {{{org.apache.jackrabbit.= api.JackrabbitRepository}}}. + = + The Jackrabbit Core bundle also contains an OSGi {{{BundleActivator}}} wh= ich ensures configuration can be provided by the Configuration Admin Servic= e and which also ensures an initial configuration to have a running reposit= ory as soon as the bundle is started. + = + As for the configuration file: The Jackrabbit Core library contains a def= ault repository.xml file ({{{OSGI-INF/repository_osgi.xml}}}) which is used= as a configuration file if none is provided. + = + = + =3D=3D=3D Extensibility =3D=3D=3D + = + = + Jackrabbit configuration is the subject of a book of its own. Yet some th= ings may be setup rather dynamically in the sense of extensible at runtime = by the system administrator. Things in this area, we have at the moment in = the Sling Jackrabbit Server bundle are a framework to extend login modules = and a support to plugin extensible access controllers. + = + Both should, if possible, be migrated to the Jackrabbit Core bundle; poss= ibly even enhancing it. Of course such extensibility points will have to be= exported from the Jackrabbit Core bundle and as such will be placed into s= eparate locations. +=20