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 <[email protected]> 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 <[email protected]> wrote: > >> On Thu, Feb 4, 2010 at 12:27, <[email protected]> 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 >> [email protected] >> > >
