Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 35436 invoked from network); 22 Oct 2009 09:02:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 22 Oct 2009 09:02:11 -0000 Received: (qmail 29579 invoked by uid 500); 22 Oct 2009 09:02:07 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 29556 invoked by uid 500); 22 Oct 2009 09:02:06 -0000 Mailing-List: contact dev-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 dev@jackrabbit.apache.org Received: (qmail 29536 invoked by uid 99); 22 Oct 2009 09:02:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Oct 2009 09:02:04 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of fmeschbe@gmail.com designates 209.85.220.210 as permitted sender) Received: from [209.85.220.210] (HELO mail-fx0-f210.google.com) (209.85.220.210) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Oct 2009 09:01:54 +0000 Received: by fxm6 with SMTP id 6so8458592fxm.43 for ; Thu, 22 Oct 2009 02:01:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=PYrQo1pZ+MfD2BJAT7GMRE2fS8h0Qdknqz3xkEOZZds=; b=Bemdnb7t7xV6DHpGB96m1tFwqvw5Y2Cm5E3pBV+ul6XKNq9N0H0mur+G2CRWrL0L15 2zUpI7nW7rcx53VbMhRr5q6fYEF4o9cMgnX63aqgnA1FmLcZc2isKmxm0P73G/VMCdTN 33sgY44KcjMUjDFm8Ebu9nhQ0uiNj8FlyC2XQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=jPlxvPoTqAbq5lYD0v9JtGmgTthPr2O+1kLlEjO/F0fkCK8naChV00iTWx5V1W8Cxz lo8ShNlSMa0Xynmb/ELeHt45eT17wwtx1Lt+jjKkJXsxHfD9B9BMqLjs17TEVLqiJBUE Z27IBCUHkW1MxZMtV3Oi4KtaXzEp/shCxrA64= Received: by 10.103.86.22 with SMTP id o22mr3939913mul.102.1256202094265; Thu, 22 Oct 2009 02:01:34 -0700 (PDT) Received: from ?192.168.1.20? (cable-static-138-82.eblcom.ch [87.102.138.82]) by mx.google.com with ESMTPS id b9sm1394429mug.39.2009.10.22.02.01.32 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 22 Oct 2009 02:01:33 -0700 (PDT) Message-ID: <4AE01F6C.7090100@gmail.com> Date: Thu, 22 Oct 2009 11:01:32 +0200 From: Felix Meschberger User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: dev@jackrabbit.apache.org Subject: Re: Generic JCR repository factory References: <510143ac0910200811g1bf00847q7e43159b4d8b8de0@mail.gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi, Marcel Reutegger schrieb: > Hi, > > I might be missing something but isn't much of this already covered > with the existing JCR RepositoryFactory interface and our > implementations thereof? > > I don't see a need to move around stuff, we just need a utility method > (which usually happen to be static ;) ) that turns a defined set of > URLs into a parameter map that is consumed by the RepositoryFactory > implementations. Those implementations can all be discovered using the > standard Java Service Provider mechanism. There is no need to declare > dependencies for that. > > e.g. to access a repository on the file system, the utility method had > to translate the URL file:///my/repo/home into a map with: > - org.apache.jackrabbit.repository.home -> file:///my/repo/home > - org.apache.jackrabbit.repository.conf -> file:///my/repo/home/repository.xml > > with this map content, the > org.apache.jackrabbit.core.RepositoryFactoryImpl will provide a > repository instance. > > and btw. that's a TransientRepository, so you don't even have to care > about life cycle :) > for all the other RepositoryFactory implementations you probably don't > need life cycle anyway because you only *connect* to an already > running repository and don't start it. We *always* need some kind of lifecycle: Even if you just *connect* to a repository, you want to be able to explicitly *disconnect* from the repository -- and don't tell me "stop the application to disconnect" ;-) Regards Felix > > regards > marcel > > On Tue, Oct 20, 2009 at 17:11, Jukka Zitting wrote: >> Hi, >> >> The current jackrabbit-jcr-client component contains a >> RepositoryFactory implementation that can choose between different >> Repository implementations based on given parameters. Currently it >> depends on the SPI implementations encoded in the >> Jcr2spiRepositoryFactory class in jackrabbit-jcr2spi and on the >> RepositoryFactoryImpl class in jackrabbit-core. However, the >> jackrabbit-jcr-client POM only declares those as test dependencies, so >> a client application needs to explicitly add the required >> implementation dependencies. >> >> Some thoughts on this: >> >> 1) Is there a reason why this generic RepositoryFactory implementation >> couldn't go to jackrabbit-jcr-commons? We obviously want to keep the >> implementation dependencies optional, so having the class in >> jcr-commons would not affect the dependency set. And since all of our >> repository implementations (core, jcr2spi + spi2dav, etc.) already >> depend on jcr-commons, a client would not need any extra dependencies >> to use this functionality. >> >> 2) It looks to me like the functionality inside the >> Jcr2spiRepositoryFactory class could/should be merged with the >> jcr-client RepositoryFactoryImpl. >> >> 3) How about using URIs as a simple configuration mechanism? A file: >> URI pointing to a repository directory would start a normal >> jackrabbit-core repository using a repository.xml from within the >> directory (or a custom one specified in a URI parameter). A http: URI >> would point to a DAV(ex) endpoint or possibly a HTML page with an >> appropriate tag pointing to the endpoint. People are already >> familiar with URIs, so documenting and communicating such >> configurations would be easy. >> >> 4) In addition to the RepositoryFactory implementation, I propose a >> simple wrapper Repository class that simply takes a URI like above as >> a constructor argument. This would make it really easy to connect to a >> repository: >> >> Repository local = new GenericRepository("file:///path/to/repository"); >> Repository remote = new GenericRepository("http://localhost:8080/"); >> >> The GenericRepository class would simply use the RepositoryFactory API >> under the hood. >> >> BR, >> >> Jukka Zitting >> >