@Test public void shouldTestGetRegisteredEventListenersTest_testRemoveEventListener() throws Exception { SimpleListener listener1 = addListener(0, ALL_EVENTS, null, false, null, null, false); EventListener listener2 = addListener(0, ALL_EVENTS, null, false, null, null, false); assertThat("Wrong number of event listeners.", getObservationManager().getRegisteredEventListeners().getSize(), is(2L)); removeListener(listener1); assertThat("Wrong number of event listeners after removing a listener.", getObservationManager().getRegisteredEventListeners().getSize(), is(1L)); assertThat("Wrong number of event listeners after removing a listener.", getObservationManager().getRegisteredEventListeners().nextEventListener(), is(listener2)); }
@Override public EventListenerIterator getRegisteredEventListeners() throws RepositoryException { checkSession(); return new JcrEventListenerIterator(Collections.unmodifiableSet(this.listeners)); }
JcrObservationManager implements ObservationManager { @Override public EventListenerIterator getRegisteredEventListeners() throws RepositoryException { checkSession(); return new JcrEventListenerIterator(Collections.unmodifiableSet(this.listeners)); } }
JcrObservationManager implements ObservationManager { @Override public EventListenerIterator getRegisteredEventListeners() throws RepositoryException { checkSession(); return new JcrEventListenerIterator(Collections.unmodifiableSet(this.listeners)); } JcrObservationManager( JcrSession session,
                           Observable repositoryObservable ); }
JcrObservationManager implements ObservationManager { @Override public EventListenerIterator getRegisteredEventListeners() throws RepositoryException { checkSession(); return new JcrEventListenerIterator(Collections.unmodifiableSet(this.listeners)); } 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 ); }
JcrObservationManager implements ObservationManager { @Override public EventListenerIterator getRegisteredEventListeners() throws RepositoryException { checkSession(); return new JcrEventListenerIterator(Collections.unmodifiableSet(this.listeners)); } 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 );  }