}
for (final Object propertyId : item.getItemPropertyIds()) {
final Property property = item.getItemProperty(propertyId);
if (property instanceof ValueChangeNotifier) {
final ValueChangeNotifier notifier = (ValueChangeNotifier) property;
notifier.addValueChangeListener(this);
propertyItemMapCache.put(property, item);
}
}
}
// Increase batch count.
batchCount++;
// Evict items from cache if cache size exceeds max cache size
int counter = 0;
while (itemCache.size() > maxCacheSize) {
final int firstIndex = itemCacheAccessLog.getFirst();
final Item firstItem = itemCache.get(firstIndex);
// Remove oldest item in cache access log if it is not modified or
// removed.
if (!modifiedItems.contains(firstItem) && !removedItems.contains(firstItem)) {
itemCacheAccessLog.removeFirst();
itemCache.remove(firstIndex);
for (final Object propertyId : firstItem.getItemPropertyIds()) {
final Property property = firstItem.getItemProperty(propertyId);
if (property instanceof ValueChangeNotifier) {
final ValueChangeNotifier notifier = (ValueChangeNotifier) property;
notifier.removeValueChangeListener(this);
propertyItemMapCache.remove(property);
}
}
} else {