On Thu, Jul 3, 2008 at 3:07 PM, Carsten Ziegeler <[EMAIL PROTECTED]> 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
}
Regards,
Alex
--
Alexander Klimetschek
[EMAIL PROTECTED]