jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmjose26 <mmjos...@yahoo.com.mx>
Subject Re: using Asynchronous listener
Date Thu, 04 Aug 2011 00:26:47 GMT
Tanks very much for your reply and suggestions, I will try with queue and
background worker thread.
I'm using a new fresh session for each new event, but onEvent()  method
never is called.
Maybe I found the reason of this behavior and I will try to explain what I
found when debugging my app
Please correct me if I'm wrong with my assumptions.
1) We need register a Event Listener via observationManager, this
observationManager uses the current session object,  adding a new
EventConsumer( using the current session object).

2) On commit:

a) Synchronous   eventListeners are executed and the asynchronous listeners
are queued.

b) Active session is invalidated after that.

But, because of we have dealing with threads,
in some point of time maybe after or   before (here the point!) of session
is invalidated,
notificationThread(the daemon thread of Observationdispatcher) call the run
method and  the EventConsumer.consumeEvent is called too.  This method
validate if the session (the object session used to register this
evenConsumer) is valid.

if commit ends with session before that consumeEvent, the onEvent method is
never called due to this validation, but we need to validate the session
object, because Event object need it.

Tanks for your help!

--
View this message in context: http://jackrabbit.510166.n4.nabble.com/using-Asynchronous-listener-tp3716110p3717305.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Mime
View raw message