You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Noah Vihinen <nv...@maven.net> on 2006/12/12 04:08:51 UTC

Persistence of Event Listeners

I'd like to be able to register a 'persistent' event listener.  It  
looks like the suggested method (according to the 170 spec) is to use  
a 'system' session.  Gaining access to a session with this scope  
doesn't seem to be described in the spec however.  Also, the  
jackrabbit-specific getSystemSession() method in RepositoryImpl is  
not accessible (nor do I prefer to use non-standard apis).

So does anyone know the right way to register an event listener that  
persists beyond a single session?

Thanks,
Noah



Re: Persistence of Event Listeners

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On 12/12/06, Noah Vihinen <nv...@maven.net> wrote:
> I'd like to be able to register a 'persistent' event listener.  It
> looks like the suggested method (according to the 170 spec) is to use
> a 'system' session.  Gaining access to a session with this scope
> doesn't seem to be described in the spec however.  Also, the
> jackrabbit-specific getSystemSession() method in RepositoryImpl is
> not accessible (nor do I prefer to use non-standard apis).

You can create your own "system session" simply by logging in with a
superuser account and keeping that session alive for the entire
lifetime of the repository. You can then register an event listener on
that session to receive notification of all the changes to the
respective workspace.

BR,

Jukka Zitting

Re: Persistence of Event Listeners

Posted by Noah Vihinen <nv...@maven.net>.
Thanks - I'll just keep a session open for the lifetime of the  
repository, as suggested.  I didn't know if there was a way that was  
better than this, as in production, this session may be open for a  
months.  Also, to span repository restarts, I plan on serializing my  
'persistent' event listeners to repository nodes, and re-initializing  
these listeners with each restart.

Thanks for the help,
Noah

On Dec 12, 2006, at 3:42 AM, Tobias Bocanegra wrote:

> hi noah,
> you can't register an event listener that is not attached to a
> session. but what is the problem? when you're application starts, just
> create a session and register your listener. the session will never
> close automatically (unless the repository is shut down).
>
> regards, toby
>
> On 12/12/06, Noah Vihinen <nv...@maven.net> wrote:
>> I'd like to be able to register a 'persistent' event listener.  It
>> looks like the suggested method (according to the 170 spec) is to use
>> a 'system' session.  Gaining access to a session with this scope
>> doesn't seem to be described in the spec however.  Also, the
>> jackrabbit-specific getSystemSession() method in RepositoryImpl is
>> not accessible (nor do I prefer to use non-standard apis).
>>
>> So does anyone know the right way to register an event listener that
>> persists beyond a single session?
>>
>> Thanks,
>> Noah
>>
>>
>>
>
>
> -- 
> -----------------------------------------< tobias.bocanegra@day.com  
> >---
> 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  
> >---


Re: Persistence of Event Listeners

Posted by Tobias Bocanegra <to...@day.com>.
hi noah,
you can't register an event listener that is not attached to a
session. but what is the problem? when you're application starts, just
create a session and register your listener. the session will never
close automatically (unless the repository is shut down).

regards, toby

On 12/12/06, Noah Vihinen <nv...@maven.net> wrote:
> I'd like to be able to register a 'persistent' event listener.  It
> looks like the suggested method (according to the 170 spec) is to use
> a 'system' session.  Gaining access to a session with this scope
> doesn't seem to be described in the spec however.  Also, the
> jackrabbit-specific getSystemSession() method in RepositoryImpl is
> not accessible (nor do I prefer to use non-standard apis).
>
> So does anyone know the right way to register an event listener that
> persists beyond a single session?
>
> Thanks,
> Noah
>
>
>


-- 
-----------------------------------------< tobias.bocanegra@day.com >---
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 >---