{
synchronized (insertCache) {
int j = 0;
for (Iterator i = insertCache.iterator();
i.hasNext() && j < maxInsertsPerRun; j++) {
ListEvent e = (ListEvent)i.next();
if (e.getID() == ListEvent.ELEMENT_ADDED) {
listener.elementAdded(e);
}
else {
listener.elementRemoved(e);
}