JcrObservationManager implements ObservationManager { @Override public void addEventListener( EventListener listener, int eventTypes, String absPath, boolean isDeep, String[] uuid, String[] nodeTypeName, boolean noLocal ) throws RepositoryException { CheckArg.isNotNull(listener, "listener"); checkSession(); JcrListenerAdapter adapter = new JcrListenerAdapter(listener, eventTypes, absPath, isDeep, uuid, nodeTypeName, noLocal); if (this.repositoryObservable.register(adapter)) { this.listeners.add(adapter); } } JcrObservationManager( JcrSession session,
                           Observable repositoryObservable ); @Override void addEventListener( EventListener listener,
                                  int eventTypes,
                                  String absPath,
                                  boolean isDeep,
                                  String[] uuid,
                                  String[] nodeTypeName,
                                  boolean noLocal ); @Override EventListenerIterator getRegisteredEventListeners(); @Override void removeEventListener( EventListener listener ); @Override void setUserData( String userData ); @Override EventJournal getEventJournal(); @Override EventJournal getEventJournal( int eventTypes,
                                         String absPath,
                                         boolean isDeep,
                                         String[] uuid,
                                         String[] nodeTypeName );  }
@Test @FixFor( "MODE-2268" ) public void shouldReceiveNonLocalEvents() throws Exception { SimpleListener listener = new SimpleListener(1, 1, Event.NODE_ADDED); session.getWorkspace() .getObservationManager() .addEventListener(listener, Event.NODE_ADDED, null, true, null, null, true); session.getRootNode().addNode("session1Node"); session.save(); Session session2 = login(WORKSPACE); Node addedNode = session2.getRootNode().addNode("session2Node"); session2.save(); listener.waitForEvents(); removeListener(listener); checkResults(listener); assertTrue("Path for added node is wrong: actual=" + listener.getEvents().get(0).getPath() + ", expected=" + addedNode.getPath(), containsPath(listener, addedNode.getPath())); }