> > You want me to provide
>
> getObservationManager().addEventListener ?
but with what
> arguments? are you sure you select the correct events to listen to

if you
> want to listen to all events
> do:
wsp.getObservationManager().addEventListener(listener,
 Event.NODE_ADDED
> | Event.NODE_REMOVED
 | Event.PROPERTY_ADDED | Event.PROPERTY_REMOVED,
 "/",
> true, null, null, false);

> There is nothing to it.
> After that I use
>
> session.getWorkspace(),getObser...getEventListenerIterator,
>
> and it's empty.
please note, that the event listener is bound to the session
> you
retrieve the workspace from. once you close/logout the session,
> the
listener is removed.

> Quote from JCR spec:
>
> "Additionally, if noLocal is true, then events generated by the session
> through which the listener was registered are ignored. Otherwise, they are
> not ignored."
>
> It seems that if the last parameter is true, the session is ignored.
> Combined with the above statement, it means that no events will be sent,
> which does not make much sense, does it?
> The event listener is bound (or should be) to Workspace, according to spec.

well it's a bit more complicated. the listener is bound to the
workspace, but the workspace object is bound to the session that
logged on that workspace.

so, if you do a Repository.login(), a new Workspace and a new Session
object is created. if you do a session.logout, both are discarded. and
so are the eventlisteners. the 'noLocal' flag referrs to the session
that registers the listener (via it's local workspace object).

regards, toby

ps: please reply to jackrabbit-dev@incubator.apache.org insted to me
personally, so all list members can profit from this discussion.

--
-----------------------------------------< [EMAIL PROTECTED] >---
Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
T +41 61 226 98 98, F +41 61 226 98 97
-----------------------------------------------< http://www.day.com >---

Reply via email to