On 5 May 2009, at 15:36, Alexander Klimetschek wrote:

On Tue, May 5, 2009 at 3:55 PM, Ian Boston <i...@tfd.co.uk> wrote:
I am after is a listener that only fires on the cluster node that created it. I need this because I want to ensure that all nodes, however they are created have certain properties (like the id of the creator) if appropriate.

Jackrabbit has support for this. There is the JackrabbitEvent
interface [1] which extends javax.jcr.Event and adds a method
"isExternal", that signals whether an event was created on the local
cluster node (false) or comes from another cluster node (true).
Casting inside a normal EventListener does the trick:


if (event instanceof JackrabbitEvent && !((JackrabbitEvent)
event).isExternal()) {
   // local event
}


Ahh, Ok hadn't seen that.

Looks like it just changed to 1.5 in Sling.
Do you know if there are plans to expose SynchronousEventListener in the same way, that would remove any need to do anything in the jackrabbit-server bundle. ?

Thanks
Ian





[1] 
http://jackrabbit.apache.org/api/1.5/org/apache/jackrabbit/api/observation/JackrabbitEvent.html

Regards,
Alex

--
Alexander Klimetschek
alexander.klimetsc...@day.com

Reply via email to