Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 15407 invoked from network); 3 Jul 2008 13:34:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Jul 2008 13:34:09 -0000 Received: (qmail 77830 invoked by uid 500); 3 Jul 2008 13:34:09 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 77805 invoked by uid 500); 3 Jul 2008 13:34:09 -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 77794 invoked by uid 99); 3 Jul 2008 13:34:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Jul 2008 06:34:09 -0700 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.9] (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 03 Jul 2008 13:33:26 +0000 Received: (qmail 15132 invoked from network); 3 Jul 2008 13:33:47 -0000 Received: from localhost (HELO ?127.0.0.1?) (127.0.0.1) by localhost with SMTP; 3 Jul 2008 13:33:47 -0000 Message-ID: <486CD538.9070808@apache.org> Date: Thu, 03 Jul 2008 15:33:44 +0200 From: Carsten Ziegeler User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; de; rv:1.8.1.14) Gecko/20080421 Lightning/0.8 Thunderbird/2.0.0.14 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: dev@jackrabbit.apache.org Subject: Re: [RT] Adding event interface to jackrabbit api References: <486CCF28.4090301@apache.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Alexander Klimetschek wrote: > On Thu, Jul 3, 2008 at 3:07 PM, Carsten Ziegeler wrote: >> Hi, >> >> when a repository cluster is used, it seems that a common problem many >> people have is to detect if an observation event is send because of changes >> on the local instance or a remote instance of the cluster. >> >> This is especially important if you want to do post processing of data >> based on observation (the post processing should only be done by one >> instance in the cluster). >> >> A current solution is to cast the jcr event object to the EventImpl of >> jackrabbit core which is obviously not a nice solution :) >> >> So what about adding an event interface to jackrabbit api which extends the >> jcr event interface and adds the isLocal() method? > > +1 > > Just to be sure (and document it), client code would like this, right? > > javax.jcr.Event event = events.nextEvent(); > if (event instanceof org.apache.jackrabbit.api.JackrabbitEvent) { > if ( ((org.apache.jackrabbit.api.JackrabbitEvent) event).isLocal() ) { > // event from local cluster node > } else { > // event from remote cluster node > } > } else { > // not a jackrabbit repository > } > Yes, that's exactly the idea. Carsten -- Carsten Ziegeler cziegeler@apache.org