jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From AElsher...@idc.com
Subject Re: Jackrabbit Observation with Spring
Date Thu, 04 Feb 2010 14:06:25 GMT
When I try to get the number of registered listeners with the same session 
before to return as you see below I also get -1!

@PostConstruct
        public void register(){
                jcrTemplate.execute(new JcrCallback() {
            public Object doInJcr(final Session session) throws 
RepositoryException {
                ObservationManager observationManager =
                    session.getWorkspace().getObservationManager();
                for(XListener listener : listeners){
                                ListenerProperties listenerProperties = 
listener.getListenerProperties();
 
observationManager.addEventListener(listenerProperties.getEventListener(),
 listenerProperties.getEventTypes(),
 listenerProperties.getAbsPath(),
 listenerProperties.isDeep(),
 listenerProperties.getUuid(),
 listenerProperties.getNodeTypeName(),
 listenerProperties.isNoLocal());
                        }
                long numberOfRegisteredListeners = 
observationManager.getRegisteredEventListeners().getSize();
                // the value of numberOfRegisteredListeners is -1 even I 
still haven't return!!
                return null;
            }
        });
        }


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