jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@day.com>
Subject Re: Observing changes made to a single session
Date Tue, 31 Mar 2009 20:07:49 GMT
On Mon, Mar 30, 2009 at 11:24 PM, Alfie Kirkpatrick
<Alfie.Kirkpatrick@ioko.com> wrote:
> Hi, I am interested in having a listener that only reacts to changes
> made in a given Jackrabbit session, rather than all changes across a
> workspace. Is this possible?

You can use the standard JCR observation mechanism (section 8.3 of the
JSR-170 spec [1]):
session.getWorkspace().getObservationManager().addEventListener() [2]

But this will always give you all repository changes (in case of
clustering, the Jackrabbit-specific isExternal() method on
JackrabbitEvent [3] will mark events that are coming from another
cluster node). What is your use case for not seeing the changes of a
certain session? You should probably separate your "events" by using a
content hierarchy that allows that.

[1] http://www.day.com/specs/jcr/1.0/8.3_Observation.html
[2] http://day.com/maven/jsr170/javadocs/jcr-1.0/javax/jcr/observation/ObservationManager.html
[3] http://jackrabbit.apache.org/api/1.5/org/apache/jackrabbit/api/observation/JackrabbitEvent.html


Alexander Klimetschek

View raw message