From commits-return-8965-apmail-jackrabbit-commits-archive=jackrabbit.apache.org@jackrabbit.apache.org Wed Sep 23 07:05:46 2009 Return-Path: Delivered-To: apmail-jackrabbit-commits-archive@www.apache.org Received: (qmail 81102 invoked from network); 23 Sep 2009 07:05:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 23 Sep 2009 07:05:46 -0000 Received: (qmail 34867 invoked by uid 500); 23 Sep 2009 07:05:46 -0000 Delivered-To: apmail-jackrabbit-commits-archive@jackrabbit.apache.org Received: (qmail 34793 invoked by uid 500); 23 Sep 2009 07:05:45 -0000 Mailing-List: contact commits-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 commits@jackrabbit.apache.org Received: (qmail 34784 invoked by uid 99); 23 Sep 2009 07:05:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Sep 2009 07:05:45 +0000 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.130] (HELO eos.apache.org) (140.211.11.130) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Sep 2009 07:05:43 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id B6B8211154 for ; Wed, 23 Sep 2009 07:05:23 +0000 (GMT) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Apache Wiki To: Apache Wiki Date: Wed, 23 Sep 2009 07:05:23 -0000 Message-ID: <20090923070523.25866.11575@eos.apache.org> Subject: =?utf-8?q?=5BJackrabbit_Wiki=5D_Update_of_=22Observation=22_by_ThomasMuel?= =?utf-8?q?ler?= X-Virus-Checked: Checked by ClamAV on apache.org Dear Wiki user, You have subscribed to a wiki page or wiki category on "Jackrabbit Wiki" fo= r change notification. The "Observation" page has been changed by ThomasMueller: http://wiki.apache.org/jackrabbit/Observation New page: In addition to JCR observation, Jackrabbit support cluster-aware event proc= essing and synchronous observation listeners. =3D=3D Cluster-Aware Event Processing =3D=3D Sometimes events must only be processed by the cluster node where the event= originated, or only by cluster nodes where the event didn't originate. Eac= h event contains an 'external' flag that indicated whether the event origin= ated on another cluster node, that means whether the code that manipulated = the node ran in another cluster node. Example source code: {{{ import org.apache.jackrabbit.api.observation.JackrabbitEvent; public void onEvent(EventIterator events) { while (events.hasNext()) { Event e =3D events.nextEvent(); if (e instanceof JackrabbitEvent && !((JackrabbitEvent) e).isExternal()= ) { // event originated in another cluster node } else { // event originated in this cluster node } } }}} =3D=3D Synchronous Observation Listener =3D=3D By default Jackrabbit call observation listeners some time after the event = occurs. However, synchronous observation is supported as well. To use it, the obser= vation listener needs to implement the interface org.apache.jackrabbit.core.observation.Syn= chronous``Event``Listener. Please note that this interface is _not_ part of the Jackrabbit API, and sh= ould only be used if really required.