Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 94438 invoked from network); 8 Sep 2009 15:46:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Sep 2009 15:46:57 -0000 Received: (qmail 19707 invoked by uid 500); 8 Sep 2009 15:46:57 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 19647 invoked by uid 500); 8 Sep 2009 15:46:57 -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 19639 invoked by uid 99); 8 Sep 2009 15:46:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Sep 2009 15:46:57 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jukka.zitting@gmail.com designates 209.85.210.193 as permitted sender) Received: from [209.85.210.193] (HELO mail-yx0-f193.google.com) (209.85.210.193) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Sep 2009 15:46:49 +0000 Received: by yxe31 with SMTP id 31so6269872yxe.29 for ; Tue, 08 Sep 2009 08:46:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=pzB1cHCdl+DpcjkT5ifoBLBt7uZou5RdLSPLmKweM6w=; b=B3Zg8wvhV/BQgSEukNRLUAVTIFRF4MdgWVKL198AVdcfLz4/kTJ4OMXPFnFG9I3fI1 ofjASp3U8pvCMO8xVJzORmuNtfndEoIcBz8nn8vF6mvOBU8TwoKXtp5G3rIt08pN7RIH 4AGQrBjjJOFvWJoRyW2Lj2nXZk4VF9FQTBbWo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=CSYBzgyz5Y+vxj3+M4hqcoxOd+C/2bzw2TFaTWSNswvtNemhB2htfP6fRb3megqTny NR4R9rM/HJFMyUq1OqBMyiwjZmwtnLnmQZkS8Y8RYMfuPLShKmYvZH2jzOzpJv8qKRX0 IqC+57jaA5bWqqJfV+swR2kKakngZ4O9geXc8= MIME-Version: 1.0 Received: by 10.100.74.13 with SMTP id w13mr16983485ana.168.1252424787104; Tue, 08 Sep 2009 08:46:27 -0700 (PDT) In-Reply-To: <91f3b2650909080800l479ca7d1rfb8fabbc9ca5fb80@mail.gmail.com> References: <510143ac0909030700m23f34bfdi8b31dbf3b3326fdc@mail.gmail.com> <91f3b2650909080204j3e818e11n2487514d826dfb7@mail.gmail.com> <510143ac0909080212y5b23e965pc9ba477cd92ba10e@mail.gmail.com> <91f3b2650909080216r11ee7679md58f7261376f9102@mail.gmail.com> <510143ac0909080234t6e8a570fv27f898c9e88806e6@mail.gmail.com> <91f3b2650909080243p1dc0c558p49fdcf747a14f135@mail.gmail.com> <510143ac0909080254x31678638sbe3f7563682dd470@mail.gmail.com> <91f3b2650909080506y75dae3c3p2110c216650b2c1a@mail.gmail.com> <510143ac0909080615s5a219ba6ye726c322d66b182@mail.gmail.com> <91f3b2650909080800l479ca7d1rfb8fabbc9ca5fb80@mail.gmail.com> From: Jukka Zitting Date: Tue, 8 Sep 2009 17:46:07 +0200 Message-ID: <510143ac0909080846u138b780dx76a65ff26d7117bf@mail.gmail.com> Subject: Re: Jackrabbit management API To: dev@jackrabbit.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Hi, On Tue, Sep 8, 2009 at 5:00 PM, Thomas M=FCller wro= te: > Jukka, it seems that you don't understand what I mean. Yeah, we're probably talking past each other. :-} >> Simply by instantiating the appropriate implementation class, for >> example like this: >> >> =A0 =A0RepositoryManager manager =3D new RepositoryManagerImpl(config); > > That's not acceptable, as it's not JCR 2.0 API compliant. This is code that we would write in a component like jackrabbit-standalone. Are you saying that we shouldn't write Jackrabbit-specific code in Jackrabbit? :-) Your own proposals all included a Class.forName(...).newInstance() call with a Jackrabbit-specific implementation class. Similarly, if one really wanted, the above code could be replaced with: RepositoryManager manager =3D (RepositoryManager) Class.forName(...).newInstance(); ... and a change to the RepositoryManager interface to accept configuration settings after instantiation. Personally I don't see the use case where something like that would be need= ed. >> The server is in any case implementation-specific, > > No, it is not. Sure it is, the code is a part of Jackrabbit. > I don't understand why the standard JCR 2.0 way can't > be used. Please tell me. Why can't the 'server' / 'listener' be > started when you get the repository (see above). Because the RepositoryFactory API was never designed for this. The getRepository() method is documented to "*establish a connection* to a repository using the given parameters" (emphasis added). We can of course extend the API by defining JackrabbitRepositoryFactory with the added methods like shutdown() needed to properly control the repository lifecycle, but that's already beyond the scope of JCR. The reason why I prefer an interface that does *not* extend existing JCR interfaces is to avoid extra complexity in things like JMX mappings. If people like that, I certainly wouldn't mind an extra method like in your proposal [C]. Or our implementation class could implement both RepositoryFactory and RepositoryManager, making the relevant part of your proposal [B] look like this: 5) if (factory instanceof RepositoryManager) ((RepositoryManager) factory).stop(); >> =A0 =A0RepositoryManager manager =3D >> =A0 =A0 =A0 =A0new LoggingRepositoryManager(new RepositoryManagerImpl(co= nfig)); > > This is Jackrabbit-specific. Where's the Jackrabbit-specific part in: public class LoggingRepositoryManager implements RepositoryManager { private static final Logger log =3D LoggerFactory.getLogger(LoggingRepositoryManager.class); private final RepositoryManager manager; public LoggingRepositoryManager(RepositoryManager manager) { this.manager =3D manager; } public boolean isRunning() { log.debug("isRunning()"); return manager.isRunning(); } public boolean start() { log.debug("start()"); manager.start(); } public boolean stop() { log.debug("stop()"); manager.stop(); } } BR, Jukka Zitting