@Override public boolean consume( ChangeSetListener consumer, ChangeSet event, long position, long maxPosition ) { consumer.notify(event); return true; }
@Override public boolean consume( ChangeSetListener consumer, ChangeSet event, long position, long maxPosition ) { consumer.notify(event); return true; }
@Override public void notify( ChangeSet changeSet ) { if (changeSet == null || !hasObservers()) return; if (shutdown.get()) { throw new IllegalStateException("Change bus has been already shut down, should not have any more observers"); } // Add the change set into the buffer so it can be processed by the asynchronous listeners ... ringBuffer.add(changeSet); if (statistics != null) { // Increment the statistics statistics.increment(ValueMetric.EVENT_COUNT); } // And process all of the in-thread listeners ... for (ChangeSetListener listener : inThreadListeners) { try { listener.notify(changeSet); } catch (RuntimeException e) { if (shutdown.get()) { // The repository has been shutdown, so we have to ignore these changes } else { throw e; } } } }
@Override public void notify( ChangeSet changeSet ) { if (changeSet == null || !hasObservers()) return; if (shutdown.get()) { throw new IllegalStateException("Change bus has been already shut down, should not have any more observers"); } // Add the change set into the buffer so it can be processed by the asynchronous listeners ... ringBuffer.add(changeSet); if (statistics != null) { // Increment the statistics statistics.increment(ValueMetric.EVENT_COUNT); } // And process all of the in-thread listeners ... for (ChangeSetListener listener : inThreadListeners) { try { listener.notify(changeSet); } catch (RuntimeException e) { if (shutdown.get()) { // The repository has been shutdown, so we have to ignore these changes } else { throw e; } } } }