if (eventsCopy.size() < MAX_SINGLE_EVENTS) {
for (AbstractDatasetChangedEvent event: eventsCopy) {
fireEventToListeners(event);
}
} else if (eventsCopy.size() == MAX_EVENTS) {
fireEventToListeners(new DataChangedEvent(this));
} else {
fireEventToListeners(new DataChangedEvent(this, eventsCopy));
}
} finally {
lock.readLock().unlock();
}
}