jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carsten Ziegeler <cziege...@apache.org>
Subject Re: [RT] Adding event interface to jackrabbit api
Date Thu, 03 Jul 2008 13:33:44 GMT
Alexander Klimetschek wrote:
> On Thu, Jul 3, 2008 at 3:07 PM, Carsten Ziegeler <cziegeler@apache.org> 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

Mime
View raw message