jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Short <...@benshort.co.uk>
Subject Re: Jackrabbit Observation with Spring
Date Thu, 04 Feb 2010 15:10:53 GMT
Sorry that should of been 'can add the event listener'

You could pass the JcrSessionFactory into your ListenerRegistrar and in the
init method get a session and add the listeners via it. Make sure you
implement a destroy method that logs out the session.

On 4 February 2010 15:05, Ben Short <ben@benshort.co.uk> wrote:

> Hi,
>
> Looking at the documentation [1] you have to add the Event Listener to the
> JcrSessionFactory bean.
>
> <bean id="sessionFactory" class="org.springmodules.jcr.JcrSessionFactory">
>   ...
>   <property name="eventListeners">
>    <list>
>     <bean class="org.springmodules.jcr.EventListenerDefinition">
>      <property name="listener">
>       <bean class="org.springmodules.examples.jcr.DummyEventListener"/>
>      </property>
>      <property name="absPath" value="/rootNode/someFolder/someLeaf"/>
>     </bean>
>    </list>
>   </property>
> </property>
>
>
> [1]
> https://springmodules.dev.java.net/docs/reference/0.8/html_single/#d0e5257
>
>
> On 4 February 2010 15:00, Alexander Klimetschek <aklimets@day.com> wrote:
>
>> On Thu, Feb 4, 2010 at 12:27,  <AElshereay@idc.com> wrote:
>> >                jcrTemplate.execute(new JcrCallback() {
>> >            public Object doInJcr(final Session session) throws
>> RepositoryException {
>> >                ObservationManager observationManager =
>> session.getWorkspace().getObservationManager();
>>
>> I think this session will be closed immediately after execution by the
>> spring-modules JcrCallback. An observation listeners is only active as
>> long as it's session is open.
>>
>> Regards,
>> Alex
>>
>> --
>> Alexander Klimetschek
>> alexander.klimetschek@day.com
>>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message